@studious-lms/server 1.22.0 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/.env.example +0 -1
  2. package/data/curriculum/nepal-cdc-g4-g5/README.md +90 -0
  3. package/data/curriculum/nepal-cdc-g4-g5/manifest.json +97 -0
  4. package/data/curriculum/nepal-cdc-g4-g5/proficiency-scale.json +76 -0
  5. package/data/curriculum/nepal-cdc-g4-g5/subjects/english.json +6936 -0
  6. package/data/curriculum/nepal-cdc-g4-g5/subjects/health-physical-creative-arts.json +3401 -0
  7. package/data/curriculum/nepal-cdc-g4-g5/subjects/mathematics.json +1511 -0
  8. package/data/curriculum/nepal-cdc-g4-g5/subjects/nepali.json +7928 -0
  9. package/data/curriculum/nepal-cdc-g4-g5/subjects/science-technology.json +2420 -0
  10. package/data/curriculum/nepal-cdc-g4-g5/subjects/social-studies.json +2177 -0
  11. package/dist/lib/assignmentTypeDefaults.d.ts +41 -0
  12. package/dist/lib/assignmentTypeDefaults.d.ts.map +1 -0
  13. package/dist/lib/assignmentTypeDefaults.js +167 -0
  14. package/dist/lib/assignmentTypeDefaults.js.map +1 -0
  15. package/dist/lib/config/env.d.ts +0 -8
  16. package/dist/lib/config/env.d.ts.map +1 -1
  17. package/dist/lib/config/env.js +2 -5
  18. package/dist/lib/config/env.js.map +1 -1
  19. package/dist/lib/feePdf.d.ts +19 -0
  20. package/dist/lib/feePdf.d.ts.map +1 -0
  21. package/dist/lib/feePdf.js +167 -0
  22. package/dist/lib/feePdf.js.map +1 -0
  23. package/dist/lib/feePdfFormat.d.ts +4 -0
  24. package/dist/lib/feePdfFormat.d.ts.map +1 -0
  25. package/dist/lib/feePdfFormat.js +16 -0
  26. package/dist/lib/feePdfFormat.js.map +1 -0
  27. package/dist/lib/idCardPdf.d.ts +26 -0
  28. package/dist/lib/idCardPdf.d.ts.map +1 -0
  29. package/dist/lib/idCardPdf.js +272 -0
  30. package/dist/lib/idCardPdf.js.map +1 -0
  31. package/dist/lib/pdfLetterhead.d.ts +41 -0
  32. package/dist/lib/pdfLetterhead.d.ts.map +1 -0
  33. package/dist/lib/pdfLetterhead.js +86 -0
  34. package/dist/lib/pdfLetterhead.js.map +1 -0
  35. package/dist/lib/transcriptPdf.d.ts +55 -0
  36. package/dist/lib/transcriptPdf.d.ts.map +1 -0
  37. package/dist/lib/transcriptPdf.js +303 -0
  38. package/dist/lib/transcriptPdf.js.map +1 -0
  39. package/dist/models/academicCalendar.d.ts +198 -0
  40. package/dist/models/academicCalendar.d.ts.map +1 -0
  41. package/dist/models/academicCalendar.js +106 -0
  42. package/dist/models/academicCalendar.js.map +1 -0
  43. package/dist/models/agenda.d.ts +8 -0
  44. package/dist/models/agenda.d.ts.map +1 -1
  45. package/dist/models/announcement.d.ts +2 -0
  46. package/dist/models/announcement.d.ts.map +1 -1
  47. package/dist/models/assignment.d.ts +66 -0
  48. package/dist/models/assignment.d.ts.map +1 -1
  49. package/dist/models/attendance.d.ts +659 -21
  50. package/dist/models/attendance.d.ts.map +1 -1
  51. package/dist/models/attendance.js +544 -75
  52. package/dist/models/attendance.js.map +1 -1
  53. package/dist/models/auth.d.ts +2 -0
  54. package/dist/models/auth.d.ts.map +1 -1
  55. package/dist/models/class.d.ts +12 -0
  56. package/dist/models/class.d.ts.map +1 -1
  57. package/dist/models/class.js +3 -2
  58. package/dist/models/class.js.map +1 -1
  59. package/dist/models/event.d.ts +16 -0
  60. package/dist/models/event.d.ts.map +1 -1
  61. package/dist/models/fees.d.ts +554 -0
  62. package/dist/models/fees.d.ts.map +1 -0
  63. package/dist/models/fees.js +278 -0
  64. package/dist/models/fees.js.map +1 -0
  65. package/dist/models/file.d.ts +29 -0
  66. package/dist/models/file.d.ts.map +1 -1
  67. package/dist/models/folder.d.ts +2 -0
  68. package/dist/models/folder.d.ts.map +1 -1
  69. package/dist/models/labChat.d.ts +2 -0
  70. package/dist/models/labChat.d.ts.map +1 -1
  71. package/dist/models/marketplace.d.ts +178 -0
  72. package/dist/models/marketplace.d.ts.map +1 -0
  73. package/dist/models/marketplace.js +115 -0
  74. package/dist/models/marketplace.js.map +1 -0
  75. package/dist/models/moduleItem.d.ts +304 -0
  76. package/dist/models/moduleItem.d.ts.map +1 -0
  77. package/dist/models/moduleItem.js +78 -0
  78. package/dist/models/moduleItem.js.map +1 -0
  79. package/dist/models/newtonChat.d.ts +1 -0
  80. package/dist/models/newtonChat.d.ts.map +1 -1
  81. package/dist/models/school.d.ts +193 -0
  82. package/dist/models/school.d.ts.map +1 -1
  83. package/dist/models/school.js +80 -2
  84. package/dist/models/school.js.map +1 -1
  85. package/dist/models/section.d.ts +4 -0
  86. package/dist/models/section.d.ts.map +1 -1
  87. package/dist/models/worksheet.d.ts +19 -0
  88. package/dist/models/worksheet.d.ts.map +1 -1
  89. package/dist/models/worksheet.js +2 -2
  90. package/dist/models/worksheet.js.map +1 -1
  91. package/dist/routers/_app.d.ts +11605 -7133
  92. package/dist/routers/_app.d.ts.map +1 -1
  93. package/dist/routers/_app.js +12 -2
  94. package/dist/routers/_app.js.map +1 -1
  95. package/dist/routers/academicCalendar.d.ts +229 -0
  96. package/dist/routers/academicCalendar.d.ts.map +1 -0
  97. package/dist/routers/academicCalendar.js +75 -0
  98. package/dist/routers/academicCalendar.js.map +1 -0
  99. package/dist/routers/admin.d.ts +2 -0
  100. package/dist/routers/admin.d.ts.map +1 -1
  101. package/dist/routers/agenda.d.ts +8 -0
  102. package/dist/routers/agenda.d.ts.map +1 -1
  103. package/dist/routers/assignment.d.ts +75 -0
  104. package/dist/routers/assignment.d.ts.map +1 -1
  105. package/dist/routers/assignment.js +10 -2
  106. package/dist/routers/assignment.js.map +1 -1
  107. package/dist/routers/attendance.d.ts +103 -0
  108. package/dist/routers/attendance.d.ts.map +1 -1
  109. package/dist/routers/attendance.js +8 -5
  110. package/dist/routers/attendance.js.map +1 -1
  111. package/dist/routers/class.d.ts +27 -0
  112. package/dist/routers/class.d.ts.map +1 -1
  113. package/dist/routers/class.js +6 -2
  114. package/dist/routers/class.js.map +1 -1
  115. package/dist/routers/event.d.ts +8 -0
  116. package/dist/routers/event.d.ts.map +1 -1
  117. package/dist/routers/fees.d.ts +513 -0
  118. package/dist/routers/fees.d.ts.map +1 -0
  119. package/dist/routers/fees.js +88 -0
  120. package/dist/routers/fees.js.map +1 -0
  121. package/dist/routers/file.d.ts +2 -0
  122. package/dist/routers/file.d.ts.map +1 -1
  123. package/dist/routers/gradebook.d.ts +4 -1
  124. package/dist/routers/gradebook.d.ts.map +1 -1
  125. package/dist/routers/marketplace.d.ts +371 -0
  126. package/dist/routers/marketplace.d.ts.map +1 -0
  127. package/dist/routers/marketplace.js +87 -0
  128. package/dist/routers/marketplace.js.map +1 -0
  129. package/dist/routers/moduleItem.d.ts +263 -0
  130. package/dist/routers/moduleItem.d.ts.map +1 -0
  131. package/dist/routers/moduleItem.js +60 -0
  132. package/dist/routers/moduleItem.js.map +1 -0
  133. package/dist/routers/parent.d.ts +169 -0
  134. package/dist/routers/parent.d.ts.map +1 -0
  135. package/dist/routers/parent.js +49 -0
  136. package/dist/routers/parent.js.map +1 -0
  137. package/dist/routers/school.d.ts +476 -6
  138. package/dist/routers/school.d.ts.map +1 -1
  139. package/dist/routers/school.js +130 -4
  140. package/dist/routers/school.js.map +1 -1
  141. package/dist/routers/worksheet.d.ts +27 -0
  142. package/dist/routers/worksheet.d.ts.map +1 -1
  143. package/dist/routers/worksheet.js +10 -3
  144. package/dist/routers/worksheet.js.map +1 -1
  145. package/dist/services/academicCalendar.d.ts +173 -0
  146. package/dist/services/academicCalendar.d.ts.map +1 -0
  147. package/dist/services/academicCalendar.js +214 -0
  148. package/dist/services/academicCalendar.js.map +1 -0
  149. package/dist/services/adminInstitution.d.ts +2 -0
  150. package/dist/services/adminInstitution.d.ts.map +1 -1
  151. package/dist/services/agenda.d.ts +8 -0
  152. package/dist/services/agenda.d.ts.map +1 -1
  153. package/dist/services/assignment.d.ts +75 -0
  154. package/dist/services/assignment.d.ts.map +1 -1
  155. package/dist/services/assignment.js +91 -12
  156. package/dist/services/assignment.js.map +1 -1
  157. package/dist/services/attendance.d.ts +323 -10
  158. package/dist/services/attendance.d.ts.map +1 -1
  159. package/dist/services/attendance.js +385 -25
  160. package/dist/services/attendance.js.map +1 -1
  161. package/dist/services/attendanceMerge.d.ts +53 -0
  162. package/dist/services/attendanceMerge.d.ts.map +1 -0
  163. package/dist/services/attendanceMerge.js +87 -0
  164. package/dist/services/attendanceMerge.js.map +1 -0
  165. package/dist/services/attendanceRate.d.ts +24 -0
  166. package/dist/services/attendanceRate.d.ts.map +1 -0
  167. package/dist/services/attendanceRate.js +31 -0
  168. package/dist/services/attendanceRate.js.map +1 -0
  169. package/dist/services/attendanceStats.d.ts +22 -0
  170. package/dist/services/attendanceStats.d.ts.map +1 -0
  171. package/dist/services/attendanceStats.js +45 -0
  172. package/dist/services/attendanceStats.js.map +1 -0
  173. package/dist/services/class.d.ts +27 -0
  174. package/dist/services/class.d.ts.map +1 -1
  175. package/dist/services/class.js +26 -3
  176. package/dist/services/class.js.map +1 -1
  177. package/dist/services/event.d.ts +8 -0
  178. package/dist/services/event.d.ts.map +1 -1
  179. package/dist/services/fees.d.ts +422 -0
  180. package/dist/services/fees.d.ts.map +1 -0
  181. package/dist/services/fees.js +310 -0
  182. package/dist/services/fees.js.map +1 -0
  183. package/dist/services/feesAuthz.d.ts +49 -0
  184. package/dist/services/feesAuthz.d.ts.map +1 -0
  185. package/dist/services/feesAuthz.js +52 -0
  186. package/dist/services/feesAuthz.js.map +1 -0
  187. package/dist/services/file.d.ts +4 -0
  188. package/dist/services/file.d.ts.map +1 -1
  189. package/dist/services/gradebook.d.ts +18 -1
  190. package/dist/services/gradebook.d.ts.map +1 -1
  191. package/dist/services/gradebook.js +57 -2
  192. package/dist/services/gradebook.js.map +1 -1
  193. package/dist/services/idCard.d.ts +11 -0
  194. package/dist/services/idCard.d.ts.map +1 -0
  195. package/dist/services/idCard.js +122 -0
  196. package/dist/services/idCard.js.map +1 -0
  197. package/dist/services/marketplace.d.ts +301 -0
  198. package/dist/services/marketplace.d.ts.map +1 -0
  199. package/dist/services/marketplace.js +628 -0
  200. package/dist/services/marketplace.js.map +1 -0
  201. package/dist/services/moduleItem.d.ts +196 -0
  202. package/dist/services/moduleItem.d.ts.map +1 -0
  203. package/dist/services/moduleItem.js +188 -0
  204. package/dist/services/moduleItem.js.map +1 -0
  205. package/dist/services/notification.d.ts +58 -0
  206. package/dist/services/notification.d.ts.map +1 -1
  207. package/dist/services/notification.js +30 -2
  208. package/dist/services/notification.js.map +1 -1
  209. package/dist/services/parentPortal.d.ts +133 -0
  210. package/dist/services/parentPortal.d.ts.map +1 -0
  211. package/dist/services/parentPortal.js +328 -0
  212. package/dist/services/parentPortal.js.map +1 -0
  213. package/dist/services/school.d.ts +122 -3
  214. package/dist/services/school.d.ts.map +1 -1
  215. package/dist/services/school.js +179 -47
  216. package/dist/services/school.js.map +1 -1
  217. package/dist/services/studentImport.d.ts +34 -0
  218. package/dist/services/studentImport.d.ts.map +1 -0
  219. package/dist/services/studentImport.js +236 -0
  220. package/dist/services/studentImport.js.map +1 -0
  221. package/dist/services/transcript.d.ts +61 -0
  222. package/dist/services/transcript.d.ts.map +1 -0
  223. package/dist/services/transcript.js +243 -0
  224. package/dist/services/transcript.js.map +1 -0
  225. package/dist/services/worksheet.d.ts +22 -0
  226. package/dist/services/worksheet.d.ts.map +1 -1
  227. package/dist/services/worksheet.js +94 -2
  228. package/dist/services/worksheet.js.map +1 -1
  229. package/dist/trpc.d.ts +1 -1
  230. package/dist/trpc.d.ts.map +1 -1
  231. package/dist/trpc.js +5 -5
  232. package/dist/trpc.js.map +1 -1
  233. package/dist/utils/adminPanelAccess.d.ts +4 -5
  234. package/dist/utils/adminPanelAccess.d.ts.map +1 -1
  235. package/dist/utils/adminPanelAccess.js +12 -34
  236. package/dist/utils/adminPanelAccess.js.map +1 -1
  237. package/package.json +2 -1
  238. package/prisma/migrations/20260804120000_add_attendance_records_and_excusals/migration.sql +114 -0
  239. package/prisma/migrations/20260804120100_add_fee_plans_invoices_payments/migration.sql +101 -0
  240. package/prisma/migrations/20260804120200_add_marketplace_listings/migration.sql +54 -0
  241. package/prisma/migrations/20260804120300_content_platform_b3_b9/migration.sql +63 -0
  242. package/prisma/migrations/20260804120400_c_academic_ops/migration.sql +77 -0
  243. package/prisma/schema.prisma +371 -11
  244. package/scripts/import-nepal-cdc-curriculum.ts +379 -0
  245. package/src/lib/assignmentTypeDefaults.ts +222 -0
  246. package/src/lib/config/env.ts +0 -3
  247. package/src/lib/feePdf.ts +199 -0
  248. package/src/lib/feePdfFormat.ts +14 -0
  249. package/src/lib/idCardPdf.ts +336 -0
  250. package/src/lib/pdfLetterhead.ts +124 -0
  251. package/src/lib/transcriptPdf.ts +502 -0
  252. package/src/models/academicCalendar.ts +139 -0
  253. package/src/models/attendance.ts +704 -73
  254. package/src/models/class.ts +1 -0
  255. package/src/models/fees.ts +349 -0
  256. package/src/models/marketplace.ts +158 -0
  257. package/src/models/moduleItem.ts +107 -0
  258. package/src/models/school.ts +95 -0
  259. package/src/models/worksheet.ts +2 -0
  260. package/src/routers/_app.ts +10 -0
  261. package/src/routers/academicCalendar.ts +103 -0
  262. package/src/routers/assignment.ts +8 -0
  263. package/src/routers/attendance.ts +7 -3
  264. package/src/routers/class.ts +4 -0
  265. package/src/routers/fees.ts +126 -0
  266. package/src/routers/marketplace.ts +134 -0
  267. package/src/routers/moduleItem.ts +89 -0
  268. package/src/routers/parent.ts +68 -0
  269. package/src/routers/school.ts +184 -1
  270. package/src/routers/worksheet.ts +11 -0
  271. package/src/services/academicCalendar.ts +299 -0
  272. package/src/services/assignment.ts +122 -12
  273. package/src/services/attendance.ts +548 -26
  274. package/src/services/attendanceMerge.ts +139 -0
  275. package/src/services/attendanceRate.ts +41 -0
  276. package/src/services/attendanceStats.ts +63 -0
  277. package/src/services/class.ts +25 -1
  278. package/src/services/fees.ts +424 -0
  279. package/src/services/feesAuthz.ts +77 -0
  280. package/src/services/gradebook.ts +70 -0
  281. package/src/services/idCard.ts +147 -0
  282. package/src/services/marketplace.ts +785 -0
  283. package/src/services/moduleItem.ts +274 -0
  284. package/src/services/notification.ts +43 -0
  285. package/src/services/parentPortal.ts +380 -0
  286. package/src/services/school.ts +243 -45
  287. package/src/services/studentImport.ts +273 -0
  288. package/src/services/transcript.ts +313 -0
  289. package/src/services/worksheet.ts +111 -0
  290. package/src/trpc.ts +3 -3
  291. package/src/utils/adminPanelAccess.ts +12 -35
  292. package/tests/unit/assignmentTypeDefaults.test.ts +52 -0
  293. package/tests/unit/lib/feePdf.test.ts +15 -0
  294. package/tests/unit/lib/idCardPdf.test.ts +40 -0
  295. package/tests/unit/lib/transcriptPdf.test.ts +111 -0
  296. package/tests/unit/services/attendanceMerge.test.ts +90 -0
  297. package/tests/unit/services/attendanceRate.test.ts +38 -0
  298. package/tests/unit/services/attendanceStats.test.ts +54 -0
