@studious-lms/server 1.11.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/.env.example +3 -0
  2. package/dist/index.js +40 -4
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/config/cors.d.ts.map +1 -1
  5. package/dist/lib/config/cors.js +7 -2
  6. package/dist/lib/config/cors.js.map +1 -1
  7. package/dist/lib/config/env.d.ts +8 -0
  8. package/dist/lib/config/env.d.ts.map +1 -1
  9. package/dist/lib/config/env.js +5 -2
  10. package/dist/lib/config/env.js.map +1 -1
  11. package/dist/lib/pusher.d.ts +2 -1
  12. package/dist/lib/pusher.d.ts.map +1 -1
  13. package/dist/lib/pusher.js +4 -3
  14. package/dist/lib/pusher.js.map +1 -1
  15. package/dist/models/agenda.d.ts +6 -0
  16. package/dist/models/agenda.d.ts.map +1 -1
  17. package/dist/models/announcement.d.ts +3 -0
  18. package/dist/models/announcement.d.ts.map +1 -1
  19. package/dist/models/assignment.d.ts +61 -0
  20. package/dist/models/assignment.d.ts.map +1 -1
  21. package/dist/models/auth.d.ts +6 -0
  22. package/dist/models/auth.d.ts.map +1 -1
  23. package/dist/models/class.d.ts +28 -0
  24. package/dist/models/class.d.ts.map +1 -1
  25. package/dist/models/class.js +12 -3
  26. package/dist/models/class.js.map +1 -1
  27. package/dist/models/comment.d.ts +13 -0
  28. package/dist/models/comment.d.ts.map +1 -1
  29. package/dist/models/comment.js +3 -2
  30. package/dist/models/comment.js.map +1 -1
  31. package/dist/models/conversation.d.ts +17 -0
  32. package/dist/models/conversation.d.ts.map +1 -1
  33. package/dist/models/conversation.js +13 -2
  34. package/dist/models/conversation.js.map +1 -1
  35. package/dist/models/event.d.ts +12 -0
  36. package/dist/models/event.d.ts.map +1 -1
  37. package/dist/models/file.d.ts +38 -0
  38. package/dist/models/file.d.ts.map +1 -1
  39. package/dist/models/folder.d.ts +6 -0
  40. package/dist/models/folder.d.ts.map +1 -1
  41. package/dist/models/labChat.d.ts +6 -0
  42. package/dist/models/labChat.d.ts.map +1 -1
  43. package/dist/models/newtonChat.d.ts +3 -0
  44. package/dist/models/newtonChat.d.ts.map +1 -1
  45. package/dist/models/school.d.ts +3 -0
  46. package/dist/models/school.d.ts.map +1 -1
  47. package/dist/models/section.d.ts +3 -0
  48. package/dist/models/section.d.ts.map +1 -1
  49. package/dist/models/worksheet.d.ts +62 -0
  50. package/dist/models/worksheet.d.ts.map +1 -1
  51. package/dist/models/worksheet.js +37 -7
  52. package/dist/models/worksheet.js.map +1 -1
  53. package/dist/pipelines/gradeWorksheet.d.ts.map +1 -1
  54. package/dist/pipelines/gradeWorksheet.js +59 -14
  55. package/dist/pipelines/gradeWorksheet.js.map +1 -1
  56. package/dist/routers/_app.d.ts +4641 -2285
  57. package/dist/routers/_app.d.ts.map +1 -1
  58. package/dist/routers/_app.js +6 -2
  59. package/dist/routers/_app.js.map +1 -1
  60. package/dist/routers/admin.d.ts +190 -0
  61. package/dist/routers/admin.d.ts.map +1 -0
  62. package/dist/routers/admin.js +50 -0
  63. package/dist/routers/admin.js.map +1 -0
  64. package/dist/routers/agenda.d.ts +6 -0
  65. package/dist/routers/agenda.d.ts.map +1 -1
  66. package/dist/routers/announcement.d.ts +6 -0
  67. package/dist/routers/announcement.d.ts.map +1 -1
  68. package/dist/routers/announcement.js +6 -5
  69. package/dist/routers/announcement.js.map +1 -1
  70. package/dist/routers/assignment.d.ts +58 -0
  71. package/dist/routers/assignment.d.ts.map +1 -1
  72. package/dist/routers/assignment.js +4 -4
  73. package/dist/routers/assignment.js.map +1 -1
  74. package/dist/routers/class.d.ts +54 -0
  75. package/dist/routers/class.d.ts.map +1 -1
  76. package/dist/routers/class.js +5 -2
  77. package/dist/routers/class.js.map +1 -1
  78. package/dist/routers/comment.d.ts +26 -0
  79. package/dist/routers/comment.d.ts.map +1 -1
  80. package/dist/routers/comment.js +6 -3
  81. package/dist/routers/comment.js.map +1 -1
  82. package/dist/routers/discussion.d.ts +823 -0
  83. package/dist/routers/discussion.d.ts.map +1 -0
  84. package/dist/routers/discussion.js +151 -0
  85. package/dist/routers/discussion.js.map +1 -0
  86. package/dist/routers/event.d.ts +3 -0
  87. package/dist/routers/event.d.ts.map +1 -1
  88. package/dist/routers/file.d.ts +4 -0
  89. package/dist/routers/file.d.ts.map +1 -1
  90. package/dist/routers/school.d.ts +6 -0
  91. package/dist/routers/school.d.ts.map +1 -1
  92. package/dist/routers/worksheet.d.ts +6 -0
  93. package/dist/routers/worksheet.d.ts.map +1 -1
  94. package/dist/routers/worksheet.js +4 -2
  95. package/dist/routers/worksheet.js.map +1 -1
  96. package/dist/seedDatabase.d.ts.map +1 -1
  97. package/dist/seedDatabase.js +1490 -1307
  98. package/dist/seedDatabase.js.map +1 -1
  99. package/dist/services/adminInstitution.d.ts +102 -0
  100. package/dist/services/adminInstitution.d.ts.map +1 -0
  101. package/dist/services/adminInstitution.js +117 -0
  102. package/dist/services/adminInstitution.js.map +1 -0
  103. package/dist/services/adminRunJob.d.ts +45 -0
  104. package/dist/services/adminRunJob.d.ts.map +1 -0
  105. package/dist/services/adminRunJob.js +41 -0
  106. package/dist/services/adminRunJob.js.map +1 -0
  107. package/dist/services/agenda.d.ts +6 -0
  108. package/dist/services/agenda.d.ts.map +1 -1
  109. package/dist/services/assignment.d.ts +50 -0
  110. package/dist/services/assignment.d.ts.map +1 -1
  111. package/dist/services/assignment.js +16 -9
  112. package/dist/services/assignment.js.map +1 -1
  113. package/dist/services/class.d.ts +54 -0
  114. package/dist/services/class.d.ts.map +1 -1
  115. package/dist/services/class.js +20 -3
  116. package/dist/services/class.js.map +1 -1
  117. package/dist/services/comment.d.ts +20 -0
  118. package/dist/services/comment.d.ts.map +1 -1
  119. package/dist/services/comment.js +23 -2
  120. package/dist/services/comment.js.map +1 -1
  121. package/dist/services/conversation.d.ts.map +1 -1
  122. package/dist/services/conversation.js +9 -7
  123. package/dist/services/conversation.js.map +1 -1
  124. package/dist/services/discussion.d.ts +762 -0
  125. package/dist/services/discussion.d.ts.map +1 -0
  126. package/dist/services/discussion.js +625 -0
  127. package/dist/services/discussion.js.map +1 -0
  128. package/dist/services/event.d.ts +3 -0
  129. package/dist/services/event.d.ts.map +1 -1
  130. package/dist/services/file.d.ts +8 -0
  131. package/dist/services/file.d.ts.map +1 -1
  132. package/dist/services/school.d.ts +6 -0
  133. package/dist/services/school.d.ts.map +1 -1
  134. package/dist/services/studentProgress.d.ts.map +1 -1
  135. package/dist/services/studentProgress.js +27 -5
  136. package/dist/services/studentProgress.js.map +1 -1
  137. package/dist/services/studentProgressInferenceCache.d.ts +16 -0
  138. package/dist/services/studentProgressInferenceCache.d.ts.map +1 -0
  139. package/dist/services/studentProgressInferenceCache.js +43 -0
  140. package/dist/services/studentProgressInferenceCache.js.map +1 -0
  141. package/dist/services/worksheet.d.ts +6 -0
  142. package/dist/services/worksheet.d.ts.map +1 -1
  143. package/dist/services/worksheet.js +5 -5
  144. package/dist/services/worksheet.js.map +1 -1
  145. package/dist/trpc.d.ts +12 -0
  146. package/dist/trpc.d.ts.map +1 -1
  147. package/dist/trpc.js +16 -3
  148. package/dist/trpc.js.map +1 -1
  149. package/dist/utils/adminPanelAccess.d.ts +8 -0
  150. package/dist/utils/adminPanelAccess.d.ts.map +1 -0
  151. package/dist/utils/adminPanelAccess.js +44 -0
  152. package/dist/utils/adminPanelAccess.js.map +1 -0
  153. package/package.json +1 -1
  154. package/prisma/migrations/20260510183000_add_discussions/migration.sql +151 -0
  155. package/prisma/schema.prisma +98 -0
  156. package/src/index.ts +39 -2
  157. package/src/lib/config/cors.ts +5 -0
  158. package/src/lib/config/env.ts +3 -0
  159. package/src/lib/pusher.ts +2 -1
  160. package/src/models/class.ts +10 -1
  161. package/src/models/comment.ts +1 -0
  162. package/src/models/conversation.ts +12 -0
  163. package/src/models/worksheet.ts +39 -5
  164. package/src/pipelines/gradeWorksheet.ts +66 -15
  165. package/src/routers/_app.ts +4 -0
  166. package/src/routers/admin.ts +70 -0
  167. package/src/routers/announcement.ts +4 -3
  168. package/src/routers/assignment.ts +2 -2
  169. package/src/routers/class.ts +3 -0
  170. package/src/routers/comment.ts +5 -0
  171. package/src/routers/discussion.ts +205 -0
  172. package/src/routers/worksheet.ts +2 -0
  173. package/src/seedDatabase.ts +1713 -1361
  174. package/src/services/adminInstitution.ts +140 -0
  175. package/src/services/adminRunJob.ts +46 -0
  176. package/src/services/assignment.ts +19 -8
  177. package/src/services/class.ts +28 -1
  178. package/src/services/comment.ts +22 -0
  179. package/src/services/conversation.ts +9 -4
  180. package/src/services/discussion.ts +701 -0
  181. package/src/services/studentProgress.ts +80 -3
  182. package/src/services/studentProgressInferenceCache.ts +64 -0
  183. package/src/services/worksheet.ts +5 -2
  184. package/src/trpc.ts +15 -0
  185. package/src/utils/adminPanelAccess.ts +46 -0
  186. package/tests/integration/routers/conversation.test.ts +9 -7
  187. package/tests/integration/routers/discussion.test.ts +253 -0
  188. package/tests/unit/services/discussion.test.ts +356 -0
