@eeplatform/basic-edu 1.0.1 → 1.1.1

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