code: func (r *GormWorkItemTypeGroupRepository) Create(ctx context.Context, g WorkItemTypeGroup) (*WorkItemTypeGroup, error) {
  	defer goa.MeasureSince([]string{"goa", "db", "workitemtypegroup", "create"}, time.Now())
  	if len(g.TypeList) <= 0 {
  		return nil, errors.NewBadParameterError("type_list", g.TypeList).Expected("not empty")
  	}
  	if g.ID == uuid.Nil {
  		g.ID = uuid.NewV4()
  	}
  	db := r.db.Create(&g)
  	if db.Error != nil {
  		return nil, errors.NewInternalError(ctx, db.Error)
  	}
  	log.Debug(ctx, map[string]interface{}{"witg_id": g.ID}, "created work item type group")
  	// Create entries for each member in the type list
  	for idx, ID := range g.TypeList {
  		member := typeGroupMember{
  			TypeGroupID:    g.ID,
  			WorkItemTypeID: ID,
  			Position:       idx,
  		}
  		db = db.Create(&member)
  		if db.Error != nil {
  			return nil, errors.NewInternalError(ctx, db.Error)
  		}
  	}
  	return &g, nil
  }
docs: // Create creates a new work item type group in the repository