@@ -5,6 +5,7 @@ export declare const commentSelect: {
5
5
  readonly assignmentId: true;
6
6
  readonly submissionId: true;
7
7
  readonly parentCommentId: true;
8
+ readonly isPinned: true;
8
9
  readonly createdAt: true;
9
10
  readonly modifiedAt: true;
10
11
  readonly author: {
@@ -61,6 +62,7 @@ export declare function findCommentById(id: string): import(".prisma/client").Pr
61
62
  modifiedAt: Date | null;
62
63
  content: string;
63
64
  parentCommentId: string | null;
65
+ isPinned: boolean;
64
66
  author: {
65
67
  id: string;
66
68
  username: string;
@@ -98,6 +100,7 @@ export declare function findRepliesByCommentId(commentId: string): import(".pris
98
100
  content: string;
99
101
  authorId: string;
100
102
  parentCommentId: string | null;
103
+ isPinned: boolean;
101
104
  studentQuestionProgressId: string | null;
102
105
  })[]>;
103
106
  /** Create a comment (reply). */
@@ -119,6 +122,7 @@ export declare function createComment(data: {
119
122
  content: string;
120
123
  authorId: string;
121
124
  parentCommentId: string | null;
125
+ isPinned: boolean;
122
126
  studentQuestionProgressId: string | null;
123
127
  }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
124
128
  datasources: {
@@ -134,6 +138,8 @@ export declare function findReactionByUserAndComment(userId: string, commentId:
134
138
  createdAt: Date;
135
139
  userId: string;
136
140
  announcementId: string | null;
141
+ discussionId: string | null;
142
+ discussionReplyId: string | null;
137
143
  commentId: string | null;
138
144
  } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
139
145
  datasources: {
@@ -163,6 +169,8 @@ export declare function upsertReaction(data: {
163
169
  createdAt: Date;
164
170
  userId: string;
165
171
  announcementId: string | null;
172
+ discussionId: string | null;
173
+ discussionReplyId: string | null;
166
174
  commentId: string | null;
167
175
  }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
168
176
  datasources: {
@@ -178,6 +186,8 @@ export declare function deleteReactionById(id: string): import(".prisma/client")
178
186
  createdAt: Date;
179
187
  userId: string;
180
188
  announcementId: string | null;
189
+ discussionId: string | null;
190
+ discussionReplyId: string | null;
181
191
  commentId: string | null;
182
192
  }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
183
193
  datasources: {
@@ -201,6 +211,7 @@ export declare function findCommentWithAnnouncement(commentId: string): import("
201
211
  content: string;
202
212
  authorId: string;
203
213
  parentCommentId: string | null;
214
+ isPinned: boolean;
204
215
  studentQuestionProgressId: string | null;
205
216
  }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
206
217
  datasources: {
@@ -372,6 +383,7 @@ export declare function findCommentWithContext(commentId: string): import(".pris
372
383
  content: string;
373
384
  authorId: string;
374
385
  parentCommentId: string | null;
386
+ isPinned: boolean;
375
387
  studentQuestionProgressId: string | null;
376
388
  }) | null;
377
389
  } & {
@@ -384,6 +396,7 @@ export declare function findCommentWithContext(commentId: string): import(".pris
384
396
  content: string;
385
397
  authorId: string;
386
398
  parentCommentId: string | null;
399
+ isPinned: boolean;
387
400
  studentQuestionProgressId: string | null;
388
401
  }) | null, null, import("@prisma/client/runtime/library.js").Default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AAC,IAAI,EAAE;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;;;;;;;;GA0BA;AAED,yBAAyB;AACzB,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;GAI5C;AAED,kDAAkD;AAClD,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;GAO5D;AAED,wEAAwE;AACxE,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGvD;AAED,sDAAsD;AACtD,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM;;;;;;;;GAM7D"}
@@ -2,7 +2,7 @@
2
2
  * Comment model – comments, replies, and reactions.
3
3
  */
4
4
 
5
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8dbc1c18-53a6-535e-8af0-25c781796a36")}catch(e){}}();
5
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6bc45608-cd32-5d3e-ae63-a06b1f3dacef")}catch(e){}}();
6
6
  import { prisma } from "../lib/prisma.js";
7
7
  export const commentSelect = {
8
8
  id: true,
@@ -11,6 +11,7 @@ export const commentSelect = {
11
11
  assignmentId: true,
12
12
  submissionId: true,
13
13
  parentCommentId: true,
14
+ isPinned: true,
14
15
  createdAt: true,
15
16
  modifiedAt: true,
16
17
  author: {
@@ -261,4 +262,4 @@ export function getReactionCountsByCommentId(commentId) {
261
262
  });
262
263
  }
263
264
  //# sourceMappingURL=comment.js.map
264
- //# debugId=8dbc1c18-53a6-535e-8af0-25c781796a36
265
+ //# debugId=6bc45608-cd32-5d3e-ae63-a06b1f3dacef
@@ -1 +1 @@
1
- {"version":3,"file":"comment.js","sources":["models/comment.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Comment model – comments, replies, and reactions.\n */\nimport { prisma } from \"../lib/prisma.js\";\nimport type { ReactionType } from \"@prisma/client\";\n\nexport const commentSelect = {\n id: true,\n content: true,\n announcementId: true,\n assignmentId: true,\n submissionId: true,\n parentCommentId: true,\n createdAt: true,\n modifiedAt: true,\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n reactions: {\n select: {\n type: true,\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n} as const;\n\nconst commentClassAuthSelect = {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n school: {\n select: {\n memberships: {\n where: {\n role: \"ADMIN\" as const,\n status: \"ACTIVE\" as const,\n },\n select: { userId: true },\n },\n },\n },\n} as const;\n\n/** @returns Comment by ID with author and reactions. */\nexport function findCommentById(id: string) {\n return prisma.comment.findUnique({\n where: { id },\n select: commentSelect,\n });\n}\n\n/** @returns Replies to a comment. */\nexport function findRepliesByCommentId(commentId: string) {\n return prisma.comment.findMany({\n where: { parentCommentId: commentId },\n include: {\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Create a comment (reply). */\nexport function createComment(data: {\n parentCommentId: string;\n content: string;\n authorId: string;\n announcementId?: string | null;\n assignmentId?: string | null;\n submissionId?: string | null;\n studentQuestionProgressId?: string | null;\n}) {\n return prisma.comment.create({\n data,\n });\n}\n\n/** @returns User's reaction on a comment. */\nexport function findReactionByUserAndComment(userId: string, commentId: string) {\n return prisma.reaction.findUnique({\n where: {\n userId_commentId: { userId, commentId },\n },\n });\n}\n\n/** Add or update reaction on a comment. */\nexport function upsertReaction(data: {\n userId: string;\n commentId: string;\n type: string;\n}) {\n return prisma.reaction.upsert({\n where: {\n userId_commentId: {\n userId: data.userId,\n commentId: data.commentId,\n },\n },\n update: { type: data.type as ReactionType },\n create: { ...data, type: data.type as ReactionType },\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Delete a reaction. */\nexport function deleteReactionById(id: string) {\n return prisma.reaction.delete({\n where: { id },\n });\n}\n\n/** @returns Comment with announcement classId. */\nexport function findCommentWithAnnouncement(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: { select: { classId: true } },\n },\n });\n}\n\n/** @returns Comment with the owning class context for authorization. */\nexport function findCommentWithContext(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n studentQuestionProgress: {\n select: {\n studentId: true,\n studentWorksheetResponse: {\n select: {\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n parentComment: {\n include: {\n announcement: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n studentQuestionProgress: {\n select: {\n studentId: true,\n studentWorksheetResponse: {\n select: {\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n });\n}\n\n/** @returns Reaction counts by type for a comment. */\nexport function getReactionCountsByCommentId(commentId: string) {\n return prisma.reaction.groupBy({\n by: [\"type\"],\n where: { commentId },\n _count: { type: true },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,IAAI;IACb,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE;QACN,MAAM,EAAE;YACN,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,MAAM,EAAE;oBACN,WAAW,EAAE,IAAI;oBACjB,cAAc,EAAE,IAAI;oBACpB,uBAAuB,EAAE,IAAI;iBAC9B;aACF;SACF;KACF;IACD,SAAS,EAAE;QACT,MAAM,EAAE;YACN,IAAI,EAAE,IAAI;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI;oBACR,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,MAAM,EAAE;4BACN,WAAW,EAAE,IAAI;4BACjB,cAAc,EAAE,IAAI;4BACpB,uBAAuB,EAAE,IAAI;yBAC9B;qB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sBAAsB;qCAC/B;iCACF;6BACF;yBACF;qBACF;oBACD,uBAAuB,EAAE;wBACvB,MAAM,EAAE;4BACN,SAAS,EAAE,IAAI;4BACf,wBAAwB,EAAE;gCACxB,MAAM,EAAE;oCACN,UAAU,EAAE;wCACV,MAAM,EAAE;4CACN,SAAS,EAAE,IAAI;4CACf,UAAU,EAAE;gDACV,MAAM,EAAE;oDACN,KAAK,EAAE;wDACL,MAAM,EAAE,sBAAsB;qDAC/B;iDACF;6CACF;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC7B,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,KAAK,EAAE,EAAE,SAAS,EAAE;QACpB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KACvB,CAAC,CAAC;AACL,CAAC","debug_id":"8dbc1c18-53a6-535e-8af0-25c781796a36"}
1
+ {"version":3,"file":"comment.js","sources":["models/comment.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Comment model – comments, replies, and reactions.\n */\nimport { prisma } from \"../lib/prisma.js\";\nimport type { ReactionType } from \"@prisma/client\";\n\nexport const commentSelect = {\n id: true,\n content: true,\n announcementId: true,\n assignmentId: true,\n submissionId: true,\n parentCommentId: true,\n isPinned: true,\n createdAt: true,\n modifiedAt: true,\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n reactions: {\n select: {\n type: true,\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n} as const;\n\nconst commentClassAuthSelect = {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n school: {\n select: {\n memberships: {\n where: {\n role: \"ADMIN\" as const,\n status: \"ACTIVE\" as const,\n },\n select: { userId: true },\n },\n },\n },\n} as const;\n\n/** @returns Comment by ID with author and reactions. */\nexport function findCommentById(id: string) {\n return prisma.comment.findUnique({\n where: { id },\n select: commentSelect,\n });\n}\n\n/** @returns Replies to a comment. */\nexport function findRepliesByCommentId(commentId: string) {\n return prisma.comment.findMany({\n where: { parentCommentId: commentId },\n include: {\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Create a comment (reply). */\nexport function createComment(data: {\n parentCommentId: string;\n content: string;\n authorId: string;\n announcementId?: string | null;\n assignmentId?: string | null;\n submissionId?: string | null;\n studentQuestionProgressId?: string | null;\n}) {\n return prisma.comment.create({\n data,\n });\n}\n\n/** @returns User's reaction on a comment. */\nexport function findReactionByUserAndComment(userId: string, commentId: string) {\n return prisma.reaction.findUnique({\n where: {\n userId_commentId: { userId, commentId },\n },\n });\n}\n\n/** Add or update reaction on a comment. */\nexport function upsertReaction(data: {\n userId: string;\n commentId: string;\n type: string;\n}) {\n return prisma.reaction.upsert({\n where: {\n userId_commentId: {\n userId: data.userId,\n commentId: data.commentId,\n },\n },\n update: { type: data.type as ReactionType },\n create: { ...data, type: data.type as ReactionType },\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Delete a reaction. */\nexport function deleteReactionById(id: string) {\n return prisma.reaction.delete({\n where: { id },\n });\n}\n\n/** @returns Comment with announcement classId. */\nexport function findCommentWithAnnouncement(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: { select: { classId: true } },\n },\n });\n}\n\n/** @returns Comment with the owning class context for authorization. */\nexport function findCommentWithContext(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n studentQuestionProgress: {\n select: {\n studentId: true,\n studentWorksheetResponse: {\n select: {\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n parentComment: {\n include: {\n announcement: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n studentQuestionProgress: {\n select: {\n studentId: true,\n studentWorksheetResponse: {\n select: {\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n });\n}\n\n/** @returns Reaction counts by type for a comment. */\nexport function getReactionCountsByCommentId(commentId: string) {\n return prisma.reaction.groupBy({\n by: [\"type\"],\n where: { commentId },\n _count: { type: true },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,IAAI;IACb,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE;QACN,MAAM,EAAE;YACN,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,IAAI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F;6BACF;yBACF;qBACF;iBACF;aACF;YACD,aAAa,EAAE;gBACb,OAAO,EAAE;oBACP,YAAY,EAAE;wBACZ,MAAM,EAAE;4BACN,KAAK,EAAE;gCACL,MAAM,EAAE,sBAAsB;6BAC/B;yBACF;qBACF;oBACD,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,KAAK,EAAE;gCACL,MAAM,EAAE,sBAAsB;6BAC/B;yBACF;qBACF;oBACD,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,SAAS,EAAE,IAAI;4BACf,UAAU,EAAE;gCACV,MAAM,EAAE;oCACN,KAAK,EAAE;wCACL,MAAM,EAAE,sBAAsB;qCAC/B;iCACF;6BACF;yBACF;qBACF;oBACD,uBAAuB,EAAE;wBACvB,MAAM,EAAE;4BACN,SAAS,EAAE,IAAI;4BACf,wBAAwB,EAAE;gCACxB,MAAM,EAAE;oCACN,UAAU,EAAE;wCACV,MAAM,EAAE;4CACN,SAAS,EAAE,IAAI;4CACf,UAAU,EAAE;gDACV,MAAM,EAAE;oDACN,KAAK,EAAE;wDACL,MAAM,EAAE,sBAAsB;qDAC/B;iDACF;6CACF;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC7B,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,KAAK,EAAE,EAAE,SAAS,EAAE;QACpB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KACvB,CAAC,CAAC;AACL,CAAC","debug_id":"6bc45608-cd32-5d3e-ae63-a06b1f3dacef"}
@@ -213,6 +213,23 @@ export declare function hideConversationMember(userId: string, conversationId: s
213
213
  };
214
214
  };
215
215
  }>;
216
+ /** Unhide a conversation for a single member. */
217
+ export declare function unhideConversationMember(userId: string, conversationId: string): import(".prisma/client").Prisma.Prisma__ConversationMemberClient<{
218
+ id: string;
219
+ userId: string;
220
+ role: import(".prisma/client").$Enums.ConversationRole;
221
+ conversationId: string;
222
+ joinedAt: Date;
223
+ hiddenAt: Date | null;
224
+ lastViewedAt: Date | null;
225
+ lastViewedMentionAt: Date | null;
226
+ }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
227
+ datasources: {
228
+ db: {
229
+ url: string;
230
+ };
231
+ };
232
+ }>;
216
233
  /** Remove a member from a conversation. */
217
234
  export declare function deleteConversationMember(userId: string, conversationId: string): import(".prisma/client").Prisma.Prisma__ConversationMemberClient<{
218
235
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"/","sources":["models/conversation.ts"],"names":[],"mappings":"AAmCA,mEAAmE;AACnE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQvD;AAED,sDAAsD;AACtD,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,IAAI,yDASb;AAED,sDAAsD;AACtD,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,IAAI,yDAYb;AAED,qDAAqD;AACrD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;GAKlD;AAED;;;;;;GAMG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM;;;;;;;;KA0Cd;AAED,wCAAwC;AACxC,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;MAUzD;AAED,0CAA0C;AAC1C,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE;;;KAW9D;AAED,sDAAsD;AACtD,wBAAgB,kBAA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;;;;;GAM9E"}
@@ -2,7 +2,7 @@
2
2
  * Conversation model – DM/group conversations, members, unread counts.
3
3
  */
4
4
 
5
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="14c80725-5a2b-5e37-aa01-49cb94535659")}catch(e){}}();
5
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2295b446-148c-59a6-bc18-dc7afb38d77f")}catch(e){}}();
6
6
  import { prisma } from "../lib/prisma.js";
7
7
  const conversationListInclude = {
8
8
  labChat: { select: { id: true, title: true } },
@@ -222,6 +222,17 @@ export function hideConversationMember(userId, conversationId) {
222
222
  },
223
223
  });
224
224
  }
225
+ /** Unhide a conversation for a single member. */
226
+ export function unhideConversationMember(userId, conversationId) {
227
+ return prisma.conversationMember.update({
228
+ where: {
229
+ userId_conversationId: { userId, conversationId },
230
+ },
231
+ data: {
232
+ hiddenAt: null,
233
+ },
234
+ });
235
+ }
225
236
  /** Remove a member from a conversation. */
226
237
  export function deleteConversationMember(userId, conversationId) {
227
238
  return prisma.conversationMember.delete({
@@ -231,4 +242,4 @@ export function deleteConversationMember(userId, conversationId) {
231
242
  });
232
243
  }
233
244
  //# sourceMappingURL=conversation.js.map
234
- //# debugId=14c80725-5a2b-5e37-aa01-49cb94535659
245
+ //# debugId=2295b446-148c-59a6-bc18-dc7afb38d77f
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.js","sources":["models/conversation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Conversation model – DM/group conversations, members, unread counts.\n */\nimport { prisma } from \"../lib/prisma.js\";\n\nconst conversationListInclude = {\n labChat: { select: { id: true, title: true } },\n members: {\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: { displayName: true, profilePicture: true },\n },\n },\n },\n },\n },\n messages: {\n orderBy: { createdAt: \"desc\" as const },\n take: 1,\n include: {\n sender: {\n select: {\n id: true,\n username: true,\n profile: { select: { displayName: true } },\n },\n },\n },\n },\n};\n\n/** @returns User's conversations with members and last message. */\nexport function findConversationsByUserId(userId: string) {\n return prisma.conversation.findMany({\n where: {\n members: { some: { userId } },\n },\n include: conversationListInclude,\n orderBy: { updatedAt: \"desc\" },\n });\n}\n\n/** Count unread messages in conversation for user. */\nexport function countUnreadMessages(\n conversationId: string,\n userId: string,\n after?: Date\n) {\n return prisma.message.count({\n where: {\n conversationId,\n senderId: { not: userId },\n ...(after && { createdAt: { gt: after } }),\n },\n });\n}\n\n/** Count unread mentions for user in conversation. */\nexport function countUnreadMentions(\n conversationId: string,\n userId: string,\n after?: Date\n) {\n return prisma.mention.count({\n where: {\n userId,\n message: {\n conversationId,\n senderId: { not: userId },\n ...(after && { createdAt: { gt: after } }),\n },\n },\n });\n}\n\n/** @returns User by username (id, username only). */\nexport function findUserByUsername(username: string) {\n return prisma.user.findFirst({\n where: { username },\n select: { id: true, username: true },\n });\n}\n\n/**\n * Search users who share at least one active school membership with the\n * requester and match the query by username or profile display name.\n *\n * The requester is always excluded so the result set can be used directly as\n * conversation member suggestions.\n */\nexport async function searchInstitutionConversationMembers(\n userId: string,\n query: string,\n limit: number\n) {\n const memberships = await prisma.schoolMembership.findMany({\n where: { userId, status: \"ACTIVE\" },\n select: { schoolId: true },\n });\n const schoolIds = memberships.map((membership) => membership.schoolId);\n\n if (schoolIds.length === 0) return [];\n\n return prisma.user.findMany({\n where: {\n id: { not: userId },\n schoolMemberships: {\n some: {\n schoolId: { in: schoolIds },\n status: \"ACTIVE\",\n },\n },\n OR: [\n { username: { contains: query, mode: \"insensitive\" } },\n {\n profile: {\n is: { displayName: { contains: query, mode: \"insensitive\" } },\n },\n },\n ],\n },\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n orderBy: { username: \"asc\" },\n take: limit,\n });\n}\n\n/** @returns User's DM conversations. */\nexport function findDmConversationsByUserId(userId: string) {\n return prisma.conversation.findMany({\n where: {\n type: \"DM\",\n members: { some: { userId } },\n },\n include: {\n members: { select: { userId: true } },\n },\n });\n}\n\n/** @returns Users by IDs or usernames. */\nexport function findUsersByIdsOrUsernames(identifiers: string[]) {\n if (identifiers.length === 0) return Promise.resolve([]);\n return prisma.user.findMany({\n where: {\n OR: [\n { id: { in: identifiers } },\n { username: { in: identifiers } },\n ],\n },\n select: { id: true, username: true },\n });\n}\n\n/** Create a DM or group conversation with members. */\nexport function createConversation(data: {\n type: \"DM\" | \"GROUP\";\n name?: string;\n members: { userId: string; role: string }[];\n}) {\n return prisma.conversation.create({\n data: {\n type: data.type,\n name: data.name,\n members: {\n create: data.members.map((m) => ({\n userId: m.userId,\n role: m.role as \"ADMIN\" | \"MEMBER\",\n })),\n },\n },\n include: {\n members: {\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: { displayName: true, profilePicture: true },\n },\n },\n },\n },\n },\n },\n });\n}\n\n/** @returns Conversation if user is a member. */\nexport function findConversationByIdAndMember(\n conversationId: string,\n userId: string\n) {\n return prisma.conversation.findFirst({\n where: {\n id: conversationId,\n members: { some: { userId } },\n },\n include: {\n members: {\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: { displayName: true, profilePicture: true },\n },\n },\n },\n },\n },\n },\n });\n}\n\n/** Add a member to a conversation. */\nexport function createConversationMember(data: {\n userId: string;\n conversationId: string;\n role: string;\n}) {\n return prisma.conversationMember.create({\n data: {\n userId: data.userId,\n conversationId: data.conversationId,\n role: data.role as \"ADMIN\" | \"MEMBER\",\n },\n });\n}\n\n/** Hide a conversation for a single member until new activity occurs. */\nexport function hideConversationMember(userId: string, conversationId: string) {\n return prisma.conversationMember.update({\n where: {\n userId_conversationId: { userId, conversationId },\n },\n data: {\n hiddenAt: new Date(),\n },\n });\n}\n\n/** Remove a member from a conversation. */\nexport function deleteConversationMember(userId: string, conversationId: string) {\n return prisma.conversationMember.delete({\n where: {\n userId_conversationId: { userId, conversationId },\n },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,uBAAuB,GAAG;IAC9B,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IAC9C,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI;oBACR,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,MAAM,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;qBACpD;iBACF;aACF;SACF;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,EAAE,SAAS,EAAE,MAAe,EAAE;QACvC,IAAI,EAAE,CAAC;QACP,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI;oBACR,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE;iBAC3C;aACF;SACF;KACF;CACF,CAAC;AAEF,mEAAmE;AACnE,MAAM,UAAU,yBAAyB,CAAC,MAAc;IACtD,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC;QAClC,KAAK,EAAE;YACL,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE;SAC9B;QACD,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;KAC/B,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,UA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CAAC","debug_id":"14c80725-5a2b-5e37-aa01-49cb94535659"}
1
+ {"version":3,"file":"conversation.js","sources":["models/conversation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Conversation model – DM/group conversations, members, unread counts.\n */\nimport { prisma } from \"../lib/prisma.js\";\n\nconst conversationListInclude = {\n labChat: { select: { id: true, title: true } },\n members: {\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: { displayName: true, profilePicture: true },\n },\n },\n },\n },\n },\n messages: {\n orderBy: { createdAt: \"desc\" as const },\n take: 1,\n include: {\n sender: {\n select: {\n id: true,\n username: true,\n profile: { select: { displayName: true } },\n },\n },\n },\n },\n};\n\n/** @returns User's conversations with members and last message. */\nexport function findConversationsByUserId(userId: string) {\n return prisma.conversation.findMany({\n where: {\n members: { some: { userId } },\n },\n include: conversationListInclude,\n orderBy: { updatedAt: \"desc\" },\n });\n}\n\n/** Count unread messages in conversation for user. */\nexport function countUnreadMessages(\n conversationId: string,\n userId: string,\n after?: Date\n) {\n return prisma.message.count({\n where: {\n conversationId,\n senderId: { not: userId },\n ...(after && { createdAt: { gt: after } }),\n },\n });\n}\n\n/** Count unread mentions for user in conversation. */\nexport function countUnreadMentions(\n conversationId: string,\n userId: string,\n after?: Date\n) {\n return prisma.mention.count({\n where: {\n userId,\n message: {\n conversationId,\n senderId: { not: userId },\n ...(after && { createdAt: { gt: after } }),\n },\n },\n });\n}\n\n/** @returns User by username (id, username only). */\nexport function findUserByUsername(username: string) {\n return prisma.user.findFirst({\n where: { username },\n select: { id: true, username: true },\n });\n}\n\n/**\n * Search users who share at least one active school membership with the\n * requester and match the query by username or profile display name.\n *\n * The requester is always excluded so the result set can be used directly as\n * conversation member suggestions.\n */\nexport async function searchInstitutionConversationMembers(\n userId: string,\n query: string,\n limit: number\n) {\n const memberships = await prisma.schoolMembership.findMany({\n where: { userId, status: \"ACTIVE\" },\n select: { schoolId: true },\n });\n const schoolIds = memberships.map((membership) => membership.schoolId);\n\n if (schoolIds.length === 0) return [];\n\n return prisma.user.findMany({\n where: {\n id: { not: userId },\n schoolMemberships: {\n some: {\n schoolId: { in: schoolIds },\n status: \"ACTIVE\",\n },\n },\n OR: [\n { username: { contains: query, mode: \"insensitive\" } },\n {\n profile: {\n is: { displayName: { contains: query, mode: \"insensitive\" } },\n },\n },\n ],\n },\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n orderBy: { username: \"asc\" },\n take: limit,\n });\n}\n\n/** @returns User's DM conversations. */\nexport function findDmConversationsByUserId(userId: string) {\n return prisma.conversation.findMany({\n where: {\n type: \"DM\",\n members: { some: { userId } },\n },\n include: {\n members: { select: { userId: true } },\n },\n });\n}\n\n/** @returns Users by IDs or usernames. */\nexport function findUsersByIdsOrUsernames(identifiers: string[]) {\n if (identifiers.length === 0) return Promise.resolve([]);\n return prisma.user.findMany({\n where: {\n OR: [\n { id: { in: identifiers } },\n { username: { in: identifiers } },\n ],\n },\n select: { id: true, username: true },\n });\n}\n\n/** Create a DM or group conversation with members. */\nexport function createConversation(data: {\n type: \"DM\" | \"GROUP\";\n name?: string;\n members: { userId: string; role: string }[];\n}) {\n return prisma.conversation.create({\n data: {\n type: data.type,\n name: data.name,\n members: {\n create: data.members.map((m) => ({\n userId: m.userId,\n role: m.role as \"ADMIN\" | \"MEMBER\",\n })),\n },\n },\n include: {\n members: {\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: { displayName: true, profilePicture: true },\n },\n },\n },\n },\n },\n },\n });\n}\n\n/** @returns Conversation if user is a member. */\nexport function findConversationByIdAndMember(\n conversationId: string,\n userId: string\n) {\n return prisma.conversation.findFirst({\n where: {\n id: conversationId,\n members: { some: { userId } },\n },\n include: {\n members: {\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: { displayName: true, profilePicture: true },\n },\n },\n },\n },\n },\n },\n });\n}\n\n/** Add a member to a conversation. */\nexport function createConversationMember(data: {\n userId: string;\n conversationId: string;\n role: string;\n}) {\n return prisma.conversationMember.create({\n data: {\n userId: data.userId,\n conversationId: data.conversationId,\n role: data.role as \"ADMIN\" | \"MEMBER\",\n },\n });\n}\n\n/** Hide a conversation for a single member until new activity occurs. */\nexport function hideConversationMember(userId: string, conversationId: string) {\n return prisma.conversationMember.update({\n where: {\n userId_conversationId: { userId, conversationId },\n },\n data: {\n hiddenAt: new Date(),\n },\n });\n}\n\n/** Unhide a conversation for a single member. */\nexport function unhideConversationMember(userId: string, conversationId: string) {\n return prisma.conversationMember.update({\n where: {\n userId_conversationId: { userId, conversationId },\n },\n data: {\n hiddenAt: null,\n },\n });\n}\n\n/** Remove a member from a conversation. */\nexport function deleteConversationMember(userId: string, conversationId: string) {\n return prisma.conversationMember.delete({\n where: {\n userId_conversationId: { userId, conversationId },\n },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,uBAAuB,GAAG;IAC9B,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IAC9C,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI;oBACR,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,MAAM,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;qBACpD;iBACF;aACF;SACF;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,EAAE,SAAS,EAAE,MAAe,EAAE;QACvC,IAAI,EAAE,CAAC;QACP,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI;oBACR,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAA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L,qBAAqB,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE;SAClD;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,IAAI,IAAI,EAAE;SACrB;KACF,CAAC,CAAC;AACL,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,wBAAwB,CAAC,MAAc,EAAE,cAAsB;IAC7E,OAAO,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC;QACtC,KAAK,EAAE;YACL,qBAAqB,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE;SAClD;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,IAAI;SACf;KACF,CAAC,CAAC;AACL,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,wBAAwB,CAAC,MAAc,EAAE,cAAsB;IAC7E,OAAO,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC;QACtC,KAAK,EAAE;YACL,qBAAqB,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE;SAClD;KACF,CAAC,CAAC;AACL,CAAC","debug_id":"2295b446-148c-59a6-bc18-dc7afb38d77f"}
@@ -37,6 +37,9 @@ export declare function findEventById(id: string): import(".prisma/client").Pris
37
37
  section: string;
38
38
  syllabus: string | null;
39
39
  departmentId: string | null;
40
+ discussionsEnabled: boolean;
41
+ studentsCanCreateDiscussions: boolean;
42
+ studentsCanReply: boolean;
40
43
  }) | null;
