@brite-future-schools-contracts/contracts 1.0.8 → 2.0.2

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 (40) hide show
  1. package/dist/chunk-AEZO7MJD.js +127 -0
  2. package/dist/chunk-AEZO7MJD.js.map +1 -0
  3. package/dist/chunk-IR6JUP6L.js +48 -0
  4. package/dist/chunk-IR6JUP6L.js.map +1 -0
  5. package/dist/chunk-PCHAGP5X.js +1 -0
  6. package/dist/contracts/index.cjs +179 -0
  7. package/dist/contracts/index.cjs.map +1 -0
  8. package/dist/contracts/index.d.cts +201 -0
  9. package/dist/contracts/index.d.ts +158 -9677
  10. package/dist/contracts/index.js +22 -1414
  11. package/dist/contracts/index.js.map +1 -1
  12. package/dist/index.cjs +222 -0
  13. package/dist/index.cjs.map +1 -0
  14. package/dist/index.d.cts +4 -0
  15. package/dist/index.d.ts +2 -2
  16. package/dist/index.js +62 -1538
  17. package/dist/index.js.map +1 -1
  18. package/dist/schemas/index.cjs +181 -0
  19. package/dist/schemas/index.cjs.map +1 -0
  20. package/dist/schemas/index.d.cts +145 -0
  21. package/dist/schemas/index.d.ts +130 -1024
  22. package/dist/schemas/index.js +42 -640
  23. package/dist/schemas/index.js.map +1 -1
  24. package/package.json +32 -59
  25. package/dist/chunk-M6LF6JUL.mjs +0 -557
  26. package/dist/chunk-M6LF6JUL.mjs.map +0 -1
  27. package/dist/chunk-VC6SCJVW.mjs +0 -935
  28. package/dist/chunk-VC6SCJVW.mjs.map +0 -1
  29. package/dist/contracts/index.d.mts +0 -9720
  30. package/dist/contracts/index.mjs +0 -36
  31. package/dist/index.d.mts +0 -4
  32. package/dist/index.mjs +0 -161
  33. package/dist/index.mjs.map +0 -1
  34. package/dist/schemas/index.d.mts +0 -1039
  35. package/dist/schemas/index.mjs +0 -129
  36. package/dist/schemas/index.mjs.map +0 -1
  37. package/src/contracts/index.ts +0 -1209
  38. package/src/index.ts +0 -2
  39. package/src/schemas/index.ts +0 -586
  40. /package/dist/{contracts/index.mjs.map → chunk-PCHAGP5X.js.map} +0 -0
