func (r *GormWorkItemTypeRepository) Load(ctx context.Context, spaceID uuid.UUID, 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,
			"space_id": spaceID,
		}, "Work item type doesn't exist in the cache. Loading from DB...")
		res = WorkItemType{}

		db := r.db.Model(&res).Where("id=? AND space_id=?", id, spaceID).First(&res)
		if db.RecordNotFound() {
			log.Error(ctx, map[string]interface{}{
				"wit_id":   id,
				"space_id": spaceID,
			}, "work item type not found")
			return nil, errors.NewNotFoundError("work item type", id.String())
		}
		if err := db.Error; err != nil {
			return nil, errors.NewInternalError(err.Error())
		}
		cache.Put(res)
	}
	return &res, nil
}
// Load returns the work item for the given spaceID and id
// returns NotFoundError, InternalError
Load returns the work item for the given spaceID and id
returns NotFoundError, InternalError
// Load returns the work item for the given spaceID and id // returns NotFoundError InternalError
func (r *GormWorkItemTypeRepository) Load(ctx context.Context, spaceID uuid.UUID, 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,
			"space_id": spaceID,
		}, "Work item type doesn't exist in the cache. Loading from DB...")
		res = WorkItemType{}
		db := r.db.Model(&res).Where("id=? AND space_id=?", id, spaceID).First(&res)
		if db.RecordNotFound() {
			log.Error(ctx, map[string]interface{}{
				"wit_id":   id,
				"space_id": spaceID,
			}, "work item type not found")
			return nil, errors.NewNotFoundError("work item type", id.String())
		}
		if err := db.Error; err != nil {
			return nil, errors.NewInternalError(err.Error())
		}
		cache.Put(res)
	}
	return &res, nil
}
func ( r * GormWorkItemTypeRepository ) Load ( ctx context . Context , spaceID uuid . UUID , id uuid . UUID ) ( * WorkItemType , error ) { log . Logger ( ) . Infoln ( " " , id ) res , ok := cache . Get ( id ) if ! ok { log . Info ( ctx , map [ string ] interface { } { " " : id , " " : spaceID , } , " " ) res = WorkItemType { } db := r . db . Model ( & res ) . Where ( " " , id , spaceID ) . First ( & res ) if db . RecordNotFound ( ) { log . Error ( ctx , map [ string ] interface { } { " " : id , " " : spaceID , } , " " ) return nil , errors . NewNotFoundError ( " " , id . String ( ) ) } if err := db . Error ; err != nil { return nil , errors . NewInternalError ( err . Error ( ) ) } cache . Put ( res ) } return & res , nil }
Load returns the work item for the given spaceID and id
returns NotFoundError, InternalError
Load returns the work item for the given spaceID and id returns NotFoundError InternalError