41
44
  assignmentsAttached: {
42
45
  type: import(".prisma/client").$Enums.AssignmentType;
@@ -88,6 +91,9 @@ export declare function findClassWithTeachers(classId: string, teacherId: string
88
91
  section: string;
89
92
  syllabus: string | null;
90
93
  departmentId: string | null;
94
+ discussionsEnabled: boolean;
95
+ studentsCanCreateDiscussions: boolean;
96
+ studentsCanReply: boolean;
91
97
  } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
92
98
  datasources: {
93
99
  db: {
@@ -201,6 +207,9 @@ export declare function findEventWithClass(eventId: string): import(".prisma/cli
201
207
  section: string;
202
208
  syllabus: string | null;
203
209
  departmentId: string | null;
210
+ discussionsEnabled: boolean;
211
+ studentsCanCreateDiscussions: boolean;
212
+ studentsCanReply: boolean;
204
213
  }) | null;
205
214
  } & {
206
215
  name: string | null;
@@ -250,6 +259,9 @@ export declare function findAssignmentWithClass(assignmentId: string): import(".
250
259
  section: string;
251
260
  syllabus: string | null;
252
261
  departmentId: string | null;
262
+ discussionsEnabled: boolean;
263
+ studentsCanCreateDiscussions: boolean;
264
+ studentsCanReply: boolean;
253
265
  };
254
266
  } & {
255
267
  type: import(".prisma/client").$Enums.AssignmentType;
@@ -1 +1 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"/","sources":["models/event.ts"],"names":[],"mappings":"AA+DA,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKvC;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;GAOvE;AAED,+BAA+B;AAC/B,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;;;;;;;;;;;;;;;;;;;GAKA;AAED,uBAAuB;AACvB,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE;IACJ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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B,CAAC,YAAY,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM7D;AAED,sDAAsD;AACtD,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;KAqB/D"}
@@ -40,6 +40,9 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
40
40
  section: string;
41
41
  syllabus: string | null;
42
42
  departmentId: string | null;
43
+ discussionsEnabled: boolean;
44
+ studentsCanCreateDiscussions: boolean;
45
+ studentsCanReply: boolean;
43
46
  };
