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