datamodel.prisma 2.8 KB

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