@eeplatform/basic-edu 1.0.0 → 1.1.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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +584 -34
- package/dist/index.js +37882 -670
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37958 -689
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,364 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
+
import * as mongodb from 'mongodb';
|
|
2
3
|
import { ObjectId, ClientSession } from 'mongodb';
|
|
4
|
+
import * as bson from 'bson';
|
|
3
5
|
import { Request, Response, NextFunction } from 'express';
|
|
6
|
+
import { Express } from 'express-serve-static-core';
|
|
7
|
+
|
|
8
|
+
type TCurriculumSubject = {
|
|
9
|
+
educationLevel: string;
|
|
10
|
+
gradeLevel: string;
|
|
11
|
+
subjectCode: string;
|
|
12
|
+
subjectName: string;
|
|
13
|
+
subjectType: string;
|
|
14
|
+
sessionFrequency: number;
|
|
15
|
+
sessionDuration: number;
|
|
16
|
+
totalMinutesPerWeek: number;
|
|
17
|
+
};
|
|
18
|
+
type TCurriculum = {
|
|
19
|
+
_id?: ObjectId;
|
|
20
|
+
school: ObjectId | string;
|
|
21
|
+
code: string;
|
|
22
|
+
effectiveSchoolYear: string;
|
|
23
|
+
maxTeachingHoursPerDay: number;
|
|
24
|
+
subjects?: TCurriculumSubject[];
|
|
25
|
+
curriculumMemoRef?: string;
|
|
26
|
+
status?: string;
|
|
27
|
+
createdAt?: Date | string;
|
|
28
|
+
updatedAt?: Date | string;
|
|
29
|
+
deletedAt?: Date | string;
|
|
30
|
+
createdBy?: string;
|
|
31
|
+
updatedBy?: string;
|
|
32
|
+
deletedBy?: string;
|
|
33
|
+
};
|
|
34
|
+
declare const schemaCurriculum: Joi.ObjectSchema<any>;
|
|
35
|
+
declare function MCurriculum(value: TCurriculum): {
|
|
36
|
+
_id: ObjectId | undefined;
|
|
37
|
+
school: string | ObjectId;
|
|
38
|
+
code: string;
|
|
39
|
+
effectiveSchoolYear: string;
|
|
40
|
+
maxTeachingHoursPerDay: number;
|
|
41
|
+
subjects: TCurriculumSubject[];
|
|
42
|
+
curriculumMemoRef: string;
|
|
43
|
+
status: string;
|
|
44
|
+
createdAt: string | Date;
|
|
45
|
+
updatedAt: string | Date;
|
|
46
|
+
deletedAt: string | Date;
|
|
47
|
+
createdBy: string;
|
|
48
|
+
updatedBy: string;
|
|
49
|
+
deletedBy: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
declare function useCurriculumRepo(): {
|
|
53
|
+
createIndexes: () => Promise<void>;
|
|
54
|
+
add: (value: TCurriculum, session?: ClientSession) => Promise<ObjectId>;
|
|
55
|
+
getAll: ({ search, page, limit, sort, status, }?: {
|
|
56
|
+
search?: string | undefined;
|
|
57
|
+
page?: number | undefined;
|
|
58
|
+
limit?: number | undefined;
|
|
59
|
+
sort?: {} | undefined;
|
|
60
|
+
status?: string | undefined;
|
|
61
|
+
}) => Promise<Record<string, any>>;
|
|
62
|
+
getById: (_id: string | ObjectId) => Promise<TCurriculum | null>;
|
|
63
|
+
updateById: (_id: ObjectId | string, value: {
|
|
64
|
+
code?: string;
|
|
65
|
+
maxTeachingHoursPerDay?: number;
|
|
66
|
+
curriculumMemoRef?: string;
|
|
67
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
68
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
declare function useCurriculumController(): {
|
|
72
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
73
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
74
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
75
|
+
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
76
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
type BasicEducEnrForm = {
|
|
80
|
+
_id?: ObjectId;
|
|
81
|
+
region: ObjectId;
|
|
82
|
+
sdo: ObjectId;
|
|
83
|
+
school: ObjectId;
|
|
84
|
+
schoolYear: string;
|
|
85
|
+
gradeLevelToEnroll: string;
|
|
86
|
+
learnerInfo: EnrLearnerInfo;
|
|
87
|
+
parentGuardianInfo: EnrParentGuardianInfo;
|
|
88
|
+
addressInfo: AddressInformation;
|
|
89
|
+
returningLearnerInfo?: EnrReturningLearnerInfo;
|
|
90
|
+
seniorHighInfo?: EnrSeniorHighInformation;
|
|
91
|
+
preferredLearningModalities?: EnrLearningModality[];
|
|
92
|
+
certification: EnrCert;
|
|
93
|
+
status?: string;
|
|
94
|
+
rejectionReason?: string;
|
|
95
|
+
createdAt?: Date | string;
|
|
96
|
+
updatedAt?: Date | string;
|
|
97
|
+
deletedAt?: Date | string;
|
|
98
|
+
createdBy?: string;
|
|
99
|
+
updatedBy?: string;
|
|
100
|
+
deletedBy?: string;
|
|
101
|
+
};
|
|
102
|
+
type EnrLearnerInfo = {
|
|
103
|
+
lrn?: string;
|
|
104
|
+
lastName: string;
|
|
105
|
+
firstName: string;
|
|
106
|
+
middleName?: string;
|
|
107
|
+
extensionName?: string;
|
|
108
|
+
birthDate: string;
|
|
109
|
+
sex: "Male" | "Female";
|
|
110
|
+
age: number;
|
|
111
|
+
placeOfBirth?: {
|
|
112
|
+
municipalityCity: string;
|
|
113
|
+
province?: string;
|
|
114
|
+
country?: string;
|
|
115
|
+
};
|
|
116
|
+
motherTongue?: string;
|
|
117
|
+
hasDisability: boolean;
|
|
118
|
+
disabilityTypes?: DisabilityType[];
|
|
119
|
+
otherDisabilityDetails?: string;
|
|
120
|
+
isIndigenous?: boolean;
|
|
121
|
+
indigenousCommunity?: string;
|
|
122
|
+
is4PsBeneficiary?: boolean;
|
|
123
|
+
fourPsHouseholdId?: string;
|
|
124
|
+
};
|
|
125
|
+
type DisabilityType = "Visual Impairment (Blind)" | "Visual Impairment (Low Vision)" | "Hearing Impairment" | "Learning Disability" | "Intellectual Disability" | "Autism Spectrum Disorder" | "Emotional-Behavioral Disorder" | "Orthopedic/Physical Handicap" | "Speech/Language Disorder" | "Cerebral Palsy" | "Special Health Problem/Chronic Disease" | "Multiple Disorder" | "Cancer" | "Other";
|
|
126
|
+
type EnrParentGuardianInfo = {
|
|
127
|
+
father?: PersonContact;
|
|
128
|
+
mother?: PersonContact;
|
|
129
|
+
legalGuardian?: PersonContact;
|
|
130
|
+
};
|
|
131
|
+
type PersonContact = {
|
|
132
|
+
lastName: string;
|
|
133
|
+
firstName: string;
|
|
134
|
+
middleName?: string;
|
|
135
|
+
contactNumber?: string;
|
|
136
|
+
};
|
|
137
|
+
type AddressInformation = {
|
|
138
|
+
currentAddress: EnrAddress;
|
|
139
|
+
permanentAddress?: EnrAddress;
|
|
140
|
+
sameAsCurrent?: boolean;
|
|
141
|
+
};
|
|
142
|
+
type EnrAddress = {
|
|
143
|
+
houseNumber?: string;
|
|
144
|
+
streetName?: string;
|
|
145
|
+
sitio?: string;
|
|
146
|
+
barangay: string;
|
|
147
|
+
municipalityCity: string;
|
|
148
|
+
province: string;
|
|
149
|
+
country?: string;
|
|
150
|
+
zipCode?: string;
|
|
151
|
+
};
|
|
152
|
+
type EnrReturningLearnerInfo = {
|
|
153
|
+
lastGradeLevelCompleted: string;
|
|
154
|
+
lastSchoolYearCompleted: string;
|
|
155
|
+
lastSchoolAttended: string;
|
|
156
|
+
lastSchoolId?: string;
|
|
157
|
+
isReturningLearner: boolean;
|
|
158
|
+
isTransferIn: boolean;
|
|
159
|
+
};
|
|
160
|
+
type EnrSeniorHighInformation = {
|
|
161
|
+
semester: "1st" | "2nd";
|
|
162
|
+
track: string;
|
|
163
|
+
strand: string;
|
|
164
|
+
};
|
|
165
|
+
type EnrLearningModality = "Modular (Print)" | "Modular (Digital)" | "Online" | "Radio-Based Instruction" | "Educational Television" | "Blended" | "Homeschooling";
|
|
166
|
+
type EnrCert = {
|
|
167
|
+
certifiedBy: string;
|
|
168
|
+
date: string;
|
|
169
|
+
consentGiven: boolean;
|
|
170
|
+
};
|
|
171
|
+
declare const schemaEnrollment: Joi.ObjectSchema<any>;
|
|
172
|
+
declare function MEnrollment(value: BasicEducEnrForm): {
|
|
173
|
+
_id: ObjectId | undefined;
|
|
174
|
+
region: ObjectId;
|
|
175
|
+
sdo: ObjectId;
|
|
176
|
+
school: ObjectId;
|
|
177
|
+
schoolYear: string;
|
|
178
|
+
gradeLevelToEnroll: string;
|
|
179
|
+
learnerInfo: EnrLearnerInfo;
|
|
180
|
+
parentGuardianInfo: EnrParentGuardianInfo;
|
|
181
|
+
addressInfo: AddressInformation;
|
|
182
|
+
returningLearnerInfo: EnrReturningLearnerInfo | undefined;
|
|
183
|
+
seniorHighInfo: EnrSeniorHighInformation | undefined;
|
|
184
|
+
preferredLearningModalities: EnrLearningModality[];
|
|
185
|
+
certification: EnrCert;
|
|
186
|
+
status: string;
|
|
187
|
+
rejectionReason: string;
|
|
188
|
+
createdAt: string | Date;
|
|
189
|
+
updatedAt: string | Date;
|
|
190
|
+
deletedAt: string | Date;
|
|
191
|
+
createdBy: string;
|
|
192
|
+
updatedBy: string;
|
|
193
|
+
deletedBy: string;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
declare function useEnrollmentRepo(): {
|
|
197
|
+
createIndexes: () => Promise<void>;
|
|
198
|
+
add: (value: BasicEducEnrForm, session?: ClientSession) => Promise<ObjectId>;
|
|
199
|
+
updateById: (_id: ObjectId | string, value: Partial<BasicEducEnrForm>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
200
|
+
getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
|
|
201
|
+
search?: string | undefined;
|
|
202
|
+
page?: number | undefined;
|
|
203
|
+
limit?: number | undefined;
|
|
204
|
+
sort?: {} | undefined;
|
|
205
|
+
status?: string | undefined;
|
|
206
|
+
school?: string | undefined;
|
|
207
|
+
schoolYear?: string | undefined;
|
|
208
|
+
gradeLevelToEnroll?: string | undefined;
|
|
209
|
+
}) => Promise<Record<string, any>>;
|
|
210
|
+
getById: (_id: string | ObjectId) => Promise<BasicEducEnrForm>;
|
|
211
|
+
getByLrn: (lrn: string, schoolYear?: string) => Promise<BasicEducEnrForm | null>;
|
|
212
|
+
deleteById: (_id: string | ObjectId, deletedBy?: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
213
|
+
getBySchoolAndYear: (school: string | ObjectId, schoolYear: string) => Promise<BasicEducEnrForm[]>;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
declare function useEnrollmentService(): {
|
|
217
|
+
createEnrollment: (value: BasicEducEnrForm) => Promise<{
|
|
218
|
+
message: string;
|
|
219
|
+
id: ObjectId;
|
|
220
|
+
}>;
|
|
221
|
+
updateEnrollment: (_id: string | ObjectId, value: Partial<BasicEducEnrForm>) => Promise<{
|
|
222
|
+
message: string;
|
|
223
|
+
modifiedCount: number;
|
|
224
|
+
}>;
|
|
225
|
+
getEnrollments: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
|
|
226
|
+
search?: string | undefined;
|
|
227
|
+
page?: number | undefined;
|
|
228
|
+
limit?: number | undefined;
|
|
229
|
+
sort?: {} | undefined;
|
|
230
|
+
status?: string | undefined;
|
|
231
|
+
school?: string | undefined;
|
|
232
|
+
schoolYear?: string | undefined;
|
|
233
|
+
gradeLevelToEnroll?: string | undefined;
|
|
234
|
+
}) => Promise<Record<string, any>>;
|
|
235
|
+
getEnrollmentById: (_id: string | ObjectId) => Promise<BasicEducEnrForm>;
|
|
236
|
+
getEnrollmentByLrn: (lrn: string, schoolYear?: string) => Promise<BasicEducEnrForm | null>;
|
|
237
|
+
deleteEnrollment: (_id: string | ObjectId, deletedBy?: string) => Promise<{
|
|
238
|
+
message: string;
|
|
239
|
+
modifiedCount: number;
|
|
240
|
+
}>;
|
|
241
|
+
getEnrollmentsBySchoolAndYear: (school: string | ObjectId, schoolYear: string) => Promise<BasicEducEnrForm[]>;
|
|
242
|
+
approveEnrollment: (_id: string | ObjectId, approvedBy: string) => Promise<{
|
|
243
|
+
message: string;
|
|
244
|
+
modifiedCount: number;
|
|
245
|
+
}>;
|
|
246
|
+
rejectEnrollment: (_id: string | ObjectId, rejectedBy: string, rejectionReason?: string) => Promise<{
|
|
247
|
+
message: string;
|
|
248
|
+
modifiedCount: number;
|
|
249
|
+
}>;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
declare function useEnrollmentController(): {
|
|
253
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
254
|
+
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
255
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
256
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
257
|
+
getByLrn: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
258
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
259
|
+
getBySchoolAndYear: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
260
|
+
approve: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
261
|
+
reject: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
262
|
+
getStatsBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
type TGradeLevel = {
|
|
266
|
+
_id?: ObjectId;
|
|
267
|
+
school?: ObjectId | string;
|
|
268
|
+
educationLevel: string;
|
|
269
|
+
gradeLevel: string;
|
|
270
|
+
tracks?: string[];
|
|
271
|
+
trackStrands?: string[];
|
|
272
|
+
teachingStyle: string;
|
|
273
|
+
maxNumberOfLearners: number;
|
|
274
|
+
defaultStartTime?: string;
|
|
275
|
+
defaultEndTime?: string;
|
|
276
|
+
status?: string;
|
|
277
|
+
createdAt?: Date | string;
|
|
278
|
+
updatedAt?: Date | string;
|
|
279
|
+
deletedAt?: Date | string;
|
|
280
|
+
createdBy?: string;
|
|
281
|
+
updatedBy?: string;
|
|
282
|
+
deletedBy?: string;
|
|
283
|
+
};
|
|
284
|
+
declare const schemaGradeLevel: Joi.ObjectSchema<any>;
|
|
285
|
+
declare function MGradeLevel(value: TGradeLevel): {
|
|
286
|
+
_id: ObjectId | undefined;
|
|
287
|
+
school: string | ObjectId | undefined;
|
|
288
|
+
educationLevel: string;
|
|
289
|
+
gradeLevel: string;
|
|
290
|
+
tracks: string[];
|
|
291
|
+
trackStrands: string[];
|
|
292
|
+
teachingStyle: string;
|
|
293
|
+
maxNumberOfLearners: number;
|
|
294
|
+
defaultStartTime: string;
|
|
295
|
+
defaultEndTime: string;
|
|
296
|
+
status: string;
|
|
297
|
+
createdAt: string | Date;
|
|
298
|
+
updatedAt: string | Date;
|
|
299
|
+
deletedAt: string | Date;
|
|
300
|
+
createdBy: string;
|
|
301
|
+
updatedBy: string;
|
|
302
|
+
deletedBy: string;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
declare function useGradeLevelRepo(): {
|
|
306
|
+
createIndexes: () => Promise<void>;
|
|
307
|
+
add: (value: TGradeLevel, session?: ClientSession) => Promise<ObjectId>;
|
|
308
|
+
getAll: ({ search, page, limit, sort, educationLevel, gradeLevel, teachingStyle, school, status, }?: {
|
|
309
|
+
search?: string | undefined;
|
|
310
|
+
page?: number | undefined;
|
|
311
|
+
limit?: number | undefined;
|
|
312
|
+
sort?: {} | undefined;
|
|
313
|
+
educationLevel?: string | undefined;
|
|
314
|
+
gradeLevel?: string | undefined;
|
|
315
|
+
teachingStyle?: string | undefined;
|
|
316
|
+
school?: string | undefined;
|
|
317
|
+
status?: string | undefined;
|
|
318
|
+
}) => Promise<Record<string, any>>;
|
|
319
|
+
getById: (_id: string | ObjectId) => Promise<bson.Document>;
|
|
320
|
+
updateById: (_id: ObjectId | string, value: {
|
|
321
|
+
educationLevel?: string;
|
|
322
|
+
gradeLevel?: string;
|
|
323
|
+
teachingStyle?: string;
|
|
324
|
+
maxTeachingHoursPerDay?: number;
|
|
325
|
+
maxTeachingHoursPerWeek?: number;
|
|
326
|
+
defaultStartTime?: string;
|
|
327
|
+
defaultEndTime?: string;
|
|
328
|
+
school?: ObjectId | string;
|
|
329
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
330
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
331
|
+
getByEducationLevel: (educationLevel: string, school?: string) => Promise<mongodb.WithId<bson.Document>[] | TGradeLevel[]>;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
declare function useGradeLevelController(): {
|
|
335
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
336
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
337
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
338
|
+
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
339
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
340
|
+
getByEducationLevel: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
341
|
+
};
|
|
4
342
|
|
|
5
343
|
type TRegion = {
|
|
6
344
|
_id?: ObjectId;
|
|
7
345
|
name?: string;
|
|
8
|
-
|
|
9
|
-
directorName?: string;
|
|
346
|
+
code: string;
|
|
10
347
|
createdAt?: string;
|
|
11
348
|
updatedAt?: string;
|
|
12
349
|
deletedAt?: string;
|
|
13
350
|
};
|
|
14
351
|
declare const schemaRegion: Joi.ObjectSchema<any>;
|
|
15
|
-
declare function
|
|
352
|
+
declare function MRegion(value: TRegion): TRegion;
|
|
16
353
|
|
|
17
354
|
declare function useRegionRepo(): {
|
|
18
355
|
createIndexes: () => Promise<void>;
|
|
19
356
|
add: (value: TRegion, session?: ClientSession) => Promise<ObjectId>;
|
|
20
|
-
getAll: ({ search, page, limit, sort
|
|
357
|
+
getAll: ({ search, page, limit, sort }?: {
|
|
21
358
|
search?: string | undefined;
|
|
22
359
|
page?: number | undefined;
|
|
23
360
|
limit?: number | undefined;
|
|
24
361
|
sort?: {} | undefined;
|
|
25
|
-
status?: string | undefined;
|
|
26
362
|
}) => Promise<Record<string, any>>;
|
|
27
363
|
getById: (_id: string | ObjectId) => Promise<TRegion>;
|
|
28
364
|
updateFieldById: ({ _id, field, value }?: {
|
|
@@ -46,26 +382,28 @@ declare function useRegionController(): {
|
|
|
46
382
|
type TDivision = {
|
|
47
383
|
_id?: ObjectId;
|
|
48
384
|
name?: string;
|
|
49
|
-
region?: ObjectId;
|
|
385
|
+
region?: string | ObjectId;
|
|
50
386
|
regionName?: string;
|
|
51
|
-
superintendent?: ObjectId;
|
|
387
|
+
superintendent?: string | ObjectId;
|
|
52
388
|
superintendentName?: string;
|
|
53
389
|
createdAt?: string;
|
|
54
390
|
updatedAt?: string;
|
|
55
391
|
deletedAt?: string;
|
|
56
392
|
};
|
|
57
393
|
declare const schemaDivision: Joi.ObjectSchema<any>;
|
|
58
|
-
declare function
|
|
394
|
+
declare function MDivision(value: TDivision): TDivision;
|
|
59
395
|
|
|
60
396
|
declare function useDivisionRepo(): {
|
|
61
|
-
|
|
397
|
+
createIndex: () => Promise<void>;
|
|
398
|
+
createTextIndex: () => Promise<void>;
|
|
399
|
+
createUniqueIndex: () => Promise<void>;
|
|
62
400
|
add: (value: TDivision, session?: ClientSession) => Promise<ObjectId>;
|
|
63
|
-
getAll: ({ search, page, limit, sort,
|
|
401
|
+
getAll: ({ search, page, limit, sort, region, }?: {
|
|
64
402
|
search?: string | undefined;
|
|
65
403
|
page?: number | undefined;
|
|
66
404
|
limit?: number | undefined;
|
|
67
405
|
sort?: {} | undefined;
|
|
68
|
-
|
|
406
|
+
region?: string | undefined;
|
|
69
407
|
}) => Promise<Record<string, any>>;
|
|
70
408
|
getById: (_id: string | ObjectId) => Promise<TDivision>;
|
|
71
409
|
updateFieldById: ({ _id, field, value }?: {
|
|
@@ -77,58 +415,270 @@ declare function useDivisionRepo(): {
|
|
|
77
415
|
getByName: (name: string) => Promise<TDivision>;
|
|
78
416
|
};
|
|
79
417
|
|
|
418
|
+
declare function useDivisionService(): {
|
|
419
|
+
add: (value: TDivision) => Promise<string>;
|
|
420
|
+
};
|
|
421
|
+
|
|
80
422
|
declare function useDivisionController(): {
|
|
81
|
-
|
|
423
|
+
createDivision: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
82
424
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
83
425
|
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
84
426
|
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
85
427
|
updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
86
|
-
|
|
428
|
+
deleteDivision: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
87
429
|
};
|
|
88
430
|
|
|
89
431
|
type TSchool = {
|
|
90
432
|
_id?: ObjectId;
|
|
91
|
-
|
|
92
|
-
|
|
433
|
+
id: string;
|
|
434
|
+
name: string;
|
|
435
|
+
country?: string;
|
|
436
|
+
address?: string;
|
|
437
|
+
continuedAddress?: string;
|
|
438
|
+
city?: string;
|
|
439
|
+
province?: string;
|
|
440
|
+
district?: string;
|
|
441
|
+
postalCode?: string;
|
|
442
|
+
courses?: Array<string>;
|
|
443
|
+
principalName?: string;
|
|
444
|
+
principalEmail?: string;
|
|
445
|
+
principalNumber?: string;
|
|
446
|
+
region: string | ObjectId;
|
|
93
447
|
regionName?: string;
|
|
94
|
-
division
|
|
448
|
+
division: string | ObjectId;
|
|
95
449
|
divisionName?: string;
|
|
96
|
-
|
|
97
|
-
principalName?: string;
|
|
450
|
+
status?: string;
|
|
98
451
|
createdAt?: string;
|
|
99
452
|
updatedAt?: string;
|
|
100
|
-
|
|
453
|
+
createdBy?: string | ObjectId;
|
|
101
454
|
};
|
|
102
455
|
declare const schemaSchool: Joi.ObjectSchema<any>;
|
|
103
|
-
declare function
|
|
456
|
+
declare function MSchool(value: TSchool): TSchool;
|
|
104
457
|
|
|
105
458
|
declare function useSchoolRepo(): {
|
|
106
|
-
|
|
459
|
+
createIndex: () => Promise<void>;
|
|
107
460
|
add: (value: TSchool, session?: ClientSession) => Promise<ObjectId>;
|
|
108
|
-
getAll: ({
|
|
109
|
-
search?: string | undefined;
|
|
461
|
+
getAll: ({ page, limit, sort, status, org, app, search, }?: {
|
|
110
462
|
page?: number | undefined;
|
|
111
463
|
limit?: number | undefined;
|
|
112
|
-
sort?:
|
|
464
|
+
sort?: Record<string, number> | undefined;
|
|
113
465
|
status?: string | undefined;
|
|
114
|
-
|
|
115
|
-
|
|
466
|
+
org?: string | undefined;
|
|
467
|
+
app?: string | undefined;
|
|
468
|
+
search?: string | undefined;
|
|
469
|
+
}) => Promise<{}>;
|
|
470
|
+
updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
116
471
|
updateFieldById: ({ _id, field, value }?: {
|
|
117
472
|
_id: string | ObjectId;
|
|
118
473
|
field: string;
|
|
119
|
-
value: string;
|
|
120
|
-
}, session?: ClientSession) => Promise<
|
|
121
|
-
|
|
122
|
-
|
|
474
|
+
value: string | ObjectId;
|
|
475
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
476
|
+
getPendingByCreatedBy: (createdBy: string | ObjectId) => Promise<{} | null>;
|
|
477
|
+
getPendingById: (_id: string | ObjectId) => Promise<TSchool>;
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
declare function useSchoolService(): {
|
|
481
|
+
register: (value: TSchool) => Promise<string>;
|
|
482
|
+
approve: (id: string) => Promise<string>;
|
|
483
|
+
add: (value: TSchool) => Promise<string>;
|
|
484
|
+
addBulk: (file: Express.Multer.File, region: string, division: string) => Promise<{
|
|
485
|
+
message: string;
|
|
486
|
+
details: {
|
|
487
|
+
successful: number;
|
|
488
|
+
failed: number;
|
|
489
|
+
total: number;
|
|
490
|
+
totalSizeMB: number;
|
|
491
|
+
errors: string[];
|
|
492
|
+
};
|
|
493
|
+
}>;
|
|
123
494
|
};
|
|
124
495
|
|
|
125
496
|
declare function useSchoolController(): {
|
|
126
497
|
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
127
498
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
499
|
+
getByCreatedBy: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
500
|
+
updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
501
|
+
registerSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
502
|
+
approveSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
503
|
+
addBulk: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
type TAsset = {
|
|
507
|
+
_id?: ObjectId;
|
|
508
|
+
school: ObjectId;
|
|
509
|
+
asset_type: "supply" | "furniture-equipment" | "fixed-asset";
|
|
510
|
+
name: string;
|
|
511
|
+
category: string;
|
|
512
|
+
type: string;
|
|
513
|
+
unit: string;
|
|
514
|
+
status?: string;
|
|
515
|
+
qty?: number;
|
|
516
|
+
brand?: string;
|
|
517
|
+
createdAt?: string | Date;
|
|
518
|
+
updatedAt?: string | Date;
|
|
519
|
+
deletedAt?: string | Date;
|
|
520
|
+
condition?: {
|
|
521
|
+
good: number;
|
|
522
|
+
disposal: number;
|
|
523
|
+
lost: number;
|
|
524
|
+
damaged: number;
|
|
525
|
+
};
|
|
526
|
+
metadata?: {
|
|
527
|
+
title?: string;
|
|
528
|
+
isbn?: string;
|
|
529
|
+
author?: string;
|
|
530
|
+
edition?: string;
|
|
531
|
+
subject?: string;
|
|
532
|
+
grade_level?: number;
|
|
533
|
+
publisher?: string;
|
|
534
|
+
language?: string;
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
declare const schemaAsset: Joi.ObjectSchema<any>;
|
|
538
|
+
declare const schemaAssetUpdateOption: Joi.ObjectSchema<any>;
|
|
539
|
+
declare function MAsset(value: TAsset): TAsset;
|
|
540
|
+
|
|
541
|
+
declare function useAssetRepo(): {
|
|
542
|
+
createIndex: () => Promise<void>;
|
|
543
|
+
add: (value: TAsset) => Promise<ObjectId>;
|
|
544
|
+
updateById: (_id: string | ObjectId, value: Partial<Pick<TAsset, "name" | "brand" | "category" | "type" | "unit" | "qty">>, session?: ClientSession) => Promise<string>;
|
|
545
|
+
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
546
|
+
getById: (_id: string | ObjectId) => Promise<TAsset>;
|
|
547
|
+
getAll: ({ page, search, limit, status, school, sort, asset_type, }?: {
|
|
548
|
+
page?: number | undefined;
|
|
549
|
+
search?: string | undefined;
|
|
550
|
+
limit?: number | undefined;
|
|
551
|
+
status?: string | undefined;
|
|
552
|
+
school?: string | ObjectId | undefined;
|
|
553
|
+
sort?: Record<string, any> | undefined;
|
|
554
|
+
asset_type: string;
|
|
555
|
+
}) => Promise<{}>;
|
|
556
|
+
getCategories: (school: string | ObjectId, asset_type: string) => Promise<{}>;
|
|
557
|
+
getTypes: (school: string | ObjectId, asset_type: string) => Promise<{}>;
|
|
558
|
+
getUnitsBySchool: (school: string | ObjectId) => Promise<{}>;
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
declare function useAssetController(): {
|
|
562
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
563
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
131
564
|
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
565
|
+
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
566
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
567
|
+
getCategories: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
568
|
+
getTypes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
569
|
+
getUnitsBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
type TStockCard = {
|
|
573
|
+
_id?: ObjectId;
|
|
574
|
+
school: ObjectId;
|
|
575
|
+
item: ObjectId;
|
|
576
|
+
balance: number;
|
|
577
|
+
qty: number;
|
|
578
|
+
unitCost?: number;
|
|
579
|
+
totalCost?: number;
|
|
580
|
+
status: string;
|
|
581
|
+
condition: string;
|
|
582
|
+
supplier?: string;
|
|
583
|
+
location?: ObjectId;
|
|
584
|
+
locationName?: string;
|
|
585
|
+
reason?: string;
|
|
586
|
+
remarks?: string;
|
|
587
|
+
createdAt?: Date | string;
|
|
588
|
+
updatedAt?: Date | string;
|
|
589
|
+
deletedAt?: Date | string;
|
|
590
|
+
};
|
|
591
|
+
declare const schemaStockCard: Joi.ObjectSchema<any>;
|
|
592
|
+
declare function MStockCard(value: TStockCard): TStockCard;
|
|
593
|
+
|
|
594
|
+
declare function useStockCardRepository(): {
|
|
595
|
+
createIndex: () => Promise<void>;
|
|
596
|
+
add: (value: TStockCard, session?: ClientSession) => Promise<ObjectId>;
|
|
597
|
+
getById: (_id: string | ObjectId) => Promise<{}>;
|
|
598
|
+
getAll: ({ page, limit, school, sort, id }?: {
|
|
599
|
+
page?: number | undefined;
|
|
600
|
+
limit?: number | undefined;
|
|
601
|
+
school?: string | ObjectId | undefined;
|
|
602
|
+
sort?: Record<string, any> | undefined;
|
|
603
|
+
id: string | ObjectId;
|
|
604
|
+
}) => Promise<{}>;
|
|
605
|
+
getSuppliers: (school: string | ObjectId) => Promise<{}>;
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
declare function useStockCardService(): {
|
|
609
|
+
add: (data: TStockCard) => Promise<string>;
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
declare function useStockCardController(): {
|
|
613
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
614
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
615
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
616
|
+
getSuppliers: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
type TPlantilla = {
|
|
620
|
+
_id?: ObjectId;
|
|
621
|
+
org: string;
|
|
622
|
+
itemNumber: string;
|
|
623
|
+
orgUnitCode?: string;
|
|
624
|
+
positionTitle: string;
|
|
625
|
+
positionCategory: string;
|
|
626
|
+
salaryGrade: number;
|
|
627
|
+
employmentType?: string;
|
|
628
|
+
personnelType: string;
|
|
629
|
+
region?: ObjectId | string;
|
|
630
|
+
regionName?: string;
|
|
631
|
+
division?: ObjectId | string;
|
|
632
|
+
divisionName?: string;
|
|
633
|
+
employee?: string | ObjectId;
|
|
634
|
+
employeeName?: string;
|
|
635
|
+
annualSalary?: number;
|
|
636
|
+
monthlySalary?: number;
|
|
637
|
+
status?: string;
|
|
638
|
+
createdAt?: Date | string;
|
|
639
|
+
updatedAt?: Date | string;
|
|
640
|
+
deletedAt?: Date | string;
|
|
641
|
+
};
|
|
642
|
+
declare const schemaPlantilla: Joi.ObjectSchema<TPlantilla>;
|
|
643
|
+
declare function MPlantilla(data: Partial<TPlantilla>): TPlantilla;
|
|
644
|
+
|
|
645
|
+
declare function usePlantillaRepo(): {
|
|
646
|
+
createIndexes: () => Promise<void>;
|
|
647
|
+
add: (value: TPlantilla, session?: ClientSession, clearCache?: boolean) => Promise<ObjectId>;
|
|
648
|
+
getAll: ({ search, page, limit, sort, org, status, }?: {
|
|
649
|
+
search?: string | undefined;
|
|
650
|
+
page?: number | undefined;
|
|
651
|
+
limit?: number | undefined;
|
|
652
|
+
sort?: {} | undefined;
|
|
653
|
+
org?: string | undefined;
|
|
654
|
+
status?: string | undefined;
|
|
655
|
+
}) => Promise<Record<string, any>>;
|
|
656
|
+
getById: (_id: string | ObjectId) => Promise<TPlantilla | null>;
|
|
657
|
+
updateById: (_id: ObjectId | string, value: Partial<Pick<TPlantilla, "status" | "positionTitle" | "updatedAt">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
658
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
659
|
+
delCachedData: () => void;
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
declare function usePlantillaService(): {
|
|
663
|
+
addBulk: (file: Express.Multer.File, region?: string, division?: string) => Promise<{
|
|
664
|
+
message: string;
|
|
665
|
+
details: {
|
|
666
|
+
successful: number;
|
|
667
|
+
failed: number;
|
|
668
|
+
total: number;
|
|
669
|
+
totalSizeMB: number;
|
|
670
|
+
errors: string[];
|
|
671
|
+
};
|
|
672
|
+
}>;
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
declare function usePlantillaController(): {
|
|
676
|
+
createPlantilla: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
677
|
+
getAllPlantillas: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
678
|
+
getPlantillaById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
679
|
+
updatePlantilla: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
680
|
+
deletePlantilla: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
681
|
+
bulkAddPlantillas: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
132
682
|
};
|
|
133
683
|
|
|
134
|
-
export { TDivision, TRegion, TSchool,
|
|
684
|
+
export { AddressInformation, BasicEducEnrForm, DisabilityType, EnrAddress, EnrCert, EnrLearnerInfo, EnrLearningModality, EnrParentGuardianInfo, EnrReturningLearnerInfo, EnrSeniorHighInformation, MAsset, MCurriculum, MDivision, MEnrollment, MGradeLevel, MPlantilla, MRegion, MSchool, MStockCard, PersonContact, TAsset, TCurriculum, TCurriculumSubject, TDivision, TGradeLevel, TPlantilla, TRegion, TSchool, TStockCard, schemaAsset, schemaAssetUpdateOption, schemaCurriculum, schemaDivision, schemaEnrollment, schemaGradeLevel, schemaPlantilla, schemaRegion, schemaSchool, schemaStockCard, useAssetController, useAssetRepo, useCurriculumController, useCurriculumRepo, useDivisionController, useDivisionRepo, useDivisionService, useEnrollmentController, useEnrollmentRepo, useEnrollmentService, useGradeLevelController, useGradeLevelRepo, usePlantillaController, usePlantillaRepo, usePlantillaService, useRegionController, useRegionRepo, useSchoolController, useSchoolRepo, useSchoolService, useStockCardController, useStockCardRepository, useStockCardService };
|