44
47
  } & {
45
48
  type: import(".prisma/client").$Enums.AssignmentType;
@@ -108,6 +111,9 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
108
111
  section: string;
109
112
  syllabus: string | null;
110
113
  departmentId: string | null;
114
+ discussionsEnabled: boolean;
115
+ studentsCanCreateDiscussions: boolean;
116
+ studentsCanReply: boolean;
111
117
  };
112
118
  } & {
113
119
  type: import(".prisma/client").$Enums.AssignmentType;
@@ -201,6 +207,9 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
201
207
  section: string;
202
208
  syllabus: string | null;
203
209
  departmentId: string | null;
210
+ discussionsEnabled: boolean;
211
+ studentsCanCreateDiscussions: boolean;
212
+ studentsCanReply: boolean;
204
213
  };
205
214
  } & {
206
215
  type: import(".prisma/client").$Enums.AssignmentType;
@@ -293,6 +302,9 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
293
302
  section: string;
294
303
  syllabus: string | null;
295
304
  departmentId: string | null;
305
+ discussionsEnabled: boolean;
306
+ studentsCanCreateDiscussions: boolean;
307
+ studentsCanReply: boolean;
296
308
  }) | null;
297
309
  } & {
298
310
  name: string;
@@ -344,6 +356,9 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
344
356
  section: string;
345
357
  syllabus: string | null;
346
358
  departmentId: string | null;
359
+ discussionsEnabled: boolean;
360
+ studentsCanCreateDiscussions: boolean;
361
+ studentsCanReply: boolean;
347
362
  };
