@studious-lms/server 1.24.0 → 1.26.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/data/curriculum/nepal-cdc-g4-g5/subjects/english.json +4 -4
- package/data/curriculum/nepal-cdc-g4-g5/subjects/mathematics.json +1 -1
- package/data/curriculum/nepal-cdc-g4-g5/subjects/science-technology.json +4 -4
- package/data/curriculum/nepal-cdc-g4-g5/subjects/social-studies.json +4 -4
- package/dist/models/attendance.d.ts.map +1 -1
- package/dist/models/attendance.js +17 -14
- package/dist/models/attendance.js.map +1 -1
- package/dist/models/marketplace.d.ts +37 -0
- package/dist/models/marketplace.d.ts.map +1 -1
- package/dist/models/marketplace.js +10 -2
- package/dist/models/marketplace.js.map +1 -1
- package/dist/models/module.d.ts +228 -0
- package/dist/models/module.d.ts.map +1 -0
- package/dist/models/module.js +69 -0
- package/dist/models/module.js.map +1 -0
- package/dist/models/moduleItem.d.ts +5 -1
- package/dist/models/moduleItem.d.ts.map +1 -1
- package/dist/models/moduleItem.js +19 -4
- package/dist/models/moduleItem.js.map +1 -1
- package/dist/pipelines/gradeWorksheet.d.ts.map +1 -1
- package/dist/pipelines/gradeWorksheet.js +4 -2
- package/dist/pipelines/gradeWorksheet.js.map +1 -1
- package/dist/routers/_app.d.ts +768 -6
- 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/fees.d.ts +1 -1
- package/dist/routers/marketplace.d.ts +41 -0
- package/dist/routers/marketplace.d.ts.map +1 -1
- package/dist/routers/marketplace.js +13 -3
- package/dist/routers/marketplace.js.map +1 -1
- package/dist/routers/module.d.ts +345 -0
- package/dist/routers/module.d.ts.map +1 -0
- package/dist/routers/module.js +82 -0
- package/dist/routers/module.js.map +1 -0
- package/dist/routers/moduleItem.d.ts.map +1 -1
- package/dist/routers/moduleItem.js +7 -6
- package/dist/routers/moduleItem.js.map +1 -1
- package/dist/routers/parent.d.ts +2 -1
- package/dist/routers/parent.d.ts.map +1 -1
- package/dist/routers/school.d.ts +1 -1
- package/dist/routers/school.d.ts.map +1 -1
- package/dist/routers/school.js +14 -4
- package/dist/routers/school.js.map +1 -1
- package/dist/services/academicCalendar.d.ts.map +1 -1
- package/dist/services/academicCalendar.js +30 -2
- package/dist/services/academicCalendar.js.map +1 -1
- package/dist/services/assignment.d.ts.map +1 -1
- package/dist/services/assignment.js +8 -3
- package/dist/services/assignment.js.map +1 -1
- package/dist/services/attendance.d.ts +6 -2
- package/dist/services/attendance.d.ts.map +1 -1
- package/dist/services/attendance.js +8 -4
- package/dist/services/attendance.js.map +1 -1
- package/dist/services/class.d.ts +14 -9
- package/dist/services/class.d.ts.map +1 -1
- package/dist/services/class.js +4 -4
- package/dist/services/class.js.map +1 -1
- package/dist/services/fees.d.ts.map +1 -1
- package/dist/services/fees.js +24 -4
- package/dist/services/fees.js.map +1 -1
- package/dist/services/feesAuthz.d.ts +2 -5
- package/dist/services/feesAuthz.d.ts.map +1 -1
- package/dist/services/feesAuthz.js +5 -8
- package/dist/services/feesAuthz.js.map +1 -1
- package/dist/services/marketplace.d.ts +36 -0
- package/dist/services/marketplace.d.ts.map +1 -1
- package/dist/services/marketplace.js +36 -6
- package/dist/services/marketplace.js.map +1 -1
- package/dist/services/module.d.ts +288 -0
- package/dist/services/module.d.ts.map +1 -0
- package/dist/services/module.js +518 -0
- package/dist/services/module.js.map +1 -0
- package/dist/services/moduleItem.d.ts.map +1 -1
- package/dist/services/moduleItem.js +23 -7
- package/dist/services/moduleItem.js.map +1 -1
- package/dist/services/parentPortal.d.ts +3 -5
- package/dist/services/parentPortal.d.ts.map +1 -1
- package/dist/services/parentPortal.js +29 -43
- package/dist/services/parentPortal.js.map +1 -1
- package/dist/services/school.d.ts.map +1 -1
- package/dist/services/school.js +52 -16
- package/dist/services/school.js.map +1 -1
- package/dist/services/studentImport.d.ts.map +1 -1
- package/dist/services/studentImport.js +38 -25
- package/dist/services/studentImport.js.map +1 -1
- package/dist/services/transcript.d.ts +2 -3
- package/dist/services/transcript.d.ts.map +1 -1
- package/dist/services/transcript.js +13 -25
- package/dist/services/transcript.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260708013000_add_modules/migration.sql +100 -0
- package/prisma/schema.prisma +93 -0
- package/scripts/import-nepal-cdc-curriculum.ts +29 -6
- package/src/models/attendance.ts +10 -12
- package/src/models/marketplace.ts +19 -0
- package/src/models/module.ts +77 -0
- package/src/models/moduleItem.ts +20 -2
- package/src/pipelines/gradeWorksheet.ts +6 -0
- package/src/routers/_app.ts +2 -0
- package/src/routers/marketplace.ts +16 -0
- package/src/routers/module.ts +118 -0
- package/src/routers/moduleItem.ts +6 -4
- package/src/routers/school.ts +16 -6
- package/src/services/academicCalendar.ts +28 -0
- package/src/services/assignment.ts +12 -1
- package/src/services/attendance.ts +7 -3
- package/src/services/class.ts +2 -2
- package/src/services/fees.ts +25 -2
- package/src/services/feesAuthz.ts +3 -7
- package/src/services/marketplace.ts +47 -3
- package/src/services/module.ts +683 -0
- package/src/services/moduleItem.ts +28 -4
- package/src/services/parentPortal.ts +26 -39
- package/src/services/school.ts +52 -15
- package/src/services/studentImport.ts +37 -25
- package/src/services/transcript.ts +11 -23
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const moduleRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
|
+
ctx: import("../trpc.js").Context;
|
|
4
|
+
meta: object;
|
|
5
|
+
errorShape: {
|
|
6
|
+
data: {
|
|
7
|
+
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
+
prismaError: import("../utils/prismaErrorHandler.js").PrismaErrorInfo | null;
|
|
9
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
10
|
+
httpStatus: number;
|
|
11
|
+
path?: string;
|
|
12
|
+
stack?: string;
|
|
13
|
+
};
|
|
14
|
+
message: string;
|
|
15
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
16
|
+
};
|
|
17
|
+
transformer: false;
|
|
18
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
19
|
+
/** Teacher view: every module (published or not) with its items. */
|
|
20
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
21
|
+
input: {
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
classId: string;
|
|
24
|
+
};
|
|
25
|
+
output: ({
|
|
26
|
+
items: {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string | null;
|
|
29
|
+
position: number;
|
|
30
|
+
moduleId: string;
|
|
31
|
+
indent: number;
|
|
32
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
33
|
+
itemId: string | null;
|
|
34
|
+
externalUrl: string | null;
|
|
35
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
36
|
+
requiredScore: number | null;
|
|
37
|
+
}[];
|
|
38
|
+
prerequisites: {
|
|
39
|
+
prerequisiteId: string;
|
|
40
|
+
}[];
|
|
41
|
+
} & {
|
|
42
|
+
id: string;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
classId: string;
|
|
46
|
+
title: string;
|
|
47
|
+
position: number;
|
|
48
|
+
published: boolean;
|
|
49
|
+
unlockAt: Date | null;
|
|
50
|
+
requireSequential: boolean;
|
|
51
|
+
})[];
|
|
52
|
+
meta: object;
|
|
53
|
+
}>;
|
|
54
|
+
/** Student view: published modules with lock state and progress. */
|
|
55
|
+
getStudentState: import("@trpc/server").TRPCQueryProcedure<{
|
|
56
|
+
input: {
|
|
57
|
+
[x: string]: unknown;
|
|
58
|
+
classId: string;
|
|
59
|
+
};
|
|
60
|
+
output: {
|
|
61
|
+
modules: {
|
|
62
|
+
items: {
|
|
63
|
+
completed: boolean;
|
|
64
|
+
accessible: boolean;
|
|
65
|
+
worksheetAssignmentId: string | null;
|
|
66
|
+
id: string;
|
|
67
|
+
title: string | null;
|
|
68
|
+
position: number;
|
|
69
|
+
moduleId: string;
|
|
70
|
+
indent: number;
|
|
71
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
72
|
+
itemId: string | null;
|
|
73
|
+
externalUrl: string | null;
|
|
74
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
75
|
+
requiredScore: number | null;
|
|
76
|
+
}[];
|
|
77
|
+
locked: boolean;
|
|
78
|
+
lockedByPrerequisite: boolean;
|
|
79
|
+
lockedByDate: boolean;
|
|
80
|
+
completed: boolean;
|
|
81
|
+
requiredCount: number;
|
|
82
|
+
completedRequiredCount: number;
|
|
83
|
+
percentComplete: number;
|
|
84
|
+
prerequisites: {
|
|
85
|
+
prerequisiteId: string;
|
|
86
|
+
}[];
|
|
87
|
+
id: string;
|
|
88
|
+
createdAt: Date;
|
|
89
|
+
updatedAt: Date;
|
|
90
|
+
classId: string;
|
|
91
|
+
title: string;
|
|
92
|
+
position: number;
|
|
93
|
+
published: boolean;
|
|
94
|
+
unlockAt: Date | null;
|
|
95
|
+
requireSequential: boolean;
|
|
96
|
+
}[];
|
|
97
|
+
continueItemId: null;
|
|
98
|
+
continueModuleId: null;
|
|
99
|
+
};
|
|
100
|
+
meta: object;
|
|
101
|
+
}>;
|
|
102
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
103
|
+
input: {
|
|
104
|
+
[x: string]: unknown;
|
|
105
|
+
classId: string;
|
|
106
|
+
title: string;
|
|
107
|
+
unlockAt?: Date | null | undefined;
|
|
108
|
+
requireSequential?: boolean | undefined;
|
|
109
|
+
};
|
|
110
|
+
output: {
|
|
111
|
+
items: {
|
|
112
|
+
id: string;
|
|
113
|
+
title: string | null;
|
|
114
|
+
position: number;
|
|
115
|
+
moduleId: string;
|
|
116
|
+
indent: number;
|
|
117
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
118
|
+
itemId: string | null;
|
|
119
|
+
externalUrl: string | null;
|
|
120
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
121
|
+
requiredScore: number | null;
|
|
122
|
+
}[];
|
|
123
|
+
prerequisites: {
|
|
124
|
+
prerequisiteId: string;
|
|
125
|
+
}[];
|
|
126
|
+
} & {
|
|
127
|
+
id: string;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
updatedAt: Date;
|
|
130
|
+
classId: string;
|
|
131
|
+
title: string;
|
|
132
|
+
position: number;
|
|
133
|
+
published: boolean;
|
|
134
|
+
unlockAt: Date | null;
|
|
135
|
+
requireSequential: boolean;
|
|
136
|
+
};
|
|
137
|
+
meta: object;
|
|
138
|
+
}>;
|
|
139
|
+
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
140
|
+
input: {
|
|
141
|
+
[x: string]: unknown;
|
|
142
|
+
classId: string;
|
|
143
|
+
id: string;
|
|
144
|
+
title?: string | undefined;
|
|
145
|
+
published?: boolean | undefined;
|
|
146
|
+
unlockAt?: Date | null | undefined;
|
|
147
|
+
requireSequential?: boolean | undefined;
|
|
148
|
+
prerequisiteIds?: string[] | undefined;
|
|
149
|
+
};
|
|
150
|
+
output: {
|
|
151
|
+
items: {
|
|
152
|
+
id: string;
|
|
153
|
+
title: string | null;
|
|
154
|
+
position: number;
|
|
155
|
+
moduleId: string;
|
|
156
|
+
indent: number;
|
|
157
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
158
|
+
itemId: string | null;
|
|
159
|
+
externalUrl: string | null;
|
|
160
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
161
|
+
requiredScore: number | null;
|
|
162
|
+
}[];
|
|
163
|
+
prerequisites: {
|
|
164
|
+
prerequisiteId: string;
|
|
165
|
+
}[];
|
|
166
|
+
} & {
|
|
167
|
+
id: string;
|
|
168
|
+
createdAt: Date;
|
|
169
|
+
updatedAt: Date;
|
|
170
|
+
classId: string;
|
|
171
|
+
title: string;
|
|
172
|
+
position: number;
|
|
173
|
+
published: boolean;
|
|
174
|
+
unlockAt: Date | null;
|
|
175
|
+
requireSequential: boolean;
|
|
176
|
+
};
|
|
177
|
+
meta: object;
|
|
178
|
+
}>;
|
|
179
|
+
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
180
|
+
input: {
|
|
181
|
+
[x: string]: unknown;
|
|
182
|
+
classId: string;
|
|
183
|
+
id: string;
|
|
184
|
+
};
|
|
185
|
+
output: {
|
|
186
|
+
id: string;
|
|
187
|
+
};
|
|
188
|
+
meta: object;
|
|
189
|
+
}>;
|
|
190
|
+
reorder: import("@trpc/server").TRPCMutationProcedure<{
|
|
191
|
+
input: {
|
|
192
|
+
[x: string]: unknown;
|
|
193
|
+
classId: string;
|
|
194
|
+
orderedIds: string[];
|
|
195
|
+
};
|
|
196
|
+
output: ({
|
|
197
|
+
items: {
|
|
198
|
+
id: string;
|
|
199
|
+
title: string | null;
|
|
200
|
+
position: number;
|
|
201
|
+
moduleId: string;
|
|
202
|
+
indent: number;
|
|
203
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
204
|
+
itemId: string | null;
|
|
205
|
+
externalUrl: string | null;
|
|
206
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
207
|
+
requiredScore: number | null;
|
|
208
|
+
}[];
|
|
209
|
+
prerequisites: {
|
|
210
|
+
prerequisiteId: string;
|
|
211
|
+
}[];
|
|
212
|
+
} & {
|
|
213
|
+
id: string;
|
|
214
|
+
createdAt: Date;
|
|
215
|
+
updatedAt: Date;
|
|
216
|
+
classId: string;
|
|
217
|
+
title: string;
|
|
218
|
+
position: number;
|
|
219
|
+
published: boolean;
|
|
220
|
+
unlockAt: Date | null;
|
|
221
|
+
requireSequential: boolean;
|
|
222
|
+
})[];
|
|
223
|
+
meta: object;
|
|
224
|
+
}>;
|
|
225
|
+
createItem: import("@trpc/server").TRPCMutationProcedure<{
|
|
226
|
+
input: {
|
|
227
|
+
[x: string]: unknown;
|
|
228
|
+
classId: string;
|
|
229
|
+
moduleId: string;
|
|
230
|
+
itemType: "FILE" | "ASSIGNMENT" | "WORKSHEET" | "ANNOUNCEMENT" | "DISCUSSION" | "EXTERNAL_URL" | "SUB_HEADER";
|
|
231
|
+
title?: string | undefined;
|
|
232
|
+
indent?: number | undefined;
|
|
233
|
+
itemId?: string | undefined;
|
|
234
|
+
externalUrl?: string | undefined;
|
|
235
|
+
requirementType?: "VIEW" | "SUBMIT" | "SCORE_AT_LEAST" | undefined;
|
|
236
|
+
requiredScore?: number | undefined;
|
|
237
|
+
};
|
|
238
|
+
output: {
|
|
239
|
+
id: string;
|
|
240
|
+
title: string | null;
|
|
241
|
+
position: number;
|
|
242
|
+
moduleId: string;
|
|
243
|
+
indent: number;
|
|
244
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
245
|
+
itemId: string | null;
|
|
246
|
+
externalUrl: string | null;
|
|
247
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
248
|
+
requiredScore: number | null;
|
|
249
|
+
};
|
|
250
|
+
meta: object;
|
|
251
|
+
}>;
|
|
252
|
+
updateItem: import("@trpc/server").TRPCMutationProcedure<{
|
|
253
|
+
input: {
|
|
254
|
+
[x: string]: unknown;
|
|
255
|
+
classId: string;
|
|
256
|
+
id: string;
|
|
257
|
+
title?: string | null | undefined;
|
|
258
|
+
indent?: number | undefined;
|
|
259
|
+
externalUrl?: string | undefined;
|
|
260
|
+
requirementType?: "VIEW" | "SUBMIT" | "SCORE_AT_LEAST" | null | undefined;
|
|
261
|
+
requiredScore?: number | null | undefined;
|
|
262
|
+
};
|
|
263
|
+
output: {
|
|
264
|
+
id: string;
|
|
265
|
+
title: string | null;
|
|
266
|
+
position: number;
|
|
267
|
+
moduleId: string;
|
|
268
|
+
indent: number;
|
|
269
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
270
|
+
itemId: string | null;
|
|
271
|
+
externalUrl: string | null;
|
|
272
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
273
|
+
requiredScore: number | null;
|
|
274
|
+
};
|
|
275
|
+
meta: object;
|
|
276
|
+
}>;
|
|
277
|
+
deleteItem: import("@trpc/server").TRPCMutationProcedure<{
|
|
278
|
+
input: {
|
|
279
|
+
[x: string]: unknown;
|
|
280
|
+
classId: string;
|
|
281
|
+
id: string;
|
|
282
|
+
};
|
|
283
|
+
output: {
|
|
284
|
+
id: string;
|
|
285
|
+
};
|
|
286
|
+
meta: object;
|
|
287
|
+
}>;
|
|
288
|
+
reorderItems: import("@trpc/server").TRPCMutationProcedure<{
|
|
289
|
+
input: {
|
|
290
|
+
[x: string]: unknown;
|
|
291
|
+
classId: string;
|
|
292
|
+
items: {
|
|
293
|
+
id: string;
|
|
294
|
+
moduleId: string;
|
|
295
|
+
}[];
|
|
296
|
+
};
|
|
297
|
+
output: ({
|
|
298
|
+
items: {
|
|
299
|
+
id: string;
|
|
300
|
+
title: string | null;
|
|
301
|
+
position: number;
|
|
302
|
+
moduleId: string;
|
|
303
|
+
indent: number;
|
|
304
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
305
|
+
itemId: string | null;
|
|
306
|
+
externalUrl: string | null;
|
|
307
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
308
|
+
requiredScore: number | null;
|
|
309
|
+
}[];
|
|
310
|
+
prerequisites: {
|
|
311
|
+
prerequisiteId: string;
|
|
312
|
+
}[];
|
|
313
|
+
} & {
|
|
314
|
+
id: string;
|
|
315
|
+
createdAt: Date;
|
|
316
|
+
updatedAt: Date;
|
|
317
|
+
classId: string;
|
|
318
|
+
title: string;
|
|
319
|
+
position: number;
|
|
320
|
+
published: boolean;
|
|
321
|
+
unlockAt: Date | null;
|
|
322
|
+
requireSequential: boolean;
|
|
323
|
+
})[];
|
|
324
|
+
meta: object;
|
|
325
|
+
}>;
|
|
326
|
+
/** Record that a student viewed an item (completes VIEW requirements). */
|
|
327
|
+
markItemViewed: import("@trpc/server").TRPCMutationProcedure<{
|
|
328
|
+
input: {
|
|
329
|
+
[x: string]: unknown;
|
|
330
|
+
classId: string;
|
|
331
|
+
itemId: string;
|
|
332
|
+
};
|
|
333
|
+
output: {
|
|
334
|
+
status: import(".prisma/client").$Enums.ModuleItemProgressStatus;
|
|
335
|
+
id: string;
|
|
336
|
+
createdAt: Date;
|
|
337
|
+
updatedAt: Date;
|
|
338
|
+
moduleItemId: string;
|
|
339
|
+
studentId: string;
|
|
340
|
+
completedAt: Date | null;
|
|
341
|
+
};
|
|
342
|
+
meta: object;
|
|
343
|
+
}>;
|
|
344
|
+
}>>;
|
|
345
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"/","sources":["routers/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;IACvB,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKpE,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmFpE,0EAA0E;;;;;;;;;;;;;;;;;;GAI1E,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
!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]="bce497d9-7c87-5479-9ba0-f2235b734365")}catch(e){}}();
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { CourseModuleItemType as ModuleItemType, ModuleItemRequirementType } from "@prisma/client";
|
|
5
|
+
import { createTRPCRouter, protectedClassMemberProcedure, protectedTeacherProcedure, } from "../trpc.js";
|
|
6
|
+
import { listModulesRecord, createModuleRecord, updateModuleRecord, deleteModuleRecord, reorderModulesRecord, createModuleItemRecord, updateModuleItemRecord, deleteModuleItemRecord, reorderModuleItemsRecord, getStudentModulesState, markItemViewedRecord, } from "../services/module.js";
|
|
7
|
+
const itemTypeSchema = z.nativeEnum(ModuleItemType);
|
|
8
|
+
const requirementTypeSchema = z.nativeEnum(ModuleItemRequirementType);
|
|
9
|
+
export const moduleRouter = createTRPCRouter({
|
|
10
|
+
/** Teacher view: every module (published or not) with its items. */
|
|
11
|
+
list: protectedTeacherProcedure
|
|
12
|
+
.input(z.object({ classId: z.string() }))
|
|
13
|
+
.query(({ ctx, input }) => listModulesRecord(ctx.user.id, input.classId)),
|
|
14
|
+
/** Student view: published modules with lock state and progress. */
|
|
15
|
+
getStudentState: protectedClassMemberProcedure
|
|
16
|
+
.input(z.object({ classId: z.string() }))
|
|
17
|
+
.query(({ ctx, input }) => getStudentModulesState(input.classId, ctx.user.id)),
|
|
18
|
+
create: protectedTeacherProcedure
|
|
19
|
+
.input(z.object({
|
|
20
|
+
classId: z.string(),
|
|
21
|
+
title: z.string().min(1),
|
|
22
|
+
unlockAt: z.coerce.date().nullish(),
|
|
23
|
+
requireSequential: z.boolean().optional(),
|
|
24
|
+
}))
|
|
25
|
+
.mutation(({ ctx, input }) => createModuleRecord(ctx.user.id, input)),
|
|
26
|
+
update: protectedTeacherProcedure
|
|
27
|
+
.input(z.object({
|
|
28
|
+
classId: z.string(),
|
|
29
|
+
id: z.string(),
|
|
30
|
+
title: z.string().min(1).optional(),
|
|
31
|
+
unlockAt: z.coerce.date().nullable().optional(),
|
|
32
|
+
requireSequential: z.boolean().optional(),
|
|
33
|
+
published: z.boolean().optional(),
|
|
34
|
+
prerequisiteIds: z.array(z.string()).optional(),
|
|
35
|
+
}))
|
|
36
|
+
.mutation(({ ctx, input }) => updateModuleRecord(ctx.user.id, input)),
|
|
37
|
+
delete: protectedTeacherProcedure
|
|
38
|
+
.input(z.object({ classId: z.string(), id: z.string() }))
|
|
39
|
+
.mutation(({ ctx, input }) => deleteModuleRecord(ctx.user.id, input)),
|
|
40
|
+
reorder: protectedTeacherProcedure
|
|
41
|
+
.input(z.object({ classId: z.string(), orderedIds: z.array(z.string()) }))
|
|
42
|
+
.mutation(({ ctx, input }) => reorderModulesRecord(ctx.user.id, input)),
|
|
43
|
+
createItem: protectedTeacherProcedure
|
|
44
|
+
.input(z.object({
|
|
45
|
+
classId: z.string(),
|
|
46
|
+
moduleId: z.string(),
|
|
47
|
+
itemType: itemTypeSchema,
|
|
48
|
+
itemId: z.string().optional(),
|
|
49
|
+
externalUrl: z.string().url().optional(),
|
|
50
|
+
title: z.string().optional(),
|
|
51
|
+
indent: z.number().int().min(0).max(4).optional(),
|
|
52
|
+
requirementType: requirementTypeSchema.optional(),
|
|
53
|
+
requiredScore: z.number().min(0).optional(),
|
|
54
|
+
}))
|
|
55
|
+
.mutation(({ ctx, input }) => createModuleItemRecord(ctx.user.id, input)),
|
|
56
|
+
updateItem: protectedTeacherProcedure
|
|
57
|
+
.input(z.object({
|
|
58
|
+
classId: z.string(),
|
|
59
|
+
id: z.string(),
|
|
60
|
+
title: z.string().nullable().optional(),
|
|
61
|
+
externalUrl: z.string().url().optional(),
|
|
62
|
+
indent: z.number().int().min(0).max(4).optional(),
|
|
63
|
+
requirementType: requirementTypeSchema.nullable().optional(),
|
|
64
|
+
requiredScore: z.number().min(0).nullable().optional(),
|
|
65
|
+
}))
|
|
66
|
+
.mutation(({ ctx, input }) => updateModuleItemRecord(ctx.user.id, input)),
|
|
67
|
+
deleteItem: protectedTeacherProcedure
|
|
68
|
+
.input(z.object({ classId: z.string(), id: z.string() }))
|
|
69
|
+
.mutation(({ ctx, input }) => deleteModuleItemRecord(ctx.user.id, input)),
|
|
70
|
+
reorderItems: protectedTeacherProcedure
|
|
71
|
+
.input(z.object({
|
|
72
|
+
classId: z.string(),
|
|
73
|
+
items: z.array(z.object({ id: z.string(), moduleId: z.string() })),
|
|
74
|
+
}))
|
|
75
|
+
.mutation(({ ctx, input }) => reorderModuleItemsRecord(ctx.user.id, input)),
|
|
76
|
+
/** Record that a student viewed an item (completes VIEW requirements). */
|
|
77
|
+
markItemViewed: protectedClassMemberProcedure
|
|
78
|
+
.input(z.object({ classId: z.string(), itemId: z.string() }))
|
|
79
|
+
.mutation(({ ctx, input }) => markItemViewedRecord(ctx.user.id, input)),
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=module.js.map
|
|
82
|
+
//# debugId=bce497d9-7c87-5479-9ba0-f2235b734365
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sources":["routers/module.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { CourseModuleItemType as ModuleItemType, ModuleItemRequirementType } from \"@prisma/client\";\nimport {\n createTRPCRouter,\n protectedClassMemberProcedure,\n protectedTeacherProcedure,\n} from \"../trpc.js\";\nimport {\n listModulesRecord,\n createModuleRecord,\n updateModuleRecord,\n deleteModuleRecord,\n reorderModulesRecord,\n createModuleItemRecord,\n updateModuleItemRecord,\n deleteModuleItemRecord,\n reorderModuleItemsRecord,\n getStudentModulesState,\n markItemViewedRecord,\n} from \"../services/module.js\";\n\nconst itemTypeSchema = z.nativeEnum(ModuleItemType);\nconst requirementTypeSchema = z.nativeEnum(ModuleItemRequirementType);\n\nexport const moduleRouter = createTRPCRouter({\n /** Teacher view: every module (published or not) with its items. */\n list: protectedTeacherProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ ctx, input }) => listModulesRecord(ctx.user!.id, input.classId)),\n\n /** Student view: published modules with lock state and progress. */\n getStudentState: protectedClassMemberProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ ctx, input }) =>\n getStudentModulesState(input.classId, ctx.user!.id)\n ),\n\n create: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n title: z.string().min(1),\n unlockAt: z.coerce.date().nullish(),\n requireSequential: z.boolean().optional(),\n })\n )\n .mutation(({ ctx, input }) => createModuleRecord(ctx.user!.id, input)),\n\n update: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n id: z.string(),\n title: z.string().min(1).optional(),\n unlockAt: z.coerce.date().nullable().optional(),\n requireSequential: z.boolean().optional(),\n published: z.boolean().optional(),\n prerequisiteIds: z.array(z.string()).optional(),\n })\n )\n .mutation(({ ctx, input }) => updateModuleRecord(ctx.user!.id, input)),\n\n delete: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), id: z.string() }))\n .mutation(({ ctx, input }) => deleteModuleRecord(ctx.user!.id, input)),\n\n reorder: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), orderedIds: z.array(z.string()) }))\n .mutation(({ ctx, input }) => reorderModulesRecord(ctx.user!.id, input)),\n\n createItem: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n moduleId: z.string(),\n itemType: itemTypeSchema,\n itemId: z.string().optional(),\n externalUrl: z.string().url().optional(),\n title: z.string().optional(),\n indent: z.number().int().min(0).max(4).optional(),\n requirementType: requirementTypeSchema.optional(),\n requiredScore: z.number().min(0).optional(),\n })\n )\n .mutation(({ ctx, input }) => createModuleItemRecord(ctx.user!.id, input)),\n\n updateItem: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n id: z.string(),\n title: z.string().nullable().optional(),\n externalUrl: z.string().url().optional(),\n indent: z.number().int().min(0).max(4).optional(),\n requirementType: requirementTypeSchema.nullable().optional(),\n requiredScore: z.number().min(0).nullable().optional(),\n })\n )\n .mutation(({ ctx, input }) => updateModuleItemRecord(ctx.user!.id, input)),\n\n deleteItem: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), id: z.string() }))\n .mutation(({ ctx, input }) => deleteModuleItemRecord(ctx.user!.id, input)),\n\n reorderItems: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n items: z.array(z.object({ id: z.string(), moduleId: z.string() })),\n })\n )\n .mutation(({ ctx, input }) => reorderModuleItemsRecord(ctx.user!.id, input)),\n\n /** Record that a student viewed an item (completes VIEW requirements). */\n markItemViewed: protectedClassMemberProcedure\n .input(z.object({ classId: z.string(), itemId: z.string() }))\n .mutation(({ ctx, input }) => markItemViewedRecord(ctx.user!.id, input)),\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,IAAI,cAAc,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,cAAc,GAAG,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACpD,MAAM,qBAAqB,GAAG,CAAC,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;IAC3C,oEAAoE;IACpE,IAAI,EAAE,yBAAyB;SAC5B,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACxC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,iBAAiB,CAA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id":"bce497d9-7c87-5479-9ba0-f2235b734365"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moduleItem.d.ts","sourceRoot":"/","sources":["routers/moduleItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"moduleItem.d.ts","sourceRoot":"/","sources":["routers/moduleItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgE3B,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="60d66767-4c5e-58c8-9f6a-7a93323eae9e")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createTRPCRouter, protectedClassMemberProcedure, protectedTeacherProcedure, } from "../trpc.js";
|
|
5
5
|
import { createModuleItemRecord, deleteModuleItemRecord, getModuleItem, listModuleItemsForClass, listModuleItemsForSection, reorderModuleItems, updateModuleItemRecord, } from "../services/moduleItem.js";
|
|
6
|
+
const MAX_MODULE_FILE_BYTES = 2 * 1024 * 1024 * 1024; // 2 GB (videos)
|
|
6
7
|
const directFileSchema = z.object({
|
|
7
|
-
name: z.string(),
|
|
8
|
-
type: z.string(),
|
|
9
|
-
size: z.number(),
|
|
8
|
+
name: z.string().trim().min(1).max(255),
|
|
9
|
+
type: z.string().trim().min(1).max(255),
|
|
10
|
+
size: z.number().int().positive().max(MAX_MODULE_FILE_BYTES),
|
|
10
11
|
});
|
|
11
12
|
const moduleItemTypeSchema = z.enum(["PAGE", "FILES", "VIDEO"]);
|
|
12
13
|
export const moduleItemRouter = createTRPCRouter({
|
|
@@ -49,7 +50,7 @@ export const moduleItemRouter = createTRPCRouter({
|
|
|
49
50
|
.input(z.object({
|
|
50
51
|
classId: z.string(),
|
|
51
52
|
sectionId: z.string(),
|
|
52
|
-
orderedIds: z.array(z.string()),
|
|
53
|
+
orderedIds: z.array(z.string()).min(1).max(500),
|
|
53
54
|
}))
|
|
54
55
|
.mutation(({ ctx, input }) => reorderModuleItems(ctx.user.id, input)),
|
|
55
56
|
delete: protectedTeacherProcedure
|
|
@@ -57,4 +58,4 @@ export const moduleItemRouter = createTRPCRouter({
|
|
|
57
58
|
.mutation(({ ctx, input }) => deleteModuleItemRecord(ctx.user.id, input.id)),
|
|
58
59
|
});
|
|
59
60
|
//# sourceMappingURL=moduleItem.js.map
|
|
60
|
-
//# debugId=
|
|
61
|
+
//# debugId=60d66767-4c5e-58c8-9f6a-7a93323eae9e
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moduleItem.js","sources":["routers/moduleItem.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport {\n createTRPCRouter,\n protectedClassMemberProcedure,\n protectedTeacherProcedure,\n} from \"../trpc.js\";\nimport {\n createModuleItemRecord,\n deleteModuleItemRecord,\n getModuleItem,\n listModuleItemsForClass,\n listModuleItemsForSection,\n reorderModuleItems,\n updateModuleItemRecord,\n} from \"../services/moduleItem.js\";\n\nconst directFileSchema = z.object({\n name: z.string(),\n type: z.string(),\n size: z.number(),\n});\n\nconst moduleItemTypeSchema = z.enum([\"PAGE\", \"FILES\", \"VIDEO\"]);\n\nexport const moduleItemRouter = createTRPCRouter({\n listByClass: protectedClassMemberProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ ctx, input }) =>\n listModuleItemsForClass(input.classId, ctx.user!.id)\n ),\n\n listBySection: protectedClassMemberProcedure\n .input(z.object({ sectionId: z.string() }))\n .query(({ ctx, input }) =>\n listModuleItemsForSection(input.sectionId, ctx.user!.id)\n ),\n\n get: protectedClassMemberProcedure\n .input(z.object({ id: z.string() }))\n .query(({ ctx, input }) => getModuleItem(input.id, ctx.user!.id)),\n\n create: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n sectionId: z.string(),\n title: z.string().min(1).max(500),\n type: moduleItemTypeSchema,\n body: z.string().max(200_000).nullable().optional(),\n published: z.boolean().optional(),\n files: z.array(directFileSchema).optional(),\n existingFileIds: z.array(z.string()).optional(),\n })\n )\n .mutation(({ ctx, input }) => createModuleItemRecord(ctx.user!.id, input)),\n\n update: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n id: z.string(),\n title: z.string().min(1).max(500).optional(),\n type: moduleItemTypeSchema.optional(),\n body: z.string().max(200_000).nullable().optional(),\n published: z.boolean().optional(),\n sectionId: z.string().optional(),\n order: z.number().int().nullable().optional(),\n files: z.array(directFileSchema).optional(),\n existingFileIds: z.array(z.string()).optional(),\n })\n )\n .mutation(({ ctx, input }) => updateModuleItemRecord(ctx.user!.id, input)),\n\n reorder: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n sectionId: z.string(),\n orderedIds: z.array(z.string()),\n })\n )\n .mutation(({ ctx, input }) => reorderModuleItems(ctx.user!.id, input)),\n\n delete: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), id: z.string() }))\n .mutation(({ ctx, input }) =>\n deleteModuleItemRecord(ctx.user!.id, input.id)\n ),\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"moduleItem.js","sources":["routers/moduleItem.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport {\n createTRPCRouter,\n protectedClassMemberProcedure,\n protectedTeacherProcedure,\n} from \"../trpc.js\";\nimport {\n createModuleItemRecord,\n deleteModuleItemRecord,\n getModuleItem,\n listModuleItemsForClass,\n listModuleItemsForSection,\n reorderModuleItems,\n updateModuleItemRecord,\n} from \"../services/moduleItem.js\";\n\nconst MAX_MODULE_FILE_BYTES = 2 * 1024 * 1024 * 1024; // 2 GB (videos)\n\nconst directFileSchema = z.object({\n name: z.string().trim().min(1).max(255),\n type: z.string().trim().min(1).max(255),\n size: z.number().int().positive().max(MAX_MODULE_FILE_BYTES),\n});\n\nconst moduleItemTypeSchema = z.enum([\"PAGE\", \"FILES\", \"VIDEO\"]);\n\nexport const moduleItemRouter = createTRPCRouter({\n listByClass: protectedClassMemberProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ ctx, input }) =>\n listModuleItemsForClass(input.classId, ctx.user!.id)\n ),\n\n listBySection: protectedClassMemberProcedure\n .input(z.object({ sectionId: z.string() }))\n .query(({ ctx, input }) =>\n listModuleItemsForSection(input.sectionId, ctx.user!.id)\n ),\n\n get: protectedClassMemberProcedure\n .input(z.object({ id: z.string() }))\n .query(({ ctx, input }) => getModuleItem(input.id, ctx.user!.id)),\n\n create: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n sectionId: z.string(),\n title: z.string().min(1).max(500),\n type: moduleItemTypeSchema,\n body: z.string().max(200_000).nullable().optional(),\n published: z.boolean().optional(),\n files: z.array(directFileSchema).optional(),\n existingFileIds: z.array(z.string()).optional(),\n })\n )\n .mutation(({ ctx, input }) => createModuleItemRecord(ctx.user!.id, input)),\n\n update: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n id: z.string(),\n title: z.string().min(1).max(500).optional(),\n type: moduleItemTypeSchema.optional(),\n body: z.string().max(200_000).nullable().optional(),\n published: z.boolean().optional(),\n sectionId: z.string().optional(),\n order: z.number().int().nullable().optional(),\n files: z.array(directFileSchema).optional(),\n existingFileIds: z.array(z.string()).optional(),\n })\n )\n .mutation(({ ctx, input }) => updateModuleItemRecord(ctx.user!.id, input)),\n\n reorder: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n sectionId: z.string(),\n orderedIds: z.array(z.string()).min(1).max(500),\n })\n )\n .mutation(({ ctx, input }) => reorderModuleItems(ctx.user!.id, input)),\n\n delete: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), id: z.string() }))\n .mutation(({ ctx, input }) =>\n deleteModuleItemRecord(ctx.user!.id, input.id)\n ),\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,qBAAqB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CA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C,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACxD,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC3B,sBAAsB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAC/C;CACJ,CAAC,CAAC","debug_id":"60d66767-4c5e-58c8-9f6a-7a93323eae9e"}
|
package/dist/routers/parent.d.ts
CHANGED
|
@@ -119,6 +119,7 @@ export declare const parentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
119
119
|
present: number;
|
|
120
120
|
late: number;
|
|
121
121
|
absent: number;
|
|
122
|
+
excused: number;
|
|
122
123
|
total: number;
|
|
123
124
|
};
|
|
124
125
|
records: {
|
|
@@ -131,7 +132,7 @@ export declare const parentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
131
132
|
name: string;
|
|
132
133
|
subject: string;
|
|
133
134
|
} | null;
|
|
134
|
-
status: "
|
|
135
|
+
status: import(".prisma/client").$Enums.AttendanceStatus;
|
|
135
136
|
}[];
|
|
136
137
|
};
|
|
137
138
|
meta: object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parent.d.ts","sourceRoot":"/","sources":["routers/parent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"parent.d.ts","sourceRoot":"/","sources":["routers/parent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDvB,CAAC"}
|
package/dist/routers/school.d.ts
CHANGED
|
@@ -474,7 +474,7 @@ export declare const schoolRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
474
474
|
revokedAt: Date | null;
|
|
475
475
|
createdAt: Date;
|
|
476
476
|
updatedAt: Date;
|
|
477
|
-
status: "ACTIVE" | "REVOKED" | "UPCOMING";
|
|
477
|
+
status: "ACTIVE" | "REVOKED" | "EXPIRED" | "UPCOMING";
|
|
478
478
|
studentIds: string[];
|
|
479
479
|
students: {
|
|
480
480
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"school.d.ts","sourceRoot":"/","sources":["routers/school.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuExB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6GvB,8DAA8D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAO9D,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqIjF;;;;OAIG;;;;;;;;;;;;;;;;;;;;;IAcH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiCH,+EAA+E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2C/E,kFAAkF;;;;;;;;;;;;;;;;GAUlF,CAAC"}
|
package/dist/routers/school.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="e365815a-3112-5d63-972f-390a63a4a409")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createTRPCRouter, protectedProcedure, publicProcedure, } from "../trpc.js";
|
|
5
5
|
import { acceptInvite, addMember, bulkRemoveMembers, bulkUpdateMemberRoles, confirmSchoolAssetUpload, createInvite, createSchoolClass, createSchoolRecord, deleteSchoolClass, getAdminOverview, getCurrentSchool, getInvite, getMemberDetail, getMemberTimeline, getSchoolAssetUploadUrl, getStudentTimeline, listClasses, listInvites, listMemberIds, listMembers, removeMember, revokeInvite, searchMembers, updateClassMembers, updateMemberRole, updateSchoolDetails, } from "../services/school.js";
|
|
@@ -201,8 +201,13 @@ export const schoolRouter = createTRPCRouter({
|
|
|
201
201
|
* No AcademicTerm yet — pass schoolYear and/or from/to (C1 dependency).
|
|
202
202
|
*/
|
|
203
203
|
generateTranscript: protectedProcedure
|
|
204
|
-
.input(transcriptPeriodSchema
|
|
204
|
+
.input(transcriptPeriodSchema
|
|
205
|
+
.extend({
|
|
205
206
|
studentId: z.string(),
|
|
207
|
+
})
|
|
208
|
+
.refine((v) => !v.from || !v.to || v.from <= v.to, {
|
|
209
|
+
message: "from must be on or before to",
|
|
210
|
+
path: ["from"],
|
|
206
211
|
}))
|
|
207
212
|
.mutation(({ ctx, input }) => generateTranscript(ctx.user.id, input)),
|
|
208
213
|
/**
|
|
@@ -210,8 +215,13 @@ export const schoolRouter = createTRPCRouter({
|
|
|
210
215
|
* Returns per-student PDFs plus any per-student errors.
|
|
211
216
|
*/
|
|
212
217
|
generateTranscripts: protectedProcedure
|
|
213
|
-
.input(transcriptPeriodSchema
|
|
218
|
+
.input(transcriptPeriodSchema
|
|
219
|
+
.extend({
|
|
214
220
|
studentIds: z.array(z.string()).min(1).max(50),
|
|
221
|
+
})
|
|
222
|
+
.refine((v) => !v.from || !v.to || v.from <= v.to, {
|
|
223
|
+
message: "from must be on or before to",
|
|
224
|
+
path: ["from"],
|
|
215
225
|
}))
|
|
216
226
|
.mutation(({ ctx, input }) => generateTranscripts(ctx.user.id, input)),
|
|
217
227
|
bulkUpdateMemberRoles: protectedProcedure
|
|
@@ -268,4 +278,4 @@ export const schoolRouter = createTRPCRouter({
|
|
|
268
278
|
.mutation(({ ctx, input }) => importStudentsCsv(ctx.user.id, input)),
|
|
269
279
|
});
|
|
270
280
|
//# sourceMappingURL=school.js.map
|
|
271
|
-
//# debugId=
|
|
281
|
+
//# debugId=e365815a-3112-5d63-972f-390a63a4a409
|