@@ -1,5 +1,107 @@
1
+ /**
2
+ * Attendance model – session-level lists + per-student AttendanceRecord,
3
+ * and school-scoped StudentExcusal persistence.
4
+ */
5
+ import { AttendanceStatus, Prisma } from "@prisma/client";
6
+ declare const attendanceInclude: {
7
+ readonly event: {
8
+ readonly select: {
9
+ readonly id: true;
10
+ readonly name: true;
11
+ readonly startTime: true;
12
+ readonly endTime: true;
13
+ readonly location: true;
14
+ readonly color: true;
15
+ };
16
+ };
17
+ readonly present: {
18
+ readonly select: {
19
+ readonly id: true;
20
+ readonly username: true;
21
+ readonly profile: {
22
+ readonly select: {
23
+ readonly displayName: true;
24
+ readonly profilePicture: true;
25
+ readonly profilePictureThumbnail: true;
26
+ readonly bio: true;
27
+ readonly location: true;
28
+ readonly website: true;
29
+ };
30
+ };
31
+ };
32
+ };
33
+ readonly late: {
34
+ readonly select: {
35
+ readonly id: true;
36
+ readonly username: true;
37
+ readonly profile: {
38
+ readonly select: {
39
+ readonly displayName: true;
40
+ readonly profilePicture: true;
41
+ readonly profilePictureThumbnail: true;
42
+ readonly bio: true;
43
+ readonly location: true;
44
+ readonly website: true;
45
+ };
46
+ };
47
+ };
48
+ };
49
+ readonly absent: {
50
+ readonly select: {
51
+ readonly id: true;
52
+ readonly username: true;
53
+ readonly profile: {
54
+ readonly select: {
55
+ readonly displayName: true;
56
+ readonly profilePicture: true;
57
+ readonly profilePictureThumbnail: true;
58
+ readonly bio: true;
59
+ readonly location: true;
60
+ readonly website: true;
61
+ };
62
+ };
63
+ };
64
+ };
65
+ readonly records: {
66
+ readonly select: {
67
+ readonly id: true;
68
+ readonly studentId: true;
69
+ readonly status: true;
70
+ readonly note: true;
71
+ readonly excusedByExcusalId: true;
72
+ readonly updatedById: true;
73
+ readonly updatedAt: true;
74
+ readonly student: {
75
+ readonly select: {
76
+ readonly id: true;
77
+ readonly username: true;
78
+ readonly profile: {
79
+ readonly select: {
80
+ readonly displayName: true;
81
+ readonly profilePicture: true;
82
+ readonly profilePictureThumbnail: true;
83
+ readonly bio: true;
84
+ readonly location: true;
85
+ readonly website: true;
86
+ };
87
+ };
88
+ };
89
+ };
90
+ readonly excusedByExcusal: {
91
+ readonly select: {
92
+ readonly id: true;
93
+ readonly reason: true;
94
+ readonly note: true;
95
+ readonly startDate: true;
96
+ readonly endDate: true;
97
+ readonly revokedAt: true;
98
+ };
99
+ };
100
+ };
101
+ };
102
+ };
1
103
  /** @returns Class with students for attendance. */
