datamodel.prisma 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. # Generic Types
  2. type User {
  3. id: ID! @unique
  4. email: String! @unique
  5. name: String!
  6. abbreviation: String!
  7. password: String!
  8. images: [File]!
  9. }
  10. type File {
  11. id: ID! @unique
  12. path: String!
  13. name: String
  14. description: String
  15. filename: String!
  16. mimetype: String!
  17. truncated: Boolean!
  18. size: Int!
  19. md5: String!
  20. }
  21. type Comment {
  22. id: ID! @unique
  23. text: String
  24. createdAt: DateTime!
  25. previousVersion: Comment
  26. }
  27. type Event {
  28. id: ID! @unique
  29. type: String!
  30. when: DateTime!
  31. }
  32. # Project Information
  33. type Project {
  34. id: ID! @unique
  35. name: String! @unique
  36. abbreviation: String! @unique
  37. description: String
  38. images: [File]!
  39. }
  40. type ProjectVersion {
  41. id: ID! @unique
  42. name: String! @unique
  43. changes: String!
  44. date: DateTime!
  45. }
  46. # Instruments
  47. type InstrumentParameter {
  48. id: ID! @unique
  49. tag: String!
  50. name: String
  51. description: String
  52. type: String!
  53. values: String
  54. }
  55. type InstrumentCommand {
  56. id: ID! @unique
  57. tag: String!
  58. name: String
  59. description: String!
  60. instrument: Instrument!
  61. readString: String
  62. writeString: String
  63. parameters: [InstrumentParameter]!
  64. }
  65. type InstrumentSubsystem {
  66. id: ID! @unique
  67. name: String
  68. description: String!
  69. commands: [InstrumentCommand]!
  70. parameters: [InstrumentParameter]!
  71. subsystems: [InstrumentSubsystem]!
  72. }
  73. type Instrument {
  74. id: ID! @unique
  75. name: String!
  76. description: String
  77. documents: [File]!
  78. interfaces: [String]!
  79. commands: [InstrumentCommand]!
  80. parameters: [InstrumentParameter]!
  81. subsystems: [InstrumentSubsystem]!
  82. }
  83. type InstrumentInstance {
  84. id: ID! @unique
  85. instrument: Instrument!
  86. identifier: String!
  87. interface: [String]!
  88. label: String
  89. location: String
  90. }
  91. # DUT
  92. type DUT {
  93. id: ID! @unique
  94. name: String!
  95. description: String
  96. project: ProjectVersion!
  97. modifications: [String]!
  98. }
  99. # Setup
  100. type SetupHardware {
  101. id: ID! @unique
  102. name: String!
  103. description: String
  104. images: [File]!
  105. }
  106. type SetupHardwareInstance {
  107. id: ID! @unique
  108. setupHardware: SetupHardware!
  109. identifier: String!
  110. images: [File]!
  111. }
  112. type Setup {
  113. id: ID! @unique
  114. name: String!
  115. description: String!
  116. images: [File]!
  117. comments: [Comment]!
  118. setupHardware: [SetupHardwareInstance]!
  119. instruments: [InstrumentInstance]!
  120. }
  121. # Measurement
  122. type Measurement {
  123. id: ID! @unique
  124. createdAt: DateTime!
  125. intValue: Int
  126. floatValue: Float
  127. stringValue: String
  128. }
  129. type MeasurementRun {
  130. id: ID! @unique
  131. operator: [User]!
  132. location: String!
  133. temperature: Float
  134. startTime: DateTime!
  135. endTime: DateTime!
  136. timeline: [Event]!
  137. comments: [Comment]!
  138. measurements: [Measurement]!
  139. setup: Setup!
  140. }
  141. # Characterization
  142. type Characterization {
  143. id: ID! @unique
  144. project: Project!
  145. measurementRuns: [MeasurementRun]!
  146. }