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. 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. json: 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. versions: [ProjectVersion]!
  42. }
  43. type ProjectVersion {
  44. id: ID! @unique
  45. name: String! @unique
  46. changes: [String]!
  47. date: DateTime!
  48. project: Project!
  49. }
  50. # Instruments
  51. type InstrumentParameter {
  52. id: ID! @unique
  53. tag: String!
  54. name: String
  55. description: String
  56. type: String!
  57. values: String
  58. }
  59. type InstrumentCommand {
  60. id: ID! @unique
  61. tag: String!
  62. name: String
  63. description: String!
  64. instrument: Instrument!
  65. readString: String
  66. writeString: String
  67. parameters: [InstrumentParameter]!
  68. }
  69. type InstrumentSubsystem {
  70. id: ID! @unique
  71. name: String
  72. description: String!
  73. commands: [InstrumentCommand]!
  74. parameters: [InstrumentParameter]!
  75. subsystems: [InstrumentSubsystem]!
  76. }
  77. type Instrument {
  78. id: ID! @unique
  79. name: String!
  80. description: String
  81. documents: [File]!
  82. interfaces: [String]!
  83. commands: [InstrumentCommand]!
  84. parameters: [InstrumentParameter]!
  85. subsystems: [InstrumentSubsystem]!
  86. }
  87. type InstrumentInstance {
  88. id: ID! @unique
  89. instrument: Instrument!
  90. identifier: String!
  91. interface: [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. }