@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,1125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/contracts/index.ts
|
|
21
|
+
var contracts_exports = {};
|
|
22
|
+
__export(contracts_exports, {
|
|
23
|
+
academicsContract: () => academicsContract,
|
|
24
|
+
adminContract: () => adminContract,
|
|
25
|
+
appContract: () => appContract,
|
|
26
|
+
assetsContract: () => assetsContract,
|
|
27
|
+
authContract: () => authContract,
|
|
28
|
+
branchesContract: () => branchesContract,
|
|
29
|
+
commsContract: () => commsContract,
|
|
30
|
+
disciplineContract: () => disciplineContract,
|
|
31
|
+
financeContract: () => financeContract,
|
|
32
|
+
hrContract: () => hrContract,
|
|
33
|
+
libraryContract: () => libraryContract,
|
|
34
|
+
payrollContract: () => payrollContract,
|
|
35
|
+
storageContract: () => storageContract,
|
|
36
|
+
studentsContract: () => studentsContract,
|
|
37
|
+
transportContract: () => transportContract
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(contracts_exports);
|
|
40
|
+
var import_contract = require("@orpc/contract");
|
|
41
|
+
var import_zod2 = require("zod");
|
|
42
|
+
|
|
43
|
+
// src/schemas/index.ts
|
|
44
|
+
var import_zod = require("zod");
|
|
45
|
+
var uuidSchema = import_zod.z.string().uuid();
|
|
46
|
+
var paginationSchema = import_zod.z.object({
|
|
47
|
+
page: import_zod.z.number().int().min(1).default(1),
|
|
48
|
+
limit: import_zod.z.number().int().min(1).max(100).default(20)
|
|
49
|
+
});
|
|
50
|
+
var dateRangeSchema = import_zod.z.object({
|
|
51
|
+
from: import_zod.z.string().datetime().optional(),
|
|
52
|
+
to: import_zod.z.string().datetime().optional()
|
|
53
|
+
});
|
|
54
|
+
var genderEnum = import_zod.z.enum(["male", "female"]);
|
|
55
|
+
var userStatusEnum = import_zod.z.enum(["active", "inactive", "suspended"]);
|
|
56
|
+
var systemRoleEnum = import_zod.z.enum([
|
|
57
|
+
"DIRECTOR",
|
|
58
|
+
"PRINCIPAL",
|
|
59
|
+
"DEPUTY_PRINCIPAL",
|
|
60
|
+
"HOD",
|
|
61
|
+
"CLASS_TEACHER",
|
|
62
|
+
"SUBJECT_TEACHER",
|
|
63
|
+
"BURSAR",
|
|
64
|
+
"HR_ADMIN",
|
|
65
|
+
"SCHOOL_NURSE",
|
|
66
|
+
"LIBRARIAN",
|
|
67
|
+
"LAB_TECHNICIAN",
|
|
68
|
+
"SPORTS_COACH",
|
|
69
|
+
"COUNSELLOR",
|
|
70
|
+
"CARETAKER",
|
|
71
|
+
"SECURITY",
|
|
72
|
+
"KITCHEN_STAFF",
|
|
73
|
+
"DRIVER",
|
|
74
|
+
"IT_ADMIN",
|
|
75
|
+
"STUDENT",
|
|
76
|
+
"PARENT",
|
|
77
|
+
"ORG_SPONSOR",
|
|
78
|
+
"INDIVIDUAL_SPONSOR"
|
|
79
|
+
]);
|
|
80
|
+
var loginInputSchema = import_zod.z.object({
|
|
81
|
+
email: import_zod.z.string().email(),
|
|
82
|
+
password: import_zod.z.string().min(8),
|
|
83
|
+
deviceFingerprint: import_zod.z.string().optional()
|
|
84
|
+
});
|
|
85
|
+
var loginOutputSchema = import_zod.z.object({
|
|
86
|
+
accessToken: import_zod.z.string(),
|
|
87
|
+
refreshToken: import_zod.z.string().optional(),
|
|
88
|
+
user: import_zod.z.object({
|
|
89
|
+
id: uuidSchema,
|
|
90
|
+
firstName: import_zod.z.string(),
|
|
91
|
+
middleName: import_zod.z.string().nullable(),
|
|
92
|
+
lastName: import_zod.z.string(),
|
|
93
|
+
email: import_zod.z.string().email(),
|
|
94
|
+
avatarUrl: import_zod.z.string().nullable(),
|
|
95
|
+
roles: import_zod.z.array(
|
|
96
|
+
import_zod.z.object({
|
|
97
|
+
id: uuidSchema,
|
|
98
|
+
name: import_zod.z.string(),
|
|
99
|
+
branchId: uuidSchema.nullable()
|
|
100
|
+
})
|
|
101
|
+
),
|
|
102
|
+
activeBranchId: uuidSchema.nullable(),
|
|
103
|
+
isMfaEnabled: import_zod.z.boolean()
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
var refreshTokenOutputSchema = import_zod.z.object({
|
|
107
|
+
accessToken: import_zod.z.string()
|
|
108
|
+
});
|
|
109
|
+
var refreshInputSchema = import_zod.z.object({
|
|
110
|
+
refreshToken: import_zod.z.string().optional()
|
|
111
|
+
});
|
|
112
|
+
var mfaVerifyInputSchema = import_zod.z.object({
|
|
113
|
+
totp: import_zod.z.string().length(6)
|
|
114
|
+
});
|
|
115
|
+
var changePasswordInputSchema = import_zod.z.object({
|
|
116
|
+
currentPassword: import_zod.z.string().min(8),
|
|
117
|
+
newPassword: import_zod.z.string().min(8)
|
|
118
|
+
});
|
|
119
|
+
var userSchema = import_zod.z.object({
|
|
120
|
+
id: uuidSchema,
|
|
121
|
+
firstName: import_zod.z.string(),
|
|
122
|
+
middleName: import_zod.z.string().nullable(),
|
|
123
|
+
lastName: import_zod.z.string(),
|
|
124
|
+
email: import_zod.z.string().email(),
|
|
125
|
+
phone: import_zod.z.string().nullable(),
|
|
126
|
+
avatarUrl: import_zod.z.string().nullable(),
|
|
127
|
+
isActive: import_zod.z.boolean(),
|
|
128
|
+
isMfaEnabled: import_zod.z.boolean(),
|
|
129
|
+
lastLoginAt: import_zod.z.string().datetime().nullable(),
|
|
130
|
+
createdAt: import_zod.z.string().datetime()
|
|
131
|
+
});
|
|
132
|
+
var branchSchema = import_zod.z.object({
|
|
133
|
+
id: uuidSchema,
|
|
134
|
+
name: import_zod.z.string(),
|
|
135
|
+
code: import_zod.z.string(),
|
|
136
|
+
address: import_zod.z.string(),
|
|
137
|
+
county: import_zod.z.string(),
|
|
138
|
+
phone: import_zod.z.string().nullable(),
|
|
139
|
+
email: import_zod.z.string().email().nullable(),
|
|
140
|
+
logoUrl: import_zod.z.string().nullable(),
|
|
141
|
+
motto: import_zod.z.string().nullable(),
|
|
142
|
+
principalId: uuidSchema.nullable(),
|
|
143
|
+
mpesaPaybill: import_zod.z.string().nullable(),
|
|
144
|
+
featureFlags: import_zod.z.record(import_zod.z.boolean()),
|
|
145
|
+
createdAt: import_zod.z.string().datetime()
|
|
146
|
+
});
|
|
147
|
+
var createBranchInputSchema = import_zod.z.object({
|
|
148
|
+
name: import_zod.z.string().min(2).max(100),
|
|
149
|
+
code: import_zod.z.string().min(2).max(20),
|
|
150
|
+
address: import_zod.z.string(),
|
|
151
|
+
county: import_zod.z.string(),
|
|
152
|
+
phone: import_zod.z.string().optional(),
|
|
153
|
+
email: import_zod.z.string().email().optional(),
|
|
154
|
+
motto: import_zod.z.string().optional()
|
|
155
|
+
});
|
|
156
|
+
var studentStatusEnum = import_zod.z.enum([
|
|
157
|
+
"active",
|
|
158
|
+
"transferred",
|
|
159
|
+
"graduated",
|
|
160
|
+
"suspended",
|
|
161
|
+
"withdrawn"
|
|
162
|
+
]);
|
|
163
|
+
var studentSchema = import_zod.z.object({
|
|
164
|
+
id: uuidSchema,
|
|
165
|
+
branchId: uuidSchema,
|
|
166
|
+
admissionNo: import_zod.z.string(),
|
|
167
|
+
nemisNo: import_zod.z.string().nullable(),
|
|
168
|
+
firstName: import_zod.z.string(),
|
|
169
|
+
middleName: import_zod.z.string().nullable(),
|
|
170
|
+
lastName: import_zod.z.string(),
|
|
171
|
+
dateOfBirth: import_zod.z.string(),
|
|
172
|
+
gender: genderEnum,
|
|
173
|
+
photoUrl: import_zod.z.string().nullable(),
|
|
174
|
+
bloodGroup: import_zod.z.string().nullable(),
|
|
175
|
+
admissionDate: import_zod.z.string(),
|
|
176
|
+
status: studentStatusEnum,
|
|
177
|
+
currentClassId: uuidSchema.nullable(),
|
|
178
|
+
createdAt: import_zod.z.string().datetime()
|
|
179
|
+
});
|
|
180
|
+
var createStudentInputSchema = import_zod.z.object({
|
|
181
|
+
admissionNo: import_zod.z.string().min(1),
|
|
182
|
+
nemisNo: import_zod.z.string().optional(),
|
|
183
|
+
firstName: import_zod.z.string().min(1).max(100),
|
|
184
|
+
middleName: import_zod.z.string().max(100).optional(),
|
|
185
|
+
lastName: import_zod.z.string().min(1).max(100),
|
|
186
|
+
dateOfBirth: import_zod.z.string(),
|
|
187
|
+
gender: genderEnum,
|
|
188
|
+
admissionDate: import_zod.z.string(),
|
|
189
|
+
guardianId: uuidSchema.optional()
|
|
190
|
+
});
|
|
191
|
+
var listStudentsInputSchema = paginationSchema.extend({
|
|
192
|
+
branchId: uuidSchema.optional(),
|
|
193
|
+
classId: uuidSchema.optional(),
|
|
194
|
+
search: import_zod.z.string().optional(),
|
|
195
|
+
status: studentStatusEnum.optional(),
|
|
196
|
+
termId: uuidSchema.optional()
|
|
197
|
+
});
|
|
198
|
+
var guardianSchema = import_zod.z.object({
|
|
199
|
+
id: uuidSchema,
|
|
200
|
+
userId: uuidSchema,
|
|
201
|
+
firstName: import_zod.z.string(),
|
|
202
|
+
middleName: import_zod.z.string().nullable(),
|
|
203
|
+
lastName: import_zod.z.string(),
|
|
204
|
+
relationship: import_zod.z.string(),
|
|
205
|
+
phone: import_zod.z.string(),
|
|
206
|
+
email: import_zod.z.string().email().nullable(),
|
|
207
|
+
nationalId: import_zod.z.string().nullable(),
|
|
208
|
+
occupation: import_zod.z.string().nullable(),
|
|
209
|
+
address: import_zod.z.string().nullable()
|
|
210
|
+
});
|
|
211
|
+
var sponsorTypeEnum = import_zod.z.enum(["organisation", "individual"]);
|
|
212
|
+
var sponsorSchema = import_zod.z.object({
|
|
213
|
+
id: uuidSchema,
|
|
214
|
+
branchId: uuidSchema,
|
|
215
|
+
type: sponsorTypeEnum,
|
|
216
|
+
organisationName: import_zod.z.string().nullable(),
|
|
217
|
+
firstName: import_zod.z.string().nullable(),
|
|
218
|
+
middleName: import_zod.z.string().nullable(),
|
|
219
|
+
lastName: import_zod.z.string().nullable(),
|
|
220
|
+
contactUserId: uuidSchema.nullable(),
|
|
221
|
+
phone: import_zod.z.string(),
|
|
222
|
+
email: import_zod.z.string().email().nullable(),
|
|
223
|
+
address: import_zod.z.string().nullable()
|
|
224
|
+
});
|
|
225
|
+
var gradeLevelEnum = import_zod.z.enum([
|
|
226
|
+
"PP1",
|
|
227
|
+
"PP2",
|
|
228
|
+
"G1",
|
|
229
|
+
"G2",
|
|
230
|
+
"G3",
|
|
231
|
+
"G4",
|
|
232
|
+
"G5",
|
|
233
|
+
"G6",
|
|
234
|
+
"G7",
|
|
235
|
+
"G8",
|
|
236
|
+
"G9"
|
|
237
|
+
]);
|
|
238
|
+
var assessmentTypeEnum = import_zod.z.enum([
|
|
239
|
+
"formative",
|
|
240
|
+
"summative",
|
|
241
|
+
"knec_national",
|
|
242
|
+
"informal"
|
|
243
|
+
]);
|
|
244
|
+
var rubricBandEnum = import_zod.z.enum(["EE", "ME", "AE", "BE"]);
|
|
245
|
+
var subjectSchema = import_zod.z.object({
|
|
246
|
+
id: uuidSchema,
|
|
247
|
+
branchId: uuidSchema,
|
|
248
|
+
name: import_zod.z.string(),
|
|
249
|
+
code: import_zod.z.string(),
|
|
250
|
+
gradeLevel: gradeLevelEnum,
|
|
251
|
+
departmentId: uuidSchema.nullable()
|
|
252
|
+
});
|
|
253
|
+
var assessmentScoreInputSchema = import_zod.z.object({
|
|
254
|
+
assessmentId: uuidSchema,
|
|
255
|
+
studentId: uuidSchema,
|
|
256
|
+
subStrandId: uuidSchema,
|
|
257
|
+
numericScore: import_zod.z.number().min(0).max(100),
|
|
258
|
+
comments: import_zod.z.string().optional()
|
|
259
|
+
});
|
|
260
|
+
var reportCardStatusEnum = import_zod.z.enum([
|
|
261
|
+
"draft",
|
|
262
|
+
"hod_review",
|
|
263
|
+
"principal_review",
|
|
264
|
+
"released",
|
|
265
|
+
"blocked"
|
|
266
|
+
]);
|
|
267
|
+
var feeItemCategoryEnum = import_zod.z.enum([
|
|
268
|
+
"compulsory",
|
|
269
|
+
"class_specific",
|
|
270
|
+
"additive"
|
|
271
|
+
]);
|
|
272
|
+
var paymentMethodEnum = import_zod.z.enum([
|
|
273
|
+
"mpesa",
|
|
274
|
+
"bank",
|
|
275
|
+
"card",
|
|
276
|
+
"cash",
|
|
277
|
+
"cheque"
|
|
278
|
+
]);
|
|
279
|
+
var invoiceStatusEnum = import_zod.z.enum([
|
|
280
|
+
"draft",
|
|
281
|
+
"sent",
|
|
282
|
+
"partial",
|
|
283
|
+
"paid",
|
|
284
|
+
"overdue",
|
|
285
|
+
"cancelled"
|
|
286
|
+
]);
|
|
287
|
+
var feeItemSchema = import_zod.z.object({
|
|
288
|
+
id: uuidSchema,
|
|
289
|
+
branchId: uuidSchema,
|
|
290
|
+
name: import_zod.z.string(),
|
|
291
|
+
category: feeItemCategoryEnum,
|
|
292
|
+
defaultAmount: import_zod.z.number(),
|
|
293
|
+
applicableGrades: import_zod.z.array(gradeLevelEnum),
|
|
294
|
+
isActive: import_zod.z.boolean()
|
|
295
|
+
});
|
|
296
|
+
var recordPaymentInputSchema = import_zod.z.object({
|
|
297
|
+
studentId: uuidSchema,
|
|
298
|
+
invoiceId: uuidSchema,
|
|
299
|
+
amount: import_zod.z.number().positive(),
|
|
300
|
+
method: paymentMethodEnum,
|
|
301
|
+
reference: import_zod.z.string().optional(),
|
|
302
|
+
mpesaReceipt: import_zod.z.string().optional(),
|
|
303
|
+
paymentDate: import_zod.z.string()
|
|
304
|
+
});
|
|
305
|
+
var employmentTypeEnum = import_zod.z.enum([
|
|
306
|
+
"permanent",
|
|
307
|
+
"contract",
|
|
308
|
+
"temporary",
|
|
309
|
+
"intern"
|
|
310
|
+
]);
|
|
311
|
+
var staffSchema = import_zod.z.object({
|
|
312
|
+
id: uuidSchema,
|
|
313
|
+
branchId: uuidSchema,
|
|
314
|
+
userId: uuidSchema,
|
|
315
|
+
firstName: import_zod.z.string(),
|
|
316
|
+
middleName: import_zod.z.string().nullable(),
|
|
317
|
+
lastName: import_zod.z.string(),
|
|
318
|
+
tscNumber: import_zod.z.string().nullable(),
|
|
319
|
+
nationalId: import_zod.z.string(),
|
|
320
|
+
kraPin: import_zod.z.string().nullable(),
|
|
321
|
+
nhifNo: import_zod.z.string().nullable(),
|
|
322
|
+
nssfNo: import_zod.z.string().nullable(),
|
|
323
|
+
phone: import_zod.z.string(),
|
|
324
|
+
departmentId: uuidSchema.nullable(),
|
|
325
|
+
designation: import_zod.z.string(),
|
|
326
|
+
employmentType: employmentTypeEnum,
|
|
327
|
+
contractStart: import_zod.z.string(),
|
|
328
|
+
contractEnd: import_zod.z.string().nullable(),
|
|
329
|
+
basicSalary: import_zod.z.number(),
|
|
330
|
+
houseAllowance: import_zod.z.number().default(0),
|
|
331
|
+
transportAllowance: import_zod.z.number().default(0),
|
|
332
|
+
bankName: import_zod.z.string().nullable(),
|
|
333
|
+
bankAccount: import_zod.z.string().nullable(),
|
|
334
|
+
status: userStatusEnum
|
|
335
|
+
});
|
|
336
|
+
var leaveStatusEnum = import_zod.z.enum([
|
|
337
|
+
"pending",
|
|
338
|
+
"approved",
|
|
339
|
+
"rejected",
|
|
340
|
+
"cancelled"
|
|
341
|
+
]);
|
|
342
|
+
var leaveRequestInputSchema = import_zod.z.object({
|
|
343
|
+
leaveTypeId: uuidSchema,
|
|
344
|
+
startDate: import_zod.z.string(),
|
|
345
|
+
endDate: import_zod.z.string(),
|
|
346
|
+
reason: import_zod.z.string().min(10)
|
|
347
|
+
});
|
|
348
|
+
var vehicleOwnershipEnum = import_zod.z.enum(["owned", "contracted"]);
|
|
349
|
+
var vehicleTypeEnum = import_zod.z.enum(["bus", "van", "pickup", "other"]);
|
|
350
|
+
var busRegisterStatusEnum = import_zod.z.enum(["boarded", "alighted", "absent"]);
|
|
351
|
+
var tripLogInputSchema = import_zod.z.object({
|
|
352
|
+
vehicleId: uuidSchema,
|
|
353
|
+
routeId: uuidSchema,
|
|
354
|
+
departureTime: import_zod.z.string().datetime(),
|
|
355
|
+
tripType: import_zod.z.enum(["morning", "evening", "errand"])
|
|
356
|
+
});
|
|
357
|
+
var busRegisterEntrySchema = import_zod.z.object({
|
|
358
|
+
studentId: uuidSchema,
|
|
359
|
+
status: busRegisterStatusEnum
|
|
360
|
+
});
|
|
361
|
+
var assetCategoryEnum = import_zod.z.enum([
|
|
362
|
+
"furniture",
|
|
363
|
+
"lab_equipment",
|
|
364
|
+
"ict_device",
|
|
365
|
+
"vehicle",
|
|
366
|
+
"sports_equipment",
|
|
367
|
+
"kitchen_equipment",
|
|
368
|
+
"musical_instrument",
|
|
369
|
+
"classroom_supply",
|
|
370
|
+
"library_book",
|
|
371
|
+
"other"
|
|
372
|
+
]);
|
|
373
|
+
var assetConditionEnum = import_zod.z.enum([
|
|
374
|
+
"excellent",
|
|
375
|
+
"good",
|
|
376
|
+
"fair",
|
|
377
|
+
"poor",
|
|
378
|
+
"condemned"
|
|
379
|
+
]);
|
|
380
|
+
var maintenanceTicketStatusEnum = import_zod.z.enum([
|
|
381
|
+
"open",
|
|
382
|
+
"in_progress",
|
|
383
|
+
"resolved",
|
|
384
|
+
"closed"
|
|
385
|
+
]);
|
|
386
|
+
var borrowingStatusEnum = import_zod.z.enum([
|
|
387
|
+
"active",
|
|
388
|
+
"returned",
|
|
389
|
+
"overdue",
|
|
390
|
+
"lost"
|
|
391
|
+
]);
|
|
392
|
+
var incidentSeverityEnum = import_zod.z.enum([
|
|
393
|
+
"minor",
|
|
394
|
+
"moderate",
|
|
395
|
+
"serious",
|
|
396
|
+
"critical"
|
|
397
|
+
]);
|
|
398
|
+
var incidentStatusEnum = import_zod.z.enum([
|
|
399
|
+
"open",
|
|
400
|
+
"counsellor_review",
|
|
401
|
+
"hod_review",
|
|
402
|
+
"principal_ruling",
|
|
403
|
+
"resolved"
|
|
404
|
+
]);
|
|
405
|
+
var disciplineRulingEnum = import_zod.z.enum([
|
|
406
|
+
"verbal_warning",
|
|
407
|
+
"written_warning",
|
|
408
|
+
"suspension",
|
|
409
|
+
"expulsion",
|
|
410
|
+
"dismissed"
|
|
411
|
+
]);
|
|
412
|
+
var payrollRunStatusEnum = import_zod.z.enum(["draft", "approved", "paid"]);
|
|
413
|
+
var notificationTypeEnum = import_zod.z.enum([
|
|
414
|
+
"report_card",
|
|
415
|
+
"fee_invoice",
|
|
416
|
+
"fee_reminder",
|
|
417
|
+
"fee_block",
|
|
418
|
+
"attendance_absent",
|
|
419
|
+
"bus_departed",
|
|
420
|
+
"bus_arrived",
|
|
421
|
+
"discipline_incident",
|
|
422
|
+
"assignment",
|
|
423
|
+
"notice",
|
|
424
|
+
"leave",
|
|
425
|
+
"payslip"
|
|
426
|
+
]);
|
|
427
|
+
var sendBulkSmsInputSchema = import_zod.z.object({
|
|
428
|
+
branchId: uuidSchema,
|
|
429
|
+
message: import_zod.z.string().min(1).max(160),
|
|
430
|
+
recipientType: import_zod.z.enum(["class", "grade", "whole_school", "custom"]),
|
|
431
|
+
recipientIds: import_zod.z.array(uuidSchema).optional(),
|
|
432
|
+
scheduleAt: import_zod.z.string().datetime().optional()
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
// src/contracts/index.ts
|
|
436
|
+
var authContract = {
|
|
437
|
+
login: import_contract.oc.input(loginInputSchema).output(loginOutputSchema),
|
|
438
|
+
refresh: import_contract.oc.input(refreshInputSchema).output(refreshTokenOutputSchema),
|
|
439
|
+
logout: import_contract.oc.output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
440
|
+
me: import_contract.oc.output(
|
|
441
|
+
userSchema.extend({
|
|
442
|
+
roles: import_zod2.z.array(
|
|
443
|
+
import_zod2.z.object({
|
|
444
|
+
id: uuidSchema,
|
|
445
|
+
name: import_zod2.z.string(),
|
|
446
|
+
branchId: uuidSchema.nullable()
|
|
447
|
+
})
|
|
448
|
+
)
|
|
449
|
+
})
|
|
450
|
+
),
|
|
451
|
+
verifyMfa: import_contract.oc.input(mfaVerifyInputSchema).output(import_zod2.z.object({ verified: import_zod2.z.boolean() })),
|
|
452
|
+
changePassword: import_contract.oc.input(changePasswordInputSchema).output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
453
|
+
switchBranch: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema })).output(import_zod2.z.object({ accessToken: import_zod2.z.string() }))
|
|
454
|
+
};
|
|
455
|
+
var branchesContract = {
|
|
456
|
+
list: import_contract.oc.output(import_zod2.z.array(branchSchema)),
|
|
457
|
+
get: import_contract.oc.input(import_zod2.z.object({ id: uuidSchema })).output(branchSchema),
|
|
458
|
+
create: import_contract.oc.input(createBranchInputSchema).output(branchSchema),
|
|
459
|
+
update: import_contract.oc.input(createBranchInputSchema.partial().extend({ id: uuidSchema })).output(branchSchema),
|
|
460
|
+
updateFeatureFlags: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema, flags: import_zod2.z.record(import_zod2.z.boolean()) })).output(branchSchema)
|
|
461
|
+
};
|
|
462
|
+
var studentWithGuardians = studentSchema.extend({
|
|
463
|
+
guardians: import_zod2.z.array(guardianSchema),
|
|
464
|
+
sponsors: import_zod2.z.array(sponsorSchema),
|
|
465
|
+
currentClass: import_zod2.z.object({ id: uuidSchema, name: import_zod2.z.string(), grade: import_zod2.z.string() }).nullable()
|
|
466
|
+
});
|
|
467
|
+
var studentsContract = {
|
|
468
|
+
list: import_contract.oc.input(listStudentsInputSchema).output(
|
|
469
|
+
import_zod2.z.object({
|
|
470
|
+
data: import_zod2.z.array(studentSchema),
|
|
471
|
+
total: import_zod2.z.number(),
|
|
472
|
+
page: import_zod2.z.number(),
|
|
473
|
+
limit: import_zod2.z.number()
|
|
474
|
+
})
|
|
475
|
+
),
|
|
476
|
+
get: import_contract.oc.input(import_zod2.z.object({ id: uuidSchema })).output(studentWithGuardians),
|
|
477
|
+
create: import_contract.oc.input(createStudentInputSchema).output(studentSchema),
|
|
478
|
+
update: import_contract.oc.input(createStudentInputSchema.partial().extend({ id: uuidSchema })).output(studentSchema),
|
|
479
|
+
enroll: import_contract.oc.input(
|
|
480
|
+
import_zod2.z.object({
|
|
481
|
+
studentId: uuidSchema,
|
|
482
|
+
classId: uuidSchema,
|
|
483
|
+
termId: uuidSchema
|
|
484
|
+
})
|
|
485
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
486
|
+
transfer: import_contract.oc.input(
|
|
487
|
+
import_zod2.z.object({
|
|
488
|
+
studentId: uuidSchema,
|
|
489
|
+
toBranchId: uuidSchema,
|
|
490
|
+
reason: import_zod2.z.string()
|
|
491
|
+
})
|
|
492
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
493
|
+
linkGuardian: import_contract.oc.input(
|
|
494
|
+
import_zod2.z.object({
|
|
495
|
+
studentId: uuidSchema,
|
|
496
|
+
guardianId: uuidSchema,
|
|
497
|
+
isPrimary: import_zod2.z.boolean()
|
|
498
|
+
})
|
|
499
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
500
|
+
linkSponsor: import_contract.oc.input(
|
|
501
|
+
import_zod2.z.object({
|
|
502
|
+
studentId: uuidSchema,
|
|
503
|
+
sponsorId: uuidSchema,
|
|
504
|
+
termId: uuidSchema,
|
|
505
|
+
feeItemIds: import_zod2.z.array(uuidSchema)
|
|
506
|
+
})
|
|
507
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() }))
|
|
508
|
+
};
|
|
509
|
+
var academicsContract = {
|
|
510
|
+
subjects: {
|
|
511
|
+
list: import_contract.oc.input(
|
|
512
|
+
import_zod2.z.object({
|
|
513
|
+
branchId: uuidSchema,
|
|
514
|
+
gradeLevel: gradeLevelEnum.optional()
|
|
515
|
+
})
|
|
516
|
+
).output(import_zod2.z.array(subjectSchema)),
|
|
517
|
+
create: import_contract.oc.input(
|
|
518
|
+
import_zod2.z.object({
|
|
519
|
+
name: import_zod2.z.string(),
|
|
520
|
+
code: import_zod2.z.string(),
|
|
521
|
+
gradeLevel: gradeLevelEnum,
|
|
522
|
+
departmentId: uuidSchema.optional()
|
|
523
|
+
})
|
|
524
|
+
).output(subjectSchema)
|
|
525
|
+
},
|
|
526
|
+
timetable: {
|
|
527
|
+
get: import_contract.oc.input(import_zod2.z.object({ classId: uuidSchema, termId: uuidSchema })).output(
|
|
528
|
+
import_zod2.z.array(
|
|
529
|
+
import_zod2.z.object({
|
|
530
|
+
id: uuidSchema,
|
|
531
|
+
dayOfWeek: import_zod2.z.number().min(1).max(5),
|
|
532
|
+
periodNo: import_zod2.z.number(),
|
|
533
|
+
subject: subjectSchema,
|
|
534
|
+
teacherName: import_zod2.z.string(),
|
|
535
|
+
room: import_zod2.z.string().nullable(),
|
|
536
|
+
startTime: import_zod2.z.string(),
|
|
537
|
+
endTime: import_zod2.z.string()
|
|
538
|
+
})
|
|
539
|
+
)
|
|
540
|
+
),
|
|
541
|
+
upsert: import_contract.oc.input(
|
|
542
|
+
import_zod2.z.object({
|
|
543
|
+
classId: uuidSchema,
|
|
544
|
+
termId: uuidSchema,
|
|
545
|
+
slots: import_zod2.z.array(
|
|
546
|
+
import_zod2.z.object({
|
|
547
|
+
dayOfWeek: import_zod2.z.number().min(1).max(5),
|
|
548
|
+
periodNo: import_zod2.z.number(),
|
|
549
|
+
subjectId: uuidSchema,
|
|
550
|
+
teacherId: uuidSchema,
|
|
551
|
+
room: import_zod2.z.string().optional(),
|
|
552
|
+
startTime: import_zod2.z.string(),
|
|
553
|
+
endTime: import_zod2.z.string()
|
|
554
|
+
})
|
|
555
|
+
)
|
|
556
|
+
})
|
|
557
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() }))
|
|
558
|
+
},
|
|
559
|
+
assessments: {
|
|
560
|
+
list: import_contract.oc.input(
|
|
561
|
+
import_zod2.z.object({
|
|
562
|
+
classId: uuidSchema,
|
|
563
|
+
termId: uuidSchema,
|
|
564
|
+
type: assessmentTypeEnum.optional()
|
|
565
|
+
})
|
|
566
|
+
).output(
|
|
567
|
+
import_zod2.z.array(
|
|
568
|
+
import_zod2.z.object({
|
|
569
|
+
id: uuidSchema,
|
|
570
|
+
title: import_zod2.z.string(),
|
|
571
|
+
type: assessmentTypeEnum,
|
|
572
|
+
date: import_zod2.z.string(),
|
|
573
|
+
maxScore: import_zod2.z.number(),
|
|
574
|
+
subjectId: uuidSchema
|
|
575
|
+
})
|
|
576
|
+
)
|
|
577
|
+
),
|
|
578
|
+
create: import_contract.oc.input(
|
|
579
|
+
import_zod2.z.object({
|
|
580
|
+
title: import_zod2.z.string(),
|
|
581
|
+
type: assessmentTypeEnum,
|
|
582
|
+
classId: uuidSchema,
|
|
583
|
+
subjectId: uuidSchema,
|
|
584
|
+
termId: uuidSchema,
|
|
585
|
+
date: import_zod2.z.string(),
|
|
586
|
+
maxScore: import_zod2.z.number()
|
|
587
|
+
})
|
|
588
|
+
).output(import_zod2.z.object({ id: uuidSchema })),
|
|
589
|
+
enterScores: import_contract.oc.input(import_zod2.z.object({ scores: import_zod2.z.array(assessmentScoreInputSchema) })).output(import_zod2.z.object({ saved: import_zod2.z.number() }))
|
|
590
|
+
},
|
|
591
|
+
reportCards: {
|
|
592
|
+
list: import_contract.oc.input(
|
|
593
|
+
import_zod2.z.object({
|
|
594
|
+
branchId: uuidSchema,
|
|
595
|
+
termId: uuidSchema,
|
|
596
|
+
classId: uuidSchema.optional(),
|
|
597
|
+
status: reportCardStatusEnum.optional()
|
|
598
|
+
})
|
|
599
|
+
).output(
|
|
600
|
+
import_zod2.z.array(
|
|
601
|
+
import_zod2.z.object({
|
|
602
|
+
id: uuidSchema,
|
|
603
|
+
studentId: uuidSchema,
|
|
604
|
+
studentName: import_zod2.z.string(),
|
|
605
|
+
status: reportCardStatusEnum,
|
|
606
|
+
generatedAt: import_zod2.z.string().datetime().nullable()
|
|
607
|
+
})
|
|
608
|
+
)
|
|
609
|
+
),
|
|
610
|
+
get: import_contract.oc.input(import_zod2.z.object({ studentId: uuidSchema, termId: uuidSchema })).output(
|
|
611
|
+
import_zod2.z.object({
|
|
612
|
+
id: uuidSchema,
|
|
613
|
+
studentId: uuidSchema,
|
|
614
|
+
termId: uuidSchema,
|
|
615
|
+
status: reportCardStatusEnum,
|
|
616
|
+
scores: import_zod2.z.array(import_zod2.z.any()),
|
|
617
|
+
teacherComments: import_zod2.z.string().nullable(),
|
|
618
|
+
generatedAt: import_zod2.z.string().datetime().nullable()
|
|
619
|
+
})
|
|
620
|
+
),
|
|
621
|
+
updateStatus: import_contract.oc.input(
|
|
622
|
+
import_zod2.z.object({
|
|
623
|
+
id: uuidSchema,
|
|
624
|
+
status: reportCardStatusEnum,
|
|
625
|
+
comments: import_zod2.z.string().optional()
|
|
626
|
+
})
|
|
627
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() }))
|
|
628
|
+
},
|
|
629
|
+
attendance: {
|
|
630
|
+
markClass: import_contract.oc.input(
|
|
631
|
+
import_zod2.z.object({
|
|
632
|
+
classId: uuidSchema,
|
|
633
|
+
date: import_zod2.z.string(),
|
|
634
|
+
subjectId: uuidSchema,
|
|
635
|
+
records: import_zod2.z.array(
|
|
636
|
+
import_zod2.z.object({
|
|
637
|
+
studentId: uuidSchema,
|
|
638
|
+
present: import_zod2.z.boolean(),
|
|
639
|
+
note: import_zod2.z.string().optional()
|
|
640
|
+
})
|
|
641
|
+
)
|
|
642
|
+
})
|
|
643
|
+
).output(import_zod2.z.object({ saved: import_zod2.z.number() })),
|
|
644
|
+
getClassAttendance: import_contract.oc.input(
|
|
645
|
+
import_zod2.z.object({ classId: uuidSchema, from: import_zod2.z.string(), to: import_zod2.z.string() })
|
|
646
|
+
).output(
|
|
647
|
+
import_zod2.z.array(
|
|
648
|
+
import_zod2.z.object({
|
|
649
|
+
studentId: uuidSchema,
|
|
650
|
+
studentName: import_zod2.z.string(),
|
|
651
|
+
presentDays: import_zod2.z.number(),
|
|
652
|
+
absentDays: import_zod2.z.number(),
|
|
653
|
+
percentage: import_zod2.z.number()
|
|
654
|
+
})
|
|
655
|
+
)
|
|
656
|
+
)
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
var financeContract = {
|
|
660
|
+
feeItems: {
|
|
661
|
+
list: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema })).output(import_zod2.z.array(feeItemSchema)),
|
|
662
|
+
create: import_contract.oc.input(
|
|
663
|
+
import_zod2.z.object({
|
|
664
|
+
name: import_zod2.z.string(),
|
|
665
|
+
category: import_zod2.z.any(),
|
|
666
|
+
defaultAmount: import_zod2.z.number(),
|
|
667
|
+
applicableGrades: import_zod2.z.array(gradeLevelEnum)
|
|
668
|
+
})
|
|
669
|
+
).output(feeItemSchema)
|
|
670
|
+
},
|
|
671
|
+
invoices: {
|
|
672
|
+
listForStudent: import_contract.oc.input(import_zod2.z.object({ studentId: uuidSchema, termId: uuidSchema.optional() })).output(
|
|
673
|
+
import_zod2.z.array(
|
|
674
|
+
import_zod2.z.object({
|
|
675
|
+
id: uuidSchema,
|
|
676
|
+
termId: uuidSchema,
|
|
677
|
+
payerType: import_zod2.z.string(),
|
|
678
|
+
totalAmount: import_zod2.z.number(),
|
|
679
|
+
paidAmount: import_zod2.z.number(),
|
|
680
|
+
balance: import_zod2.z.number(),
|
|
681
|
+
status: invoiceStatusEnum,
|
|
682
|
+
dueDate: import_zod2.z.string().nullable()
|
|
683
|
+
})
|
|
684
|
+
)
|
|
685
|
+
),
|
|
686
|
+
generate: import_contract.oc.input(
|
|
687
|
+
import_zod2.z.object({
|
|
688
|
+
branchId: uuidSchema,
|
|
689
|
+
termId: uuidSchema,
|
|
690
|
+
studentIds: import_zod2.z.array(uuidSchema).optional()
|
|
691
|
+
})
|
|
692
|
+
).output(import_zod2.z.object({ generated: import_zod2.z.number() }))
|
|
693
|
+
},
|
|
694
|
+
payments: {
|
|
695
|
+
record: import_contract.oc.input(recordPaymentInputSchema).output(import_zod2.z.object({ id: uuidSchema, receipt: import_zod2.z.string() })),
|
|
696
|
+
listForStudent: import_contract.oc.input(import_zod2.z.object({ studentId: uuidSchema })).output(
|
|
697
|
+
import_zod2.z.array(
|
|
698
|
+
import_zod2.z.object({
|
|
699
|
+
id: uuidSchema,
|
|
700
|
+
amount: import_zod2.z.number(),
|
|
701
|
+
method: import_zod2.z.string(),
|
|
702
|
+
reference: import_zod2.z.string().nullable(),
|
|
703
|
+
paymentDate: import_zod2.z.string(),
|
|
704
|
+
createdAt: import_zod2.z.string()
|
|
705
|
+
})
|
|
706
|
+
)
|
|
707
|
+
)
|
|
708
|
+
},
|
|
709
|
+
blocks: {
|
|
710
|
+
list: import_contract.oc.input(
|
|
711
|
+
import_zod2.z.object({
|
|
712
|
+
branchId: uuidSchema,
|
|
713
|
+
termId: uuidSchema,
|
|
714
|
+
active: import_zod2.z.boolean().optional()
|
|
715
|
+
})
|
|
716
|
+
).output(
|
|
717
|
+
import_zod2.z.array(
|
|
718
|
+
import_zod2.z.object({
|
|
719
|
+
id: uuidSchema,
|
|
720
|
+
studentId: uuidSchema,
|
|
721
|
+
studentName: import_zod2.z.string(),
|
|
722
|
+
blockType: import_zod2.z.string(),
|
|
723
|
+
isActive: import_zod2.z.boolean(),
|
|
724
|
+
balanceAtBlock: import_zod2.z.number()
|
|
725
|
+
})
|
|
726
|
+
)
|
|
727
|
+
),
|
|
728
|
+
lift: import_contract.oc.input(import_zod2.z.object({ blockId: uuidSchema, reason: import_zod2.z.string() })).output(import_zod2.z.object({ success: import_zod2.z.boolean() }))
|
|
729
|
+
},
|
|
730
|
+
reports: {
|
|
731
|
+
termCollection: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema, termId: uuidSchema })).output(
|
|
732
|
+
import_zod2.z.object({
|
|
733
|
+
totalExpected: import_zod2.z.number(),
|
|
734
|
+
totalCollected: import_zod2.z.number(),
|
|
735
|
+
totalOutstanding: import_zod2.z.number(),
|
|
736
|
+
collectionRate: import_zod2.z.number(),
|
|
737
|
+
byPaymentMethod: import_zod2.z.record(import_zod2.z.number())
|
|
738
|
+
})
|
|
739
|
+
)
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
var hrContract = {
|
|
743
|
+
staff: {
|
|
744
|
+
list: import_contract.oc.input(
|
|
745
|
+
paginationSchema.extend({
|
|
746
|
+
branchId: uuidSchema,
|
|
747
|
+
search: import_zod2.z.string().optional(),
|
|
748
|
+
departmentId: uuidSchema.optional()
|
|
749
|
+
})
|
|
750
|
+
).output(import_zod2.z.object({ data: import_zod2.z.array(staffSchema), total: import_zod2.z.number() })),
|
|
751
|
+
get: import_contract.oc.input(import_zod2.z.object({ id: uuidSchema })).output(staffSchema),
|
|
752
|
+
create: import_contract.oc.input(
|
|
753
|
+
staffSchema.omit({ id: true }).partial({
|
|
754
|
+
contractEnd: true,
|
|
755
|
+
tscNumber: true,
|
|
756
|
+
kraPin: true,
|
|
757
|
+
nhifNo: true,
|
|
758
|
+
nssfNo: true,
|
|
759
|
+
bankName: true,
|
|
760
|
+
bankAccount: true,
|
|
761
|
+
departmentId: true
|
|
762
|
+
})
|
|
763
|
+
).output(staffSchema)
|
|
764
|
+
},
|
|
765
|
+
leave: {
|
|
766
|
+
request: import_contract.oc.input(leaveRequestInputSchema).output(import_zod2.z.object({ id: uuidSchema })),
|
|
767
|
+
list: import_contract.oc.input(
|
|
768
|
+
import_zod2.z.object({
|
|
769
|
+
branchId: uuidSchema,
|
|
770
|
+
staffId: uuidSchema.optional(),
|
|
771
|
+
status: leaveStatusEnum.optional()
|
|
772
|
+
})
|
|
773
|
+
).output(import_zod2.z.array(import_zod2.z.any())),
|
|
774
|
+
approve: import_contract.oc.input(
|
|
775
|
+
import_zod2.z.object({
|
|
776
|
+
id: uuidSchema,
|
|
777
|
+
approved: import_zod2.z.boolean(),
|
|
778
|
+
comment: import_zod2.z.string().optional()
|
|
779
|
+
})
|
|
780
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() }))
|
|
781
|
+
},
|
|
782
|
+
attendance: {
|
|
783
|
+
mark: import_contract.oc.input(
|
|
784
|
+
import_zod2.z.object({
|
|
785
|
+
staffId: uuidSchema,
|
|
786
|
+
date: import_zod2.z.string(),
|
|
787
|
+
checkIn: import_zod2.z.string().optional(),
|
|
788
|
+
checkOut: import_zod2.z.string().optional(),
|
|
789
|
+
status: import_zod2.z.enum(["present", "absent", "late", "half_day"])
|
|
790
|
+
})
|
|
791
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
792
|
+
getSummary: import_contract.oc.input(
|
|
793
|
+
import_zod2.z.object({ staffId: uuidSchema, month: import_zod2.z.number(), year: import_zod2.z.number() })
|
|
794
|
+
).output(
|
|
795
|
+
import_zod2.z.object({
|
|
796
|
+
presentDays: import_zod2.z.number(),
|
|
797
|
+
absentDays: import_zod2.z.number(),
|
|
798
|
+
lateDays: import_zod2.z.number()
|
|
799
|
+
})
|
|
800
|
+
)
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
var payrollContract = {
|
|
804
|
+
runs: {
|
|
805
|
+
list: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema, year: import_zod2.z.number().optional() })).output(
|
|
806
|
+
import_zod2.z.array(
|
|
807
|
+
import_zod2.z.object({
|
|
808
|
+
id: uuidSchema,
|
|
809
|
+
month: import_zod2.z.number(),
|
|
810
|
+
year: import_zod2.z.number(),
|
|
811
|
+
status: payrollRunStatusEnum,
|
|
812
|
+
netTotal: import_zod2.z.number()
|
|
813
|
+
})
|
|
814
|
+
)
|
|
815
|
+
),
|
|
816
|
+
initiate: import_contract.oc.input(
|
|
817
|
+
import_zod2.z.object({ branchId: uuidSchema, month: import_zod2.z.number(), year: import_zod2.z.number() })
|
|
818
|
+
).output(import_zod2.z.object({ id: uuidSchema, preview: import_zod2.z.array(import_zod2.z.any()) })),
|
|
819
|
+
approve: import_contract.oc.input(import_zod2.z.object({ id: uuidSchema })).output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
820
|
+
getPayslip: import_contract.oc.input(import_zod2.z.object({ payrollRunId: uuidSchema, staffId: uuidSchema })).output(import_zod2.z.object({ url: import_zod2.z.string() }))
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
var transportContract = {
|
|
824
|
+
vehicles: {
|
|
825
|
+
list: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema })).output(
|
|
826
|
+
import_zod2.z.array(
|
|
827
|
+
import_zod2.z.object({
|
|
828
|
+
id: uuidSchema,
|
|
829
|
+
plateNo: import_zod2.z.string(),
|
|
830
|
+
type: import_zod2.z.string(),
|
|
831
|
+
status: import_zod2.z.string(),
|
|
832
|
+
currentTrip: import_zod2.z.any().nullable()
|
|
833
|
+
})
|
|
834
|
+
)
|
|
835
|
+
)
|
|
836
|
+
},
|
|
837
|
+
trips: {
|
|
838
|
+
start: import_contract.oc.input(tripLogInputSchema).output(import_zod2.z.object({ id: uuidSchema })),
|
|
839
|
+
recordBoardings: import_contract.oc.input(
|
|
840
|
+
import_zod2.z.object({
|
|
841
|
+
tripId: uuidSchema,
|
|
842
|
+
entries: import_zod2.z.array(busRegisterEntrySchema)
|
|
843
|
+
})
|
|
844
|
+
).output(import_zod2.z.object({ saved: import_zod2.z.number() })),
|
|
845
|
+
complete: import_contract.oc.input(
|
|
846
|
+
import_zod2.z.object({ tripId: uuidSchema, arrivalTime: import_zod2.z.string().datetime() })
|
|
847
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
848
|
+
reportIncident: import_contract.oc.input(
|
|
849
|
+
import_zod2.z.object({
|
|
850
|
+
tripId: uuidSchema,
|
|
851
|
+
description: import_zod2.z.string(),
|
|
852
|
+
severity: incidentSeverityEnum,
|
|
853
|
+
location: import_zod2.z.string().optional()
|
|
854
|
+
})
|
|
855
|
+
).output(import_zod2.z.object({ id: uuidSchema }))
|
|
856
|
+
},
|
|
857
|
+
maintenance: {
|
|
858
|
+
log: import_contract.oc.input(
|
|
859
|
+
import_zod2.z.object({
|
|
860
|
+
vehicleId: uuidSchema,
|
|
861
|
+
issue: import_zod2.z.string(),
|
|
862
|
+
severity: import_zod2.z.enum(["routine", "urgent", "critical"])
|
|
863
|
+
})
|
|
864
|
+
).output(import_zod2.z.object({ id: uuidSchema })),
|
|
865
|
+
list: import_contract.oc.input(import_zod2.z.object({ vehicleId: uuidSchema })).output(import_zod2.z.array(import_zod2.z.any()))
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
var assetsContract = {
|
|
869
|
+
list: import_contract.oc.input(
|
|
870
|
+
paginationSchema.extend({
|
|
871
|
+
branchId: uuidSchema,
|
|
872
|
+
category: assetCategoryEnum.optional(),
|
|
873
|
+
search: import_zod2.z.string().optional()
|
|
874
|
+
})
|
|
875
|
+
).output(import_zod2.z.object({ data: import_zod2.z.array(import_zod2.z.any()), total: import_zod2.z.number() })),
|
|
876
|
+
create: import_contract.oc.input(
|
|
877
|
+
import_zod2.z.object({
|
|
878
|
+
name: import_zod2.z.string(),
|
|
879
|
+
category: assetCategoryEnum,
|
|
880
|
+
serialNo: import_zod2.z.string().optional(),
|
|
881
|
+
purchaseDate: import_zod2.z.string(),
|
|
882
|
+
purchaseCost: import_zod2.z.number(),
|
|
883
|
+
supplier: import_zod2.z.string().optional(),
|
|
884
|
+
warrantyExpiry: import_zod2.z.string().optional(),
|
|
885
|
+
condition: assetConditionEnum,
|
|
886
|
+
depreciationRate: import_zod2.z.number().min(0).max(100)
|
|
887
|
+
})
|
|
888
|
+
).output(import_zod2.z.object({ id: uuidSchema })),
|
|
889
|
+
assign: import_contract.oc.input(
|
|
890
|
+
import_zod2.z.object({
|
|
891
|
+
assetId: uuidSchema,
|
|
892
|
+
staffId: uuidSchema.optional(),
|
|
893
|
+
room: import_zod2.z.string().optional()
|
|
894
|
+
})
|
|
895
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() })),
|
|
896
|
+
ticket: {
|
|
897
|
+
create: import_contract.oc.input(
|
|
898
|
+
import_zod2.z.object({
|
|
899
|
+
assetId: uuidSchema,
|
|
900
|
+
description: import_zod2.z.string(),
|
|
901
|
+
severity: import_zod2.z.string()
|
|
902
|
+
})
|
|
903
|
+
).output(import_zod2.z.object({ id: uuidSchema })),
|
|
904
|
+
update: import_contract.oc.input(
|
|
905
|
+
import_zod2.z.object({
|
|
906
|
+
ticketId: uuidSchema,
|
|
907
|
+
status: maintenanceTicketStatusEnum,
|
|
908
|
+
notes: import_zod2.z.string().optional(),
|
|
909
|
+
cost: import_zod2.z.number().optional()
|
|
910
|
+
})
|
|
911
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() }))
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
var libraryContract = {
|
|
915
|
+
books: {
|
|
916
|
+
list: import_contract.oc.input(
|
|
917
|
+
paginationSchema.extend({
|
|
918
|
+
branchId: uuidSchema,
|
|
919
|
+
search: import_zod2.z.string().optional(),
|
|
920
|
+
available: import_zod2.z.boolean().optional()
|
|
921
|
+
})
|
|
922
|
+
).output(import_zod2.z.object({ data: import_zod2.z.array(import_zod2.z.any()), total: import_zod2.z.number() })),
|
|
923
|
+
create: import_contract.oc.input(
|
|
924
|
+
import_zod2.z.object({
|
|
925
|
+
isbn: import_zod2.z.string(),
|
|
926
|
+
title: import_zod2.z.string(),
|
|
927
|
+
author: import_zod2.z.string(),
|
|
928
|
+
publisher: import_zod2.z.string().optional(),
|
|
929
|
+
year: import_zod2.z.number().optional(),
|
|
930
|
+
subjectArea: import_zod2.z.string().optional(),
|
|
931
|
+
copiesTotal: import_zod2.z.number().min(1),
|
|
932
|
+
shelfLocation: import_zod2.z.string().optional()
|
|
933
|
+
})
|
|
934
|
+
).output(import_zod2.z.object({ id: uuidSchema }))
|
|
935
|
+
},
|
|
936
|
+
borrowings: {
|
|
937
|
+
checkout: import_contract.oc.input(
|
|
938
|
+
import_zod2.z.object({
|
|
939
|
+
bookId: uuidSchema,
|
|
940
|
+
borrowerType: import_zod2.z.enum(["student", "staff"]),
|
|
941
|
+
borrowerId: uuidSchema,
|
|
942
|
+
dueDate: import_zod2.z.string()
|
|
943
|
+
})
|
|
944
|
+
).output(import_zod2.z.object({ id: uuidSchema })),
|
|
945
|
+
return: import_contract.oc.input(
|
|
946
|
+
import_zod2.z.object({ borrowingId: uuidSchema, condition: import_zod2.z.string().optional() })
|
|
947
|
+
).output(import_zod2.z.object({ fine: import_zod2.z.number() })),
|
|
948
|
+
listOverdue: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema })).output(import_zod2.z.array(import_zod2.z.any()))
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
var disciplineContract = {
|
|
952
|
+
incidents: {
|
|
953
|
+
log: import_contract.oc.input(
|
|
954
|
+
import_zod2.z.object({
|
|
955
|
+
studentId: uuidSchema,
|
|
956
|
+
incidentType: import_zod2.z.string(),
|
|
957
|
+
description: import_zod2.z.string(),
|
|
958
|
+
severity: incidentSeverityEnum,
|
|
959
|
+
incidentDate: import_zod2.z.string(),
|
|
960
|
+
requiresCounsellor: import_zod2.z.boolean().default(false)
|
|
961
|
+
})
|
|
962
|
+
).output(import_zod2.z.object({ id: uuidSchema })),
|
|
963
|
+
list: import_contract.oc.input(
|
|
964
|
+
paginationSchema.extend({
|
|
965
|
+
branchId: uuidSchema,
|
|
966
|
+
studentId: uuidSchema.optional(),
|
|
967
|
+
status: incidentStatusEnum.optional()
|
|
968
|
+
})
|
|
969
|
+
).output(import_zod2.z.object({ data: import_zod2.z.array(import_zod2.z.any()), total: import_zod2.z.number() })),
|
|
970
|
+
rule: import_contract.oc.input(
|
|
971
|
+
import_zod2.z.object({
|
|
972
|
+
incidentId: uuidSchema,
|
|
973
|
+
ruling: disciplineRulingEnum,
|
|
974
|
+
suspensionDays: import_zod2.z.number().optional(),
|
|
975
|
+
notes: import_zod2.z.string()
|
|
976
|
+
})
|
|
977
|
+
).output(import_zod2.z.object({ success: import_zod2.z.boolean() }))
|
|
978
|
+
}
|
|
979
|
+
};
|
|
980
|
+
var commsContract = {
|
|
981
|
+
notifications: {
|
|
982
|
+
list: import_contract.oc.input(paginationSchema.extend({ unreadOnly: import_zod2.z.boolean().optional() })).output(import_zod2.z.object({ data: import_zod2.z.array(import_zod2.z.any()), unreadCount: import_zod2.z.number() })),
|
|
983
|
+
markRead: import_contract.oc.input(import_zod2.z.object({ ids: import_zod2.z.array(uuidSchema) })).output(import_zod2.z.object({ updated: import_zod2.z.number() }))
|
|
984
|
+
},
|
|
985
|
+
messages: {
|
|
986
|
+
list: import_contract.oc.input(paginationSchema).output(import_zod2.z.array(import_zod2.z.any())),
|
|
987
|
+
send: import_contract.oc.input(
|
|
988
|
+
import_zod2.z.object({
|
|
989
|
+
recipientId: uuidSchema,
|
|
990
|
+
subject: import_zod2.z.string(),
|
|
991
|
+
body: import_zod2.z.string(),
|
|
992
|
+
parentId: uuidSchema.optional()
|
|
993
|
+
})
|
|
994
|
+
).output(import_zod2.z.object({ id: uuidSchema }))
|
|
995
|
+
},
|
|
996
|
+
sms: {
|
|
997
|
+
send: import_contract.oc.input(sendBulkSmsInputSchema).output(import_zod2.z.object({ queued: import_zod2.z.number() }))
|
|
998
|
+
},
|
|
999
|
+
notices: {
|
|
1000
|
+
list: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema, active: import_zod2.z.boolean().optional() })).output(import_zod2.z.array(import_zod2.z.any())),
|
|
1001
|
+
create: import_contract.oc.input(
|
|
1002
|
+
import_zod2.z.object({
|
|
1003
|
+
title: import_zod2.z.string(),
|
|
1004
|
+
body: import_zod2.z.string(),
|
|
1005
|
+
audienceType: import_zod2.z.string(),
|
|
1006
|
+
audienceIds: import_zod2.z.array(uuidSchema).optional(),
|
|
1007
|
+
publishAt: import_zod2.z.string().optional(),
|
|
1008
|
+
expiresAt: import_zod2.z.string().optional()
|
|
1009
|
+
})
|
|
1010
|
+
).output(import_zod2.z.object({ id: uuidSchema }))
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
var adminContract = {
|
|
1014
|
+
auditLogs: {
|
|
1015
|
+
list: import_contract.oc.input(
|
|
1016
|
+
paginationSchema.extend({
|
|
1017
|
+
branchId: uuidSchema.optional(),
|
|
1018
|
+
userId: uuidSchema.optional(),
|
|
1019
|
+
action: import_zod2.z.string().optional(),
|
|
1020
|
+
from: import_zod2.z.string().optional(),
|
|
1021
|
+
to: import_zod2.z.string().optional()
|
|
1022
|
+
})
|
|
1023
|
+
).output(import_zod2.z.object({ data: import_zod2.z.array(import_zod2.z.any()), total: import_zod2.z.number() }))
|
|
1024
|
+
},
|
|
1025
|
+
users: {
|
|
1026
|
+
create: import_contract.oc.input(
|
|
1027
|
+
import_zod2.z.object({
|
|
1028
|
+
firstName: import_zod2.z.string(),
|
|
1029
|
+
middleName: import_zod2.z.string().optional(),
|
|
1030
|
+
lastName: import_zod2.z.string(),
|
|
1031
|
+
email: import_zod2.z.string().email(),
|
|
1032
|
+
phone: import_zod2.z.string().optional(),
|
|
1033
|
+
roleId: uuidSchema,
|
|
1034
|
+
branchId: uuidSchema,
|
|
1035
|
+
temporaryPassword: import_zod2.z.string().min(8)
|
|
1036
|
+
})
|
|
1037
|
+
).output(import_zod2.z.object({ id: uuidSchema })),
|
|
1038
|
+
suspend: import_contract.oc.input(import_zod2.z.object({ userId: uuidSchema, reason: import_zod2.z.string() })).output(import_zod2.z.object({ success: import_zod2.z.boolean() }))
|
|
1039
|
+
},
|
|
1040
|
+
roles: {
|
|
1041
|
+
list: import_contract.oc.input(import_zod2.z.object({ branchId: uuidSchema })).output(
|
|
1042
|
+
import_zod2.z.array(
|
|
1043
|
+
import_zod2.z.object({
|
|
1044
|
+
id: uuidSchema,
|
|
1045
|
+
name: import_zod2.z.string(),
|
|
1046
|
+
isSystem: import_zod2.z.boolean(),
|
|
1047
|
+
permissionCount: import_zod2.z.number()
|
|
1048
|
+
})
|
|
1049
|
+
)
|
|
1050
|
+
),
|
|
1051
|
+
create: import_contract.oc.input(
|
|
1052
|
+
import_zod2.z.object({
|
|
1053
|
+
name: import_zod2.z.string(),
|
|
1054
|
+
description: import_zod2.z.string().optional(),
|
|
1055
|
+
permissionIds: import_zod2.z.array(uuidSchema)
|
|
1056
|
+
})
|
|
1057
|
+
).output(import_zod2.z.object({ id: uuidSchema }))
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
var storageContract = {
|
|
1061
|
+
presignUpload: import_contract.oc.input(
|
|
1062
|
+
import_zod2.z.object({
|
|
1063
|
+
fileName: import_zod2.z.string(),
|
|
1064
|
+
mimeType: import_zod2.z.string(),
|
|
1065
|
+
category: import_zod2.z.enum([
|
|
1066
|
+
"student_photo",
|
|
1067
|
+
"staff_photo",
|
|
1068
|
+
"document",
|
|
1069
|
+
"payslip",
|
|
1070
|
+
"report_card",
|
|
1071
|
+
"asset_photo",
|
|
1072
|
+
"notice_attachment"
|
|
1073
|
+
]),
|
|
1074
|
+
resourceId: uuidSchema.optional()
|
|
1075
|
+
})
|
|
1076
|
+
).output(
|
|
1077
|
+
import_zod2.z.object({
|
|
1078
|
+
uploadUrl: import_zod2.z.string(),
|
|
1079
|
+
fileKey: import_zod2.z.string(),
|
|
1080
|
+
expiresIn: import_zod2.z.number()
|
|
1081
|
+
})
|
|
1082
|
+
),
|
|
1083
|
+
confirmUpload: import_contract.oc.input(
|
|
1084
|
+
import_zod2.z.object({
|
|
1085
|
+
fileKey: import_zod2.z.string(),
|
|
1086
|
+
resourceId: uuidSchema,
|
|
1087
|
+
resourceType: import_zod2.z.string()
|
|
1088
|
+
})
|
|
1089
|
+
).output(import_zod2.z.object({ publicUrl: import_zod2.z.string() }))
|
|
1090
|
+
};
|
|
1091
|
+
var appContract = {
|
|
1092
|
+
auth: authContract,
|
|
1093
|
+
branches: branchesContract,
|
|
1094
|
+
students: studentsContract,
|
|
1095
|
+
academics: academicsContract,
|
|
1096
|
+
finance: financeContract,
|
|
1097
|
+
hr: hrContract,
|
|
1098
|
+
payroll: payrollContract,
|
|
1099
|
+
transport: transportContract,
|
|
1100
|
+
assets: assetsContract,
|
|
1101
|
+
library: libraryContract,
|
|
1102
|
+
discipline: disciplineContract,
|
|
1103
|
+
comms: commsContract,
|
|
1104
|
+
admin: adminContract,
|
|
1105
|
+
storage: storageContract
|
|
1106
|
+
};
|
|
1107
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1108
|
+
0 && (module.exports = {
|
|
1109
|
+
academicsContract,
|
|
1110
|
+
adminContract,
|
|
1111
|
+
appContract,
|
|
1112
|
+
assetsContract,
|
|
1113
|
+
authContract,
|
|
1114
|
+
branchesContract,
|
|
1115
|
+
commsContract,
|
|
1116
|
+
disciplineContract,
|
|
1117
|
+
financeContract,
|
|
1118
|
+
hrContract,
|
|
1119
|
+
libraryContract,
|
|
1120
|
+
payrollContract,
|
|
1121
|
+
storageContract,
|
|
1122
|
+
studentsContract,
|
|
1123
|
+
transportContract
|
|
1124
|
+
});
|
|
1125
|
+
//# sourceMappingURL=index.js.map
|