@brite-future-schools-contracts/contracts 2.0.12 → 2.0.16
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/chunk-NCAGCDZV.js +1 -0
- package/dist/{chunk-TTAZOH4Y.js → chunk-TBCAMVHG.js} +99 -60
- package/dist/chunk-TBCAMVHG.js.map +1 -0
- package/dist/{chunk-YQELK62C.js → chunk-ZHUFBLV5.js} +50 -3
- package/dist/chunk-ZHUFBLV5.js.map +1 -0
- package/dist/contracts/index.cjs +125 -56
- package/dist/contracts/index.cjs.map +1 -1
- package/dist/contracts/index.d.cts +275 -253
- package/dist/contracts/index.d.ts +275 -253
- package/dist/contracts/index.js +22 -2
- package/dist/index.cjs +180 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -18
- package/dist/index.d.ts +26 -18
- package/dist/index.js +43 -5
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +107 -59
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +122 -158
- package/dist/schemas/index.d.ts +122 -158
- package/dist/schemas/index.js +22 -4
- package/package.json +5 -3
- package/dist/chunk-PDCM3NIB.js +0 -1
- package/dist/chunk-TTAZOH4Y.js.map +0 -1
- package/dist/chunk-YQELK62C.js.map +0 -1
- /package/dist/{chunk-PDCM3NIB.js.map → chunk-NCAGCDZV.js.map} +0 -0
package/dist/contracts/index.js
CHANGED
|
@@ -2,59 +2,79 @@ import {
|
|
|
2
2
|
attendanceContract,
|
|
3
3
|
authContract,
|
|
4
4
|
bulkUploadStudentsContract,
|
|
5
|
+
calendarContract,
|
|
6
|
+
calendarListTermsContract,
|
|
5
7
|
changePasswordContract,
|
|
6
8
|
createDepartmentContract,
|
|
9
|
+
createGradeContract,
|
|
7
10
|
createStaffContract,
|
|
8
11
|
createStudentContract,
|
|
12
|
+
createTermContract,
|
|
13
|
+
createYearContract,
|
|
9
14
|
getByClassContract,
|
|
10
15
|
getByStudentContract,
|
|
11
16
|
getMeContract,
|
|
12
17
|
getStaffByIdContract,
|
|
13
18
|
getStudentByIdContract,
|
|
19
|
+
gradesContract,
|
|
14
20
|
hrContract,
|
|
15
21
|
linkGuardianContract,
|
|
16
22
|
listClassesContract,
|
|
17
23
|
listDepartmentsContract,
|
|
24
|
+
listGradesContract,
|
|
18
25
|
listStaffContract,
|
|
19
26
|
listStudentsContract,
|
|
20
27
|
listTermsContract,
|
|
28
|
+
listYearsContract,
|
|
21
29
|
loginContract,
|
|
22
30
|
logoutContract,
|
|
23
31
|
markAttendanceContract,
|
|
24
32
|
refreshTokenContract,
|
|
25
33
|
requestPasswordResetContract,
|
|
26
34
|
resetPasswordContract,
|
|
35
|
+
setCurrentTermContract,
|
|
36
|
+
setCurrentYearContract,
|
|
27
37
|
studentsContract,
|
|
28
38
|
switchBranchContract,
|
|
29
39
|
updateStaffStatusContract
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import "../chunk-
|
|
40
|
+
} from "../chunk-ZHUFBLV5.js";
|
|
41
|
+
import "../chunk-TBCAMVHG.js";
|
|
32
42
|
export {
|
|
33
43
|
attendanceContract,
|
|
34
44
|
authContract,
|
|
35
45
|
bulkUploadStudentsContract,
|
|
46
|
+
calendarContract,
|
|
47
|
+
calendarListTermsContract,
|
|
36
48
|
changePasswordContract,
|
|
37
49
|
createDepartmentContract,
|
|
50
|
+
createGradeContract,
|
|
38
51
|
createStaffContract,
|
|
39
52
|
createStudentContract,
|
|
53
|
+
createTermContract,
|
|
54
|
+
createYearContract,
|
|
40
55
|
getByClassContract,
|
|
41
56
|
getByStudentContract,
|
|
42
57
|
getMeContract,
|
|
43
58
|
getStaffByIdContract,
|
|
44
59
|
getStudentByIdContract,
|
|
60
|
+
gradesContract,
|
|
45
61
|
hrContract,
|
|
46
62
|
linkGuardianContract,
|
|
47
63
|
listClassesContract,
|
|
48
64
|
listDepartmentsContract,
|
|
65
|
+
listGradesContract,
|
|
49
66
|
listStaffContract,
|
|
50
67
|
listStudentsContract,
|
|
51
68
|
listTermsContract,
|
|
69
|
+
listYearsContract,
|
|
52
70
|
loginContract,
|
|
53
71
|
logoutContract,
|
|
54
72
|
markAttendanceContract,
|
|
55
73
|
refreshTokenContract,
|
|
56
74
|
requestPasswordResetContract,
|
|
57
75
|
resetPasswordContract,
|
|
76
|
+
setCurrentTermContract,
|
|
77
|
+
setCurrentYearContract,
|
|
58
78
|
studentsContract,
|
|
59
79
|
switchBranchContract,
|
|
60
80
|
updateStaffStatusContract
|
package/dist/index.cjs
CHANGED
|
@@ -30,6 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
AcademicTermSchema: () => AcademicTermSchema,
|
|
34
|
+
AcademicYearSchema: () => AcademicYearSchema,
|
|
33
35
|
AttendanceRecordInputSchema: () => AttendanceRecordInputSchema,
|
|
34
36
|
AttendanceStatusSchema: () => AttendanceStatusSchema,
|
|
35
37
|
BranchRefSchema: () => BranchRefSchema,
|
|
@@ -40,20 +42,26 @@ __export(src_exports, {
|
|
|
40
42
|
ClassAttendanceRowSchema: () => ClassAttendanceRowSchema,
|
|
41
43
|
ClassSummarySchema: () => ClassSummarySchema,
|
|
42
44
|
CreateDepartmentInputSchema: () => CreateDepartmentInputSchema,
|
|
45
|
+
CreateGradeInputSchema: () => CreateGradeInputSchema,
|
|
43
46
|
CreateStaffInputSchema: () => CreateStaffInputSchema,
|
|
44
47
|
CreateStaffOutputSchema: () => CreateStaffOutputSchema,
|
|
45
48
|
CreateStudentInputSchema: () => CreateStudentInputSchema,
|
|
46
49
|
CreateStudentOutputSchema: () => CreateStudentOutputSchema,
|
|
50
|
+
CreateTermInputSchema: () => CreateTermInputSchema,
|
|
51
|
+
CreateYearInputSchema: () => CreateYearInputSchema,
|
|
47
52
|
CuidSchema: () => CuidSchema,
|
|
48
53
|
DepartmentSchema: () => DepartmentSchema,
|
|
49
54
|
EmploymentTypeSchema: () => EmploymentTypeSchema,
|
|
55
|
+
GRADE_LEVELS: () => GRADE_LEVELS,
|
|
50
56
|
GenderSchema: () => GenderSchema,
|
|
51
57
|
GetByClassInputSchema: () => GetByClassInputSchema,
|
|
52
58
|
GetByStudentInputSchema: () => GetByStudentInputSchema,
|
|
53
59
|
GradeLevelSchema: () => GradeLevelSchema,
|
|
60
|
+
GradeSchema: () => GradeSchema,
|
|
54
61
|
LinkGuardianInputSchema: () => LinkGuardianInputSchema,
|
|
55
62
|
ListStaffInputSchema: () => ListStaffInputSchema,
|
|
56
63
|
ListStudentsInputSchema: () => ListStudentsInputSchema,
|
|
64
|
+
ListTermsInputSchema: () => ListTermsInputSchema,
|
|
57
65
|
LoginInputSchema: () => LoginInputSchema,
|
|
58
66
|
LoginOutputSchema: () => LoginOutputSchema,
|
|
59
67
|
LogoutInputSchema: () => LogoutInputSchema,
|
|
@@ -64,10 +72,11 @@ __export(src_exports, {
|
|
|
64
72
|
RefreshTokenOutputSchema: () => RefreshTokenOutputSchema,
|
|
65
73
|
RequestPasswordResetInputSchema: () => RequestPasswordResetInputSchema,
|
|
66
74
|
ResetPasswordInputSchema: () => ResetPasswordInputSchema,
|
|
67
|
-
RoleNameSchema: () => RoleNameSchema,
|
|
68
75
|
SessionUserOutputSchema: () => SessionUserOutputSchema,
|
|
69
76
|
SessionUserRoleSchema: () => SessionUserRoleSchema,
|
|
70
77
|
SessionUserSubRoleSchema: () => SessionUserSubRoleSchema,
|
|
78
|
+
SetCurrentTermInputSchema: () => SetCurrentTermInputSchema,
|
|
79
|
+
SetCurrentYearInputSchema: () => SetCurrentYearInputSchema,
|
|
71
80
|
SoftDeleteSchema: () => SoftDeleteSchema,
|
|
72
81
|
StaffListItemSchema: () => StaffListItemSchema,
|
|
73
82
|
StaffProfileSchema: () => StaffProfileSchema,
|
|
@@ -82,6 +91,8 @@ __export(src_exports, {
|
|
|
82
91
|
attendanceContract: () => attendanceContract,
|
|
83
92
|
authContract: () => authContract,
|
|
84
93
|
bulkUploadStudentsContract: () => bulkUploadStudentsContract,
|
|
94
|
+
calendarContract: () => calendarContract,
|
|
95
|
+
calendarListTermsContract: () => calendarListTermsContract,
|
|
85
96
|
canAccessAdminDashboard: () => canAccessAdminDashboard,
|
|
86
97
|
canAssignClassTeacher: () => canAssignClassTeacher,
|
|
87
98
|
canManageStaff: () => canManageStaff,
|
|
@@ -95,13 +106,17 @@ __export(src_exports, {
|
|
|
95
106
|
canViewStudentList: () => canViewStudentList,
|
|
96
107
|
changePasswordContract: () => changePasswordContract,
|
|
97
108
|
createDepartmentContract: () => createDepartmentContract,
|
|
109
|
+
createGradeContract: () => createGradeContract,
|
|
98
110
|
createStaffContract: () => createStaffContract,
|
|
99
111
|
createStudentContract: () => createStudentContract,
|
|
112
|
+
createTermContract: () => createTermContract,
|
|
113
|
+
createYearContract: () => createYearContract,
|
|
100
114
|
getByClassContract: () => getByClassContract,
|
|
101
115
|
getByStudentContract: () => getByStudentContract,
|
|
102
116
|
getMeContract: () => getMeContract,
|
|
103
117
|
getStaffByIdContract: () => getStaffByIdContract,
|
|
104
118
|
getStudentByIdContract: () => getStudentByIdContract,
|
|
119
|
+
gradesContract: () => gradesContract,
|
|
105
120
|
hrContract: () => hrContract,
|
|
106
121
|
isBoardingMaster: () => isBoardingMaster,
|
|
107
122
|
isBursar: () => isBursar,
|
|
@@ -135,9 +150,11 @@ __export(src_exports, {
|
|
|
135
150
|
linkGuardianContract: () => linkGuardianContract,
|
|
136
151
|
listClassesContract: () => listClassesContract,
|
|
137
152
|
listDepartmentsContract: () => listDepartmentsContract,
|
|
153
|
+
listGradesContract: () => listGradesContract,
|
|
138
154
|
listStaffContract: () => listStaffContract,
|
|
139
155
|
listStudentsContract: () => listStudentsContract,
|
|
140
156
|
listTermsContract: () => listTermsContract,
|
|
157
|
+
listYearsContract: () => listYearsContract,
|
|
141
158
|
loginContract: () => loginContract,
|
|
142
159
|
logoutContract: () => logoutContract,
|
|
143
160
|
markAttendanceContract: () => markAttendanceContract,
|
|
@@ -145,6 +162,8 @@ __export(src_exports, {
|
|
|
145
162
|
refreshTokenContract: () => refreshTokenContract,
|
|
146
163
|
requestPasswordResetContract: () => requestPasswordResetContract,
|
|
147
164
|
resetPasswordContract: () => resetPasswordContract,
|
|
165
|
+
setCurrentTermContract: () => setCurrentTermContract,
|
|
166
|
+
setCurrentYearContract: () => setCurrentYearContract,
|
|
148
167
|
studentsContract: () => studentsContract,
|
|
149
168
|
switchBranchContract: () => switchBranchContract,
|
|
150
169
|
updateStaffStatusContract: () => updateStaffStatusContract
|
|
@@ -166,15 +185,15 @@ var SoftDeleteSchema = z.object({
|
|
|
166
185
|
})
|
|
167
186
|
});
|
|
168
187
|
var PaginationInputSchema = z.object({
|
|
169
|
-
cursor:
|
|
188
|
+
cursor: z.string().optional().meta({
|
|
170
189
|
description: "Opaque cursor from the previous page response"
|
|
171
190
|
}),
|
|
172
|
-
limit: z.int().min(1).max(
|
|
191
|
+
limit: z.int().min(1).max(200).default(20).meta({ description: "Number of items to return (1\u2013200, default 20)" })
|
|
173
192
|
});
|
|
174
193
|
function paginatedOutputSchema(itemSchema) {
|
|
175
194
|
return z.object({
|
|
176
195
|
items: z.array(itemSchema),
|
|
177
|
-
nextCursor:
|
|
196
|
+
nextCursor: z.string().nullable().meta({
|
|
178
197
|
description: "Pass as `cursor` on the next request; null when no more pages"
|
|
179
198
|
}),
|
|
180
199
|
total: z.int().nonnegative().meta({ description: "Total matching records (before pagination)" })
|
|
@@ -264,35 +283,6 @@ var EmploymentTypeSchema = z3.enum([
|
|
|
264
283
|
"temporary",
|
|
265
284
|
"intern"
|
|
266
285
|
]);
|
|
267
|
-
var RoleNameSchema = z3.enum([
|
|
268
|
-
"PROPRIETOR",
|
|
269
|
-
"DIRECTOR",
|
|
270
|
-
"SYSTEM_ADMIN",
|
|
271
|
-
"PRINCIPAL",
|
|
272
|
-
"DEPUTY_PRINCIPAL",
|
|
273
|
-
"HOD",
|
|
274
|
-
"CLASS_TEACHER",
|
|
275
|
-
"SUBJECT_TEACHER",
|
|
276
|
-
"BURSAR",
|
|
277
|
-
"HR_ADMIN",
|
|
278
|
-
"SCHOOL_NURSE",
|
|
279
|
-
"LIBRARIAN",
|
|
280
|
-
"LAB_TECHNICIAN",
|
|
281
|
-
"SPORTS_COACH",
|
|
282
|
-
"COUNSELLOR",
|
|
283
|
-
"CARETAKER",
|
|
284
|
-
"SECURITY",
|
|
285
|
-
"KITCHEN_STAFF",
|
|
286
|
-
"KITCHEN_MANAGER",
|
|
287
|
-
"DRIVER",
|
|
288
|
-
"IT_ADMIN",
|
|
289
|
-
"BOARDING_MASTER",
|
|
290
|
-
"PREFECT",
|
|
291
|
-
"STUDENT",
|
|
292
|
-
"PARENT",
|
|
293
|
-
"ORG_SPONSOR",
|
|
294
|
-
"INDIVIDUAL_SPONSOR"
|
|
295
|
-
]);
|
|
296
286
|
var CreateStaffInputSchema = z3.object({
|
|
297
287
|
// Personal details
|
|
298
288
|
firstName: z3.string().min(1).max(100),
|
|
@@ -301,9 +291,9 @@ var CreateStaffInputSchema = z3.object({
|
|
|
301
291
|
email: z3.email(),
|
|
302
292
|
phone: z3.string().min(9).max(30),
|
|
303
293
|
nationalId: z3.string().min(1).max(20),
|
|
304
|
-
// Role assignment
|
|
305
|
-
roleName:
|
|
306
|
-
description: "
|
|
294
|
+
// Role assignment — DB-driven, any valid role code accepted
|
|
295
|
+
roleName: z3.string().min(1).meta({
|
|
296
|
+
description: "Role code from the roles table \u2014 e.g. TEACHER, PRINCIPAL"
|
|
307
297
|
}),
|
|
308
298
|
isPrimaryRole: z3.boolean().default(true),
|
|
309
299
|
// Employment details
|
|
@@ -314,24 +304,19 @@ var CreateStaffInputSchema = z3.object({
|
|
|
314
304
|
employmentType: EmploymentTypeSchema,
|
|
315
305
|
contractStart: z3.iso.date().meta({ description: "ISO date, e.g. 2026-01-15" }),
|
|
316
306
|
contractEnd: z3.iso.date().optional(),
|
|
317
|
-
//
|
|
318
|
-
basicSalary: z3.number().positive(),
|
|
319
|
-
houseAllowance: z3.number().nonnegative().default(0),
|
|
320
|
-
transportAllowance: z3.number().nonnegative().default(0),
|
|
321
|
-
helbDeduction: z3.number().nonnegative().default(0),
|
|
322
|
-
saccoDeduction: z3.number().nonnegative().default(0),
|
|
323
|
-
// Banking
|
|
307
|
+
// Banking (optional at creation — can be completed later)
|
|
324
308
|
bankName: z3.string().max(100).optional(),
|
|
325
309
|
bankAccount: z3.string().max(30).optional(),
|
|
326
310
|
bankBranch: z3.string().max(100).optional(),
|
|
327
|
-
// Statutory
|
|
311
|
+
// Statutory (optional at creation)
|
|
328
312
|
tscNumber: z3.string().max(30).optional(),
|
|
329
313
|
kraPin: z3.string().max(20).optional(),
|
|
330
314
|
nhifNo: z3.string().max(20).optional(),
|
|
331
|
-
nssfNo: z3.string().max(20).optional()
|
|
315
|
+
nssfNo: z3.string().max(20).optional(),
|
|
316
|
+
helbNo: z3.string().max(20).optional(),
|
|
317
|
+
saccoNo: z3.string().max(20).optional()
|
|
332
318
|
});
|
|
333
319
|
var StaffProfileSchema = z3.object({
|
|
334
|
-
// Staff record
|
|
335
320
|
id: UuidSchema,
|
|
336
321
|
userId: UuidSchema,
|
|
337
322
|
branchId: UuidSchema,
|
|
@@ -344,28 +329,23 @@ var StaffProfileSchema = z3.object({
|
|
|
344
329
|
kraPin: z3.string().nullable(),
|
|
345
330
|
nhifNo: z3.string().nullable(),
|
|
346
331
|
nssfNo: z3.string().nullable(),
|
|
332
|
+
helbNo: z3.string().nullable(),
|
|
333
|
+
saccoNo: z3.string().nullable(),
|
|
347
334
|
designation: z3.string(),
|
|
348
335
|
employmentType: EmploymentTypeSchema,
|
|
349
336
|
contractStart: z3.string(),
|
|
350
337
|
contractEnd: z3.string().nullable(),
|
|
351
|
-
basicSalary: z3.string(),
|
|
352
|
-
houseAllowance: z3.string(),
|
|
353
|
-
transportAllowance: z3.string(),
|
|
354
|
-
helbDeduction: z3.string().nullable(),
|
|
355
|
-
saccoDeduction: z3.string().nullable(),
|
|
356
338
|
bankName: z3.string().nullable(),
|
|
357
339
|
bankAccount: z3.string().nullable(),
|
|
358
340
|
bankBranch: z3.string().nullable(),
|
|
359
341
|
status: z3.string(),
|
|
360
342
|
createdAt: z3.string(),
|
|
361
|
-
// From users join
|
|
362
343
|
email: z3.string(),
|
|
363
344
|
mustChangePassword: z3.boolean(),
|
|
364
|
-
// Department (nullable — not all staff are in a department)
|
|
365
345
|
departmentId: UuidSchema.nullable(),
|
|
366
346
|
departmentName: z3.string().nullable(),
|
|
367
|
-
//
|
|
368
|
-
roleName:
|
|
347
|
+
// Role — DB-driven code string, not a fixed enum
|
|
348
|
+
roleName: z3.string().nullable(),
|
|
369
349
|
roleId: UuidSchema.nullable()
|
|
370
350
|
});
|
|
371
351
|
var StaffListItemSchema = z3.object({
|
|
@@ -380,7 +360,7 @@ var StaffListItemSchema = z3.object({
|
|
|
380
360
|
employmentType: EmploymentTypeSchema,
|
|
381
361
|
status: z3.string(),
|
|
382
362
|
departmentName: z3.string().nullable(),
|
|
383
|
-
roleName:
|
|
363
|
+
roleName: z3.string().nullable(),
|
|
384
364
|
createdAt: z3.string()
|
|
385
365
|
});
|
|
386
366
|
var ListStaffInputSchema = PaginationInputSchema.extend({
|
|
@@ -388,14 +368,13 @@ var ListStaffInputSchema = PaginationInputSchema.extend({
|
|
|
388
368
|
description: "Search by name or email"
|
|
389
369
|
}),
|
|
390
370
|
departmentId: UuidSchema.optional(),
|
|
391
|
-
roleName:
|
|
371
|
+
roleName: z3.string().optional(),
|
|
392
372
|
status: z3.enum(["active", "inactive"]).optional()
|
|
393
373
|
});
|
|
394
374
|
var CreateStaffOutputSchema = z3.object({
|
|
395
375
|
staffId: UuidSchema,
|
|
396
376
|
userId: UuidSchema,
|
|
397
377
|
email: z3.string(),
|
|
398
|
-
/** Temp password was emailed — not returned in response for security */
|
|
399
378
|
emailSent: z3.boolean()
|
|
400
379
|
});
|
|
401
380
|
var DepartmentSchema = z3.object({
|
|
@@ -647,10 +626,80 @@ var StudentAttendanceRowSchema = z5.object({
|
|
|
647
626
|
className: z5.string()
|
|
648
627
|
});
|
|
649
628
|
|
|
629
|
+
// src/schemas/calendar.ts
|
|
630
|
+
var z6 = __toESM(require("zod"), 1);
|
|
631
|
+
var AcademicYearSchema = z6.object({
|
|
632
|
+
id: z6.string().uuid(),
|
|
633
|
+
branchId: z6.string().uuid(),
|
|
634
|
+
name: z6.string(),
|
|
635
|
+
startDate: z6.string(),
|
|
636
|
+
endDate: z6.string(),
|
|
637
|
+
isCurrent: z6.boolean(),
|
|
638
|
+
createdAt: z6.string()
|
|
639
|
+
});
|
|
640
|
+
var CreateYearInputSchema = z6.object({
|
|
641
|
+
name: z6.string().min(1).max(50),
|
|
642
|
+
startDate: z6.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Must be YYYY-MM-DD"),
|
|
643
|
+
endDate: z6.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Must be YYYY-MM-DD")
|
|
644
|
+
});
|
|
645
|
+
var SetCurrentYearInputSchema = z6.object({
|
|
646
|
+
yearId: z6.string().uuid()
|
|
647
|
+
});
|
|
648
|
+
var AcademicTermSchema = z6.object({
|
|
649
|
+
id: z6.string().uuid(),
|
|
650
|
+
branchId: z6.string().uuid(),
|
|
651
|
+
academicYearId: z6.string().uuid(),
|
|
652
|
+
name: z6.string(),
|
|
653
|
+
startDate: z6.string(),
|
|
654
|
+
endDate: z6.string(),
|
|
655
|
+
isCurrent: z6.boolean(),
|
|
656
|
+
createdAt: z6.string()
|
|
657
|
+
});
|
|
658
|
+
var CreateTermInputSchema = z6.object({
|
|
659
|
+
academicYearId: z6.string().uuid(),
|
|
660
|
+
name: z6.string().min(1).max(50),
|
|
661
|
+
startDate: z6.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Must be YYYY-MM-DD"),
|
|
662
|
+
endDate: z6.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Must be YYYY-MM-DD")
|
|
663
|
+
});
|
|
664
|
+
var SetCurrentTermInputSchema = z6.object({
|
|
665
|
+
termId: z6.string().uuid()
|
|
666
|
+
});
|
|
667
|
+
var ListTermsInputSchema = z6.object({
|
|
668
|
+
yearId: z6.string().uuid().optional()
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
// src/schemas/grades.ts
|
|
672
|
+
var z7 = __toESM(require("zod"), 1);
|
|
673
|
+
var GRADE_LEVELS = [
|
|
674
|
+
"PP1",
|
|
675
|
+
"PP2",
|
|
676
|
+
"G1",
|
|
677
|
+
"G2",
|
|
678
|
+
"G3",
|
|
679
|
+
"G4",
|
|
680
|
+
"G5",
|
|
681
|
+
"G6",
|
|
682
|
+
"G7",
|
|
683
|
+
"G8",
|
|
684
|
+
"G9"
|
|
685
|
+
];
|
|
686
|
+
var GradeSchema = z7.object({
|
|
687
|
+
id: z7.string().uuid(),
|
|
688
|
+
branchId: z7.string().uuid(),
|
|
689
|
+
name: z7.string(),
|
|
690
|
+
level: GradeLevelSchema,
|
|
691
|
+
description: z7.string().nullable()
|
|
692
|
+
});
|
|
693
|
+
var CreateGradeInputSchema = z7.object({
|
|
694
|
+
name: z7.string().min(1).max(50),
|
|
695
|
+
level: GradeLevelSchema,
|
|
696
|
+
description: z7.string().max(300).optional()
|
|
697
|
+
});
|
|
698
|
+
|
|
650
699
|
// src/contracts/auth.ts
|
|
651
700
|
var import_contract = require("@orpc/contract");
|
|
652
|
-
var
|
|
653
|
-
var EmptyOutputSchema =
|
|
701
|
+
var z8 = __toESM(require("zod"), 1);
|
|
702
|
+
var EmptyOutputSchema = z8.object({}).meta({ description: "Empty success response" });
|
|
654
703
|
var loginContract = import_contract.oc.route({ method: "POST", path: "/auth/login" }).input(LoginInputSchema).output(LoginOutputSchema);
|
|
655
704
|
var refreshTokenContract = import_contract.oc.route({ method: "POST", path: "/auth/refresh" }).input(RefreshTokenInputSchema).output(RefreshTokenOutputSchema);
|
|
656
705
|
var logoutContract = import_contract.oc.route({ method: "POST", path: "/auth/logout" }).input(LogoutInputSchema).output(EmptyOutputSchema);
|
|
@@ -672,20 +721,20 @@ var authContract = {
|
|
|
672
721
|
|
|
673
722
|
// src/contracts/hr.ts
|
|
674
723
|
var import_contract2 = require("@orpc/contract");
|
|
675
|
-
var
|
|
676
|
-
var EmptyOutput =
|
|
724
|
+
var z9 = __toESM(require("zod"), 1);
|
|
725
|
+
var EmptyOutput = z9.object({});
|
|
677
726
|
var createStaffContract = import_contract2.oc.route({ method: "POST", path: "/hr/staff" }).input(CreateStaffInputSchema).output(CreateStaffOutputSchema);
|
|
678
|
-
var listStaffContract = import_contract2.oc.route({ method: "GET", path: "/hr/staff" }).input(ListStaffInputSchema).output(
|
|
679
|
-
items:
|
|
680
|
-
total:
|
|
727
|
+
var listStaffContract = import_contract2.oc.route({ method: "GET", path: "/hr/staff" }).input(ListStaffInputSchema).output(z9.object({
|
|
728
|
+
items: z9.array(StaffListItemSchema),
|
|
729
|
+
total: z9.number(),
|
|
681
730
|
nextCursor: UuidSchema.nullable()
|
|
682
731
|
}));
|
|
683
|
-
var getStaffByIdContract = import_contract2.oc.route({ method: "GET", path: "/hr/staff/{id}" }).input(
|
|
684
|
-
var updateStaffStatusContract = import_contract2.oc.route({ method: "PATCH", path: "/hr/staff/{id}/status" }).input(
|
|
732
|
+
var getStaffByIdContract = import_contract2.oc.route({ method: "GET", path: "/hr/staff/{id}" }).input(z9.object({ id: UuidSchema })).output(StaffProfileSchema);
|
|
733
|
+
var updateStaffStatusContract = import_contract2.oc.route({ method: "PATCH", path: "/hr/staff/{id}/status" }).input(z9.object({
|
|
685
734
|
id: UuidSchema,
|
|
686
|
-
status:
|
|
735
|
+
status: z9.enum(["active", "inactive", "suspended"])
|
|
687
736
|
})).output(EmptyOutput);
|
|
688
|
-
var listDepartmentsContract = import_contract2.oc.route({ method: "GET", path: "/hr/departments" }).input(
|
|
737
|
+
var listDepartmentsContract = import_contract2.oc.route({ method: "GET", path: "/hr/departments" }).input(z9.object({ branchId: UuidSchema.optional() })).output(z9.array(DepartmentSchema));
|
|
689
738
|
var createDepartmentContract = import_contract2.oc.route({ method: "POST", path: "/hr/departments" }).input(CreateDepartmentInputSchema).output(DepartmentSchema);
|
|
690
739
|
var hrContract = {
|
|
691
740
|
createStaff: createStaffContract,
|
|
@@ -698,21 +747,21 @@ var hrContract = {
|
|
|
698
747
|
|
|
699
748
|
// src/contracts/students.ts
|
|
700
749
|
var import_contract3 = require("@orpc/contract");
|
|
701
|
-
var
|
|
702
|
-
var EmptyOutput2 =
|
|
750
|
+
var z10 = __toESM(require("zod"), 1);
|
|
751
|
+
var EmptyOutput2 = z10.object({});
|
|
703
752
|
var createStudentContract = import_contract3.oc.route({ method: "POST", path: "/students" }).input(CreateStudentInputSchema).output(CreateStudentOutputSchema);
|
|
704
753
|
var bulkUploadStudentsContract = import_contract3.oc.route({ method: "POST", path: "/students/bulk" }).input(BulkUploadStudentsInputSchema).output(BulkUploadStudentsOutputSchema);
|
|
705
|
-
var listStudentsContract = import_contract3.oc.route({ method: "GET", path: "/students" }).input(ListStudentsInputSchema).output(
|
|
706
|
-
items:
|
|
707
|
-
total:
|
|
754
|
+
var listStudentsContract = import_contract3.oc.route({ method: "GET", path: "/students" }).input(ListStudentsInputSchema).output(z10.object({
|
|
755
|
+
items: z10.array(StudentListItemSchema),
|
|
756
|
+
total: z10.number(),
|
|
708
757
|
nextCursor: UuidSchema.nullable()
|
|
709
758
|
}));
|
|
710
|
-
var getStudentByIdContract = import_contract3.oc.route({ method: "GET", path: "/students/{id}" }).input(
|
|
711
|
-
var linkGuardianContract = import_contract3.oc.route({ method: "POST", path: "/students/guardians" }).input(LinkGuardianInputSchema).output(
|
|
712
|
-
var listClassesContract = import_contract3.oc.route({ method: "GET", path: "/students/classes" }).input(
|
|
759
|
+
var getStudentByIdContract = import_contract3.oc.route({ method: "GET", path: "/students/{id}" }).input(z10.object({ id: UuidSchema })).output(StudentProfileSchema);
|
|
760
|
+
var linkGuardianContract = import_contract3.oc.route({ method: "POST", path: "/students/guardians" }).input(LinkGuardianInputSchema).output(z10.object({ guardianId: UuidSchema }));
|
|
761
|
+
var listClassesContract = import_contract3.oc.route({ method: "GET", path: "/students/classes" }).input(z10.object({
|
|
713
762
|
termId: UuidSchema.optional(),
|
|
714
|
-
gradeLevel:
|
|
715
|
-
})).output(
|
|
763
|
+
gradeLevel: z10.string().optional()
|
|
764
|
+
})).output(z10.array(ClassSummarySchema));
|
|
716
765
|
var studentsContract = {
|
|
717
766
|
create: createStudentContract,
|
|
718
767
|
bulkUpload: bulkUploadStudentsContract,
|
|
@@ -724,11 +773,11 @@ var studentsContract = {
|
|
|
724
773
|
|
|
725
774
|
// src/contracts/attendance.ts
|
|
726
775
|
var import_contract4 = require("@orpc/contract");
|
|
727
|
-
var
|
|
776
|
+
var z11 = __toESM(require("zod"), 1);
|
|
728
777
|
var markAttendanceContract = import_contract4.oc.route({ method: "POST", path: "/attendance/class/mark" }).input(MarkAttendanceInputSchema).output(MarkAttendanceOutputSchema);
|
|
729
|
-
var getByClassContract = import_contract4.oc.route({ method: "GET", path: "/attendance/class" }).input(GetByClassInputSchema).output(
|
|
730
|
-
var getByStudentContract = import_contract4.oc.route({ method: "GET", path: "/attendance/student" }).input(GetByStudentInputSchema).output(
|
|
731
|
-
var listTermsContract = import_contract4.oc.route({ method: "GET", path: "/terms" }).input(
|
|
778
|
+
var getByClassContract = import_contract4.oc.route({ method: "GET", path: "/attendance/class" }).input(GetByClassInputSchema).output(z11.array(ClassAttendanceRowSchema));
|
|
779
|
+
var getByStudentContract = import_contract4.oc.route({ method: "GET", path: "/attendance/student" }).input(GetByStudentInputSchema).output(z11.array(StudentAttendanceRowSchema));
|
|
780
|
+
var listTermsContract = import_contract4.oc.route({ method: "GET", path: "/terms" }).input(z11.object({})).output(z11.array(TermSchema));
|
|
732
781
|
var attendanceContract = {
|
|
733
782
|
mark: markAttendanceContract,
|
|
734
783
|
getByClass: getByClassContract,
|
|
@@ -736,6 +785,34 @@ var attendanceContract = {
|
|
|
736
785
|
listTerms: listTermsContract
|
|
737
786
|
};
|
|
738
787
|
|
|
788
|
+
// src/contracts/calendar.ts
|
|
789
|
+
var import_contract5 = require("@orpc/contract");
|
|
790
|
+
var z12 = __toESM(require("zod"), 1);
|
|
791
|
+
var listYearsContract = import_contract5.oc.route({ method: "GET", path: "/calendar/years" }).input(z12.object({})).output(z12.array(AcademicYearSchema));
|
|
792
|
+
var createYearContract = import_contract5.oc.route({ method: "POST", path: "/calendar/years" }).input(CreateYearInputSchema).output(AcademicYearSchema);
|
|
793
|
+
var setCurrentYearContract = import_contract5.oc.route({ method: "POST", path: "/calendar/years/current" }).input(SetCurrentYearInputSchema).output(AcademicYearSchema);
|
|
794
|
+
var calendarListTermsContract = import_contract5.oc.route({ method: "GET", path: "/calendar/terms" }).input(ListTermsInputSchema).output(z12.array(AcademicTermSchema));
|
|
795
|
+
var createTermContract = import_contract5.oc.route({ method: "POST", path: "/calendar/terms" }).input(CreateTermInputSchema).output(AcademicTermSchema);
|
|
796
|
+
var setCurrentTermContract = import_contract5.oc.route({ method: "POST", path: "/calendar/terms/current" }).input(SetCurrentTermInputSchema).output(AcademicTermSchema);
|
|
797
|
+
var calendarContract = {
|
|
798
|
+
listYears: listYearsContract,
|
|
799
|
+
createYear: createYearContract,
|
|
800
|
+
setCurrentYear: setCurrentYearContract,
|
|
801
|
+
listTerms: calendarListTermsContract,
|
|
802
|
+
createTerm: createTermContract,
|
|
803
|
+
setCurrentTerm: setCurrentTermContract
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
// src/contracts/grades.ts
|
|
807
|
+
var import_contract6 = require("@orpc/contract");
|
|
808
|
+
var z13 = __toESM(require("zod"), 1);
|
|
809
|
+
var listGradesContract = import_contract6.oc.route({ method: "GET", path: "/grades" }).input(z13.object({})).output(z13.array(GradeSchema));
|
|
810
|
+
var createGradeContract = import_contract6.oc.route({ method: "POST", path: "/grades" }).input(CreateGradeInputSchema).output(GradeSchema);
|
|
811
|
+
var gradesContract = {
|
|
812
|
+
list: listGradesContract,
|
|
813
|
+
create: createGradeContract
|
|
814
|
+
};
|
|
815
|
+
|
|
739
816
|
// src/roles/helpers.ts
|
|
740
817
|
function hasRole(user, role) {
|
|
741
818
|
return user.roles.some(
|
|
@@ -893,6 +970,8 @@ function canAccessAdminDashboard(user) {
|
|
|
893
970
|
}
|
|
894
971
|
// Annotate the CommonJS export names for ESM import in node:
|
|
895
972
|
0 && (module.exports = {
|
|
973
|
+
AcademicTermSchema,
|
|
974
|
+
AcademicYearSchema,
|
|
896
975
|
AttendanceRecordInputSchema,
|
|
897
976
|
AttendanceStatusSchema,
|
|
898
977
|
BranchRefSchema,
|
|
@@ -903,20 +982,26 @@ function canAccessAdminDashboard(user) {
|
|
|
903
982
|
ClassAttendanceRowSchema,
|
|
904
983
|
ClassSummarySchema,
|
|
905
984
|
CreateDepartmentInputSchema,
|
|
985
|
+
CreateGradeInputSchema,
|
|
906
986
|
CreateStaffInputSchema,
|
|
907
987
|
CreateStaffOutputSchema,
|
|
908
988
|
CreateStudentInputSchema,
|
|
909
989
|
CreateStudentOutputSchema,
|
|
990
|
+
CreateTermInputSchema,
|
|
991
|
+
CreateYearInputSchema,
|
|
910
992
|
CuidSchema,
|
|
911
993
|
DepartmentSchema,
|
|
912
994
|
EmploymentTypeSchema,
|
|
995
|
+
GRADE_LEVELS,
|
|
913
996
|
GenderSchema,
|
|
914
997
|
GetByClassInputSchema,
|
|
915
998
|
GetByStudentInputSchema,
|
|
916
999
|
GradeLevelSchema,
|
|
1000
|
+
GradeSchema,
|
|
917
1001
|
LinkGuardianInputSchema,
|
|
918
1002
|
ListStaffInputSchema,
|
|
919
1003
|
ListStudentsInputSchema,
|
|
1004
|
+
ListTermsInputSchema,
|
|
920
1005
|
LoginInputSchema,
|
|
921
1006
|
LoginOutputSchema,
|
|
922
1007
|
LogoutInputSchema,
|
|
@@ -927,10 +1012,11 @@ function canAccessAdminDashboard(user) {
|
|
|
927
1012
|
RefreshTokenOutputSchema,
|
|
928
1013
|
RequestPasswordResetInputSchema,
|
|
929
1014
|
ResetPasswordInputSchema,
|
|
930
|
-
RoleNameSchema,
|
|
931
1015
|
SessionUserOutputSchema,
|
|
932
1016
|
SessionUserRoleSchema,
|
|
933
1017
|
SessionUserSubRoleSchema,
|
|
1018
|
+
SetCurrentTermInputSchema,
|
|
1019
|
+
SetCurrentYearInputSchema,
|
|
934
1020
|
SoftDeleteSchema,
|
|
935
1021
|
StaffListItemSchema,
|
|
936
1022
|
StaffProfileSchema,
|
|
@@ -945,6 +1031,8 @@ function canAccessAdminDashboard(user) {
|
|
|
945
1031
|
attendanceContract,
|
|
946
1032
|
authContract,
|
|
947
1033
|
bulkUploadStudentsContract,
|
|
1034
|
+
calendarContract,
|
|
1035
|
+
calendarListTermsContract,
|
|
948
1036
|
canAccessAdminDashboard,
|
|
949
1037
|
canAssignClassTeacher,
|
|
950
1038
|
canManageStaff,
|
|
@@ -958,13 +1046,17 @@ function canAccessAdminDashboard(user) {
|
|
|
958
1046
|
canViewStudentList,
|
|
959
1047
|
changePasswordContract,
|
|
960
1048
|
createDepartmentContract,
|
|
1049
|
+
createGradeContract,
|
|
961
1050
|
createStaffContract,
|
|
962
1051
|
createStudentContract,
|
|
1052
|
+
createTermContract,
|
|
1053
|
+
createYearContract,
|
|
963
1054
|
getByClassContract,
|
|
964
1055
|
getByStudentContract,
|
|
965
1056
|
getMeContract,
|
|
966
1057
|
getStaffByIdContract,
|
|
967
1058
|
getStudentByIdContract,
|
|
1059
|
+
gradesContract,
|
|
968
1060
|
hrContract,
|
|
969
1061
|
isBoardingMaster,
|
|
970
1062
|
isBursar,
|
|
@@ -998,9 +1090,11 @@ function canAccessAdminDashboard(user) {
|
|
|
998
1090
|
linkGuardianContract,
|
|
999
1091
|
listClassesContract,
|
|
1000
1092
|
listDepartmentsContract,
|
|
1093
|
+
listGradesContract,
|
|
1001
1094
|
listStaffContract,
|
|
1002
1095
|
listStudentsContract,
|
|
1003
1096
|
listTermsContract,
|
|
1097
|
+
listYearsContract,
|
|
1004
1098
|
loginContract,
|
|
1005
1099
|
logoutContract,
|
|
1006
1100
|
markAttendanceContract,
|
|
@@ -1008,6 +1102,8 @@ function canAccessAdminDashboard(user) {
|
|
|
1008
1102
|
refreshTokenContract,
|
|
1009
1103
|
requestPasswordResetContract,
|
|
1010
1104
|
resetPasswordContract,
|
|
1105
|
+
setCurrentTermContract,
|
|
1106
|
+
setCurrentYearContract,
|
|
1011
1107
|
studentsContract,
|
|
1012
1108
|
switchBranchContract,
|
|
1013
1109
|
updateStaffStatusContract
|