2
- export declare function findClassWithStudents(classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
104
+ export declare function findClassWithStudents(classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
3
105
  result: {
4
106
  userProfile: {
5
107
  profilePicture: () => {
@@ -37,9 +139,10 @@ export declare function findClassWithStudents(classId: string): import("@prisma/
37
139
  profilePictureThumbnail: string | null;
38
140
  } | null;
39
141
  }[];
142
+ schoolId: string | null;
40
143
  } | null>;
41
144
  /** @returns Class if user is a teacher or school admin. */
42
- export declare function findClassWithTeacher(classId: string, teacherId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
145
+ export declare function findClassWithTeacher(classId: string, teacherId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
43
146
  result: {
44
147
  userProfile: {
45
148
  profilePicture: () => {
@@ -69,6 +172,7 @@ export declare function findClassWithTeacher(classId: string, teacherId: string)
69
172
  students: {
70
173
  id: string;
71
174
  }[];
175
+ schoolId: string | null;
72
176
  } | null>;
73
177
  /** @returns Events for a class. */
74
178
  export declare function findEventsByClassId(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
@@ -83,7 +187,7 @@ export declare function findEventsByClassId(classId: string): import("@prisma/cl
83
187
  remarks: string | null;
84
188
  }[]>;
85
189
  /** @returns Attendance record for an event. */
86
- export declare function findAttendanceByEventId(eventId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
190
+ export declare function findAttendanceByEventId(eventId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
87
191
  result: {
88
192
  userProfile: {
89
193
  profilePicture: () => {
@@ -107,14 +211,20 @@ export declare function findAttendanceByEventId(eventId: string): import("@prism
107
211
  model: {};
108
212
  query: {};
109
213
  client: {};
110
- }, {}>, "Attendance", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
214
+ }, {}>, "Attendance", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<({
215
+ records: {
216
+ status: import(".prisma/client").$Enums.AttendanceStatus;
217
+ studentId: string;
218
+ excusedByExcusalId: string | null;
219
+ }[];
220
+ } & {
111
221
  id: string;
112
222
  classId: string;
113
223
  eventId: string | null;
114
224
  date: Date;
115
- } | null>;
225
+ }) | null>;
116
226
  /** @returns Attendance for class and event (eventId null = class-level). */
117
- export declare function findAttendanceByClassAndEvent(classId: string, eventId: string | null): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
227
+ export declare function findAttendanceByClassAndEvent(classId: string, eventId: string | null): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
118
228
  result: {
119
229
  userProfile: {
120
230
  profilePicture: () => {
@@ -142,6 +252,7 @@ export declare function findAttendanceByClassAndEvent(classId: string, eventId:
142
252
  event: {
143
253
  id: string;
144
254
  name: string | null;
255
+ startTime: Date;
145
256
  } | null;
146
257
  late: {
147
258
  id: string;
@@ -149,6 +260,12 @@ export declare function findAttendanceByClassAndEvent(classId: string, eventId:
149
260
  absent: {
150
261
  id: string;
151
262
  }[];
263
+ records: {
264
+ status: import(".prisma/client").$Enums.AttendanceStatus;
265
+ studentId: string;
266
+ note: string | null;
267
+ excusedByExcusalId: string | null;
268
+ }[];
152
269
  } & {
153
270
  id: string;
154
271
  classId: string;
@@ -201,20 +318,59 @@ export declare function findManyAttendance(classId: string, eventId?: string): i
201
318
  profilePictureThumbnail: string | null;
202
319
  } | null;
203
320
  }[];
321
+ records: {
322
+ status: import(".prisma/client").$Enums.AttendanceStatus;
323
+ id: string;
324
+ updatedAt: Date;
325
+ student: {
326
+ id: string;
327
+ username: string;
328
+ profile: {
329
+ profilePicture: string | null;
330
+ displayName: string | null;
331
+ bio: string | null;
332
+ location: string | null;
333
+ website: string | null;
334
+ profilePictureThumbnail: string | null;
335
+ } | null;
336
+ };
337
+ studentId: string;
338
+ note: string | null;
339
+ excusedByExcusalId: string | null;
340
+ updatedById: string | null;
341
+ excusedByExcusal: {
342
+ id: string;
343
+ reason: string;
344
+ startDate: Date;
345
+ endDate: Date;
346
+ revokedAt: Date | null;
347
+ note: string | null;
348
+ } | null;
349
+ }[];
204
350
  } & {
205
351
  id: string;
206
352
  classId: string;
207
353
  eventId: string | null;
208
354
  date: Date;
209
355
  })[]>;
210
- /** Create an attendance record. */
356
+ /** Create an attendance session with legacy lists + per-student records. */
211
357
  export declare function createAttendance(data: {
212
358
  classId: string;
213
359
  eventId?: string | null;
360
+ date?: Date;
214
361
  presentIds: string[];
215
362
  lateIds?: string[];
216
363
  absentIds?: string[];
217
- }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
364
+ excusedIds?: string[];
365
+ records?: Array<{
366
+ studentId: string;
367
+ status: AttendanceStatus;
368
+ note?: string | null;
369
+ excusedByExcusalId?: string | null;
370
+ updatedById?: string | null;
371
+ }>;
372
+ updatedById?: string | null;
373
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
218
374
  result: {
219
375
  userProfile: {
220
376
  profilePicture: () => {
@@ -258,6 +414,24 @@ export declare function createAttendance(data: {
258
414
  id: string;
259
415
  username: string;
260
416
  }[];
417
+ records: {
418
+ status: import(".prisma/client").$Enums.AttendanceStatus;
419
+ id: string;
420
+ updatedAt: Date;
421
+ student: {
422
+ id: string;
423
+ username: string;
424
+ };
425
+ studentId: string;
426
+ note: string | null;
427
+ excusedByExcusalId: string | null;
428
+ updatedById: string | null;
429
+ excusedByExcusal: {
430
+ id: string;
431
+ reason: string;
432
+ note: string | null;
433
+ } | null;
434
+ }[];
261
435
  } & {
262
436
  id: string;
263
437
  classId: string;
@@ -268,8 +442,19 @@ export declare function createAttendance(data: {
268
442
  export declare function createAttendanceForEvent(data: {
269
443
  classId: string;
270
444
  eventId: string;
445
+ date?: Date;
271
446
  presentIds: string[];
272
- }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
447
+ lateIds?: string[];
448
+ absentIds?: string[];
449
+ excusedIds?: string[];
450
+ records?: Array<{
451
+ studentId: string;
452
+ status: AttendanceStatus;
453
+ note?: string | null;
454
+ excusedByExcusalId?: string | null;
455
+ updatedById?: string | null;
456
+ }>;
457
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
273
458
  result: {
274
459
  userProfile: {
275
460
  profilePicture: () => {
@@ -294,17 +479,195 @@ export declare function createAttendanceForEvent(data: {
294
479
  query: {};
295
480
  client: {};
296
481
  }, {}>, "Attendance", "create", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
482
+ event: {
483
+ id: string;
484
+ location: string | null;
485
+ name: string | null;
486
+ startTime: Date;
487
+ endTime: Date;
488
+ } | null;
489
+ present: {
490
+ id: string;
491
+ username: string;
492
+ }[];
493
+ late: {
494
+ id: string;
495
+ username: string;
496
+ }[];
497
+ absent: {
498
+ id: string;
499
+ username: string;
500
+ }[];
501
+ records: {
502
+ status: import(".prisma/client").$Enums.AttendanceStatus;
503
+ id: string;
504
+ updatedAt: Date;
505
+ student: {
506
+ id: string;
507
+ username: string;
508
+ };
509
+ studentId: string;
510
+ note: string | null;
511
+ excusedByExcusalId: string | null;
512
+ updatedById: string | null;
513
+ excusedByExcusal: {
514
+ id: string;
515
+ reason: string;
516
+ note: string | null;
517
+ } | null;
518
+ }[];
519
+ } & {
297
520
  id: string;
298
521
  classId: string;
299
522
  eventId: string | null;
300
523
  date: Date;
301
524
  }>;
302
- /** Update attendance present/late/absent lists. */
525
+ /** Update attendance present/late/absent lists and sync per-student records. */
303
526
  export declare function updateAttendance(id: string, data: {
304
527
  presentIds: string[];
305
528
  lateIds: string[];
306
529
  absentIds: string[];
307
- }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
530
+ records: Array<{
531
+ studentId: string;
532
+ status: AttendanceStatus;
533
+ note?: string | null;
534
+ excusedByExcusalId?: string | null;
535
+ updatedById?: string | null;
536
+ }>;
537
+ }): Promise<{
538
+ event: {
539
+ id: string;
540
+ location: string | null;
541
+ name: string | null;
542
+ startTime: Date;
543
+ endTime: Date;
544
+ } | null;
545
+ present: {
546
+ id: string;
547
+ username: string;
548
+ }[];
549
+ late: {
550
+ id: string;
551
+ username: string;
552
+ }[];
553
+ absent: {
554
+ id: string;
555
+ username: string;
556
+ }[];
557
+ records: {
558
+ status: import(".prisma/client").$Enums.AttendanceStatus;
559
+ id: string;
560
+ updatedAt: Date;
561
+ student: {
562
+ id: string;
563
+ username: string;
564
+ };
565
+ studentId: string;
566
+ note: string | null;
567
+ excusedByExcusalId: string | null;
568
+ updatedById: string | null;
569
+ excusedByExcusal: {
570
+ id: string;
571
+ reason: string;
572
+ note: string | null;
573
+ } | null;
574
+ }[];
575
+ } & {
576
+ id: string;
577
+ classId: string;
578
+ eventId: string | null;
579
+ date: Date;
580
+ }>;
581
+ /** Active (non-revoked) excusals covering a calendar date for given students. */
582
+ export declare function findActiveExcusalsForStudents(input: {
583
+ schoolId: string;
584
+ studentIds: string[];
585
+ date: Date;
586
+ }): Promise<never[]> | import("@prisma/client/runtime/library.js").PrismaPromise<({
587
+ students: {
588
+ studentId: string;
589
+ }[];
590
+ } & {
591
+ id: string;
592
+ createdAt: Date;
593
+ updatedAt: Date;
594
+ schoolId: string;
595
+ reason: string;
596
+ startDate: Date;
597
+ endDate: Date;
598
+ createdById: string;
599
+ revokedAt: Date | null;
600
+ note: string | null;
601
+ revokedById: string | null;
602
+ })[]>;
603
+ /** Active excusals overlapping a date range for school students. */
604
+ export declare function findActiveExcusalsInRange(input: {
605
+ schoolId: string;
606
+ studentIds?: string[];
607
+ startDate: Date;
608
+ endDate: Date;
609
+ }): import("@prisma/client/runtime/library.js").PrismaPromise<({
610
+ students: {
611
+ studentId: string;
612
+ }[];
613
+ } & {
614
+ id: string;
615
+ createdAt: Date;
616
+ updatedAt: Date;
617
+ schoolId: string;
618
+ reason: string;
619
+ startDate: Date;
620
+ endDate: Date;
621
+ createdById: string;
622
+ revokedAt: Date | null;
623
+ note: string | null;
624
+ revokedById: string | null;
625
+ })[]>;
626
+ export declare function listExcusalsForSchool(input: {
627
+ schoolId: string;
628
+ includeRevoked?: boolean;
629
+ studentId?: string;
630
+ }): import("@prisma/client/runtime/library.js").PrismaPromise<({
631
+ students: {
632
+ student: {
633
+ id: string;
634
+ username: string;
635
+ profile: {
636
+ profilePicture: string | null;
637
+ displayName: string | null;
638
+ profilePictureThumbnail: string | null;
639
+ } | null;
640
+ };
641
+ studentId: string;
642
+ }[];
643
+ createdBy: {
644
+ id: string;
645
+ username: string;
646
+ profile: {
647
+ displayName: string | null;
648
+ } | null;
649
+ };
650
+ revokedBy: {
651
+ id: string;
652
+ username: string;
653
+ profile: {
654
+ displayName: string | null;
655
+ } | null;
656
+ } | null;
657
+ } & {
658
+ id: string;
659
+ createdAt: Date;
660
+ updatedAt: Date;
661
+ schoolId: string;
662
+ reason: string;
663
+ startDate: Date;
664
+ endDate: Date;
665
+ createdById: string;
666
+ revokedAt: Date | null;
667
+ note: string | null;
668
+ revokedById: string | null;
669
+ })[]>;
670
+ export declare function findExcusalById(excusalId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
308
671
  result: {
309
672
  userProfile: {
310
673
  profilePicture: () => {
@@ -328,30 +691,305 @@ export declare function updateAttendance(id: string, data: {
328
691
  model: {};
329
692
  query: {};
330
693
  client: {};
331
- }, {}>, "Attendance", "update", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
332
- event: {
694
+ }, {}>, "StudentExcusal", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<({
695
+ students: {
696
+ studentId: string;
697
+ }[];
698
+ createdBy: {
333
699
  id: string;
334
- location: string | null;
335
- name: string | null;
336
- startTime: Date;
337
- endTime: Date;
338
- } | null;
339
- present: {
700
+ username: string;
701
+ profile: {
702
+ displayName: string | null;
703
+ } | null;
704
+ };
705
+ revokedBy: {
340
706
  id: string;
341
707
  username: string;
708
+ profile: {
709
+ displayName: string | null;
710
+ } | null;
711
+ } | null;
712
+ } & {
713
+ id: string;
714
+ createdAt: Date;
715
+ updatedAt: Date;
716
+ schoolId: string;
717
+ reason: string;
718
+ startDate: Date;
719
+ endDate: Date;
720
+ createdById: string;
721
+ revokedAt: Date | null;
722
+ note: string | null;
723
+ revokedById: string | null;
724
+ }) | null>;
725
+ export declare function createStudentExcusal(data: {
726
+ schoolId: string;
727
+ studentIds: string[];
728
+ startDate: Date;
729
+ endDate: Date;
730
+ reason: string;
731
+ note?: string | null;
732
+ createdById: string;
733
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
734
+ result: {
735
+ userProfile: {
736
+ profilePicture: () => {
737
+ needs: {
738
+ profilePicture: true;
739
+ };
740
+ compute(profile: {
741
+ profilePicture: string | null;
742
+ }): string | null;
743
+ };
744
+ profilePictureThumbnail: () => {
745
+ needs: {
746
+ profilePictureThumbnail: true;
747
+ };
748
+ compute(profile: {
749
+ profilePictureThumbnail: string | null;
750
+ }): string | null;
751
+ };
752
+ };
753
+ };
754
+ model: {};
755
+ query: {};
756
+ client: {};
757
+ }, {}>, "StudentExcusal", "create", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
758
+ students: {
759
+ student: {
760
+ id: string;
761
+ username: string;
762
+ profile: {
763
+ profilePicture: string | null;
764
+ displayName: string | null;
765
+ profilePictureThumbnail: string | null;
766
+ } | null;
767
+ };
768
+ studentId: string;
342
769
  }[];
343
- late: {
770
+ createdBy: {
771
+ id: string;
772
+ username: string;
773
+ profile: {
774
+ displayName: string | null;
775
+ } | null;
776
+ };
777
+ revokedBy: {
344
778
  id: string;
345
779
  username: string;
780
+ profile: {
781
+ displayName: string | null;
782
+ } | null;
783
+ } | null;
784
+ } & {
785
+ id: string;
786
+ createdAt: Date;
787
+ updatedAt: Date;
788
+ schoolId: string;
789
+ reason: string;
790
+ startDate: Date;
791
+ endDate: Date;
792
+ createdById: string;
793
+ revokedAt: Date | null;
794
+ note: string | null;
795
+ revokedById: string | null;
796
+ }>;
797
+ export declare function updateStudentExcusal(excusalId: string, data: {
798
+ studentIds?: string[];
799
+ startDate?: Date;
800
+ endDate?: Date;
801
+ reason?: string;
802
+ note?: string | null;
803
+ }): Promise<{
804
+ students: {
805
+ student: {
806
+ id: string;
807
+ username: string;
808
+ profile: {
809
+ profilePicture: string | null;
810
+ displayName: string | null;
811
+ profilePictureThumbnail: string | null;
812
+ } | null;
813
+ };
814
+ studentId: string;
346
815
  }[];
347
- absent: {
816
+ createdBy: {
817
+ id: string;
818
+ username: string;
819
+ profile: {
820
+ displayName: string | null;
821
+ } | null;
822
+ };
823
+ revokedBy: {
348
824
  id: string;
349
825
  username: string;
826
+ profile: {
827
+ displayName: string | null;
828
+ } | null;
829
+ } | null;
830
+ } & {
831
+ id: string;
832
+ createdAt: Date;
833
+ updatedAt: Date;
834
+ schoolId: string;
835
+ reason: string;
836
+ startDate: Date;
837
+ endDate: Date;
838
+ createdById: string;
839
+ revokedAt: Date | null;
840
+ note: string | null;
841
+ revokedById: string | null;
842
+ }>;
843
+ export declare function revokeStudentExcusal(excusalId: string, revokedById: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
844
+ result: {
845
+ userProfile: {
846
+ profilePicture: () => {
847
+ needs: {
848
+ profilePicture: true;
849
+ };
850
+ compute(profile: {
851
+ profilePicture: string | null;
852
+ }): string | null;
853
+ };
854
+ profilePictureThumbnail: () => {
855
+ needs: {
856
+ profilePictureThumbnail: true;
857
+ };
858
+ compute(profile: {
859
+ profilePictureThumbnail: string | null;
860
+ }): string | null;
861
+ };
862
+ };
863
+ };
864
+ model: {};
865
+ query: {};
866
+ client: {};
867
+ }, {}>, "StudentExcusal", "update", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
868
+ students: {
869
+ student: {
870
+ id: string;
871
+ username: string;
872
+ profile: {
873
+ profilePicture: string | null;
874
+ displayName: string | null;
875
+ profilePictureThumbnail: string | null;
876
+ } | null;
877
+ };
878
+ studentId: string;
350
879
  }[];
880
+ createdBy: {
881
+ id: string;
882
+ username: string;
883
+ profile: {
884
+ displayName: string | null;
885
+ } | null;
886
+ };
887
+ revokedBy: {
888
+ id: string;
889
+ username: string;
890
+ profile: {
891
+ displayName: string | null;
892
+ } | null;
893
+ } | null;
351
894
  } & {
895
+ id: string;
896
+ createdAt: Date;
897
+ updatedAt: Date;
898
+ schoolId: string;
899
+ reason: string;
900
+ startDate: Date;
901
+ endDate: Date;
902
+ createdById: string;
903
+ revokedAt: Date | null;
904
+ note: string | null;
905
+ revokedById: string | null;
906
+ }>;
907
+ /** Apply EXCUSED status for an excusal across matching class attendance sessions. */
908
+ export declare function applyExcusalToAttendance(input: {
909
+ schoolId: string;
910
+ excusalId: string;
911
+ studentIds: string[];
912
+ startDate: Date;
913
+ endDate: Date;
914
+ updatedById?: string | null;
915
+ }): Promise<{
916
+ sessionsTouched: number;
917
+ recordsUpserted: number;
918
+ }>;
919
+ /** Clear EXCUSED locks tied to a revoked/updated excusal (leave status EXCUSED unless cleared). */
920
+ export declare function clearExcusalLocks(excusalId: string): Promise<import("@prisma/client/runtime/library.js").GetBatchResult>;
921
+ export declare function listSchoolStudentMemberships(schoolId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
922
+ user: {
923
+ id: string;
924
+ username: string;
925
+ profile: {
926
+ profilePicture: string | null;
927
+ displayName: string | null;
928
+ profilePictureThumbnail: string | null;
929
+ } | null;
930
+ studentIn: {
931
+ section: string;
932
+ id: string;
933
+ name: string;
934
+ subject: string;
935
+ }[];
936
+ };
937
+ userId: string;
938
+ }[]>;
939
+ export declare function listAttendanceRecordsForSchoolStudents(input: {
940
+ schoolId: string;
941
+ studentIds: string[];
942
+ from?: Date;
943
+ to?: Date;
944
+ }): Promise<never[]> | import("@prisma/client/runtime/library.js").PrismaPromise<{
945
+ status: import(".prisma/client").$Enums.AttendanceStatus;
946
+ attendance: {
947
+ class: {
948
+ id: string;
949
+ name: string;
950
+ };
951
+ event: {
952
+ id: string;
953
+ name: string | null;
954
+ startTime: Date;
955
+ } | null;
956
+ id: string;
957
+ classId: string;
958
+ eventId: string | null;
959
+ date: Date;
960
+ };
961
+ studentId: string;
962
+ }[]>;
963
+ export declare function listTodaySchoolAttendanceSessions(schoolId: string, day: Date): import("@prisma/client/runtime/library.js").PrismaPromise<{
964
+ class: {
965
+ section: string;
966
+ id: string;
967
+ name: string;
968
+ _count: {
969
+ students: number;
970
+ };
971
+ subject: string;
972
+ };
973
+ event: {
974
+ id: string;
975
+ name: string | null;
976
+ startTime: Date;
977
+ endTime: Date;
978
+ } | null;
352
979
  id: string;
353
980
  classId: string;
354
981
  eventId: string | null;
355
982
  date: Date;
983
+ records: {
984
+ status: import(".prisma/client").$Enums.AttendanceStatus;
985
+ studentId: string;
986
+ }[];
987
+ }[]>;
988
+ export declare function toDateOnly(date: Date): Date;
989
+ export declare function startOfUtcDay(date: Date): Date;
990
+ export declare function endOfUtcDay(date: Date): Date;
991
+ export type { AttendanceStatus };
992
+ export type AttendanceIncludeResult = Prisma.AttendanceGetPayload<{
993
+ include: typeof attendanceInclude;
356
994
  }>;
357
995
  //# sourceMappingURL=attendance.d.ts.map