func (r *GormWorkItemTypeRepository) LoadTypeFromDB(ctx context.Context, id uuid.UUID) (*WorkItemType, error) {
	log.Logger().Infoln("Loading work item type", id)
	res, ok := cache.Get(id)
	if !ok {
		log.Info(ctx, map[string]interface{}{
			"wit_id": id,
		}, "Work item type doesn't exist in the cache. Loading from DB...")
		res = WorkItemType{}
		db := r.db.Model(&res).Where("id=?", id).First(&res)
		if db.RecordNotFound() {
			log.Error(ctx, map[string]interface{}{
				"wit_id": id,
			}, "work item type not found")
			return nil, errors.NewNotFoundError("work item type", id.String())
		}
		if err := db.Error; err != nil {
			log.Error(ctx, map[string]interface{}{
				"witID": id,
			}, "work item type retrieval error", err.Error())
			return nil, errors.NewInternalError(err.Error())
		}
		cache.Put(res)
	}
	return &res, nil
}
// LoadTypeFromDB return work item type for the given id
LoadTypeFromDB return work item type for the given id
// LoadTypeFromDB return work item type for the given id
func (r *GormWorkItemTypeRepository) LoadTypeFromDB(ctx context.Context, id uuid.UUID) (*WorkItemType, error) {
	log.Logger().Infoln("Loading work item type", id)
	res, ok := cache.Get(id)
	if !ok {
		log.Info(ctx, map[string]interface{}{
			"wit_id": id,
		}, "Work item type doesn't exist in the cache. Loading from DB...")
		res = WorkItemType{}
		db := r.db.Model(&res).Where("id=?", id).First(&res)
		if db.RecordNotFound() {
			log.Error(ctx, map[string]interface{}{
				"wit_id": id,
			}, "work item type not found")
			return nil, errors.NewNotFoundError("work item type", id.String())
		}
		if err := db.Error; err != nil {
			log.Error(ctx, map[string]interface{}{
				"witID": id,
			}, "work item type retrieval error", err.Error())
			return nil, errors.NewInternalError(err.Error())
		}
		cache.Put(res)
	}
	return &res, nil
}
func ( r * GormWorkItemTypeRepository ) LoadTypeFromDB ( ctx context . Context , id uuid . UUID ) ( * WorkItemType , error ) { log . Logger ( ) . Infoln ( " " , id ) res , ok := cache . Get ( id ) if ! ok { log . Info ( ctx , map [ string ] interface { } { " " : id , } , " " ) res = WorkItemType { } db := r . db . Model ( & res ) . Where ( " " , id ) . First ( & res ) if db . RecordNotFound ( ) { log . Error ( ctx , map [ string ] interface { } { " " : id , } , " " ) return nil , errors . NewNotFoundError ( " " , id . String ( ) ) } if err := db . Error ; err != nil { log . Error ( ctx , map [ string ] interface { } { " " : id , } , " " , err . Error ( ) ) return nil , errors . NewInternalError ( err . Error ( ) ) } cache . Put ( res ) } return & res , nil }
LoadTypeFromDB return work item type for the given id
LoadTypeFromDB return work item type for the given id