datamodel.prisma 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. interface: [String]!
  93. label: String
  94. location: String
  95. }
  96. # DUT
  97. type DUT {
  98. id: ID! @unique
  99. name: String!
  100. description: String
  101. project: ProjectVersion!
  102. modifications: [String]!
  103. }
  104. # Setup
  105. type SetupHardware {
  106. id: ID! @unique
  107. name: String!
  108. description: String
  109. images: [File]!
  110. }
  111. type SetupHardwareInstance {
  112. id: ID! @unique
  113. setupHardware: SetupHardware!
  114. identifier: String!
  115. images: [File]!
  116. }
  117. type Setup {
  118. id: ID! @unique
  119. name: String!
  120. description: String!
  121. images: [File]!
  122. comments: [Comment]!
  123. setupHardware: [SetupHardwareInstance]!
  124. instruments: [InstrumentInstance]!
  125. }
  126. # Measurement
  127. type Measurement {
  128. id: ID! @unique
  129. createdAt: DateTime!
  130. intValue: Int
  131. floatValue: Float
  132. stringValue: String
  133. }
  134. type MeasurementRun {
  135. id: ID! @unique
  136. name: String!
  137. operators: [User]!
  138. location: String!
  139. temperature: Float
  140. startTime: DateTime!
  141. endTime: DateTime!
  142. log: [Event]!
  143. comments: [Comment]!
  144. measurements: [Measurement]!
  145. setup: Setup!
  146. }
  147. # Characterization
  148. type Characterization {
  149. id: ID! @unique
  150. name: String!
  151. projectVersion: ProjectVersion!
  152. measurementRuns: [MeasurementRun]!
  153. }