@studious-lms/server 1.8.0 → 1.11.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.
- package/dist/middleware/security.d.ts.map +1 -1
- package/dist/middleware/security.js +3 -3
- package/dist/middleware/security.js.map +1 -1
- package/dist/models/agenda.d.ts +2 -2
- package/dist/models/announcement.d.ts +2 -2
- package/dist/models/assignment.d.ts +33 -33
- package/dist/models/class.d.ts +2 -2
- package/dist/models/cloudStorage.d.ts +14 -1
- package/dist/models/cloudStorage.d.ts.map +1 -1
- package/dist/models/cloudStorage.js +123 -3
- package/dist/models/cloudStorage.js.map +1 -1
- package/dist/models/event.d.ts +3 -3
- package/dist/models/file.d.ts +27 -26
- package/dist/models/file.d.ts.map +1 -1
- package/dist/models/file.js +4 -39
- package/dist/models/file.js.map +1 -1
- package/dist/models/labChat.d.ts +6 -6
- package/dist/models/section.d.ts +1 -1
- package/dist/routers/_app.d.ts +444 -100
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +4 -2
- package/dist/routers/_app.js.map +1 -1
- package/dist/routers/agenda.d.ts +2 -2
- package/dist/routers/assignment.d.ts +31 -31
- package/dist/routers/class.d.ts +5 -5
- package/dist/routers/event.d.ts +2 -2
- package/dist/routers/file.d.ts +2 -2
- package/dist/routers/folder.d.ts +24 -0
- package/dist/routers/folder.d.ts.map +1 -1
- package/dist/routers/folder.js +27 -5
- package/dist/routers/folder.js.map +1 -1
- package/dist/routers/labChat.d.ts +2 -2
- package/dist/routers/newtonChat.d.ts +1 -1
- package/dist/routers/permissions.d.ts +120 -0
- package/dist/routers/permissions.d.ts.map +1 -0
- package/dist/routers/permissions.js +50 -0
- package/dist/routers/permissions.js.map +1 -0
- package/dist/routers/studentProgress.d.ts +45 -0
- package/dist/routers/studentProgress.d.ts.map +1 -1
- package/dist/routers/studentProgress.js +12 -3
- package/dist/routers/studentProgress.js.map +1 -1
- package/dist/routers/tag.d.ts +5 -5
- package/dist/services/agenda.d.ts +2 -2
- package/dist/services/assignment.d.ts +31 -31
- package/dist/services/class.d.ts +5 -5
- package/dist/services/class.js +3 -3
- package/dist/services/class.js.map +1 -1
- package/dist/services/event.d.ts +2 -2
- package/dist/services/file.d.ts +22 -5
- package/dist/services/file.d.ts.map +1 -1
- package/dist/services/file.js +81 -45
- package/dist/services/file.js.map +1 -1
- package/dist/services/folder.d.ts +97 -2
- package/dist/services/folder.d.ts.map +1 -1
- package/dist/services/folder.js +158 -87
- package/dist/services/folder.js.map +1 -1
- package/dist/services/labChat.d.ts +2 -2
- package/dist/services/permissions.d.ts +188 -0
- package/dist/services/permissions.d.ts.map +1 -0
- package/dist/services/permissions.js +661 -0
- package/dist/services/permissions.js.map +1 -0
- package/dist/services/studentProgress.d.ts +94 -0
- package/dist/services/studentProgress.d.ts.map +1 -1
- package/dist/services/studentProgress.js +94 -3
- package/dist/services/studentProgress.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260510170000_add_folder_permissions/migration.sql +93 -0
- package/prisma/schema.prisma +74 -0
- package/src/middleware/security.ts +1 -1
- package/src/models/cloudStorage.ts +134 -1
- package/src/models/file.ts +2 -37
- package/src/routers/_app.ts +2 -0
- package/src/routers/folder.ts +32 -2
- package/src/routers/permissions.ts +71 -0
- package/src/routers/studentProgress.ts +21 -0
- package/src/services/class.ts +1 -1
- package/src/services/file.ts +76 -47
- package/src/services/folder.ts +180 -91
- package/src/services/permissions.ts +778 -0
- package/src/services/studentProgress.ts +197 -11
- package/tests/unit/services/permissions.test.ts +463 -0
- package/tests/unit/services/studentProgress.test.ts +168 -2
|
@@ -67,8 +67,8 @@ export declare function getAssignment(id: string, _classId: string): Promise<{
|
|
|
67
67
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
68
68
|
id: string;
|
|
69
69
|
createdAt: Date | null;
|
|
70
|
-
modifiedAt: Date | null;
|
|
71
70
|
classId: string;
|
|
71
|
+
modifiedAt: Date | null;
|
|
72
72
|
title: string;
|
|
73
73
|
instructions: string;
|
|
74
74
|
dueDate: Date;
|
|
@@ -118,8 +118,8 @@ export declare function getSubmission(assignmentId: string, studentId: string):
|
|
|
118
118
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
119
119
|
id: string;
|
|
120
120
|
createdAt: Date | null;
|
|
121
|
-
modifiedAt: Date | null;
|
|
122
121
|
classId: string;
|
|
122
|
+
modifiedAt: Date | null;
|
|
123
123
|
title: string;
|
|
124
124
|
instructions: string;
|
|
125
125
|
dueDate: Date;
|
|
@@ -146,6 +146,7 @@ export declare function getSubmission(assignmentId: string, studentId: string):
|
|
|
146
146
|
name: string;
|
|
147
147
|
id: string;
|
|
148
148
|
userId: string | null;
|
|
149
|
+
folderId: string | null;
|
|
149
150
|
size: number | null;
|
|
150
151
|
uploadedAt: Date | null;
|
|
151
152
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -162,7 +163,6 @@ export declare function getSubmission(assignmentId: string, studentId: string):
|
|
|
162
163
|
submissionId: string | null;
|
|
163
164
|
annotationId: string | null;
|
|
164
165
|
classDraftId: string | null;
|
|
165
|
-
folderId: string | null;
|
|
166
166
|
conversationId: string | null;
|
|
167
167
|
messageId: string | null;
|
|
168
168
|
announcementId: string | null;
|
|
@@ -174,6 +174,7 @@ export declare function getSubmission(assignmentId: string, studentId: string):
|
|
|
174
174
|
name: string;
|
|
175
175
|
id: string;
|
|
176
176
|
userId: string | null;
|
|
177
|
+
folderId: string | null;
|
|
177
178
|
size: number | null;
|
|
178
179
|
uploadedAt: Date | null;
|
|
179
180
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -190,7 +191,6 @@ export declare function getSubmission(assignmentId: string, studentId: string):
|
|
|
190
191
|
submissionId: string | null;
|
|
191
192
|
annotationId: string | null;
|
|
192
193
|
classDraftId: string | null;
|
|
193
|
-
folderId: string | null;
|
|
194
194
|
conversationId: string | null;
|
|
195
195
|
messageId: string | null;
|
|
196
196
|
announcementId: string | null;
|
|
@@ -245,8 +245,8 @@ export declare function getSubmissionById(submissionId: string, classId: string,
|
|
|
245
245
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
246
246
|
id: string;
|
|
247
247
|
createdAt: Date | null;
|
|
248
|
-
modifiedAt: Date | null;
|
|
249
248
|
classId: string;
|
|
249
|
+
modifiedAt: Date | null;
|
|
250
250
|
title: string;
|
|
251
251
|
instructions: string;
|
|
252
252
|
dueDate: Date;
|
|
@@ -273,6 +273,7 @@ export declare function getSubmissionById(submissionId: string, classId: string,
|
|
|
273
273
|
name: string;
|
|
274
274
|
id: string;
|
|
275
275
|
userId: string | null;
|
|
276
|
+
folderId: string | null;
|
|
276
277
|
size: number | null;
|
|
277
278
|
uploadedAt: Date | null;
|
|
278
279
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -289,7 +290,6 @@ export declare function getSubmissionById(submissionId: string, classId: string,
|
|
|
289
290
|
submissionId: string | null;
|
|
290
291
|
annotationId: string | null;
|
|
291
292
|
classDraftId: string | null;
|
|
292
|
-
folderId: string | null;
|
|
293
293
|
conversationId: string | null;
|
|
294
294
|
messageId: string | null;
|
|
295
295
|
announcementId: string | null;
|
|
@@ -301,6 +301,7 @@ export declare function getSubmissionById(submissionId: string, classId: string,
|
|
|
301
301
|
name: string;
|
|
302
302
|
id: string;
|
|
303
303
|
userId: string | null;
|
|
304
|
+
folderId: string | null;
|
|
304
305
|
size: number | null;
|
|
305
306
|
uploadedAt: Date | null;
|
|
306
307
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -317,7 +318,6 @@ export declare function getSubmissionById(submissionId: string, classId: string,
|
|
|
317
318
|
submissionId: string | null;
|
|
318
319
|
annotationId: string | null;
|
|
319
320
|
classDraftId: string | null;
|
|
320
|
-
folderId: string | null;
|
|
321
321
|
conversationId: string | null;
|
|
322
322
|
messageId: string | null;
|
|
323
323
|
announcementId: string | null;
|
|
@@ -380,8 +380,8 @@ export declare function getSubmissions(assignmentId: string, teacherId: string):
|
|
|
380
380
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
381
381
|
id: string;
|
|
382
382
|
createdAt: Date | null;
|
|
383
|
-
modifiedAt: Date | null;
|
|
384
383
|
classId: string;
|
|
384
|
+
modifiedAt: Date | null;
|
|
385
385
|
title: string;
|
|
386
386
|
instructions: string;
|
|
387
387
|
dueDate: Date;
|
|
@@ -409,6 +409,7 @@ export declare function getSubmissions(assignmentId: string, teacherId: string):
|
|
|
409
409
|
name: string;
|
|
410
410
|
id: string;
|
|
411
411
|
userId: string | null;
|
|
412
|
+
folderId: string | null;
|
|
412
413
|
size: number | null;
|
|
413
414
|
uploadedAt: Date | null;
|
|
414
415
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -425,7 +426,6 @@ export declare function getSubmissions(assignmentId: string, teacherId: string):
|
|
|
425
426
|
submissionId: string | null;
|
|
426
427
|
annotationId: string | null;
|
|
427
428
|
classDraftId: string | null;
|
|
428
|
-
folderId: string | null;
|
|
429
429
|
conversationId: string | null;
|
|
430
430
|
messageId: string | null;
|
|
431
431
|
announcementId: string | null;
|
|
@@ -437,6 +437,7 @@ export declare function getSubmissions(assignmentId: string, teacherId: string):
|
|
|
437
437
|
name: string;
|
|
438
438
|
id: string;
|
|
439
439
|
userId: string | null;
|
|
440
|
+
folderId: string | null;
|
|
440
441
|
size: number | null;
|
|
441
442
|
uploadedAt: Date | null;
|
|
442
443
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -453,7 +454,6 @@ export declare function getSubmissions(assignmentId: string, teacherId: string):
|
|
|
453
454
|
submissionId: string | null;
|
|
454
455
|
annotationId: string | null;
|
|
455
456
|
classDraftId: string | null;
|
|
456
|
-
folderId: string | null;
|
|
457
457
|
conversationId: string | null;
|
|
458
458
|
messageId: string | null;
|
|
459
459
|
announcementId: string | null;
|
|
@@ -547,8 +547,8 @@ export declare function duplicateAssignmentRecord(assignmentId: string, classId:
|
|
|
547
547
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
548
548
|
id: string;
|
|
549
549
|
createdAt: Date | null;
|
|
550
|
-
modifiedAt: Date | null;
|
|
551
550
|
classId: string;
|
|
551
|
+
modifiedAt: Date | null;
|
|
552
552
|
title: string;
|
|
553
553
|
instructions: string;
|
|
554
554
|
dueDate: Date;
|
|
@@ -651,6 +651,7 @@ export declare function updateAssignmentRecord(userId: string, input: {
|
|
|
651
651
|
name: string;
|
|
652
652
|
id: string;
|
|
653
653
|
userId: string | null;
|
|
654
|
+
folderId: string | null;
|
|
654
655
|
size: number | null;
|
|
655
656
|
uploadedAt: Date | null;
|
|
656
657
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -667,7 +668,6 @@ export declare function updateAssignmentRecord(userId: string, input: {
|
|
|
667
668
|
submissionId: string | null;
|
|
668
669
|
annotationId: string | null;
|
|
669
670
|
classDraftId: string | null;
|
|
670
|
-
folderId: string | null;
|
|
671
671
|
conversationId: string | null;
|
|
672
672
|
messageId: string | null;
|
|
673
673
|
announcementId: string | null;
|
|
@@ -715,8 +715,8 @@ export declare function updateSubmissionRecord(userId: string, input: {
|
|
|
715
715
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
716
716
|
id: string;
|
|
717
717
|
createdAt: Date | null;
|
|
718
|
-
modifiedAt: Date | null;
|
|
719
718
|
classId: string;
|
|
719
|
+
modifiedAt: Date | null;
|
|
720
720
|
title: string;
|
|
721
721
|
instructions: string;
|
|
722
722
|
dueDate: Date;
|
|
@@ -743,6 +743,7 @@ export declare function updateSubmissionRecord(userId: string, input: {
|
|
|
743
743
|
name: string;
|
|
744
744
|
id: string;
|
|
745
745
|
userId: string | null;
|
|
746
|
+
folderId: string | null;
|
|
746
747
|
size: number | null;
|
|
747
748
|
uploadedAt: Date | null;
|
|
748
749
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -759,7 +760,6 @@ export declare function updateSubmissionRecord(userId: string, input: {
|
|
|
759
760
|
submissionId: string | null;
|
|
760
761
|
annotationId: string | null;
|
|
761
762
|
classDraftId: string | null;
|
|
762
|
-
folderId: string | null;
|
|
763
763
|
conversationId: string | null;
|
|
764
764
|
messageId: string | null;
|
|
765
765
|
announcementId: string | null;
|
|
@@ -830,8 +830,8 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
830
830
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
831
831
|
id: string;
|
|
832
832
|
createdAt: Date | null;
|
|
833
|
-
modifiedAt: Date | null;
|
|
834
833
|
classId: string;
|
|
834
|
+
modifiedAt: Date | null;
|
|
835
835
|
title: string;
|
|
836
836
|
instructions: string;
|
|
837
837
|
dueDate: Date;
|
|
@@ -859,6 +859,7 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
859
859
|
name: string;
|
|
860
860
|
id: string;
|
|
861
861
|
userId: string | null;
|
|
862
|
+
folderId: string | null;
|
|
862
863
|
size: number | null;
|
|
863
864
|
uploadedAt: Date | null;
|
|
864
865
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -875,7 +876,6 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
875
876
|
submissionId: string | null;
|
|
876
877
|
annotationId: string | null;
|
|
877
878
|
classDraftId: string | null;
|
|
878
|
-
folderId: string | null;
|
|
879
879
|
conversationId: string | null;
|
|
880
880
|
messageId: string | null;
|
|
881
881
|
announcementId: string | null;
|
|
@@ -887,6 +887,7 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
887
887
|
name: string;
|
|
888
888
|
id: string;
|
|
889
889
|
userId: string | null;
|
|
890
|
+
folderId: string | null;
|
|
890
891
|
size: number | null;
|
|
891
892
|
uploadedAt: Date | null;
|
|
892
893
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -903,7 +904,6 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
903
904
|
submissionId: string | null;
|
|
904
905
|
annotationId: string | null;
|
|
905
906
|
classDraftId: string | null;
|
|
906
|
-
folderId: string | null;
|
|
907
907
|
conversationId: string | null;
|
|
908
908
|
messageId: string | null;
|
|
909
909
|
announcementId: string | null;
|
|
@@ -916,6 +916,7 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
916
916
|
name: string;
|
|
917
917
|
id: string;
|
|
918
918
|
userId: string | null;
|
|
919
|
+
folderId: string | null;
|
|
919
920
|
size: number | null;
|
|
920
921
|
uploadedAt: Date | null;
|
|
921
922
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -932,7 +933,6 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
932
933
|
submissionId: string | null;
|
|
933
934
|
annotationId: string | null;
|
|
934
935
|
classDraftId: string | null;
|
|
935
|
-
folderId: string | null;
|
|
936
936
|
conversationId: string | null;
|
|
937
937
|
messageId: string | null;
|
|
938
938
|
announcementId: string | null;
|
|
@@ -944,6 +944,7 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
944
944
|
name: string;
|
|
945
945
|
id: string;
|
|
946
946
|
userId: string | null;
|
|
947
|
+
folderId: string | null;
|
|
947
948
|
size: number | null;
|
|
948
949
|
uploadedAt: Date | null;
|
|
949
950
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -960,7 +961,6 @@ export declare function updateSubmissionAsTeacherRecord(teacherId: string, input
|
|
|
960
961
|
submissionId: string | null;
|
|
961
962
|
annotationId: string | null;
|
|
962
963
|
classDraftId: string | null;
|
|
963
|
-
folderId: string | null;
|
|
964
964
|
conversationId: string | null;
|
|
965
965
|
messageId: string | null;
|
|
966
966
|
announcementId: string | null;
|
|
@@ -1018,8 +1018,8 @@ export declare function attachAssignmentToEventRecord(teacherId: string, assignm
|
|
|
1018
1018
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
1019
1019
|
id: string;
|
|
1020
1020
|
createdAt: Date | null;
|
|
1021
|
-
modifiedAt: Date | null;
|
|
1022
1021
|
classId: string;
|
|
1022
|
+
modifiedAt: Date | null;
|
|
1023
1023
|
title: string;
|
|
1024
1024
|
instructions: string;
|
|
1025
1025
|
dueDate: Date;
|
|
@@ -1067,8 +1067,8 @@ export declare function detachAssignmentFromEventRecord(teacherId: string, assig
|
|
|
1067
1067
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
1068
1068
|
id: string;
|
|
1069
1069
|
createdAt: Date | null;
|
|
1070
|
-
modifiedAt: Date | null;
|
|
1071
1070
|
classId: string;
|
|
1071
|
+
modifiedAt: Date | null;
|
|
1072
1072
|
title: string;
|
|
1073
1073
|
instructions: string;
|
|
1074
1074
|
dueDate: Date;
|
|
@@ -1130,6 +1130,7 @@ export declare function attachMarkSchemeRecord(teacherId: string, assignmentId:
|
|
|
1130
1130
|
name: string;
|
|
1131
1131
|
id: string;
|
|
1132
1132
|
userId: string | null;
|
|
1133
|
+
folderId: string | null;
|
|
1133
1134
|
size: number | null;
|
|
1134
1135
|
uploadedAt: Date | null;
|
|
1135
1136
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -1146,7 +1147,6 @@ export declare function attachMarkSchemeRecord(teacherId: string, assignmentId:
|
|
|
1146
1147
|
submissionId: string | null;
|
|
1147
1148
|
annotationId: string | null;
|
|
1148
1149
|
classDraftId: string | null;
|
|
1149
|
-
folderId: string | null;
|
|
1150
1150
|
conversationId: string | null;
|
|
1151
1151
|
messageId: string | null;
|
|
1152
1152
|
announcementId: string | null;
|
|
@@ -1167,8 +1167,8 @@ export declare function attachMarkSchemeRecord(teacherId: string, assignmentId:
|
|
|
1167
1167
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
1168
1168
|
id: string;
|
|
1169
1169
|
createdAt: Date | null;
|
|
1170
|
-
modifiedAt: Date | null;
|
|
1171
1170
|
classId: string;
|
|
1171
|
+
modifiedAt: Date | null;
|
|
1172
1172
|
title: string;
|
|
1173
1173
|
instructions: string;
|
|
1174
1174
|
dueDate: Date;
|
|
@@ -1218,6 +1218,7 @@ export declare function detachMarkSchemeRecord(teacherId: string, assignmentId:
|
|
|
1218
1218
|
name: string;
|
|
1219
1219
|
id: string;
|
|
1220
1220
|
userId: string | null;
|
|
1221
|
+
folderId: string | null;
|
|
1221
1222
|
size: number | null;
|
|
1222
1223
|
uploadedAt: Date | null;
|
|
1223
1224
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -1234,7 +1235,6 @@ export declare function detachMarkSchemeRecord(teacherId: string, assignmentId:
|
|
|
1234
1235
|
submissionId: string | null;
|
|
1235
1236
|
annotationId: string | null;
|
|
1236
1237
|
classDraftId: string | null;
|
|
1237
|
-
folderId: string | null;
|
|
1238
1238
|
conversationId: string | null;
|
|
1239
1239
|
messageId: string | null;
|
|
1240
1240
|
announcementId: string | null;
|
|
@@ -1255,8 +1255,8 @@ export declare function detachMarkSchemeRecord(teacherId: string, assignmentId:
|
|
|
1255
1255
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
1256
1256
|
id: string;
|
|
1257
1257
|
createdAt: Date | null;
|
|
1258
|
-
modifiedAt: Date | null;
|
|
1259
1258
|
classId: string;
|
|
1259
|
+
modifiedAt: Date | null;
|
|
1260
1260
|
title: string;
|
|
1261
1261
|
instructions: string;
|
|
1262
1262
|
dueDate: Date;
|
|
@@ -1306,6 +1306,7 @@ export declare function attachGradingBoundaryRecord(teacherId: string, assignmen
|
|
|
1306
1306
|
name: string;
|
|
1307
1307
|
id: string;
|
|
1308
1308
|
userId: string | null;
|
|
1309
|
+
folderId: string | null;
|
|
1309
1310
|
size: number | null;
|
|
1310
1311
|
uploadedAt: Date | null;
|
|
1311
1312
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -1322,7 +1323,6 @@ export declare function attachGradingBoundaryRecord(teacherId: string, assignmen
|
|
|
1322
1323
|
submissionId: string | null;
|
|
1323
1324
|
annotationId: string | null;
|
|
1324
1325
|
classDraftId: string | null;
|
|
1325
|
-
folderId: string | null;
|
|
1326
1326
|
conversationId: string | null;
|
|
1327
1327
|
messageId: string | null;
|
|
1328
1328
|
announcementId: string | null;
|
|
@@ -1343,8 +1343,8 @@ export declare function attachGradingBoundaryRecord(teacherId: string, assignmen
|
|
|
1343
1343
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
1344
1344
|
id: string;
|
|
1345
1345
|
createdAt: Date | null;
|
|
1346
|
-
modifiedAt: Date | null;
|
|
1347
1346
|
classId: string;
|
|
1347
|
+
modifiedAt: Date | null;
|
|
1348
1348
|
title: string;
|
|
1349
1349
|
instructions: string;
|
|
1350
1350
|
dueDate: Date;
|
|
@@ -1394,6 +1394,7 @@ export declare function detachGradingBoundaryRecord(teacherId: string, assignmen
|
|
|
1394
1394
|
name: string;
|
|
1395
1395
|
id: string;
|
|
1396
1396
|
userId: string | null;
|
|
1397
|
+
folderId: string | null;
|
|
1397
1398
|
size: number | null;
|
|
1398
1399
|
uploadedAt: Date | null;
|
|
1399
1400
|
uploadStatus: import(".prisma/client").$Enums.UploadStatus;
|
|
@@ -1410,7 +1411,6 @@ export declare function detachGradingBoundaryRecord(teacherId: string, assignmen
|
|
|
1410
1411
|
submissionId: string | null;
|
|
1411
1412
|
annotationId: string | null;
|
|
1412
1413
|
classDraftId: string | null;
|
|
1413
|
-
folderId: string | null;
|
|
1414
1414
|
conversationId: string | null;
|
|
1415
1415
|
messageId: string | null;
|
|
1416
1416
|
announcementId: string | null;
|
|
@@ -1431,8 +1431,8 @@ export declare function detachGradingBoundaryRecord(teacherId: string, assignmen
|
|
|
1431
1431
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
1432
1432
|
id: string;
|
|
1433
1433
|
createdAt: Date | null;
|
|
1434
|
-
modifiedAt: Date | null;
|
|
1435
1434
|
classId: string;
|
|
1435
|
+
modifiedAt: Date | null;
|
|
1436
1436
|
title: string;
|
|
1437
1437
|
instructions: string;
|
|
1438
1438
|
dueDate: Date;
|
|
@@ -1462,8 +1462,8 @@ export declare function reorderAssignmentRecord(teacherId: string, input: {
|
|
|
1462
1462
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
1463
1463
|
id: string;
|
|
1464
1464
|
createdAt: Date | null;
|
|
1465
|
-
modifiedAt: Date | null;
|
|
1466
1465
|
classId: string;
|
|
1466
|
+
modifiedAt: Date | null;
|
|
1467
1467
|
title: string;
|
|
1468
1468
|
instructions: string;
|
|
1469
1469
|
dueDate: Date;
|
|
@@ -1492,8 +1492,8 @@ export declare function moveAssignmentRecord(teacherId: string, input: {
|
|
|
1492
1492
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
1493
1493
|
id: string;
|
|
1494
1494
|
createdAt: Date | null;
|
|
1495
|
-
modifiedAt: Date | null;
|
|
1496
1495
|
classId: string;
|
|
1496
|
+
modifiedAt: Date | null;
|
|
1497
1497
|
title: string;
|
|
1498
1498
|
instructions: string;
|
|
1499
1499
|
dueDate: Date;
|
package/dist/services/class.d.ts
CHANGED
|
@@ -461,8 +461,8 @@ export declare function listLabDrafts(classId: string, teacherId: string): Promi
|
|
|
461
461
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
462
462
|
id: string;
|
|
463
463
|
createdAt: Date | null;
|
|
464
|
-
modifiedAt: Date | null;
|
|
465
464
|
classId: string;
|
|
465
|
+
modifiedAt: Date | null;
|
|
466
466
|
title: string;
|
|
467
467
|
instructions: string;
|
|
468
468
|
dueDate: Date;
|
|
@@ -498,8 +498,8 @@ export declare function createLabDraft(classId: string, teacherId: string, input
|
|
|
498
498
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
499
499
|
id: string;
|
|
500
500
|
createdAt: Date | null;
|
|
501
|
-
modifiedAt: Date | null;
|
|
502
501
|
classId: string;
|
|
502
|
+
modifiedAt: Date | null;
|
|
503
503
|
title: string;
|
|
504
504
|
instructions: string;
|
|
505
505
|
dueDate: Date;
|
|
@@ -524,8 +524,8 @@ export declare function updateLabDraft(classId: string, teacherId: string, draft
|
|
|
524
524
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
525
525
|
id: string;
|
|
526
526
|
createdAt: Date | null;
|
|
527
|
-
modifiedAt: Date | null;
|
|
528
527
|
classId: string;
|
|
528
|
+
modifiedAt: Date | null;
|
|
529
529
|
title: string;
|
|
530
530
|
instructions: string;
|
|
531
531
|
dueDate: Date;
|
|
@@ -550,8 +550,8 @@ export declare function deleteLabDraft(classId: string, teacherId: string, draft
|
|
|
550
550
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
551
551
|
id: string;
|
|
552
552
|
createdAt: Date | null;
|
|
553
|
-
modifiedAt: Date | null;
|
|
554
553
|
classId: string;
|
|
554
|
+
modifiedAt: Date | null;
|
|
555
555
|
title: string;
|
|
556
556
|
instructions: string;
|
|
557
557
|
dueDate: Date;
|
|
@@ -581,8 +581,8 @@ export declare function publishLabDraft(classId: string, teacherId: string, draf
|
|
|
581
581
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
582
582
|
id: string;
|
|
583
583
|
createdAt: Date | null;
|
|
584
|
-
modifiedAt: Date | null;
|
|
585
584
|
classId: string;
|
|
585
|
+
modifiedAt: Date | null;
|
|
586
586
|
title: string;
|
|
587
587
|
instructions: string;
|
|
588
588
|
dueDate: Date;
|
package/dist/services/class.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* syllabus, lab drafts, and invite codes.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
!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]="
|
|
6
|
+
!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]="76b26204-6063-5f15-8e0c-bbd80a554dbc")}catch(e){}}();
|
|
7
7
|
import { SessionType } from "@prisma/client";
|
|
8
8
|
import { TRPCError } from "@trpc/server";
|
|
9
9
|
import { prisma } from "../lib/prisma.js";
|
|
@@ -50,7 +50,7 @@ export async function getAllClasses(userId) {
|
|
|
50
50
|
schoolId: cls.schoolId ?? null,
|
|
51
51
|
school: cls.school ?? null,
|
|
52
52
|
department: cls.department ?? null,
|
|
53
|
-
})),
|
|
53
|
+
})).filter((cls) => cls.members.some((member) => member.id === userId)),
|
|
54
54
|
studentInClass: studentClasses.map((cls) => ({
|
|
55
55
|
id: cls.id,
|
|
56
56
|
name: cls.name,
|
|
@@ -610,4 +610,4 @@ export async function importClass(classId, userId, year, classData) {
|
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
//# sourceMappingURL=class.js.map
|
|
613
|
-
//# debugId=
|
|
613
|
+
//# debugId=76b26204-6063-5f15-8e0c-bbd80a554dbc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sources":["services/class.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Class service – CRUD for classes, members, grades, mark schemes, grading boundaries,\n * syllabus, lab drafts, and invite codes.\n */\nimport { SessionType } from \"@prisma/client\";\nimport { TRPCError } from \"@trpc/server\";\nimport { prisma } from \"../lib/prisma.js\";\nimport { generateInviteCode } from \"../utils/generateInviteCode.js\";\nimport {\n findTeacherClasses,\n findStudentClasses,\n isTeacherInClass,\n findClassWithAssignments,\n findSectionsByClassId,\n findUserById,\n findSessionByClassCode,\n findSessionByClassId,\n findSubmissionsForGrades,\n findEventsByClassId,\n findMarkSchemesByClassId,\n findGradingBoundariesByClassId,\n findClassSyllabus,\n findLabDraftsByClass,\n findAssignmentsWithFiles,\n findFullExportableClass,\n createClassByImport,\n} from \"../models/class.js\";\nimport { Class, Folder } from \"@prisma/client\";\n\nasync function requireActiveSchoolMembers(schoolId: string, userIds: string[]) {\n const uniqueUserIds = [...new Set(userIds)];\n if (!uniqueUserIds.length) {\n return;\n }\n\n const memberships = await prisma.schoolMembership.findMany({\n where: {\n schoolId,\n status: \"ACTIVE\",\n userId: { in: uniqueUserIds },\n },\n select: { userId: true },\n });\n const activeMemberIds = new Set(\n memberships.map((membership) => membership.userId)\n );\n const hasNonMember = uniqueUserIds.some((id) => !activeMemberIds.has(id));\n\n if (hasNonMember) {\n throw new TRPCError({\n code: \"FORBIDDEN\",\n message: \"All class members must belong to this school\",\n });\n }\n}\n\n/** Get all classes where user is teacher or student, with assignments and members. */\nexport async function getAllClasses(userId: string) {\n const [teacherClasses, studentClasses] = await Promise.all([\n findTeacherClasses(userId),\n findStudentClasses(userId),\n ]);\n\n return {\n teacherInClass: teacherClasses.map((cls) => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n members: [...cls.students, ...cls.teachers],\n color: cls.color,\n schoolId: cls.schoolId ?? null,\n school: cls.school ?? null,\n department: cls.department ?? null,\n })),\n studentInClass: studentClasses.map((cls) => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n members: [...cls.students, ...cls.teachers],\n color: cls.color,\n schoolId: cls.schoolId ?? null,\n school: cls.school ?? null,\n department: cls.department ?? null,\n })),\n };\n}\n\n/** Get single class with assignments, sections, and submission status. */\nexport async function getClass(userId: string, classId: string) {\n const isTeacher = await isTeacherInClass(classId, userId ?? \"\");\n\n const classData = await findClassWithAssignments(classId, {\n isTeacher: !!isTeacher,\n userId: userId ?? undefined,\n });\n\n if (!classData) {\n throw new Error(\"Class not found\");\n }\n\n const formattedClassData = {\n ...classData,\n assignments: classData.assignments.map((assignment) => ({\n ...assignment,\n late: assignment.dueDate < new Date(),\n submitted: assignment.submissions.find(\n (s) => s.studentId === userId\n )?.submitted,\n returned: assignment.submissions.find(\n (s) => s.studentId === userId\n )?.returned,\n })),\n };\n\n const [sections, affiliation] = await Promise.all([\n findSectionsByClassId(classId),\n prisma.class.findUnique({\n where: { id: classId },\n select: {\n schoolId: true,\n departmentId: true,\n school: {\n select: {\n id: true,\n name: true,\n description: true,\n logo: { select: { id: true, path: true, type: true } },\n },\n },\n department: {\n select: {\n id: true,\n name: true,\n color: true,\n description: true,\n },\n },\n tags: {\n select: { id: true, name: true, color: true, departmentId: true },\n },\n },\n }),\n ]);\n\n return {\n class: {\n ...formattedClassData,\n sections,\n affiliation: affiliation\n ? {\n school: affiliation.school,\n department: affiliation.department,\n tags: affiliation.tags,\n }\n : null,\n },\n };\n}\n\nexport async function updateClass(\n classId: string,\n data: {\n name?: string;\n section?: string;\n subject?: string;\n color?: string;\n departmentId?: string | null;\n }\n) {\n if (data.departmentId !== undefined) {\n // Department must belong to the class's institution.\n const cls = await prisma.class.findUnique({\n where: { id: classId },\n select: { schoolId: true },\n });\n if (!cls?.schoolId && data.departmentId) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Personal classes can't have a department\",\n });\n }\n if (data.departmentId && cls?.schoolId) {\n const dept = await prisma.department.findUnique({\n where: { id: data.departmentId },\n select: { schoolId: true },\n });\n if (!dept || dept.schoolId !== cls.schoolId) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Department does not belong to this institution\",\n });\n }\n }\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data,\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n color: true,\n departmentId: true,\n },\n });\n return { updatedClass };\n}\n\nexport async function createClass(\n userId: string,\n input: {\n students?: string[];\n teachers?: string[];\n name: string;\n section: string;\n subject: string;\n color?: string;\n schoolId?: string;\n departmentId?: string;\n }\n) {\n const {\n students,\n teachers,\n name,\n section,\n subject,\n color,\n schoolId,\n departmentId,\n } = input;\n\n if (schoolId) {\n const membership = await prisma.schoolMembership.findFirst({\n where: { userId, schoolId, status: \"ACTIVE\" },\n select: { role: true },\n });\n\n if (!membership) {\n throw new TRPCError({\n code: \"FORBIDDEN\",\n message: \"You are not a member of this school\",\n });\n }\n\n if (membership.role === \"STUDENT\") {\n throw new TRPCError({\n code: \"FORBIDDEN\",\n message: \"Students cannot create school classes\",\n });\n }\n }\n\n if (departmentId) {\n if (!schoolId) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Personal classes can't have a department\",\n });\n }\n const dept = await prisma.department.findUnique({\n where: { id: departmentId },\n select: { schoolId: true },\n });\n if (!dept || dept.schoolId !== schoolId) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Department does not belong to this institution\",\n });\n }\n }\n\n const teacherIds = teachers?.length ? teachers : [userId];\n const studentIds = students?.length ? students : [];\n\n if (schoolId) {\n await requireActiveSchoolMembers(schoolId, [...teacherIds, ...studentIds]);\n }\n\n return prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n schoolId,\n departmentId,\n teachers: { connect: teacherIds.map((id) => ({ id })) },\n ...(studentIds.length\n ? { students: { connect: studentIds.map((id) => ({ id })) } }\n : {}),\n },\n include: { teachers: true, students: true },\n });\n}\n\nexport async function deleteClass(classId: string) {\n const classToDelete = await prisma.class.findFirst({\n where: { id: classId },\n });\n\n if (!classToDelete) {\n throw new Error(\"Class not found or you don't have permission to delete it\");\n }\n\n await prisma.class.delete({\n where: { id: classId },\n });\n\n return { deletedClass: { id: classId } };\n}\n\nexport async function addStudent(classId: string, studentId: string) {\n const student = await findUserById(studentId);\n if (!student) {\n throw new Error(\"Student not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n students: { connect: { id: studentId } },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n },\n });\n\n return { updatedClass, newStudent: student };\n}\n\nexport async function changeRole(\n classId: string,\n userId: string,\n type: \"teacher\" | \"student\"\n) {\n const user = await findUserById(userId);\n if (!user) {\n throw new Error(\"User not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n [type === \"teacher\" ? \"teachers\" : \"students\"]: {\n connect: { id: userId },\n },\n [type === \"teacher\" ? \"students\" : \"teachers\"]: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n user: { ...user, type },\n };\n}\n\nexport async function removeMember(classId: string, userId: string) {\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n teachers: { disconnect: { id: userId } },\n students: { disconnect: { id: userId } },\n },\n });\n return { updatedClass, removedUserId: userId };\n}\n\nexport async function leaveClass(userId: string, classId: string) {\n const classData = await prisma.class.findFirst({\n where: {\n id: classId,\n students: { some: { id: userId } },\n },\n });\n\n if (!classData) {\n throw new TRPCError({\n code: \"NOT_FOUND\",\n message: \"Class not found or you are not a student in this class\",\n });\n }\n\n await prisma.class.update({\n where: { id: classId },\n data: {\n students: { disconnect: { id: userId } },\n },\n });\n\n return { success: true, leftClassId: classId };\n}\n\nexport async function joinClass(userId: string, classCode: string) {\n const session = await findSessionByClassCode(classCode);\n\n if (!session || !session.classId) {\n throw new Error(\"Class not found\");\n }\n\n if (session.expiresAt && session.expiresAt < new Date()) {\n throw new Error(\"Session expired\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: session.classId },\n data: {\n students: { connect: { id: userId } },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n },\n });\n\n return { joinedClass: updatedClass };\n}\n\nexport async function getInviteCode(classId: string) {\n const session = await findSessionByClassId(classId);\n\n if ((session?.expiresAt && session.expiresAt < new Date()) || !session) {\n const newSession = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n type: SessionType.CLASS_INVITE,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),\n },\n });\n return { code: newSession.id };\n }\n\n return { code: session?.id };\n}\n\nexport async function createInviteCode(classId: string) {\n await prisma.session.deleteMany({\n where: { classId, type: SessionType.CLASS_INVITE },\n });\n\n const session = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n type: SessionType.CLASS_INVITE,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),\n },\n });\n\n return { code: session.id };\n}\n\nexport async function getGrades(\n userId: string,\n classId: string,\n targetUserId: string\n) {\n const isTeacher = await isTeacherInClass(classId, userId);\n if (userId !== targetUserId && !isTeacher) {\n throw new TRPCError({\n code: \"UNAUTHORIZED\",\n message: \"You can only view your own grades\",\n });\n }\n\n const grades = await findSubmissionsForGrades(targetUserId, classId);\n return { grades };\n}\n\nexport async function updateGrade(\n assignmentId: string,\n submissionId: string,\n gradeReceived: number | null\n) {\n const updatedSubmission = await prisma.submission.update({\n where: { id: submissionId, assignmentId },\n data: { gradeReceived },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n },\n },\n },\n });\n return updatedSubmission;\n}\n\nexport async function getEvents(classId: string) {\n return findEventsByClassId(classId);\n}\n\nexport async function listMarkSchemes(classId: string) {\n return findMarkSchemesByClassId(classId);\n}\n\nexport async function createMarkScheme(classId: string, structure: string) {\n const validatedStructure = structure.replace(/\\\\n/g, \"\\n\");\n return prisma.markScheme.create({\n data: {\n class: { connect: { id: classId } },\n structured: validatedStructure,\n },\n });\n}\n\nexport async function updateMarkScheme(\n markSchemeId: string,\n classId: string,\n structure: string\n) {\n const validatedStructure = structure.replace(/\\\\n/g, \"\\n\");\n return prisma.markScheme.update({\n where: { id: markSchemeId },\n data: {\n class: { connect: { id: classId } },\n structured: validatedStructure,\n },\n });\n}\n\nexport async function deleteMarkScheme(markSchemeId: string) {\n return prisma.markScheme.delete({\n where: { id: markSchemeId },\n });\n}\n\nexport async function listGradingBoundaries(classId: string) {\n return findGradingBoundariesByClassId(classId);\n}\n\nexport async function createGradingBoundary(classId: string, structure: string) {\n const validatedStructure = structure.replace(/\\\\n/g, \"\\n\");\n return prisma.gradingBoundary.create({\n data: {\n class: { connect: { id: classId } },\n structured: validatedStructure,\n },\n });\n}\n\nexport async function updateGradingBoundary(\n gradingBoundaryId: string,\n classId: string,\n structure: string\n) {\n const validatedStructure = structure.replace(/\\\\n/g, \"\\n\");\n return prisma.gradingBoundary.update({\n where: { id: gradingBoundaryId },\n data: {\n class: { connect: { id: classId } },\n structured: validatedStructure,\n },\n });\n}\n\nexport async function deleteGradingBoundary(gradingBoundaryId: string) {\n return prisma.gradingBoundary.delete({\n where: { id: gradingBoundaryId },\n });\n}\n\nexport async function getSyllabus(classId: string) {\n const classData = await findClassSyllabus(classId);\n const markSchemes = await findMarkSchemesByClassId(classId);\n const gradingBoundaries = await findGradingBoundariesByClassId(classId);\n return {\n syllabus: classData?.syllabus,\n gradingBoundaries,\n markSchemes,\n };\n}\n\nexport async function updateSyllabus(classId: string, contents: string) {\n if (!contents) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Missing key contents\",\n });\n }\n return prisma.class.update({\n where: { id: classId },\n data: { syllabus: contents },\n });\n}\n\nexport async function listLabDrafts(classId: string, teacherId: string) {\n return findLabDraftsByClass(classId, teacherId);\n}\n\nexport async function createLabDraft(\n classId: string,\n teacherId: string,\n input: {\n title: string;\n type: string;\n instructions: string;\n dueDate?: Date;\n maxGrade?: number;\n weight?: number;\n graded?: boolean;\n sectionId?: string;\n markSchemeId?: string;\n gradingBoundaryId?: string;\n }\n) {\n return prisma.assignment.create({\n data: {\n classId,\n teacherId,\n inProgress: true,\n graded: input.graded ?? false,\n maxGrade: input.maxGrade ?? 0,\n weight: input.weight ?? 1,\n dueDate:\n input.dueDate ||\n new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),\n title: input.title,\n instructions: input.instructions,\n type: input.type as any,\n ...(input.sectionId && { sectionId: input.sectionId }),\n ...(input.markSchemeId && { markSchemeId: input.markSchemeId }),\n ...(input.gradingBoundaryId && {\n gradingBoundaryId: input.gradingBoundaryId,\n }),\n },\n });\n}\n\nexport async function updateLabDraft(\n classId: string,\n teacherId: string,\n draftId: string,\n input: Record<string, unknown>\n) {\n const updateData: Record<string, unknown> = {\n modifiedAt: new Date(),\n };\n if (input.title !== undefined) updateData.title = input.title;\n if (input.instructions !== undefined)\n updateData.instructions = input.instructions;\n if (input.dueDate !== undefined) updateData.dueDate = input.dueDate;\n if (input.maxGrade !== undefined) updateData.maxGrade = input.maxGrade;\n if (input.weight !== undefined) updateData.weight = input.weight;\n if (input.graded !== undefined) updateData.graded = input.graded;\n if (input.sectionId !== undefined) updateData.sectionId = input.sectionId;\n if (input.markSchemeId !== undefined)\n updateData.markSchemeId = input.markSchemeId;\n if (input.gradingBoundaryId !== undefined)\n updateData.gradingBoundaryId = input.gradingBoundaryId;\n\n return prisma.assignment.update({\n where: {\n id: draftId,\n classId,\n teacherId,\n inProgress: true,\n },\n data: updateData as any,\n });\n}\n\nexport async function deleteLabDraft(\n classId: string,\n teacherId: string,\n draftId: string\n) {\n return prisma.assignment.delete({\n where: {\n id: draftId,\n classId,\n teacherId,\n inProgress: true,\n },\n });\n}\n\nexport async function publishLabDraft(\n classId: string,\n teacherId: string,\n draftId: string,\n input: {\n dueDate?: Date;\n maxGrade?: number;\n weight?: number;\n graded?: boolean;\n }\n) {\n const labDraft = await prisma.assignment.findUnique({\n where: {\n id: draftId,\n classId,\n teacherId,\n inProgress: true,\n },\n });\n\n if (!labDraft) {\n throw new TRPCError({\n code: \"NOT_FOUND\",\n message: \"Lab draft not found\",\n });\n }\n\n return prisma.assignment.update({\n where: { id: draftId },\n data: {\n inProgress: false,\n dueDate: input.dueDate || labDraft.dueDate,\n maxGrade: input.maxGrade || labDraft.maxGrade || 100,\n weight: input.weight || labDraft.weight || 1,\n graded: input.graded !== undefined ? input.graded : true,\n modifiedAt: new Date(),\n },\n });\n}\n\nexport async function getFiles(classId: string) {\n const assignments = await findAssignmentsWithFiles(classId);\n return assignments.map((assignment) => ({\n id: assignment.id,\n title: assignment.title,\n teacher: assignment.teacher,\n teacherAttachments: assignment.attachments,\n students: assignment.submissions.map((submission) => ({\n id: submission.student.id,\n username: submission.student.username,\n attachments: submission.attachments,\n annotations: submission.annotations,\n })),\n }));\n}\n\nexport async function exportClass(classId: string, userId: string) {\n const classExport = await findFullExportableClass(classId);\n if (!classExport) {\n throw new TRPCError({\n code: \"INTERNAL_SERVER_ERROR\",\n message: \"Failed to export class\",\n });\n }\n\n return classExport;\n}\n\nexport async function importClass(classId: string, userId: string, year: number, classData: Class & { classFiles: Folder | null }) {\n try {\n const newClassId = await createClassByImport(classId, userId, year, classData);\n if (!newClassId) {\n throw new TRPCError({\n code: \"INTERNAL_SERVER_ERROR\",\n message: \"Failed to import class\",\n });\n }\n return newClassId;\n } catch (err) {\n if (err instanceof TRPCError) throw err;\n const message = err instanceof Error ? err.message : \"Unknown error\";\n throw new TRPCError({\n code: \"INTERNAL_SERVER_ERROR\",\n message: `Failed to import class: ${message}`,\n cause: err,\n });\n }\n}\n"],"names":[],"mappings":"AAAA;;;GAGG;;;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,8BAA8B,EAC9B,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,KAAK,UAAU,0BAA0B,CAAC,QAAgB,EAAE,OAAiB;IAC3E,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5C,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QACzD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AED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAe,EAAE,MAAc,EAAE,IAAY,EAAE,SAAgD;IAC/H,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;QAC/E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,SAAS,CAAC;gBAClB,IAAI,EAAE,uBAAuB;gBAC7B,OAAO,EAAE,wBAAwB;aAClC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,SAAS;YAAE,MAAM,GAAG,CAAC;QACxC,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACrE,MAAM,IAAI,SAAS,CAAC;YAClB,IAAI,EAAE,uBAAuB;YAC7B,OAAO,EAAE,2BAA2B,OAAO,EAAE;YAC7C,KAAK,EAAE,GAAG;SACX,CAAC,CAAC;IACL,CAAC;AACH,CAAC","debug_id":"e28817fa-e672-5014-8f4d-d20df9febedc"}
|
|
1
|
+
{"version":3,"file":"class.js","sources":["services/class.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Class service – CRUD for classes, members, grades, mark schemes, grading boundaries,\n * syllabus, lab drafts, and invite codes.\n */\nimport { SessionType } from \"@prisma/client\";\nimport { TRPCError } from \"@trpc/server\";\nimport { prisma } from \"../lib/prisma.js\";\nimport { generateInviteCode } from \"../utils/generateInviteCode.js\";\nimport {\n findTeacherClasses,\n findStudentClasses,\n isTeacherInClass,\n findClassWithAssignments,\n findSectionsByClassId,\n findUserById,\n findSessionByClassCode,\n findSessionByClassId,\n findSubmissionsForGrades,\n findEventsByClassId,\n findMarkSchemesByClassId,\n findGradingBoundariesByClassId,\n findClassSyllabus,\n findLabDraftsByClass,\n findAssignmentsWithFiles,\n findFullExportableClass,\n createClassByImport,\n} from \"../models/class.js\";\nimport { Class, Folder } from \"@prisma/client\";\n\nasync function requireActiveSchoolMembers(schoolId: string, userIds: string[]) {\n const uniqueUserIds = [...new Set(userIds)];\n if (!uniqueUserIds.length) {\n return;\n }\n\n const memberships = await prisma.schoolMembership.findMany({\n where: {\n schoolId,\n status: \"ACTIVE\",\n userId: { in: uniqueUserIds },\n },\n select: { userId: true },\n });\n const activeMemberIds = new Set(\n memberships.map((membership) => membership.userId)\n );\n const hasNonMember = uniqueUserIds.some((id) => !activeMemberIds.has(id));\n\n if (hasNonMember) {\n throw new TRPCError({\n code: \"FORBIDDEN\",\n message: \"All class members must belong to this school\",\n });\n }\n}\n\n/** Get all classes where user is teacher or student, with assignments and members. */\nexport async function getAllClasses(userId: string) {\n const [teacherClasses, studentClasses] = await Promise.all([\n findTeacherClasses(userId),\n findStudentClasses(userId),\n ]);\n\n return {\n teacherInClass: teacherClasses.map((cls) => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n members: [...cls.students, ...cls.teachers],\n color: cls.color,\n schoolId: cls.schoolId ?? null,\n school: cls.school ?? null,\n department: cls.department ?? null,\n })).filter((cls) => cls.members.some((member) => member.id === userId)),\n studentInClass: studentClasses.map((cls) => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n members: [...cls.students, ...cls.teachers],\n color: cls.color,\n schoolId: cls.schoolId ?? null,\n school: cls.school ?? null,\n department: cls.department ?? null,\n })),\n };\n}\n\n/** Get single class with assignments, sections, and submission status. */\nexport async function getClass(userId: string, classId: string) {\n const isTeacher = await isTeacherInClass(classId, userId ?? \"\");\n\n const classData = await findClassWithAssignments(classId, {\n isTeacher: !!isTeacher,\n userId: userId ?? undefined,\n });\n\n if (!classData) {\n throw new Error(\"Class not found\");\n }\n\n const formattedClassData = {\n ...classData,\n assignments: classData.assignments.map((assignment) => ({\n ...assignment,\n late: assignment.dueDate < new Date(),\n submitted: assignment.submissions.find(\n (s) => s.studentId === userId\n )?.submitted,\n returned: assignment.submissions.find(\n (s) => s.studentId === userId\n )?.returned,\n })),\n };\n\n const [sections, affiliation] = await Promise.all([\n findSectionsByClassId(classId),\n prisma.class.findUnique({\n where: { id: classId },\n select: {\n schoolId: true,\n departmentId: true,\n school: {\n select: {\n id: true,\n name: true,\n description: true,\n logo: { select: { id: true, path: true, type: true } },\n },\n },\n department: {\n select: {\n id: true,\n name: true,\n color: true,\n description: true,\n },\n },\n tags: {\n select: { id: true, name: true, color: true, departmentId: true },\n },\n },\n }),\n ]);\n\n return {\n class: {\n ...formattedClassData,\n sections,\n affiliation: affiliation\n ? {\n school: affiliation.school,\n department: affiliation.department,\n tags: affiliation.tags,\n }\n : null,\n },\n };\n}\n\nexport async function updateClass(\n classId: string,\n data: {\n name?: string;\n section?: string;\n subject?: string;\n color?: string;\n departmentId?: string | null;\n }\n) {\n if (data.departmentId !== undefined) {\n // Department must belong to the class's institution.\n const cls = await prisma.class.findUnique({\n where: { id: classId },\n select: { schoolId: true },\n });\n if (!cls?.schoolId && data.departmentId) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Personal classes can't have a department\",\n });\n }\n if (data.departmentId && cls?.schoolId) {\n const dept = await prisma.department.findUnique({\n where: { id: data.departmentId },\n select: { schoolId: true },\n });\n if (!dept || dept.schoolId !== cls.schoolId) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Department does not belong to this institution\",\n });\n }\n }\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data,\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n color: true,\n departmentId: true,\n },\n });\n return { updatedClass };\n}\n\nexport async function createClass(\n userId: string,\n input: {\n students?: string[];\n teachers?: string[];\n name: string;\n section: string;\n subject: string;\n color?: string;\n schoolId?: string;\n departmentId?: string;\n }\n) {\n const {\n students,\n teachers,\n name,\n section,\n subject,\n color,\n schoolId,\n departmentId,\n } = input;\n\n if (schoolId) {\n const membership = await prisma.schoolMembership.findFirst({\n where: { userId, schoolId, status: \"ACTIVE\" },\n select: { role: true },\n });\n\n if (!membership) {\n throw new TRPCError({\n code: \"FORBIDDEN\",\n message: \"You are not a member of this school\",\n });\n }\n\n if (membership.role === \"STUDENT\") {\n throw new TRPCError({\n code: \"FORBIDDEN\",\n message: \"Students cannot create school classes\",\n });\n }\n }\n\n if (departmentId) {\n if (!schoolId) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Personal classes can't have a department\",\n });\n }\n const dept = await prisma.department.findUnique({\n where: { id: departmentId },\n select: { schoolId: true },\n });\n if (!dept || dept.schoolId !== schoolId) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Department does not belong to this institution\",\n });\n }\n }\n\n const teacherIds = teachers?.length ? teachers : [userId];\n const studentIds = students?.length ? students : [];\n\n if (schoolId) {\n await requireActiveSchoolMembers(schoolId, [...teacherIds, ...studentIds]);\n }\n\n return prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n schoolId,\n departmentId,\n teachers: { connect: teacherIds.map((id) => ({ id })) },\n ...(studentIds.length\n ? { students: { connect: studentIds.map((id) => ({ id })) } }\n : {}),\n },\n include: { teachers: true, students: true },\n });\n}\n\nexport async function deleteClass(classId: string) {\n const classToDelete = await prisma.class.findFirst({\n where: { id: classId },\n });\n\n if (!classToDelete) {\n throw new Error(\"Class not found or you don't have permission to delete it\");\n }\n\n await prisma.class.delete({\n where: { id: classId },\n });\n\n return { deletedClass: { id: classId } };\n}\n\nexport async function addStudent(classId: string, studentId: string) {\n const student = await findUserById(studentId);\n if (!student) {\n throw new Error(\"Student not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n students: { connect: { id: studentId } },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n },\n });\n\n return { updatedClass, newStudent: student };\n}\n\nexport async function changeRole(\n classId: string,\n userId: string,\n type: \"teacher\" | \"student\"\n) {\n const user = await findUserById(userId);\n if (!user) {\n throw new Error(\"User not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n [type === \"teacher\" ? \"teachers\" : \"students\"]: {\n connect: { id: userId },\n },\n [type === \"teacher\" ? \"students\" : \"teachers\"]: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n user: { ...user, type },\n };\n}\n\nexport async function removeMember(classId: string, userId: string) {\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n teachers: { disconnect: { id: userId } },\n students: { disconnect: { id: userId } },\n },\n });\n return { updatedClass, removedUserId: userId };\n}\n\nexport async function leaveClass(userId: string, classId: string) {\n const classData = await prisma.class.findFirst({\n where: {\n id: classId,\n students: { some: { id: userId } },\n },\n });\n\n if (!classData) {\n throw new TRPCError({\n code: \"NOT_FOUND\",\n message: \"Class not found or you are not a student in this class\",\n });\n }\n\n await prisma.class.update({\n where: { id: classId },\n data: {\n students: { disconnect: { id: userId } },\n },\n });\n\n return { success: true, leftClassId: classId };\n}\n\nexport async function joinClass(userId: string, classCode: string) {\n const session = await findSessionByClassCode(classCode);\n\n if (!session || !session.classId) {\n throw new Error(\"Class not found\");\n }\n\n if (session.expiresAt && session.expiresAt < new Date()) {\n throw new Error(\"Session expired\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: session.classId },\n data: {\n students: { connect: { id: userId } },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n },\n });\n\n return { joinedClass: updatedClass };\n}\n\nexport async function getInviteCode(classId: string) {\n const session = await findSessionByClassId(classId);\n\n if ((session?.expiresAt && session.expiresAt < new Date()) || !session) {\n const newSession = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n type: SessionType.CLASS_INVITE,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),\n },\n });\n return { code: newSession.id };\n }\n\n return { code: session?.id };\n}\n\nexport async function createInviteCode(classId: string) {\n await prisma.session.deleteMany({\n where: { classId, type: SessionType.CLASS_INVITE },\n });\n\n const session = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n type: SessionType.CLASS_INVITE,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),\n },\n });\n\n return { code: session.id };\n}\n\nexport async function getGrades(\n userId: string,\n classId: string,\n targetUserId: string\n) {\n const isTeacher = await isTeacherInClass(classId, userId);\n if (userId !== targetUserId && !isTeacher) {\n throw new TRPCError({\n code: \"UNAUTHORIZED\",\n message: \"You can only view your own grades\",\n });\n }\n\n const grades = await findSubmissionsForGrades(targetUserId, classId);\n return { grades };\n}\n\nexport async function updateGrade(\n assignmentId: string,\n submissionId: string,\n gradeReceived: number | null\n) {\n const updatedSubmission = await prisma.submission.update({\n where: { id: submissionId, assignmentId },\n data: { gradeReceived },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n },\n },\n },\n });\n return updatedSubmission;\n}\n\nexport async function getEvents(classId: string) {\n return findEventsByClassId(classId);\n}\n\nexport async function listMarkSchemes(classId: string) {\n return findMarkSchemesByClassId(classId);\n}\n\nexport async function createMarkScheme(classId: string, structure: string) {\n const validatedStructure = structure.replace(/\\\\n/g, \"\\n\");\n return prisma.markScheme.create({\n data: {\n class: { connect: { id: classId } },\n structured: validatedStructure,\n },\n });\n}\n\nexport async function updateMarkScheme(\n markSchemeId: string,\n classId: string,\n structure: string\n) {\n const validatedStructure = structure.replace(/\\\\n/g, \"\\n\");\n return prisma.markScheme.update({\n where: { id: markSchemeId },\n data: {\n class: { connect: { id: classId } },\n structured: validatedStructure,\n },\n });\n}\n\nexport async function deleteMarkScheme(markSchemeId: string) {\n return prisma.markScheme.delete({\n where: { id: markSchemeId },\n });\n}\n\nexport async function listGradingBoundaries(classId: string) {\n return findGradingBoundariesByClassId(classId);\n}\n\nexport async function createGradingBoundary(classId: string, structure: string) {\n const validatedStructure = structure.replace(/\\\\n/g, \"\\n\");\n return prisma.gradingBoundary.create({\n data: {\n class: { connect: { id: classId } },\n structured: validatedStructure,\n },\n });\n}\n\nexport async function updateGradingBoundary(\n gradingBoundaryId: string,\n classId: string,\n structure: string\n) {\n const validatedStructure = structure.replace(/\\\\n/g, \"\\n\");\n return prisma.gradingBoundary.update({\n where: { id: gradingBoundaryId },\n data: {\n class: { connect: { id: classId } },\n structured: validatedStructure,\n },\n });\n}\n\nexport async function deleteGradingBoundary(gradingBoundaryId: string) {\n return prisma.gradingBoundary.delete({\n where: { id: gradingBoundaryId },\n });\n}\n\nexport async function getSyllabus(classId: string) {\n const classData = await findClassSyllabus(classId);\n const markSchemes = await findMarkSchemesByClassId(classId);\n const gradingBoundaries = await findGradingBoundariesByClassId(classId);\n return {\n syllabus: classData?.syllabus,\n gradingBoundaries,\n markSchemes,\n };\n}\n\nexport async function updateSyllabus(classId: string, contents: string) {\n if (!contents) {\n throw new TRPCError({\n code: \"BAD_REQUEST\",\n message: \"Missing key contents\",\n });\n }\n return prisma.class.update({\n where: { id: classId },\n data: { syllabus: contents },\n });\n}\n\nexport async function listLabDrafts(classId: string, teacherId: string) {\n return findLabDraftsByClass(classId, teacherId);\n}\n\nexport async function createLabDraft(\n classId: string,\n teacherId: string,\n input: {\n title: string;\n type: string;\n instructions: string;\n dueDate?: Date;\n maxGrade?: number;\n weight?: number;\n graded?: boolean;\n sectionId?: string;\n markSchemeId?: string;\n gradingBoundaryId?: string;\n }\n) {\n return prisma.assignment.create({\n data: {\n classId,\n teacherId,\n inProgress: true,\n graded: input.graded ?? false,\n maxGrade: input.maxGrade ?? 0,\n weight: input.weight ?? 1,\n dueDate:\n input.dueDate ||\n new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),\n title: input.title,\n instructions: input.instructions,\n type: input.type as any,\n ...(input.sectionId && { sectionId: input.sectionId }),\n ...(input.markSchemeId && { markSchemeId: input.markSchemeId }),\n ...(input.gradingBoundaryId && {\n gradingBoundaryId: input.gradingBoundaryId,\n }),\n },\n });\n}\n\nexport async function updateLabDraft(\n classId: string,\n teacherId: string,\n draftId: string,\n input: Record<string, unknown>\n) {\n const updateData: Record<string, unknown> = {\n modifiedAt: new Date(),\n };\n if (input.title !== undefined) updateData.title = input.title;\n if (input.instructions !== undefined)\n updateData.instructions = input.instructions;\n if (input.dueDate !== undefined) updateData.dueDate = input.dueDate;\n if (input.maxGrade !== undefined) updateData.maxGrade = input.maxGrade;\n if (input.weight !== undefined) updateData.weight = input.weight;\n if (input.graded !== undefined) updateData.graded = input.graded;\n if (input.sectionId !== undefined) updateData.sectionId = input.sectionId;\n if (input.markSchemeId !== undefined)\n updateData.markSchemeId = input.markSchemeId;\n if (input.gradingBoundaryId !== undefined)\n updateData.gradingBoundaryId = input.gradingBoundaryId;\n\n return prisma.assignment.update({\n where: {\n id: draftId,\n classId,\n teacherId,\n inProgress: true,\n },\n data: updateData as any,\n });\n}\n\nexport async function deleteLabDraft(\n classId: string,\n teacherId: string,\n draftId: string\n) {\n return prisma.assignment.delete({\n where: {\n id: draftId,\n classId,\n teacherId,\n inProgress: true,\n },\n });\n}\n\nexport async function publishLabDraft(\n classId: string,\n teacherId: string,\n draftId: string,\n input: {\n dueDate?: Date;\n maxGrade?: number;\n weight?: number;\n graded?: boolean;\n }\n) {\n const labDraft = await prisma.assignment.findUnique({\n where: {\n id: draftId,\n classId,\n teacherId,\n inProgress: true,\n },\n });\n\n if (!labDraft) {\n throw new TRPCError({\n code: \"NOT_FOUND\",\n message: \"Lab draft not found\",\n });\n }\n\n return prisma.assignment.update({\n where: { id: draftId },\n data: {\n inProgress: false,\n dueDate: input.dueDate || labDraft.dueDate,\n maxGrade: input.maxGrade || labDraft.maxGrade || 100,\n weight: input.weight || labDraft.weight || 1,\n graded: input.graded !== undefined ? input.graded : true,\n modifiedAt: new Date(),\n },\n });\n}\n\nexport async function getFiles(classId: string) {\n const assignments = await findAssignmentsWithFiles(classId);\n return assignments.map((assignment) => ({\n id: assignment.id,\n title: assignment.title,\n teacher: assignment.teacher,\n teacherAttachments: assignment.attachments,\n students: assignment.submissions.map((submission) => ({\n id: submission.student.id,\n username: submission.student.username,\n attachments: submission.attachments,\n annotations: submission.annotations,\n })),\n }));\n}\n\nexport async function exportClass(classId: string, userId: string) {\n const classExport = await findFullExportableClass(classId);\n if (!classExport) {\n throw new TRPCError({\n code: \"INTERNAL_SERVER_ERROR\",\n message: \"Failed to export class\",\n });\n }\n\n return classExport;\n}\n\nexport async function importClass(classId: string, userId: string, year: number, classData: Class & { classFiles: Folder | null }) {\n try {\n const newClassId = await createClassByImport(classId, userId, year, classData);\n if (!newClassId) {\n throw new TRPCError({\n code: \"INTERNAL_SERVER_ERROR\",\n message: \"Failed to import class\",\n });\n }\n return newClassId;\n } catch (err) {\n if (err instanceof TRPCError) throw err;\n const message = err instanceof Error ? err.message : \"Unknown error\";\n throw new TRPCError({\n code: \"INTERNAL_SERVER_ERROR\",\n message: `Failed to import class: ${message}`,\n cause: err,\n });\n }\n}\n"],"names":[],"mappings":"AAAA;;;GAGG;;;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,8BAA8B,EAC9B,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,KAAK,UAAU,0BAA0B,CAAC,QAAgB,EAAE,OAAiB;IAC3E,MAAM,aAAa,GAAG,CAAC,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