@@ -1,935 +0,0 @@
1
- import {
2
- assessmentScoreInputSchema,
3
- assessmentTypeEnum,
4
- assetCategoryEnum,
5
- assetConditionEnum,
6
- branchSchema,
7
- busRegisterEntrySchema,
8
- busRegisterStatusEnum,
9
- changePasswordInputSchema,
10
- createBranchInputSchema,
11
- createStudentInputSchema,
12
- disciplineRulingEnum,
13
- feeItemSchema,
14
- gradeLevelEnum,
15
- guardianSchema,
16
- incidentSeverityEnum,
17
- incidentStatusEnum,
18
- invoiceStatusEnum,
19
- leaveRequestInputSchema,
20
- leaveStatusEnum,
21
- listStudentsInputSchema,
22
- loginInputSchema,
23
- loginOutputSchema,
24
- maintenanceRequestSchema,
25
- maintenanceRequestStatusEnum,
26
- maintenanceTicketStatusEnum,
27
- mfaVerifyInputSchema,
28
- paginationSchema,
29
- payrollRunStatusEnum,
30
- recordPaymentInputSchema,
31
- refreshInputSchema,
32
- refreshTokenOutputSchema,
33
- reportCardStatusEnum,
34
- routeSchema,
35
- sendBulkSmsInputSchema,
36
- sponsorSchema,
37
- staffSchema,
38
- studentSchema,
39
- subjectSchema,
40
- transportAppStatusEnum,
41
- transportApplicationSchema,
42
- tripCategoryEnum,
43
- tripLogSchema,
44
- tripStatusEnum,
45
- userSchema,
46
- uuidSchema,
47
- vehicleOwnershipEnum,
48
- vehicleSchema,
49
- vehicleStatusEnum
50
- } from "./chunk-M6LF6JUL.mjs";
51
-
52
- // src/contracts/index.ts
53
- import { oc } from "@orpc/contract";
54
- import { z } from "zod";
55
- var authContract = {
56
- login: oc.input(loginInputSchema).output(loginOutputSchema),
57
- refresh: oc.input(refreshInputSchema).output(refreshTokenOutputSchema),
58
- logout: oc.output(z.object({ success: z.boolean() })),
59
- me: oc.output(
60
- userSchema.extend({
61
- roles: z.array(
62
- z.object({
63
- id: uuidSchema,
64
- name: z.string(),
65
- branchId: uuidSchema.nullable()
66
- })
67
- )
68
- })
69
- ),
70
- verifyMfa: oc.input(mfaVerifyInputSchema).output(z.object({ verified: z.boolean() })),
71
- changePassword: oc.input(changePasswordInputSchema).output(z.object({ success: z.boolean() })),
72
- switchBranch: oc.input(z.object({ branchId: uuidSchema })).output(z.object({ accessToken: z.string() }))
73
- };
74
- var branchesContract = {
75
- list: oc.output(z.array(branchSchema)),
76
- get: oc.input(z.object({ id: uuidSchema })).output(branchSchema),
77
- create: oc.input(createBranchInputSchema).output(branchSchema),
78
- update: oc.input(createBranchInputSchema.partial().extend({ id: uuidSchema })).output(branchSchema),
79
- updateFeatureFlags: oc.input(z.object({ branchId: uuidSchema, flags: z.record(z.boolean()) })).output(branchSchema)
80
- };
81
- var studentWithGuardians = studentSchema.extend({
82
- guardians: z.array(guardianSchema),
83
- sponsors: z.array(sponsorSchema),
84
- currentClass: z.object({ id: uuidSchema, name: z.string(), grade: z.string() }).nullable()
85
- });
86
- var studentsContract = {
87
- list: oc.input(listStudentsInputSchema).output(
88
- z.object({
89
- data: z.array(studentSchema),
90
- total: z.number(),
91
- page: z.number(),
92
- limit: z.number()
93
- })
94
- ),
95
- get: oc.input(z.object({ id: uuidSchema })).output(studentWithGuardians),
96
- create: oc.input(createStudentInputSchema).output(studentSchema),
97
- update: oc.input(createStudentInputSchema.partial().extend({ id: uuidSchema })).output(studentSchema),
98
- enroll: oc.input(
99
- z.object({
100
- studentId: uuidSchema,
101
- classId: uuidSchema,
102
- termId: uuidSchema
103
- })
104
- ).output(z.object({ success: z.boolean() })),
105
- transfer: oc.input(
106
- z.object({
107
- studentId: uuidSchema,
108
- toBranchId: uuidSchema,
109
- reason: z.string()
110
- })
111
- ).output(z.object({ success: z.boolean() })),
112
- linkGuardian: oc.input(
113
- z.object({
114
- studentId: uuidSchema,
115
- guardianId: uuidSchema,
116
- isPrimary: z.boolean()
117
- })
118
- ).output(z.object({ success: z.boolean() })),
119
- linkSponsor: oc.input(
120
- z.object({
121
- studentId: uuidSchema,
122
- sponsorId: uuidSchema,
123
- termId: uuidSchema,
124
- feeItemIds: z.array(uuidSchema)
125
- })
126
- ).output(z.object({ success: z.boolean() })),
127
- listGuardians: oc.input(
128
- z.object({
129
- branchId: uuidSchema.optional(),
130
- search: z.string().optional()
131
- })
132
- ).output(
133
- z.array(
134
- guardianSchema.extend({
135
- email: z.string().nullable(),
136
- linkedStudents: z.array(
137
- z.object({
138
- id: uuidSchema,
139
- firstName: z.string(),
140
- lastName: z.string(),
141
- admissionNo: z.string(),
142
- status: z.string()
143
- })
144
- )
145
- })
146
- )
147
- ),
148
- createGuardian: oc.input(
149
- z.object({
150
- firstName: z.string().min(1),
151
- middleName: z.string().optional(),
152
- lastName: z.string().min(1),
153
- relationship: z.string().min(1),
154
- phone: z.string().min(9),
155
- email: z.string().email().optional(),
156
- nationalId: z.string().optional(),
157
- occupation: z.string().optional(),
158
- address: z.string().optional()
159
- })
160
- ).output(guardianSchema),
161
- listClasses: oc.input(z.object({ branchId: uuidSchema.optional() })).output(
162
- z.array(
163
- z.object({
164
- id: uuidSchema,
165
- name: z.string(),
166
- grade: z.string(),
167
- level: z.string()
168
- })
169
- )
170
- ),
171
- listGrades: oc.input(z.object({ branchId: uuidSchema.optional() })).output(
172
- z.array(
173
- z.object({
174
- id: uuidSchema,
175
- name: z.string(),
176
- level: z.string()
177
- })
178
- )
179
- ),
180
- listTerms: oc.input(z.object({ branchId: uuidSchema.optional() })).output(
181
- z.array(
182
- z.object({
183
- id: uuidSchema,
184
- name: z.string(),
185
- isCurrent: z.boolean(),
186
- startDate: z.string(),
187
- endDate: z.string()
188
- })
189
- )
190
- ),
191
- listSponsors: oc.input(z.object({ branchId: uuidSchema.optional() })).output(z.array(sponsorSchema))
192
- };
193
- var academicsContract = {
194
- subjects: {
195
- list: oc.input(
196
- z.object({
197
- branchId: uuidSchema,
198
- gradeLevel: gradeLevelEnum.optional()
199
- })
200
- ).output(z.array(subjectSchema)),
201
- create: oc.input(
202
- z.object({
203
- name: z.string(),
204
- code: z.string(),
205
- gradeLevel: gradeLevelEnum,
206
- departmentId: uuidSchema.optional()
207
- })
208
- ).output(subjectSchema)
209
- },
210
- timetable: {
211
- get: oc.input(z.object({ classId: uuidSchema, termId: uuidSchema })).output(
212
- z.array(
213
- z.object({
214
- id: uuidSchema,
215
- dayOfWeek: z.number().min(1).max(5),
216
- periodNo: z.number(),
217
- subject: subjectSchema,
218
- teacherName: z.string(),
219
- room: z.string().nullable(),
220
- startTime: z.string(),
221
- endTime: z.string()
222
- })
223
- )
224
- ),
225
- upsert: oc.input(
226
- z.object({
227
- classId: uuidSchema,
228
- termId: uuidSchema,
229
- slots: z.array(
230
- z.object({
231
- dayOfWeek: z.number().min(1).max(5),
232
- periodNo: z.number(),
233
- subjectId: uuidSchema,
234
- teacherId: uuidSchema,
235
- room: z.string().optional(),
236
- startTime: z.string(),
237
- endTime: z.string()
238
- })
239
- )
240
- })
241
- ).output(z.object({ success: z.boolean() }))
242
- },
243
- assessments: {
244
- list: oc.input(
245
- z.object({
246
- classId: uuidSchema,
247
- termId: uuidSchema,
248
- type: assessmentTypeEnum.optional()
249
- })
250
- ).output(
251
- z.array(
252
- z.object({
253
- id: uuidSchema,
254
- title: z.string(),
255
- type: assessmentTypeEnum,
256
- date: z.string(),
257
- maxScore: z.number(),
258
- subjectId: uuidSchema
259
- })
260
- )
261
- ),
262
- create: oc.input(
263
- z.object({
264
- title: z.string(),
265
- type: assessmentTypeEnum,
266
- classId: uuidSchema,
267
- subjectId: uuidSchema,
268
- termId: uuidSchema,
269
- date: z.string(),
270
- maxScore: z.number()
271
- })
272
- ).output(z.object({ id: uuidSchema })),
273
- enterScores: oc.input(z.object({ scores: z.array(assessmentScoreInputSchema) })).output(z.object({ saved: z.number() }))
274
- },
275
- reportCards: {
276
- list: oc.input(
277
- z.object({
278
- branchId: uuidSchema,
279
- termId: uuidSchema,
280
- classId: uuidSchema.optional(),
281
- status: reportCardStatusEnum.optional()
282
- })
283
- ).output(
284
- z.array(
285
- z.object({
286
- id: uuidSchema,
287
- studentId: uuidSchema,
288
- studentName: z.string(),
289
- status: reportCardStatusEnum,
290
- generatedAt: z.string().datetime().nullable()
291
- })
292
- )
293
- ),
294
- get: oc.input(z.object({ studentId: uuidSchema, termId: uuidSchema })).output(
295
- z.object({
296
- id: uuidSchema,
297
- studentId: uuidSchema,
298
- termId: uuidSchema,
299
- status: reportCardStatusEnum,
300
- scores: z.array(z.any()),
301
- teacherComments: z.string().nullable(),
302
- generatedAt: z.string().datetime().nullable()
303
- })
304
- ),
305
- updateStatus: oc.input(
306
- z.object({
307
- id: uuidSchema,
308
- status: reportCardStatusEnum,
309
- comments: z.string().optional()
310
- })
311
- ).output(z.object({ success: z.boolean() }))
312
- },
313
- attendance: {
314
- markClass: oc.input(
315
- z.object({
316
- classId: uuidSchema,
317
- date: z.string(),
318
- subjectId: uuidSchema,
319
- records: z.array(
320
- z.object({
321
- studentId: uuidSchema,
322
- present: z.boolean(),
323
- note: z.string().optional()
324
- })
325
- )
326
- })
327
- ).output(z.object({ saved: z.number() })),
328
- getClassAttendance: oc.input(
329
- z.object({ classId: uuidSchema, from: z.string(), to: z.string() })
330
- ).output(
331
- z.array(
332
- z.object({
333
- studentId: uuidSchema,
334
- studentName: z.string(),
335
- presentDays: z.number(),
336
- absentDays: z.number(),
337
- percentage: z.number()
338
- })
339
- )
340
- )
341
- }
342
- };
343
- var financeContract = {
344
- feeItems: {
345
- list: oc.input(z.object({ branchId: uuidSchema })).output(z.array(feeItemSchema)),
346
- create: oc.input(
347
- z.object({
348
- name: z.string(),
349
- category: z.any(),
350
- defaultAmount: z.number(),
351
- applicableGrades: z.array(gradeLevelEnum)
352
- })
353
- ).output(feeItemSchema)
354
- },
355
- invoices: {
356
- listForStudent: oc.input(z.object({ studentId: uuidSchema, termId: uuidSchema.optional() })).output(
357
- z.array(
358
- z.object({
359
- id: uuidSchema,
360
- termId: uuidSchema,
361
- payerType: z.string(),
362
- totalAmount: z.number(),
363
- paidAmount: z.number(),
364
- balance: z.number(),
365
- status: invoiceStatusEnum,
366
- dueDate: z.string().nullable()
367
- })
368
- )
369
- ),
370
- generate: oc.input(
371
- z.object({
372
- branchId: uuidSchema,
373
- termId: uuidSchema,
374
- studentIds: z.array(uuidSchema).optional()
375
- })
376
- ).output(z.object({ generated: z.number() }))
377
- },
378
- payments: {
379
- record: oc.input(recordPaymentInputSchema).output(z.object({ id: uuidSchema, receipt: z.string() })),
380
- listForStudent: oc.input(z.object({ studentId: uuidSchema })).output(
381
- z.array(
382
- z.object({
383
- id: uuidSchema,
384
- amount: z.number(),
385
- method: z.string(),
386
- reference: z.string().nullable(),
387
- paymentDate: z.string(),
388
- createdAt: z.string()
389
- })
390
- )
391
- )
392
- },
393
- blocks: {
394
- list: oc.input(
395
- z.object({
396
- branchId: uuidSchema,
397
- termId: uuidSchema,
398
- active: z.boolean().optional()
399
- })
400
- ).output(
401
- z.array(
402
- z.object({
403
- id: uuidSchema,
404
- studentId: uuidSchema,
405
- studentName: z.string(),
406
- blockType: z.string(),
407
- isActive: z.boolean(),
408
- balanceAtBlock: z.number()
409
- })
410
- )
411
- ),
412
- lift: oc.input(z.object({ blockId: uuidSchema, reason: z.string() })).output(z.object({ success: z.boolean() }))
413
- },
414
- reports: {
415
- termCollection: oc.input(z.object({ branchId: uuidSchema, termId: uuidSchema })).output(
416
- z.object({
417
- totalExpected: z.number(),
418
- totalCollected: z.number(),
419
- totalOutstanding: z.number(),
420
- collectionRate: z.number(),
421
- byPaymentMethod: z.record(z.number())
422
- })
423
- )
424
- }
425
- };
426
- var hrContract = {
427
- staff: {
428
- list: oc.input(
429
- paginationSchema.extend({
430
- branchId: uuidSchema,
431
- search: z.string().optional(),
432
- departmentId: uuidSchema.optional()
433
- })
434
- ).output(z.object({ data: z.array(staffSchema), total: z.number() })),
435
- get: oc.input(z.object({ id: uuidSchema })).output(staffSchema),
436
- create: oc.input(
437
- staffSchema.omit({ id: true }).partial({
438
- contractEnd: true,
439
- tscNumber: true,
440
- kraPin: true,
441
- nhifNo: true,
442
- nssfNo: true,
443
- bankName: true,
444
- bankAccount: true,
445
- departmentId: true
446
- })
447
- ).output(staffSchema)
448
- },
449
- leave: {
450
- request: oc.input(leaveRequestInputSchema).output(z.object({ id: uuidSchema })),
451
- list: oc.input(
452
- z.object({
453
- branchId: uuidSchema,
454
- staffId: uuidSchema.optional(),
455
- status: leaveStatusEnum.optional()
456
- })
457
- ).output(z.array(z.any())),
458
- approve: oc.input(
459
- z.object({
460
- id: uuidSchema,
461
- approved: z.boolean(),
462
- comment: z.string().optional()
463
- })
464
- ).output(z.object({ success: z.boolean() }))
465
- },
466
- attendance: {
467
- mark: oc.input(
468
- z.object({
469
- staffId: uuidSchema,
470
- date: z.string(),
471
- checkIn: z.string().optional(),
472
- checkOut: z.string().optional(),
473
- status: z.enum(["present", "absent", "late", "half_day"])
474
- })
475
- ).output(z.object({ success: z.boolean() })),
476
- getSummary: oc.input(
477
- z.object({ staffId: uuidSchema, month: z.number(), year: z.number() })
478
- ).output(
479
- z.object({
480
- presentDays: z.number(),
481
- absentDays: z.number(),
482
- lateDays: z.number()
483
- })
484
- )
485
- }
486
- };
487
- var payrollContract = {
488
- runs: {
489
- list: oc.input(z.object({ branchId: uuidSchema, year: z.number().optional() })).output(
490
- z.array(
491
- z.object({
492
- id: uuidSchema,
493
- month: z.number(),
494
- year: z.number(),
495
- status: payrollRunStatusEnum,
496
- netTotal: z.number()
497
- })
498
- )
499
- ),
500
- initiate: oc.input(
501
- z.object({ branchId: uuidSchema, month: z.number(), year: z.number() })
502
- ).output(z.object({ id: uuidSchema, preview: z.array(z.any()) })),
503
- approve: oc.input(z.object({ id: uuidSchema })).output(z.object({ success: z.boolean() })),
504
- getPayslip: oc.input(z.object({ payrollRunId: uuidSchema, staffId: uuidSchema })).output(z.object({ url: z.string() }))
505
- }
506
- };
507
- var transportContract = {
508
- vehicles: {
509
- list: oc.input(z.object({ branchId: uuidSchema })).output(z.array(vehicleSchema)),
510
- create: oc.input(z.object({
511
- branchId: uuidSchema,
512
- plateNo: z.string().min(1),
513
- type: z.string().min(1),
514
- ownershipType: vehicleOwnershipEnum,
515
- make: z.string().optional(),
516
- model: z.string().optional(),
517
- capacity: z.number().int().positive().optional(),
518
- insuranceExpiry: z.string().optional(),
519
- inspectionDate: z.string().optional(),
520
- driverUserId: uuidSchema.optional(),
521
- notes: z.string().optional()
522
- })).output(vehicleSchema),
523
- update: oc.input(z.object({
524
- id: uuidSchema,
525
- plateNo: z.string().optional(),
526
- type: z.string().optional(),
527
- ownershipType: vehicleOwnershipEnum.optional(),
528
- make: z.string().optional(),
529
- model: z.string().optional(),
530
- capacity: z.number().int().positive().optional(),
531
- insuranceExpiry: z.string().optional(),
532
- inspectionDate: z.string().optional(),
533
- driverUserId: uuidSchema.optional(),
534
- notes: z.string().optional()
535
- })).output(vehicleSchema),
536
- updateStatus: oc.input(z.object({ id: uuidSchema, status: vehicleStatusEnum })).output(vehicleSchema)
537
- },
538
- routes: {
539
- list: oc.input(z.object({ branchId: uuidSchema })).output(z.array(routeSchema)),
540
- get: oc.input(z.object({ routeId: uuidSchema })).output(routeSchema),
541
- create: oc.input(z.object({
542
- branchId: uuidSchema,
543
- name: z.string().min(1),
544
- description: z.string().optional(),
545
- vehicleId: uuidSchema.optional(),
546
- routeCategory: z.string().optional(),
547
- departureTime: z.string().optional(),
548
- returnTime: z.string().optional(),
549
- fare: z.number().optional(),
550
- stops: z.array(z.object({
551
- stopName: z.string().min(1),
552
- stopOrder: z.number().int(),
553
- estimatedTime: z.string().optional()
554
- })).optional()
555
- })).output(routeSchema),
556
- update: oc.input(z.object({
557
- id: uuidSchema,
558
- name: z.string().optional(),
559
- description: z.string().optional(),
560
- vehicleId: uuidSchema.optional(),
561
- routeCategory: z.string().optional(),
562
- departureTime: z.string().optional(),
563
- returnTime: z.string().optional(),
564
- fare: z.number().optional()
565
- })).output(routeSchema),
566
- toggle: oc.input(z.object({ id: uuidSchema, isActive: z.boolean() })).output(z.object({ success: z.boolean() })),
567
- roster: oc.input(z.object({ routeId: uuidSchema, termId: uuidSchema })).output(z.array(z.object({
568
- studentId: uuidSchema,
569
- studentName: z.string(),
570
- admissionNo: z.string(),
571
- pickupStop: z.string().nullable(),
572
- dropoffStop: z.string().nullable()
573
- }))),
574
- enroll: oc.input(z.object({
575
- studentId: uuidSchema,
576
- routeId: uuidSchema,
577
- termId: uuidSchema,
578
- pickupStopId: uuidSchema.optional(),
579
- dropoffStopId: uuidSchema.optional()
580
- })).output(z.object({ success: z.boolean() })),
581
- unenroll: oc.input(z.object({ studentId: uuidSchema, routeId: uuidSchema, termId: uuidSchema })).output(z.object({ success: z.boolean() }))
582
- },
583
- trips: {
584
- list: oc.input(z.object({
585
- branchId: uuidSchema,
586
- date: z.string().optional(),
587
- vehicleId: uuidSchema.optional(),
588
- tripCategory: tripCategoryEnum.optional(),
589
- status: tripStatusEnum.optional()
590
- })).output(z.array(tripLogSchema)),
591
- get: oc.input(z.object({ tripId: uuidSchema })).output(tripLogSchema.extend({
592
- boardings: z.array(z.object({
593
- studentId: uuidSchema,
594
- studentName: z.string(),
595
- status: busRegisterStatusEnum,
596
- recordedAt: z.string().datetime()
597
- }))
598
- })),
599
- create: oc.input(z.object({
600
- branchId: uuidSchema,
601
- vehicleId: uuidSchema,
602
- routeId: uuidSchema.optional(),
603
- tripType: z.string(),
604
- tripCategory: tripCategoryEnum,
605
- departureTime: z.string().datetime(),
606
- returnTime: z.string().datetime().optional(),
607
- title: z.string().optional(),
608
- description: z.string().optional(),
609
- destination: z.string().optional(),
610
- expectedStudents: z.number().optional(),
611
- notes: z.string().optional()
612
- })).output(z.object({ id: uuidSchema })),
613
- updateStatus: oc.input(z.object({ tripId: uuidSchema, status: tripStatusEnum })).output(z.object({ success: z.boolean() })),
614
- complete: oc.input(z.object({ tripId: uuidSchema, arrivalTime: z.string().datetime() })).output(z.object({ success: z.boolean() })),
615
- recordBoardings: oc.input(z.object({
616
- tripId: uuidSchema,
617
- entries: z.array(busRegisterEntrySchema)
618
- })).output(z.object({ saved: z.number() })),
619
- reportIncident: oc.input(z.object({
620
- tripId: uuidSchema,
621
- description: z.string(),
622
- severity: incidentSeverityEnum,
623
- location: z.string().optional()
624
- })).output(z.object({ id: uuidSchema })),
625
- enrollStudent: oc.input(z.object({ tripId: uuidSchema, studentId: uuidSchema })).output(z.object({ success: z.boolean() })),
626
- unenrollStudent: oc.input(z.object({ tripId: uuidSchema, studentId: uuidSchema })).output(z.object({ success: z.boolean() })),
627
- listEnrolled: oc.input(z.object({ tripId: uuidSchema })).output(z.array(z.object({
628
- studentId: uuidSchema,
629
- studentName: z.string(),
630
- admissionNo: z.string(),
631
- status: busRegisterStatusEnum.nullable()
632
- })))
633
- },
634
- maintenance: {
635
- submit: oc.input(z.object({
636
- vehicleId: uuidSchema,
637
- issue: z.string().min(5),
638
- severity: z.enum(["routine", "urgent", "critical"])
639
- })).output(z.object({ id: uuidSchema })),
640
- list: oc.input(z.object({
641
- branchId: uuidSchema,
642
- vehicleId: uuidSchema.optional(),
643
- status: maintenanceRequestStatusEnum.optional()
644
- })).output(z.array(maintenanceRequestSchema)),
645
- review: oc.input(z.object({
646
- id: uuidSchema,
647
- approved: z.boolean(),
648
- reviewNotes: z.string().optional()
649
- })).output(z.object({ success: z.boolean() })),
650
- resolve: oc.input(z.object({
651
- id: uuidSchema,
652
- notes: z.string().optional(),
653
- cost: z.number().optional()
654
- })).output(z.object({ success: z.boolean() }))
655
- },
656
- applications: {
657
- list: oc.input(z.object({
658
- branchId: uuidSchema,
659
- status: transportAppStatusEnum.optional(),
660
- applicationType: z.enum(["route", "trip"]).optional()
661
- })).output(z.array(transportApplicationSchema)),
662
- apply: oc.input(z.object({
663
- branchId: uuidSchema,
664
- studentId: uuidSchema,
665
- applicationType: z.enum(["route", "trip"]),
666
- routeId: uuidSchema.optional(),
667
- tripLogId: uuidSchema.optional(),
668
- feeItemId: uuidSchema.optional()
669
- })).output(z.object({ id: uuidSchema })),
670
- review: oc.input(z.object({
671
- id: uuidSchema,
672
- approved: z.boolean(),
673
- reviewNotes: z.string().optional(),
674
- updateInvoice: z.boolean().optional()
675
- })).output(z.object({ success: z.boolean() }))
676
- }
677
- };
678
- var assetsContract = {
679
- list: oc.input(
680
- paginationSchema.extend({
681
- branchId: uuidSchema,
682
- category: assetCategoryEnum.optional(),
683
- search: z.string().optional()
684
- })
685
- ).output(z.object({ data: z.array(z.any()), total: z.number() })),
686
- create: oc.input(
687
- z.object({
688
- name: z.string(),
689
- category: assetCategoryEnum,
690
- serialNo: z.string().optional(),
691
- purchaseDate: z.string(),
692
- purchaseCost: z.number(),
693
- supplier: z.string().optional(),
694
- warrantyExpiry: z.string().optional(),
695
- condition: assetConditionEnum,
696
- depreciationRate: z.number().min(0).max(100)
697
- })
698
- ).output(z.object({ id: uuidSchema })),
699
- assign: oc.input(
700
- z.object({
701
- assetId: uuidSchema,
702
- staffId: uuidSchema.optional(),
703
- room: z.string().optional()
704
- })
705
- ).output(z.object({ success: z.boolean() })),
706
- ticket: {
707
- create: oc.input(
708
- z.object({
709
- assetId: uuidSchema,
710
- description: z.string(),
711
- severity: z.string()
712
- })
713
- ).output(z.object({ id: uuidSchema })),
714
- update: oc.input(
715
- z.object({
716
- ticketId: uuidSchema,
717
- status: maintenanceTicketStatusEnum,
718
- notes: z.string().optional(),
719
- cost: z.number().optional()
720
- })
721
- ).output(z.object({ success: z.boolean() }))
722
- }
723
- };
724
- var libraryContract = {
725
- books: {
726
- list: oc.input(
727
- paginationSchema.extend({
728
- branchId: uuidSchema,
729
- search: z.string().optional(),
730
- available: z.boolean().optional()
731
- })
732
- ).output(z.object({ data: z.array(z.any()), total: z.number() })),
733
- create: oc.input(
734
- z.object({
735
- isbn: z.string(),
736
- title: z.string(),
737
- author: z.string(),
738
- publisher: z.string().optional(),
739
- year: z.number().optional(),
740
- subjectArea: z.string().optional(),
741
- copiesTotal: z.number().min(1),
742
- shelfLocation: z.string().optional()
743
- })
744
- ).output(z.object({ id: uuidSchema }))
745
- },
746
- borrowings: {
747
- checkout: oc.input(
748
- z.object({
749
- bookId: uuidSchema,
750
- borrowerType: z.enum(["student", "staff"]),
751
- borrowerId: uuidSchema,
752
- dueDate: z.string()
753
- })
754
- ).output(z.object({ id: uuidSchema })),
755
- return: oc.input(
756
- z.object({ borrowingId: uuidSchema, condition: z.string().optional() })
757
- ).output(z.object({ fine: z.number() })),
758
- listOverdue: oc.input(z.object({ branchId: uuidSchema })).output(z.array(z.any()))
759
- }
760
- };
761
- var disciplineContract = {
762
- incidents: {
763
- log: oc.input(
764
- z.object({
765
- studentId: uuidSchema,
766
- incidentType: z.string(),
767
- description: z.string(),
768
- severity: incidentSeverityEnum,
769
- incidentDate: z.string(),
770
- requiresCounsellor: z.boolean().default(false)
771
- })
772
- ).output(z.object({ id: uuidSchema })),
773
- list: oc.input(
774
- paginationSchema.extend({
775
- branchId: uuidSchema,
776
- studentId: uuidSchema.optional(),
777
- status: incidentStatusEnum.optional()
778
- })
779
- ).output(z.object({ data: z.array(z.any()), total: z.number() })),
780
- rule: oc.input(
781
- z.object({
782
- incidentId: uuidSchema,
783
- ruling: disciplineRulingEnum,
784
- suspensionDays: z.number().optional(),
785
- notes: z.string()
786
- })
787
- ).output(z.object({ success: z.boolean() }))
788
- }
789
- };
790
- var commsContract = {
791
- notifications: {
792
- list: oc.input(paginationSchema.extend({ unreadOnly: z.boolean().optional() })).output(z.object({ data: z.array(z.any()), unreadCount: z.number() })),
793
- markRead: oc.input(z.object({ ids: z.array(uuidSchema) })).output(z.object({ updated: z.number() }))
794
- },
795
- messages: {
796
- list: oc.input(paginationSchema).output(z.array(z.any())),
797
- send: oc.input(
798
- z.object({
799
- recipientId: uuidSchema,
800
- subject: z.string(),
801
- body: z.string(),
802
- parentId: uuidSchema.optional()
803
- })
804
- ).output(z.object({ id: uuidSchema }))
805
- },
806
- sms: {
807
- send: oc.input(sendBulkSmsInputSchema).output(z.object({ queued: z.number() }))
808
- },
809
- notices: {
810
- list: oc.input(z.object({ branchId: uuidSchema, active: z.boolean().optional() })).output(z.array(z.any())),
811
- create: oc.input(
812
- z.object({
813
- title: z.string(),
814
- body: z.string(),
815
- audienceType: z.string(),
816
- audienceIds: z.array(uuidSchema).optional(),
817
- publishAt: z.string().optional(),
818
- expiresAt: z.string().optional()
819
- })
820
- ).output(z.object({ id: uuidSchema }))
821
- }
822
- };
823
- var adminContract = {
824
- auditLogs: {
825
- list: oc.input(
826
- paginationSchema.extend({
827
- branchId: uuidSchema.optional(),
828
- userId: uuidSchema.optional(),
829
- action: z.string().optional(),
830
- from: z.string().optional(),
831
- to: z.string().optional()
832
- })
833
- ).output(z.object({ data: z.array(z.any()), total: z.number() }))
834
- },
835
- users: {
836
- create: oc.input(
837
- z.object({
838
- firstName: z.string(),
839
- middleName: z.string().optional(),
840
- lastName: z.string(),
841
- email: z.string().email(),
842
- phone: z.string().optional(),
843
- roleId: uuidSchema,
844
- branchId: uuidSchema,
845
- temporaryPassword: z.string().min(8)
846
- })
847
- ).output(z.object({ id: uuidSchema })),
848
- suspend: oc.input(z.object({ userId: uuidSchema, reason: z.string() })).output(z.object({ success: z.boolean() }))
849
- },
850
- roles: {
851
- list: oc.input(z.object({ branchId: uuidSchema })).output(
852
- z.array(
853
- z.object({
854
- id: uuidSchema,
855
- name: z.string(),
856
- isSystem: z.boolean(),
857
- permissionCount: z.number()
858
- })
859
- )
860
- ),
861
- create: oc.input(
862
- z.object({
863
- name: z.string(),
864
- description: z.string().optional(),
865
- permissionIds: z.array(uuidSchema)
866
- })
867
- ).output(z.object({ id: uuidSchema }))
868
- }
869
- };
870
- var storageContract = {
871
- presignUpload: oc.input(
872
- z.object({
873
- fileName: z.string(),
874
- mimeType: z.string(),
875
- category: z.enum([
876
- "student_photo",
877
- "staff_photo",
878
- "document",
879
- "payslip",
880
- "report_card",
881
- "asset_photo",
882
- "notice_attachment"
883
- ]),
884
- resourceId: uuidSchema.optional()
885
- })
886
- ).output(
887
- z.object({
888
- uploadUrl: z.string(),
889
- fileKey: z.string(),
890
- expiresIn: z.number()
891
- })
892
- ),
893
- confirmUpload: oc.input(
894
- z.object({
895
- fileKey: z.string(),
896
- resourceId: uuidSchema,
897
- resourceType: z.string()
898
- })
899
- ).output(z.object({ publicUrl: z.string() }))
900
- };
901
- var appContract = {
902
- auth: authContract,
903
- branches: branchesContract,
904
- students: studentsContract,
905
- academics: academicsContract,
906
- finance: financeContract,
907
- hr: hrContract,
908
- payroll: payrollContract,
909
- transport: transportContract,
910
- assets: assetsContract,
911
- library: libraryContract,
912
- discipline: disciplineContract,
913
- comms: commsContract,
914
- admin: adminContract,
915
- storage: storageContract
916
- };
917
-
918
- export {
919
- authContract,
920
- branchesContract,
921
- studentsContract,
922
- academicsContract,
923
- financeContract,
924
- hrContract,
925
- payrollContract,
926
- transportContract,
927
- assetsContract,
928
- libraryContract,
929
- disciplineContract,
930
- commsContract,
931
- adminContract,
932
- storageContract,
933
- appContract
934
- };
935
- //# sourceMappingURL=chunk-VC6SCJVW.mjs.map