datamodel.prisma 2.7 KB

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