348
363
  } & {
349
364
  id: string;
@@ -379,6 +394,8 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
379
394
  conversationId: string | null;
380
395
  messageId: string | null;
381
396
  announcementId: string | null;
397
+ discussionId: string | null;
398
+ discussionReplyId: string | null;
382
399
  schoolDevelopementProgramId: string | null;
383
400
  }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
384
401
  datasources: {
@@ -399,6 +416,9 @@ export declare function findFileWithFolder(fileId: string): import(".prisma/clie
399
416
  section: string;
400
417
  syllabus: string | null;
401
418
  departmentId: string | null;
419
+ discussionsEnabled: boolean;
420
+ studentsCanCreateDiscussions: boolean;
421
+ studentsCanReply: boolean;
402
422
  } | null;
403
423
  } & {
404
424
  name: string;
@@ -436,6 +456,8 @@ export declare function findFileWithFolder(fileId: string): import(".prisma/clie
436
456
  conversationId: string | null;
437
457
  messageId: string | null;
438
458
  announcementId: string | null;
459
+ discussionId: string | null;
460
+ discussionReplyId: string | null;
439
461
  schoolDevelopementProgramId: string | null;
440
462
  }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
441
463
  datasources: {
@@ -472,6 +494,8 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
472
494
  conversationId: string | null;
473
495
  messageId: string | null;
474
496
  announcementId: string | null;
497
+ discussionId: string | null;
498
+ discussionReplyId: string | null;
475
499
  schoolDevelopementProgramId: string | null;
476
500
  } | null;
477
501
  folder: ({
@@ -484,6 +508,9 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
484
508
  section: string;
485
509
  syllabus: string | null;
486
510
  departmentId: string | null;
511
+ discussionsEnabled: boolean;
512
+ studentsCanCreateDiscussions: boolean;
513
+ studentsCanReply: boolean;
487
514
  } | null;
488
515
  } & {
489
516
  name: string;
@@ -521,6 +548,8 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
521
548
  conversationId: string | null;
522
549
  messageId: string | null;
523
550
  announcementId: string | null;
551
+ discussionId: string | null;
552
+ discussionReplyId: string | null;
524
553
  schoolDevelopementProgramId: string | null;
525
554
  }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
526
555
  datasources: {
@@ -540,6 +569,9 @@ export declare function findFolderById(folderId: string): import(".prisma/client
540
569
  section: string;
541
570
  syllabus: string | null;
542
571
  departmentId: string | null;
572
+ discussionsEnabled: boolean;
573
+ studentsCanCreateDiscussions: boolean;
574
+ studentsCanReply: boolean;
543
575
  } | null;
544
576
  } & {
545
577
  name: string;
@@ -589,6 +621,8 @@ export declare function updateFileFolder(fileId: string, folderId: string): impo
589
621
  conversationId: string | null;
590
622
  messageId: string | null;
591
623
  announcementId: string | null;
624
+ discussionId: string | null;
625
+ discussionReplyId: string | null;
592
626
  schoolDevelopementProgramId: string | null;
593
627
  }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
594
628
  datasources: {
@@ -629,6 +663,8 @@ export declare function updateFileName(fileId: string, name: string): import(".p
629
663
  conversationId: string | null;
630
664
  messageId: string | null;
631
665
  announcementId: string | null;
666
+ discussionId: string | null;
667
+ discussionReplyId: string | null;
632
668
  schoolDevelopementProgramId: string | null;
633
669
  }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
634
670
  datasources: {
@@ -664,6 +700,8 @@ export declare function deleteFileById(fileId: string): import(".prisma/client")
664
700
  conversationId: string | null;
665
701
  messageId: string | null;
666
702
  announcementId: string | null;
703
+ discussionId: string | null;
704
+ discussionReplyId: string | null;
667
705
  schoolDevelopementProgramId: string | null;
668
706
  }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
669
707
  datasources: {
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"/","sources":["models/file.ts"],"names":[],"mappings":"AAqBA,0GAA0G;AAC1G,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAI5C"}
@@ -8,6 +8,9 @@ export declare function findClassWithTeacher(classId: string, teacherId: string)
8
8
  section: string;
9
9
  syllabus: string | null;
10
10
  departmentId: string | null;
11
+ discussionsEnabled: boolean;
12
+ studentsCanCreateDiscussions: boolean;
13
+ studentsCanReply: boolean;
11
14
  } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
12
15
  datasources: {
13
16
  db: {
@@ -43,6 +46,9 @@ export declare function findFolderByIdWithClass(folderId: string): import(".pris
43
46
  section: string;
44
47
  syllabus: string | null;
45
48
  departmentId: string | null;
49
+ discussionsEnabled: boolean;
50
+ studentsCanCreateDiscussions: boolean;
51
+ studentsCanReply: boolean;
46
52
  } | null;
47
53
  } & {
48
54
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"folder.d.ts","sourceRoot":"/","sources":["models/folder.ts"],"names":[],"mappings":"AAsBA,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;GAOtE;AAED,6BAA6B;AAC7B,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;GAI9C;AAED,kCAAkC;AAClC,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;GAKvD;AAED,wCAAwC;AACxC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;GAOtD;AAED,6CAA6C;AAC7C,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;GAW3D;AAED,uBAAuB;AACvB,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,MAA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;;;;;;;;;;;;;GAOpE;AAED,+CAA+C;AAC/C,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;GAOvD;AAED,uBAAuB;AACvB,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;GAIhD;AAED,iCAAiC;AACjC,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAS1E;AAED,oCAAoC;AACpC,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUxC;AAED,0CAA0C;AAC1C,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;GAIpD;AAED,6BAA6B;AAC7B,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;GAIjD"}
@@ -25,6 +25,9 @@ export declare function findClassWithTeachersForLab(classId: string, teacherId:
25
25
  section: string;
26
26
  syllabus: string | null;
27
27
  departmentId: string | null;
28
+ discussionsEnabled: boolean;
29
+ studentsCanCreateDiscussions: boolean;
30
+ studentsCanReply: boolean;
28
31
  }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
29
32
  datasources: {
30
33
  db: {
@@ -183,6 +186,9 @@ export declare function findClassMembership(classId: string, userId: string): im
183
186
  section: string;
184
187
  syllabus: string | null;
185
188
  departmentId: string | null;
189
+ discussionsEnabled: boolean;
190
+ studentsCanCreateDiscussions: boolean;
191
+ studentsCanReply: boolean;
186
192
  } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
187
193
  datasources: {
188
194
  db: {
@@ -1 +1 @@
1
- {"version":3,"file":"labChat.d.ts","sourceRoot":"/","sources":["models/labChat.ts"],"names":[],"mappings":"AAoDA,kEAAkE;AAClE,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiC7E;AAED,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUpE;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;GAYrE;AAED,+BAA+B;AAC/B,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKhD;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;GAOlE;AAED,sCAAsC;AACtC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwClD;AAED,8DAA8D;AAC9D,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;GAYnE;AAED,sDAAsD;AACtD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;GAOrE;AAED,4DAA4D;AAC5D,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EAAE;;;;;;;;;KAQlB"}
1
+ {"version":3,"file":"labChat.d.ts","sourceRoot":"/","sources":["models/labChat.ts"],"names":[],"mappings":"AAoDA,kEAAkE;AAClE,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiC7E;AAED,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUpE;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;GAYrE;AAED,+BAA+B;AAC/B,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKhD;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;GAOlE;AAED,sCAAsC;AACtC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwClD;AAED,8DAA8D;AAC9D,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;GAYnE;AAED,sDAAsD;AACtD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;GAOrE;AAED,4DAA4D;AAC5D,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EAAE;;;;;;;;;KAQlB"}
@@ -8,6 +8,9 @@ export declare function findClassWithStudent(classId: string, studentId: string)
8
8
  section: string;
9
9
  syllabus: string | null;
10
10
  departmentId: string | null;
11
+ discussionsEnabled: boolean;
12
+ studentsCanCreateDiscussions: boolean;
13
+ studentsCanReply: boolean;
11
14
  } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
12
15
  datasources: {
13
16
  db: {
@@ -1 +1 @@
1
- {"version":3,"file":"newtonChat.d.ts","sourceRoot":"/","sources":["models/newtonChat.ts"],"names":[],"mappings":"AAKA,2CAA2C;AAC3C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;GAOtE;AAED,sDAAsD;AACtD,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;GAQlB;AAED,kFAAkF;AAClF,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyBf;AAED,wDAAwD;AACxD,wBAAgB,gCAAgC,CAC9C,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EAAE;;;;;;;;;KAQlB"}
1
+ {"version":3,"file":"newtonChat.d.ts","sourceRoot":"/","sources":["models/newtonChat.ts"],"names":[],"mappings":"AAKA,2CAA2C;AAC3C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;GAOtE;AAED,sDAAsD;AACtD,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;GAQlB;AAED,kFAAkF;AAClF,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyBf;AAED,wDAAwD;AACxD,wBAAgB,gCAAgC,CAC9C,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EAAE;;;;;;;;;KAQlB"}
@@ -204,6 +204,9 @@ export declare function listSchoolClasses(schoolId: string): import(".prisma/cli
204
204
  section: string;
205
205
  syllabus: string | null;
206
206
  departmentId: string | null;
207
+ discussionsEnabled: boolean;
208
+ studentsCanCreateDiscussions: boolean;
209
+ studentsCanReply: boolean;
207
210
  })[]>;
208
211
  export declare function listSchoolMembers(schoolId: string): import(".prisma/client").Prisma.PrismaPromise<{
209
212
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
@@ -1 +1 @@
1
- {"version":3,"file":"school.d.ts","sourceRoot":"/","sources":["models/school.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAyBtD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;GAIpE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;GAI1E;AAED,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;GAI/E;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;MAmBvD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;;;;;;;;;;;;;;;;;;;;;;;;GAoBA;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;GAc7C;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;IACJ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IA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QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;GAuClE"}
@@ -22,6 +22,9 @@ export declare function findClassWithTeacher(classId: string, teacherId: string)
22
22
  section: string;
23
23
  syllabus: string | null;
24
24
  departmentId: string | null;
25
+ discussionsEnabled: boolean;
26
+ studentsCanCreateDiscussions: boolean;
27
+ studentsCanReply: boolean;
25
28
  } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
26
29
  datasources: {
27
30
  db: {
@@ -1 +1 @@
1
- {"version":3,"file":"section.d.ts","sourceRoot":"/","sources":["models/section.ts"],"names":[],"mappings":"AAMA,8BAA8B;AAC9B,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;GAIzC;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;GAOtE;AAED,mCAAmC;AACnC,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;;;;;;;;;;;GAUA;AAED,sDAAsD;AACtD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM;;;KAKpD;AAED,yDAAyD;AACzD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM;;;KAKvD;AAED,4BAA4B;AAC5B,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;;;;;;;;;GAK3D;AAED,+BAA+B;AAC/B,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAK9D;AAED,qCAAqC;AACrC,wBAAgB,aAAa,CAC3B,EAAE,EAAE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