temp_user.go 977 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package models
  2. import (
  3. "errors"
  4. "time"
  5. )
  6. // Typed errors
  7. var (
  8. ErrTempUserNotFound = errors.New("User not found")
  9. )
  10. // TempUser holds data for org invites and new sign ups
  11. type TempUser struct {
  12. Id int64
  13. OrgId int64
  14. Version int
  15. Email string
  16. Name string
  17. Role string
  18. IsInvite bool
  19. EmailSent bool
  20. EmailSentOn time.Time
  21. Code string
  22. Created time.Time
  23. Updated time.Time
  24. }
  25. // ---------------------
  26. // COMMANDS
  27. type CreateTempUserCommand struct {
  28. Email string
  29. Name string
  30. OrgId int64
  31. IsInvite bool
  32. Code string
  33. Result *TempUser
  34. }
  35. type GetTempUsersForOrgQuery struct {
  36. OrgId int64
  37. Result []*TempUserDTO
  38. }
  39. type TempUserDTO struct {
  40. Id int64 `json:"id"`
  41. Name string `json:"name"`
  42. Email string `json:"email"`
  43. Role string `json:"role"`
  44. EmailSent bool `json:"emailSent"`
  45. EmailSentOn time.Time `json:"emailSentOn"`
  46. Created time.Time `json:"createdOn"`
  47. }