preferences.go 863 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. Version int
  15. HomeDashboardId int64
  16. Timezone string
  17. Theme string
  18. Created time.Time
  19. Updated time.Time
  20. }
  21. // ---------------------
  22. // QUERIES
  23. type GetPreferencesQuery struct {
  24. Id int64
  25. OrgId int64
  26. UserId int64
  27. Result *Preferences
  28. }
  29. type GetPreferencesWithDefaultsQuery struct {
  30. Id int64
  31. OrgId int64
  32. UserId int64
  33. Result *Preferences
  34. }
  35. // ---------------------
  36. // COMMANDS
  37. type SavePreferencesCommand struct {
  38. UserId int64
  39. OrgId int64
  40. HomeDashboardId int64 `json:"homeDashboardId"`
  41. Timezone string `json:"timezone"`
  42. Theme string `json:"theme"`
  43. }