code: func (r *GormWorkItemTypeGroupRepository) List(ctx context.Context, spaceTemplateID uuid.UUID) ([]*WorkItemTypeGroup, error) {
  	defer goa.MeasureSince([]string{"goa", "db", "workitemtypegroup", "list"}, time.Now())
  	log.Debug(ctx, map[string]interface{}{"space_template_id": spaceTemplateID}, "loading work item type groups for space template")
  
  	// check space template exists
  	if err := spacetemplate.NewRepository(r.db).CheckExists(ctx, spaceTemplateID); err != nil {
  		return nil, errors.NewNotFoundError("space template", spaceTemplateID.String())
  	}
  
  	res := []*WorkItemTypeGroup{}
  	db := r.db.Model(&res).Where("space_template_id=?", spaceTemplateID).Order("position ASC").Find(&res)
  	if db.RecordNotFound() {
  		log.Error(ctx, map[string]interface{}{"space_template_id": spaceTemplateID}, "work item type groups not found")
  		return nil, errors.NewNotFoundError("work item type groups for space template", spaceTemplateID.String())
  	}
  	if err := db.Error; err != nil {
  		return nil, errors.NewInternalError(ctx, err)
  	}
  	for _, group := range res {
  		typeList, err := r.loadTypeList(ctx, group.ID)
  		if err != nil {
  			return nil, errs.WithStack(err)
  		}
  		group.TypeList = typeList
  	}
  	return res, nil
  }
docs: // List returns all work item type groups for the given space template ID
  // ordered by their position value.