@brite-future-schools-contracts/contracts 2.0.2 → 2.0.3
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-3OMU2YSE.js +478 -0
- package/dist/chunk-3OMU2YSE.js.map +1 -0
- package/dist/chunk-R4XE3SFR.js +1 -0
- package/dist/chunk-S3BK5YEH.js +131 -0
- package/dist/chunk-S3BK5YEH.js.map +1 -0
- package/dist/contracts/index.cjs +415 -2
- package/dist/contracts/index.cjs.map +1 -1
- package/dist/contracts/index.d.cts +941 -1
- package/dist/contracts/index.d.ts +941 -1
- package/dist/contracts/index.js +32 -4
- package/dist/index.cjs +457 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +77 -5
- package/dist/schemas/index.cjs +373 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +564 -1
- package/dist/schemas/index.d.ts +564 -1
- package/dist/schemas/index.js +46 -2
- package/package.json +1 -1
- package/dist/chunk-AEZO7MJD.js +0 -127
- package/dist/chunk-AEZO7MJD.js.map +0 -1
- package/dist/chunk-IR6JUP6L.js +0 -48
- package/dist/chunk-IR6JUP6L.js.map +0 -1
- package/dist/chunk-PCHAGP5X.js +0 -1
- /package/dist/{chunk-PCHAGP5X.js.map → chunk-R4XE3SFR.js.map} +0 -0
package/dist/contracts/index.js
CHANGED
|
@@ -1,24 +1,52 @@
|
|
|
1
1
|
import {
|
|
2
2
|
authContract,
|
|
3
|
+
bulkUploadStudentsContract,
|
|
3
4
|
changePasswordContract,
|
|
5
|
+
createDepartmentContract,
|
|
6
|
+
createStaffContract,
|
|
7
|
+
createStudentContract,
|
|
4
8
|
getMeContract,
|
|
9
|
+
getStaffByIdContract,
|
|
10
|
+
getStudentByIdContract,
|
|
11
|
+
hrContract,
|
|
12
|
+
linkGuardianContract,
|
|
13
|
+
listClassesContract,
|
|
14
|
+
listDepartmentsContract,
|
|
15
|
+
listStaffContract,
|
|
16
|
+
listStudentsContract,
|
|
5
17
|
loginContract,
|
|
6
18
|
logoutContract,
|
|
7
19
|
refreshTokenContract,
|
|
8
20
|
requestPasswordResetContract,
|
|
9
21
|
resetPasswordContract,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
22
|
+
studentsContract,
|
|
23
|
+
switchBranchContract,
|
|
24
|
+
updateStaffStatusContract
|
|
25
|
+
} from "../chunk-S3BK5YEH.js";
|
|
26
|
+
import "../chunk-3OMU2YSE.js";
|
|
13
27
|
export {
|
|
14
28
|
authContract,
|
|
29
|
+
bulkUploadStudentsContract,
|
|
15
30
|
changePasswordContract,
|
|
31
|
+
createDepartmentContract,
|
|
32
|
+
createStaffContract,
|
|
33
|
+
createStudentContract,
|
|
16
34
|
getMeContract,
|
|
35
|
+
getStaffByIdContract,
|
|
36
|
+
getStudentByIdContract,
|
|
37
|
+
hrContract,
|
|
38
|
+
linkGuardianContract,
|
|
39
|
+
listClassesContract,
|
|
40
|
+
listDepartmentsContract,
|
|
41
|
+
listStaffContract,
|
|
42
|
+
listStudentsContract,
|
|
17
43
|
loginContract,
|
|
18
44
|
logoutContract,
|
|
19
45
|
refreshTokenContract,
|
|
20
46
|
requestPasswordResetContract,
|
|
21
47
|
resetPasswordContract,
|
|
22
|
-
|
|
48
|
+
studentsContract,
|
|
49
|
+
switchBranchContract,
|
|
50
|
+
updateStaffStatusContract
|
|
23
51
|
};
|
|
24
52
|
//# sourceMappingURL=index.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -31,8 +31,24 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
BranchRefSchema: () => BranchRefSchema,
|
|
34
|
+
BulkUploadStudentRowSchema: () => BulkUploadStudentRowSchema,
|
|
35
|
+
BulkUploadStudentsInputSchema: () => BulkUploadStudentsInputSchema,
|
|
36
|
+
BulkUploadStudentsOutputSchema: () => BulkUploadStudentsOutputSchema,
|
|
34
37
|
ChangePasswordInputSchema: () => ChangePasswordInputSchema,
|
|
38
|
+
ClassSummarySchema: () => ClassSummarySchema,
|
|
39
|
+
CreateDepartmentInputSchema: () => CreateDepartmentInputSchema,
|
|
40
|
+
CreateStaffInputSchema: () => CreateStaffInputSchema,
|
|
41
|
+
CreateStaffOutputSchema: () => CreateStaffOutputSchema,
|
|
42
|
+
CreateStudentInputSchema: () => CreateStudentInputSchema,
|
|
43
|
+
CreateStudentOutputSchema: () => CreateStudentOutputSchema,
|
|
35
44
|
CuidSchema: () => CuidSchema,
|
|
45
|
+
DepartmentSchema: () => DepartmentSchema,
|
|
46
|
+
EmploymentTypeSchema: () => EmploymentTypeSchema,
|
|
47
|
+
GenderSchema: () => GenderSchema,
|
|
48
|
+
GradeLevelSchema: () => GradeLevelSchema,
|
|
49
|
+
LinkGuardianInputSchema: () => LinkGuardianInputSchema,
|
|
50
|
+
ListStaffInputSchema: () => ListStaffInputSchema,
|
|
51
|
+
ListStudentsInputSchema: () => ListStudentsInputSchema,
|
|
36
52
|
LoginInputSchema: () => LoginInputSchema,
|
|
37
53
|
LoginOutputSchema: () => LoginOutputSchema,
|
|
38
54
|
LogoutInputSchema: () => LogoutInputSchema,
|
|
@@ -41,23 +57,43 @@ __export(src_exports, {
|
|
|
41
57
|
RefreshTokenOutputSchema: () => RefreshTokenOutputSchema,
|
|
42
58
|
RequestPasswordResetInputSchema: () => RequestPasswordResetInputSchema,
|
|
43
59
|
ResetPasswordInputSchema: () => ResetPasswordInputSchema,
|
|
60
|
+
RoleNameSchema: () => RoleNameSchema,
|
|
44
61
|
SessionUserOutputSchema: () => SessionUserOutputSchema,
|
|
45
62
|
SessionUserRoleSchema: () => SessionUserRoleSchema,
|
|
46
63
|
SessionUserSubRoleSchema: () => SessionUserSubRoleSchema,
|
|
47
64
|
SoftDeleteSchema: () => SoftDeleteSchema,
|
|
65
|
+
StaffListItemSchema: () => StaffListItemSchema,
|
|
66
|
+
StaffProfileSchema: () => StaffProfileSchema,
|
|
67
|
+
StudentListItemSchema: () => StudentListItemSchema,
|
|
68
|
+
StudentProfileSchema: () => StudentProfileSchema,
|
|
69
|
+
StudentStatusSchema: () => StudentStatusSchema,
|
|
48
70
|
SwitchBranchInputSchema: () => SwitchBranchInputSchema,
|
|
49
71
|
TimestampsSchema: () => TimestampsSchema,
|
|
50
72
|
UuidSchema: () => UuidSchema,
|
|
51
73
|
authContract: () => authContract,
|
|
74
|
+
bulkUploadStudentsContract: () => bulkUploadStudentsContract,
|
|
52
75
|
changePasswordContract: () => changePasswordContract,
|
|
76
|
+
createDepartmentContract: () => createDepartmentContract,
|
|
77
|
+
createStaffContract: () => createStaffContract,
|
|
78
|
+
createStudentContract: () => createStudentContract,
|
|
53
79
|
getMeContract: () => getMeContract,
|
|
80
|
+
getStaffByIdContract: () => getStaffByIdContract,
|
|
81
|
+
getStudentByIdContract: () => getStudentByIdContract,
|
|
82
|
+
hrContract: () => hrContract,
|
|
83
|
+
linkGuardianContract: () => linkGuardianContract,
|
|
84
|
+
listClassesContract: () => listClassesContract,
|
|
85
|
+
listDepartmentsContract: () => listDepartmentsContract,
|
|
86
|
+
listStaffContract: () => listStaffContract,
|
|
87
|
+
listStudentsContract: () => listStudentsContract,
|
|
54
88
|
loginContract: () => loginContract,
|
|
55
89
|
logoutContract: () => logoutContract,
|
|
56
90
|
paginatedOutputSchema: () => paginatedOutputSchema,
|
|
57
91
|
refreshTokenContract: () => refreshTokenContract,
|
|
58
92
|
requestPasswordResetContract: () => requestPasswordResetContract,
|
|
59
93
|
resetPasswordContract: () => resetPasswordContract,
|
|
60
|
-
|
|
94
|
+
studentsContract: () => studentsContract,
|
|
95
|
+
switchBranchContract: () => switchBranchContract,
|
|
96
|
+
updateStaffStatusContract: () => updateStaffStatusContract
|
|
61
97
|
});
|
|
62
98
|
module.exports = __toCommonJS(src_exports);
|
|
63
99
|
|
|
@@ -166,10 +202,339 @@ var SwitchBranchInputSchema = z2.object({
|
|
|
166
202
|
branchId: CuidSchema.meta({ description: "Branch to switch the active session to" })
|
|
167
203
|
});
|
|
168
204
|
|
|
205
|
+
// src/schemas/hr.ts
|
|
206
|
+
var z3 = __toESM(require("zod"), 1);
|
|
207
|
+
var EmploymentTypeSchema = z3.enum([
|
|
208
|
+
"permanent",
|
|
209
|
+
"contract",
|
|
210
|
+
"temporary",
|
|
211
|
+
"intern"
|
|
212
|
+
]);
|
|
213
|
+
var RoleNameSchema = z3.enum([
|
|
214
|
+
"PROPRIETOR",
|
|
215
|
+
"DIRECTOR",
|
|
216
|
+
"SYSTEM_ADMIN",
|
|
217
|
+
"PRINCIPAL",
|
|
218
|
+
"DEPUTY_PRINCIPAL",
|
|
219
|
+
"HOD",
|
|
220
|
+
"CLASS_TEACHER",
|
|
221
|
+
"SUBJECT_TEACHER",
|
|
222
|
+
"BURSAR",
|
|
223
|
+
"HR_ADMIN",
|
|
224
|
+
"SCHOOL_NURSE",
|
|
225
|
+
"LIBRARIAN",
|
|
226
|
+
"LAB_TECHNICIAN",
|
|
227
|
+
"SPORTS_COACH",
|
|
228
|
+
"COUNSELLOR",
|
|
229
|
+
"CARETAKER",
|
|
230
|
+
"SECURITY",
|
|
231
|
+
"KITCHEN_STAFF",
|
|
232
|
+
"KITCHEN_MANAGER",
|
|
233
|
+
"DRIVER",
|
|
234
|
+
"IT_ADMIN",
|
|
235
|
+
"BOARDING_MASTER",
|
|
236
|
+
"PREFECT",
|
|
237
|
+
"STUDENT",
|
|
238
|
+
"PARENT",
|
|
239
|
+
"ORG_SPONSOR",
|
|
240
|
+
"INDIVIDUAL_SPONSOR"
|
|
241
|
+
]);
|
|
242
|
+
var CreateStaffInputSchema = z3.object({
|
|
243
|
+
// Personal details
|
|
244
|
+
firstName: z3.string().min(1).max(100),
|
|
245
|
+
middleName: z3.string().max(100).optional(),
|
|
246
|
+
lastName: z3.string().min(1).max(100),
|
|
247
|
+
email: z3.email(),
|
|
248
|
+
phone: z3.string().min(9).max(30),
|
|
249
|
+
nationalId: z3.string().min(1).max(20),
|
|
250
|
+
// Role assignment
|
|
251
|
+
roleName: RoleNameSchema.meta({
|
|
252
|
+
description: "System role to assign \u2014 determines dashboard access and permissions"
|
|
253
|
+
}),
|
|
254
|
+
isPrimaryRole: z3.boolean().default(true),
|
|
255
|
+
// Employment details
|
|
256
|
+
departmentId: UuidSchema.optional(),
|
|
257
|
+
designation: z3.string().min(1).max(100).meta({
|
|
258
|
+
description: 'Job title, e.g. "Mathematics Teacher", "Head of Finance"'
|
|
259
|
+
}),
|
|
260
|
+
employmentType: EmploymentTypeSchema,
|
|
261
|
+
contractStart: z3.iso.date().meta({ description: "ISO date, e.g. 2026-01-15" }),
|
|
262
|
+
contractEnd: z3.iso.date().optional(),
|
|
263
|
+
// Payroll
|
|
264
|
+
basicSalary: z3.number().positive(),
|
|
265
|
+
houseAllowance: z3.number().nonnegative().default(0),
|
|
266
|
+
transportAllowance: z3.number().nonnegative().default(0),
|
|
267
|
+
helbDeduction: z3.number().nonnegative().default(0),
|
|
268
|
+
saccoDeduction: z3.number().nonnegative().default(0),
|
|
269
|
+
// Banking
|
|
270
|
+
bankName: z3.string().max(100).optional(),
|
|
271
|
+
bankAccount: z3.string().max(30).optional(),
|
|
272
|
+
bankBranch: z3.string().max(100).optional(),
|
|
273
|
+
// Statutory
|
|
274
|
+
tscNumber: z3.string().max(30).optional(),
|
|
275
|
+
kraPin: z3.string().max(20).optional(),
|
|
276
|
+
nhifNo: z3.string().max(20).optional(),
|
|
277
|
+
nssfNo: z3.string().max(20).optional()
|
|
278
|
+
});
|
|
279
|
+
var StaffProfileSchema = z3.object({
|
|
280
|
+
// Staff record
|
|
281
|
+
id: UuidSchema,
|
|
282
|
+
userId: UuidSchema,
|
|
283
|
+
branchId: UuidSchema,
|
|
284
|
+
firstName: z3.string(),
|
|
285
|
+
middleName: z3.string().nullable(),
|
|
286
|
+
lastName: z3.string(),
|
|
287
|
+
phone: z3.string(),
|
|
288
|
+
nationalId: z3.string(),
|
|
289
|
+
tscNumber: z3.string().nullable(),
|
|
290
|
+
kraPin: z3.string().nullable(),
|
|
291
|
+
nhifNo: z3.string().nullable(),
|
|
292
|
+
nssfNo: z3.string().nullable(),
|
|
293
|
+
designation: z3.string(),
|
|
294
|
+
employmentType: EmploymentTypeSchema,
|
|
295
|
+
contractStart: z3.string(),
|
|
296
|
+
contractEnd: z3.string().nullable(),
|
|
297
|
+
basicSalary: z3.string(),
|
|
298
|
+
houseAllowance: z3.string(),
|
|
299
|
+
transportAllowance: z3.string(),
|
|
300
|
+
helbDeduction: z3.string().nullable(),
|
|
301
|
+
saccoDeduction: z3.string().nullable(),
|
|
302
|
+
bankName: z3.string().nullable(),
|
|
303
|
+
bankAccount: z3.string().nullable(),
|
|
304
|
+
bankBranch: z3.string().nullable(),
|
|
305
|
+
status: z3.string(),
|
|
306
|
+
createdAt: z3.string(),
|
|
307
|
+
// From users join
|
|
308
|
+
email: z3.string(),
|
|
309
|
+
mustChangePassword: z3.boolean(),
|
|
310
|
+
// Department (nullable — not all staff are in a department)
|
|
311
|
+
departmentId: UuidSchema.nullable(),
|
|
312
|
+
departmentName: z3.string().nullable(),
|
|
313
|
+
// Primary role
|
|
314
|
+
roleName: RoleNameSchema.nullable(),
|
|
315
|
+
roleId: UuidSchema.nullable()
|
|
316
|
+
});
|
|
317
|
+
var StaffListItemSchema = z3.object({
|
|
318
|
+
id: UuidSchema,
|
|
319
|
+
userId: UuidSchema,
|
|
320
|
+
firstName: z3.string(),
|
|
321
|
+
middleName: z3.string().nullable(),
|
|
322
|
+
lastName: z3.string(),
|
|
323
|
+
email: z3.string(),
|
|
324
|
+
phone: z3.string(),
|
|
325
|
+
designation: z3.string(),
|
|
326
|
+
employmentType: EmploymentTypeSchema,
|
|
327
|
+
status: z3.string(),
|
|
328
|
+
departmentName: z3.string().nullable(),
|
|
329
|
+
roleName: RoleNameSchema.nullable(),
|
|
330
|
+
createdAt: z3.string()
|
|
331
|
+
});
|
|
332
|
+
var ListStaffInputSchema = PaginationInputSchema.extend({
|
|
333
|
+
search: z3.string().optional().meta({
|
|
334
|
+
description: "Search by name or email"
|
|
335
|
+
}),
|
|
336
|
+
departmentId: UuidSchema.optional(),
|
|
337
|
+
roleName: RoleNameSchema.optional(),
|
|
338
|
+
status: z3.enum(["active", "inactive"]).optional()
|
|
339
|
+
});
|
|
340
|
+
var CreateStaffOutputSchema = z3.object({
|
|
341
|
+
staffId: UuidSchema,
|
|
342
|
+
userId: UuidSchema,
|
|
343
|
+
email: z3.string(),
|
|
344
|
+
/** Temp password was emailed — not returned in response for security */
|
|
345
|
+
emailSent: z3.boolean()
|
|
346
|
+
});
|
|
347
|
+
var DepartmentSchema = z3.object({
|
|
348
|
+
id: UuidSchema,
|
|
349
|
+
branchId: UuidSchema,
|
|
350
|
+
name: z3.string(),
|
|
351
|
+
hodId: UuidSchema.nullable()
|
|
352
|
+
});
|
|
353
|
+
var CreateDepartmentInputSchema = z3.object({
|
|
354
|
+
name: z3.string().min(1).max(100),
|
|
355
|
+
hodId: UuidSchema.optional()
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
// src/schemas/students.ts
|
|
359
|
+
var z4 = __toESM(require("zod"), 1);
|
|
360
|
+
var GenderSchema = z4.enum(["male", "female"]);
|
|
361
|
+
var StudentStatusSchema = z4.enum([
|
|
362
|
+
"active",
|
|
363
|
+
"transferred",
|
|
364
|
+
"graduated",
|
|
365
|
+
"suspended",
|
|
366
|
+
"withdrawn"
|
|
367
|
+
]);
|
|
368
|
+
var GradeLevelSchema = z4.enum([
|
|
369
|
+
"PP1",
|
|
370
|
+
"PP2",
|
|
371
|
+
"G1",
|
|
372
|
+
"G2",
|
|
373
|
+
"G3",
|
|
374
|
+
"G4",
|
|
375
|
+
"G5",
|
|
376
|
+
"G6",
|
|
377
|
+
"G7",
|
|
378
|
+
"G8",
|
|
379
|
+
"G9"
|
|
380
|
+
]);
|
|
381
|
+
var CreateStudentInputSchema = z4.object({
|
|
382
|
+
// Identity
|
|
383
|
+
firstName: z4.string().min(1).max(100),
|
|
384
|
+
middleName: z4.string().max(100).optional(),
|
|
385
|
+
lastName: z4.string().min(1).max(100),
|
|
386
|
+
dateOfBirth: z4.iso.date().meta({ description: "ISO date, e.g. 2015-03-22" }),
|
|
387
|
+
gender: GenderSchema,
|
|
388
|
+
admissionNo: z4.string().min(1).max(50).meta({
|
|
389
|
+
description: "School-assigned admission number \u2014 must be unique per branch"
|
|
390
|
+
}),
|
|
391
|
+
nemisNo: z4.string().max(50).optional(),
|
|
392
|
+
admissionDate: z4.iso.date(),
|
|
393
|
+
bloodGroup: z4.string().max(10).optional(),
|
|
394
|
+
medicalNotes: z4.string().optional(),
|
|
395
|
+
// Class placement (optional at creation — can be enrolled later)
|
|
396
|
+
classId: UuidSchema.optional().meta({
|
|
397
|
+
description: "Class to enrol student in for the current term"
|
|
398
|
+
}),
|
|
399
|
+
termId: UuidSchema.optional().meta({
|
|
400
|
+
description: "Term for class enrolment \u2014 required if classId is provided"
|
|
401
|
+
}),
|
|
402
|
+
// Guardian (optional at creation — can be linked later)
|
|
403
|
+
guardian: z4.object({
|
|
404
|
+
firstName: z4.string().min(1).max(100),
|
|
405
|
+
middleName: z4.string().max(100).optional(),
|
|
406
|
+
lastName: z4.string().min(1).max(100),
|
|
407
|
+
relationship: z4.string().min(1).max(50).meta({
|
|
408
|
+
description: "e.g. mother, father, uncle, guardian"
|
|
409
|
+
}),
|
|
410
|
+
phone: z4.string().min(9).max(30),
|
|
411
|
+
email: z4.email().optional(),
|
|
412
|
+
nationalId: z4.string().max(20).optional(),
|
|
413
|
+
occupation: z4.string().max(100).optional()
|
|
414
|
+
}).optional()
|
|
415
|
+
});
|
|
416
|
+
var StudentProfileSchema = z4.object({
|
|
417
|
+
id: UuidSchema,
|
|
418
|
+
branchId: UuidSchema,
|
|
419
|
+
admissionNo: z4.string(),
|
|
420
|
+
nemisNo: z4.string().nullable(),
|
|
421
|
+
firstName: z4.string(),
|
|
422
|
+
middleName: z4.string().nullable(),
|
|
423
|
+
lastName: z4.string(),
|
|
424
|
+
dateOfBirth: z4.string(),
|
|
425
|
+
gender: GenderSchema,
|
|
426
|
+
photoUrl: z4.string().nullable(),
|
|
427
|
+
bloodGroup: z4.string().nullable(),
|
|
428
|
+
medicalNotes: z4.string().nullable(),
|
|
429
|
+
admissionDate: z4.string(),
|
|
430
|
+
status: StudentStatusSchema,
|
|
431
|
+
createdAt: z4.string(),
|
|
432
|
+
// Current class (from latest enrollment)
|
|
433
|
+
currentClass: z4.object({
|
|
434
|
+
classId: UuidSchema,
|
|
435
|
+
className: z4.string(),
|
|
436
|
+
gradeLevel: GradeLevelSchema,
|
|
437
|
+
termId: UuidSchema,
|
|
438
|
+
termName: z4.string()
|
|
439
|
+
}).nullable(),
|
|
440
|
+
// Guardians
|
|
441
|
+
guardians: z4.array(z4.object({
|
|
442
|
+
id: UuidSchema,
|
|
443
|
+
firstName: z4.string(),
|
|
444
|
+
middleName: z4.string().nullable(),
|
|
445
|
+
lastName: z4.string(),
|
|
446
|
+
relationship: z4.string(),
|
|
447
|
+
phone: z4.string(),
|
|
448
|
+
email: z4.string().nullable(),
|
|
449
|
+
isPrimary: z4.boolean()
|
|
450
|
+
}))
|
|
451
|
+
});
|
|
452
|
+
var StudentListItemSchema = z4.object({
|
|
453
|
+
id: UuidSchema,
|
|
454
|
+
admissionNo: z4.string(),
|
|
455
|
+
firstName: z4.string(),
|
|
456
|
+
middleName: z4.string().nullable(),
|
|
457
|
+
lastName: z4.string(),
|
|
458
|
+
gender: GenderSchema,
|
|
459
|
+
status: StudentStatusSchema,
|
|
460
|
+
className: z4.string().nullable(),
|
|
461
|
+
gradeLevel: GradeLevelSchema.nullable(),
|
|
462
|
+
primaryGuardianName: z4.string().nullable(),
|
|
463
|
+
primaryGuardianPhone: z4.string().nullable(),
|
|
464
|
+
createdAt: z4.string()
|
|
465
|
+
});
|
|
466
|
+
var ListStudentsInputSchema = PaginationInputSchema.extend({
|
|
467
|
+
search: z4.string().optional().meta({
|
|
468
|
+
description: "Search by name or admission number"
|
|
469
|
+
}),
|
|
470
|
+
classId: UuidSchema.optional(),
|
|
471
|
+
gradeLevel: GradeLevelSchema.optional(),
|
|
472
|
+
status: StudentStatusSchema.optional(),
|
|
473
|
+
termId: UuidSchema.optional()
|
|
474
|
+
});
|
|
475
|
+
var BulkUploadStudentRowSchema = z4.object({
|
|
476
|
+
firstName: z4.string().min(1),
|
|
477
|
+
middleName: z4.string().optional(),
|
|
478
|
+
lastName: z4.string().min(1),
|
|
479
|
+
dateOfBirth: z4.string().min(1).meta({ description: "Any parseable date string" }),
|
|
480
|
+
gender: z4.string().min(1).meta({ description: "male | female (case-insensitive)" }),
|
|
481
|
+
admissionNo: z4.string().min(1),
|
|
482
|
+
nemisNo: z4.string().optional(),
|
|
483
|
+
admissionDate: z4.string().optional(),
|
|
484
|
+
bloodGroup: z4.string().optional(),
|
|
485
|
+
// Guardian columns (all optional in CSV)
|
|
486
|
+
guardianFirstName: z4.string().optional(),
|
|
487
|
+
guardianLastName: z4.string().optional(),
|
|
488
|
+
guardianRelationship: z4.string().optional(),
|
|
489
|
+
guardianPhone: z4.string().optional(),
|
|
490
|
+
guardianEmail: z4.string().optional()
|
|
491
|
+
});
|
|
492
|
+
var BulkUploadStudentsInputSchema = z4.object({
|
|
493
|
+
classId: UuidSchema.meta({
|
|
494
|
+
description: "Class to enrol all uploaded students into"
|
|
495
|
+
}),
|
|
496
|
+
termId: UuidSchema,
|
|
497
|
+
rows: z4.array(BulkUploadStudentRowSchema).min(1).max(500)
|
|
498
|
+
});
|
|
499
|
+
var BulkUploadStudentsOutputSchema = z4.object({
|
|
500
|
+
created: z4.int().nonnegative(),
|
|
501
|
+
skipped: z4.int().nonnegative(),
|
|
502
|
+
errors: z4.array(z4.object({
|
|
503
|
+
row: z4.int().positive(),
|
|
504
|
+
admissionNo: z4.string().optional(),
|
|
505
|
+
reason: z4.string()
|
|
506
|
+
}))
|
|
507
|
+
});
|
|
508
|
+
var CreateStudentOutputSchema = z4.object({
|
|
509
|
+
studentId: UuidSchema,
|
|
510
|
+
admissionNo: z4.string()
|
|
511
|
+
});
|
|
512
|
+
var LinkGuardianInputSchema = z4.object({
|
|
513
|
+
studentId: UuidSchema,
|
|
514
|
+
firstName: z4.string().min(1).max(100),
|
|
515
|
+
middleName: z4.string().max(100).optional(),
|
|
516
|
+
lastName: z4.string().min(1).max(100),
|
|
517
|
+
relationship: z4.string().min(1).max(50),
|
|
518
|
+
phone: z4.string().min(9).max(30),
|
|
519
|
+
email: z4.email().optional(),
|
|
520
|
+
nationalId: z4.string().max(20).optional(),
|
|
521
|
+
occupation: z4.string().max(100).optional(),
|
|
522
|
+
isPrimary: z4.boolean().default(false)
|
|
523
|
+
});
|
|
524
|
+
var ClassSummarySchema = z4.object({
|
|
525
|
+
id: UuidSchema,
|
|
526
|
+
name: z4.string(),
|
|
527
|
+
gradeLevel: GradeLevelSchema,
|
|
528
|
+
gradeName: z4.string(),
|
|
529
|
+
capacity: z4.number().nullable(),
|
|
530
|
+
enrolledCount: z4.number(),
|
|
531
|
+
classTeacherId: UuidSchema.nullable()
|
|
532
|
+
});
|
|
533
|
+
|
|
169
534
|
// src/contracts/auth.ts
|
|
170
535
|
var import_contract = require("@orpc/contract");
|
|
171
|
-
var
|
|
172
|
-
var EmptyOutputSchema =
|
|
536
|
+
var z5 = __toESM(require("zod"), 1);
|
|
537
|
+
var EmptyOutputSchema = z5.object({}).meta({ description: "Empty success response" });
|
|
173
538
|
var loginContract = import_contract.oc.route({ method: "POST", path: "/auth/login" }).input(LoginInputSchema).output(LoginOutputSchema);
|
|
174
539
|
var refreshTokenContract = import_contract.oc.route({ method: "POST", path: "/auth/refresh" }).input(RefreshTokenInputSchema).output(RefreshTokenOutputSchema);
|
|
175
540
|
var logoutContract = import_contract.oc.route({ method: "POST", path: "/auth/logout" }).input(LogoutInputSchema).output(EmptyOutputSchema);
|
|
@@ -188,11 +553,79 @@ var authContract = {
|
|
|
188
553
|
resetPassword: resetPasswordContract,
|
|
189
554
|
switchBranch: switchBranchContract
|
|
190
555
|
};
|
|
556
|
+
|
|
557
|
+
// src/contracts/hr.ts
|
|
558
|
+
var import_contract2 = require("@orpc/contract");
|
|
559
|
+
var z6 = __toESM(require("zod"), 1);
|
|
560
|
+
var EmptyOutput = z6.object({});
|
|
561
|
+
var createStaffContract = import_contract2.oc.route({ method: "POST", path: "/hr/staff" }).input(CreateStaffInputSchema).output(CreateStaffOutputSchema);
|
|
562
|
+
var listStaffContract = import_contract2.oc.route({ method: "GET", path: "/hr/staff" }).input(ListStaffInputSchema).output(z6.object({
|
|
563
|
+
items: z6.array(StaffListItemSchema),
|
|
564
|
+
total: z6.number(),
|
|
565
|
+
nextCursor: UuidSchema.nullable()
|
|
566
|
+
}));
|
|
567
|
+
var getStaffByIdContract = import_contract2.oc.route({ method: "GET", path: "/hr/staff/{id}" }).input(z6.object({ id: UuidSchema })).output(StaffProfileSchema);
|
|
568
|
+
var updateStaffStatusContract = import_contract2.oc.route({ method: "PATCH", path: "/hr/staff/{id}/status" }).input(z6.object({
|
|
569
|
+
id: UuidSchema,
|
|
570
|
+
status: z6.enum(["active", "inactive", "suspended"])
|
|
571
|
+
})).output(EmptyOutput);
|
|
572
|
+
var listDepartmentsContract = import_contract2.oc.route({ method: "GET", path: "/hr/departments" }).input(z6.object({ branchId: UuidSchema.optional() })).output(z6.array(DepartmentSchema));
|
|
573
|
+
var createDepartmentContract = import_contract2.oc.route({ method: "POST", path: "/hr/departments" }).input(CreateDepartmentInputSchema).output(DepartmentSchema);
|
|
574
|
+
var hrContract = {
|
|
575
|
+
createStaff: createStaffContract,
|
|
576
|
+
listStaff: listStaffContract,
|
|
577
|
+
getStaffById: getStaffByIdContract,
|
|
578
|
+
updateStaffStatus: updateStaffStatusContract,
|
|
579
|
+
listDepartments: listDepartmentsContract,
|
|
580
|
+
createDepartment: createDepartmentContract
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
// src/contracts/students.ts
|
|
584
|
+
var import_contract3 = require("@orpc/contract");
|
|
585
|
+
var z7 = __toESM(require("zod"), 1);
|
|
586
|
+
var EmptyOutput2 = z7.object({});
|
|
587
|
+
var createStudentContract = import_contract3.oc.route({ method: "POST", path: "/students" }).input(CreateStudentInputSchema).output(CreateStudentOutputSchema);
|
|
588
|
+
var bulkUploadStudentsContract = import_contract3.oc.route({ method: "POST", path: "/students/bulk" }).input(BulkUploadStudentsInputSchema).output(BulkUploadStudentsOutputSchema);
|
|
589
|
+
var listStudentsContract = import_contract3.oc.route({ method: "GET", path: "/students" }).input(ListStudentsInputSchema).output(z7.object({
|
|
590
|
+
items: z7.array(StudentListItemSchema),
|
|
591
|
+
total: z7.number(),
|
|
592
|
+
nextCursor: UuidSchema.nullable()
|
|
593
|
+
}));
|
|
594
|
+
var getStudentByIdContract = import_contract3.oc.route({ method: "GET", path: "/students/{id}" }).input(z7.object({ id: UuidSchema })).output(StudentProfileSchema);
|
|
595
|
+
var linkGuardianContract = import_contract3.oc.route({ method: "POST", path: "/students/guardians" }).input(LinkGuardianInputSchema).output(z7.object({ guardianId: UuidSchema }));
|
|
596
|
+
var listClassesContract = import_contract3.oc.route({ method: "GET", path: "/students/classes" }).input(z7.object({
|
|
597
|
+
termId: UuidSchema.optional(),
|
|
598
|
+
gradeLevel: z7.string().optional()
|
|
599
|
+
})).output(z7.array(ClassSummarySchema));
|
|
600
|
+
var studentsContract = {
|
|
601
|
+
create: createStudentContract,
|
|
602
|
+
bulkUpload: bulkUploadStudentsContract,
|
|
603
|
+
list: listStudentsContract,
|
|
604
|
+
getById: getStudentByIdContract,
|
|
605
|
+
linkGuardian: linkGuardianContract,
|
|
606
|
+
listClasses: listClassesContract
|
|
607
|
+
};
|
|
191
608
|
// Annotate the CommonJS export names for ESM import in node:
|
|
192
609
|
0 && (module.exports = {
|
|
193
610
|
BranchRefSchema,
|
|
611
|
+
BulkUploadStudentRowSchema,
|
|
612
|
+
BulkUploadStudentsInputSchema,
|
|
613
|
+
BulkUploadStudentsOutputSchema,
|
|
194
614
|
ChangePasswordInputSchema,
|
|
615
|
+
ClassSummarySchema,
|
|
616
|
+
CreateDepartmentInputSchema,
|
|
617
|
+
CreateStaffInputSchema,
|
|
618
|
+
CreateStaffOutputSchema,
|
|
619
|
+
CreateStudentInputSchema,
|
|
620
|
+
CreateStudentOutputSchema,
|
|
195
621
|
CuidSchema,
|
|
622
|
+
DepartmentSchema,
|
|
623
|
+
EmploymentTypeSchema,
|
|
624
|
+
GenderSchema,
|
|
625
|
+
GradeLevelSchema,
|
|
626
|
+
LinkGuardianInputSchema,
|
|
627
|
+
ListStaffInputSchema,
|
|
628
|
+
ListStudentsInputSchema,
|
|
196
629
|
LoginInputSchema,
|
|
197
630
|
LoginOutputSchema,
|
|
198
631
|
LogoutInputSchema,
|
|
@@ -201,22 +634,42 @@ var authContract = {
|
|
|
201
634
|
RefreshTokenOutputSchema,
|
|
202
635
|
RequestPasswordResetInputSchema,
|
|
203
636
|
ResetPasswordInputSchema,
|
|
637
|
+
RoleNameSchema,
|
|
204
638
|
SessionUserOutputSchema,
|
|
205
639
|
SessionUserRoleSchema,
|
|
206
640
|
SessionUserSubRoleSchema,
|
|
207
641
|
SoftDeleteSchema,
|
|
642
|
+
StaffListItemSchema,
|
|
643
|
+
StaffProfileSchema,
|
|
644
|
+
StudentListItemSchema,
|
|
645
|
+
StudentProfileSchema,
|
|
646
|
+
StudentStatusSchema,
|
|
208
647
|
SwitchBranchInputSchema,
|
|
209
648
|
TimestampsSchema,
|
|
210
649
|
UuidSchema,
|
|
211
650
|
authContract,
|
|
651
|
+
bulkUploadStudentsContract,
|
|
212
652
|
changePasswordContract,
|
|
653
|
+
createDepartmentContract,
|
|
654
|
+
createStaffContract,
|
|
655
|
+
createStudentContract,
|
|
213
656
|
getMeContract,
|
|
657
|
+
getStaffByIdContract,
|
|
658
|
+
getStudentByIdContract,
|
|
659
|
+
hrContract,
|
|
660
|
+
linkGuardianContract,
|
|
661
|
+
listClassesContract,
|
|
662
|
+
listDepartmentsContract,
|
|
663
|
+
listStaffContract,
|
|
664
|
+
listStudentsContract,
|
|
214
665
|
loginContract,
|
|
215
666
|
logoutContract,
|
|
216
667
|
paginatedOutputSchema,
|
|
217
668
|
refreshTokenContract,
|
|
218
669
|
requestPasswordResetContract,
|
|
219
670
|
resetPasswordContract,
|
|
220
|
-
|
|
671
|
+
studentsContract,
|
|
672
|
+
switchBranchContract,
|
|
673
|
+
updateStaffStatusContract
|
|
221
674
|
});
|
|
222
675
|
//# sourceMappingURL=index.cjs.map
|