code: func (r *GormRepository) Create(ctx context.Context, s SpaceTemplate) (*SpaceTemplate, error) {
  	if uuid.Equal(s.ID, uuid.Nil) {
  		s.ID = uuid.NewV4()
  	}
  
  	if err := s.Validate(); err != nil {
  		log.Error(ctx, map[string]interface{}{"space_template": s, "err": err}, "space template is invalid")
  		return nil, errs.Wrap(err, "space template is invalid")
  	}
  
  	// Create space template
  	db := r.db.Create(&s)
  	if err := db.Error; err != nil {
  		log.Error(ctx, map[string]interface{}{"space_template": s, "err": err}, "failed to create space template")
  		// name needs to be unique
  		if gormsupport.IsUniqueViolation(err, "space_templates_name_uidx") {
  			return nil, errors.NewBadParameterError("name", s.Name).Expected("unique")
  		}
  		return nil, errs.Wrap(err, "failed to create space template")
  	}
  	log.Debug(ctx, map[string]interface{}{"space_template_id": s.ID}, "space template created successfully")
  	return &s, nil
  }
docs: // Create creates a new space template and all the artifacts (e.g. work item
  // types, work item link types) in the system.