Advertisement
minafaw3

appOne.Schema2

Jun 10th, 2023
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. type Session @model @auth(rules: [{allow: private}]) {
  2. id: ID!
  3. start: String!
  4. end: String!
  5. trackerperiodID: ID! @index(name: "byTrackerPeriod")
  6. }
  7.  
  8. type DeviceState @model @auth(rules: [{allow: private}]) {
  9. id: ID!
  10. Time: String!
  11. State: String!
  12. trackerperiodID: ID! @index(name: "byTrackerPeriod")
  13. }
  14.  
  15. type SubPeriod @model @auth(rules: [{allow: private}]) {
  16. id: ID!
  17. Range: String!
  18. MovementCount: Int!
  19. trackerperiodID: ID! @index(name: "byTrackerPeriod")
  20. }
  21.  
  22. type TrackerPeriod @model @auth(rules: [{allow: owner}]) {
  23. id: ID!
  24. WakeUpTime: String!
  25. SleepTime: String!
  26. AverageMovementCount: String
  27. SleepDuration: String
  28. DurationInNumbers: String
  29. DisturbancesCount: String
  30. TotalMovements: Int
  31. AccelerometerLastReading: Float
  32. createdAt: AWSDateTime!
  33. userID: ID! @index(name: "byUser")
  34. Sessions: [Session] @hasMany(indexName: "byTrackerPeriod", fields: ["id"])
  35. DeviceStates: [DeviceState] @hasMany(indexName: "byTrackerPeriod", fields: ["id"])
  36. SubPeriods: [SubPeriod] @hasMany(indexName: "byTrackerPeriod", fields: ["id"])
  37. ActualSleepTime: String
  38. ActualWakeUpTime: String
  39. }
  40.  
  41.  
  42. type DayGroup {
  43. SleepTime: String!
  44. WakeUpTime: String!
  45. Days: [String]!
  46. }
  47.  
  48.  
  49. type User @model @auth(rules: [{allow: owner}]) {
  50. id: ID!
  51. sid: String!
  52. studyId: String!
  53. offDay: DayGroup!
  54. workday: DayGroup!
  55. tracker: [TrackerPeriod] @hasMany(indexName: "byUser", fields: ["id"])
  56. }
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement