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