preferences.go 892 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package models
  2. import (
  3. "errors"
  4. "time"
  5. )
  6. // Typed errors
  7. var (
  8. ErrPreferencesNotFound = errors.New("Preferences not found")
  9. )
  10. type Preferences struct {
  11. Id int64
  12. OrgId int64
  13. UserId int64
  14. TeamId int64
  15. Version int
  16. HomeDashboardId int64
  17. Timezone string
  18. Theme string
  19. Created time.Time
  20. Updated time.Time
  21. }
  22. // ---------------------
  23. // QUERIES
  24. type GetPreferencesQuery struct {
  25. Id int64
  26. OrgId int64
  27. UserId int64
  28. TeamId int64
  29. Result *Preferences
  30. }
  31. type GetPreferencesWithDefaultsQuery struct {
  32. User *SignedInUser
  33. Result *Preferences
  34. }
  35. // ---------------------
  36. // COMMANDS
  37. type SavePreferencesCommand struct {
  38. UserId int64
  39. OrgId int64
  40. TeamId int64
  41. HomeDashboardId int64 `json:"homeDashboardId"`
  42. Timezone string `json:"timezone"`
  43. Theme string `json:"theme"`
  44. }