datamodel.prisma 2.6 KB

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