You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0 KiB

  1. package models
  2. import "context"
  3. type ProjectGroup struct {
  4. ID string `json:"id" db:"id"`
  5. UserID string `json:"-" db:"user_id"`
  6. Name string `json:"name" db:"name"`
  7. Abbreviation string `json:"abbreviation" db:"abbreviation"`
  8. CategoryNames map[string]string `json:"categoryNames" db:"category_names"`
  9. }
  10. type ProjectGroupUpdate struct {
  11. Name *string `json:"name"`
  12. Abbreviation *string `json:"abbreviation"`
  13. SetCategoryNames map[string]string `json:"setCategoryNames"`
  14. ResetCategoryName *string `json:"resetCategoryName"`
  15. }
  16. type ProjectGroupFilter struct {
  17. UserID string `json:"userId"`
  18. }
  19. type ProjectGroupRepository interface {
  20. Find(ctx context.Context, id string) (*ProjectGroup, error)
  21. List(ctx context.Context, filter ProjectGroupFilter) ([]*ProjectGroup, error)
  22. Insert(ctx context.Context, group ProjectGroup) error
  23. Update(ctx context.Context, group ProjectGroup) error
  24. Delete(ctx context.Context, group ProjectGroup) error
  25. }