@eeplatform/basic-edu 1.3.12 → 1.4.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eeplatform/basic-edu
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f35df69: Enrollment mgmt - initial stable release
8
+
3
9
  ## 1.3.12
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -79,7 +79,7 @@ declare function useCurriculumController(): {
79
79
  deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
80
80
  };
81
81
 
82
- type BasicEducEnrForm = {
82
+ type TLearner = {
83
83
  _id?: ObjectId;
84
84
  region: string;
85
85
  regionName?: string;
@@ -88,21 +88,20 @@ type BasicEducEnrForm = {
88
88
  division: string;
89
89
  divisionName?: string;
90
90
  schoolId: string;
91
- school: ObjectId;
91
+ school: ObjectId | string;
92
92
  schoolName?: string;
93
93
  schoolYear: string;
94
94
  gradeLevel: string;
95
95
  returningLearner: boolean;
96
- learnerInfo: EnrLearnerInfo;
97
- parentGuardianInfo: EnrParentGuardianInfo;
98
- address: AddressInformation;
99
- returningLearnerInfo?: EnrReturningLearnerInfo;
100
- seniorHighInfo?: EnrSeniorHighInformation;
96
+ learnerInfo: TLearnerInfo;
97
+ parentGuardianInfo: TParentGuardianInfo;
98
+ address: TAddressInformation;
99
+ returningLearnerInfo?: TReturningLearnerInfo;
100
+ seniorHighInfo?: TSeniorHighInformation;
101
101
  alternativeLearningOptions?: string[];
102
102
  isCertifiedAndConsented: boolean;
103
103
  status?: string;
104
104
  remarks?: string;
105
- rejectionReason?: string;
106
105
  createdAt?: Date | string;
107
106
  updatedAt?: Date | string;
108
107
  deletedAt?: Date | string;
@@ -110,7 +109,7 @@ type BasicEducEnrForm = {
110
109
  updatedBy?: string;
111
110
  deletedBy?: string;
112
111
  };
113
- type EnrLearnerInfo = {
112
+ type TLearnerInfo = {
114
113
  psaBirthCertificateNo?: string;
115
114
  lrn?: string;
116
115
  lastName: string;
@@ -128,23 +127,23 @@ type EnrLearnerInfo = {
128
127
  disabilities?: string[];
129
128
  otherDisabilityDetails?: string;
130
129
  };
131
- type EnrParentGuardianInfo = {
132
- father?: PersonContact;
133
- mother?: PersonContact;
134
- legalGuardian?: PersonContact;
130
+ type TParentGuardianInfo = {
131
+ father?: TPersonContact;
132
+ mother?: TPersonContact;
133
+ legalGuardian?: TPersonContact;
135
134
  };
136
- type PersonContact = {
135
+ type TPersonContact = {
137
136
  lastName: string;
138
137
  firstName: string;
139
138
  middleName?: string;
140
139
  contactNumber?: string;
141
140
  };
142
- type AddressInformation = {
143
- current: EnrAddress;
144
- permanent: EnrAddress;
141
+ type TAddressInformation = {
142
+ current: TAddress;
143
+ permanent: TAddress;
145
144
  sameAsCurrent?: boolean;
146
145
  };
147
- type EnrAddress = {
146
+ type TAddress = {
148
147
  houseNumber?: string;
149
148
  streetName?: string;
150
149
  sitio?: string;
@@ -154,7 +153,7 @@ type EnrAddress = {
154
153
  country?: string;
155
154
  zipCode?: string;
156
155
  };
157
- type EnrReturningLearnerInfo = {
156
+ type TReturningLearnerInfo = {
158
157
  lastGradeLevelCompleted: string;
159
158
  lastSchoolYearCompleted: string;
160
159
  lastSchoolAttended: string;
@@ -162,14 +161,15 @@ type EnrReturningLearnerInfo = {
162
161
  isReturningLearner: boolean;
163
162
  isTransferIn: boolean;
164
163
  };
165
- type EnrSeniorHighInformation = {
164
+ type TSeniorHighInformation = {
166
165
  semester: "1st" | "2nd";
167
166
  track: string;
168
167
  strand: string;
169
168
  };
170
- type EnrLearningModality = "Modular (Print)" | "Modular (Digital)" | "Online" | "Radio-Based Instruction" | "Educational Television" | "Blended" | "Homeschooling";
169
+ type TLearningModality = "Modular (Print)" | "Modular (Digital)" | "Online" | "Radio-Based Instruction" | "Educational Television" | "Blended" | "Homeschooling";
170
+ declare const schemaUpdateStatus: Joi.ObjectSchema<any>;
171
171
  declare const schemaEnrollment: Joi.ObjectSchema<any>;
172
- declare function MEnrollment(value: BasicEducEnrForm): {
172
+ declare function MLearner(value: TLearner): {
173
173
  _id: ObjectId | undefined;
174
174
  region: string;
175
175
  regionName: string;
@@ -177,22 +177,21 @@ declare function MEnrollment(value: BasicEducEnrForm): {
177
177
  cityMunicipality: string;
178
178
  division: string;
179
179
  divisionName: string;
180
- school: ObjectId;
180
+ school: string | ObjectId;
181
181
  schoolId: string;
182
182
  schoolName: string;
183
183
  schoolYear: string;
184
184
  gradeLevel: string;
185
185
  returningLearner: boolean;
186
- learnerInfo: EnrLearnerInfo;
187
- parentGuardianInfo: EnrParentGuardianInfo;
188
- address: AddressInformation;
189
- returningLearnerInfo: EnrReturningLearnerInfo | undefined;
190
- seniorHighInfo: EnrSeniorHighInformation | undefined;
186
+ learnerInfo: TLearnerInfo;
187
+ parentGuardianInfo: TParentGuardianInfo;
188
+ address: TAddressInformation;
189
+ returningLearnerInfo: TReturningLearnerInfo | undefined;
190
+ seniorHighInfo: TSeniorHighInformation | undefined;
191
191
  alternativeLearningOptions: string[];
192
192
  isCertifiedAndConsented: boolean;
193
193
  status: string;
194
194
  remarks: string;
195
- rejectionReason: string;
196
195
  createdAt: string | Date;
197
196
  updatedAt: string | Date;
198
197
  deletedAt: string | Date;
@@ -203,8 +202,7 @@ declare function MEnrollment(value: BasicEducEnrForm): {
203
202
 
204
203
  declare function useEnrollmentRepo(): {
205
204
  createIndexes: () => Promise<void>;
206
- add: (value: BasicEducEnrForm, session?: ClientSession) => Promise<ObjectId>;
207
- updateById: (_id: ObjectId | string, value: Partial<BasicEducEnrForm>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
205
+ add: (value: TLearner, session?: ClientSession) => Promise<ObjectId>;
208
206
  getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
209
207
  search?: string | undefined;
210
208
  page?: number | undefined;
@@ -219,9 +217,6 @@ declare function useEnrollmentRepo(): {
219
217
  pages: number;
220
218
  pageRange: string;
221
219
  }>;
222
- getById: (_id: string | ObjectId) => Promise<BasicEducEnrForm>;
223
- getByLrn: (lrn: string, schoolYear?: string) => Promise<BasicEducEnrForm | null>;
224
- deleteById: (_id: string | ObjectId, deletedBy?: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
225
220
  getByApplicantInfo: ({ school, schoolYear, gradeLevel, firstName, lastName, middleName, birthDate, placeOfBirth, }?: {
226
221
  school?: string | undefined;
227
222
  schoolYear?: string | undefined;
@@ -235,60 +230,22 @@ declare function useEnrollmentRepo(): {
235
230
  accepted: boolean;
236
231
  length: number;
237
232
  }>;
238
- getBySchoolAndYear: (school: string | ObjectId, schoolYear: string) => Promise<BasicEducEnrForm[]>;
233
+ updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
234
+ getById: (_id: string | ObjectId, status?: string) => Promise<TLearner | null>;
239
235
  };
240
236
 
241
237
  declare function useEnrollmentService(): {
242
- createEnrollment: (value: BasicEducEnrForm) => Promise<{
238
+ add: (value: TLearner) => Promise<{
243
239
  message: string;
244
- id: ObjectId;
245
- }>;
246
- updateEnrollment: (_id: string | ObjectId, value: Partial<BasicEducEnrForm>) => Promise<{
247
- message: string;
248
- modifiedCount: number;
249
- }>;
250
- getEnrollments: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
251
- search?: string | undefined;
252
- page?: number | undefined;
253
- limit?: number | undefined;
254
- sort?: {} | undefined;
255
- status?: string | undefined;
256
- school?: string | undefined;
257
- schoolYear?: string | undefined;
258
- gradeLevelToEnroll?: string | undefined;
259
- }) => Promise<Record<string, any> | {
260
- items: any[];
261
- pages: number;
262
- pageRange: string;
263
- }>;
264
- getEnrollmentById: (_id: string | ObjectId) => Promise<BasicEducEnrForm>;
265
- getEnrollmentByLrn: (lrn: string, schoolYear?: string) => Promise<BasicEducEnrForm | null>;
266
- deleteEnrollment: (_id: string | ObjectId, deletedBy?: string) => Promise<{
267
- message: string;
268
- modifiedCount: number;
269
- }>;
270
- getEnrollmentsBySchoolAndYear: (school: string | ObjectId, schoolYear: string) => Promise<BasicEducEnrForm[]>;
271
- approveEnrollment: (_id: string | ObjectId, approvedBy: string) => Promise<{
272
- message: string;
273
- modifiedCount: number;
274
- }>;
275
- rejectEnrollment: (_id: string | ObjectId, rejectedBy: string, rejectionReason?: string) => Promise<{
276
- message: string;
277
- modifiedCount: number;
240
+ id: bson.ObjectId;
278
241
  }>;
242
+ updateStatusById: (_id: string, status: string) => Promise<string>;
279
243
  };
280
244
 
281
245
  declare function useEnrollmentController(): {
282
246
  add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
283
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
284
247
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
285
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
286
- getByLrn: (req: Request, res: Response, next: NextFunction) => Promise<void>;
287
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
288
- getBySchoolAndYear: (req: Request, res: Response, next: NextFunction) => Promise<void>;
289
- approve: (req: Request, res: Response, next: NextFunction) => Promise<void>;
290
- reject: (req: Request, res: Response, next: NextFunction) => Promise<void>;
291
- getStatsBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
248
+ updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
292
249
  };
293
250
 
294
251
  type TGradeLevel = {
@@ -361,7 +318,7 @@ declare function useGradeLevelRepo(): {
361
318
  school?: ObjectId | string;
362
319
  }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
363
320
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
364
- getByEducationLevel: (educationLevel: string, school?: string) => Promise<mongodb.WithId<bson.Document>[] | TGradeLevel[]>;
321
+ getByEducationLevel: (educationLevel: string, school?: string) => Promise<TGradeLevel[] | mongodb.WithId<bson.Document>[]>;
365
322
  };
366
323
 
367
324
  declare function useGradeLevelController(): {
@@ -747,4 +704,52 @@ declare function usePlantillaController(): {
747
704
  bulkAddPlantillas: (req: Request, res: Response, next: NextFunction) => Promise<void>;
748
705
  };
749
706
 
750
- export { AddressInformation, BasicEducEnrForm, EnrAddress, EnrLearnerInfo, EnrLearningModality, EnrParentGuardianInfo, EnrReturningLearnerInfo, EnrSeniorHighInformation, MAsset, MCurriculum, MEnrollment, MGradeLevel, MPlantilla, MStockCard, PersonContact, TAsset, TCurriculum, TCurriculumSubject, TDivision, TGradeLevel, TPlantilla, TRegion, TSchool, TStockCard, modelDivision, modelRegion, modelSchool, schemaAsset, schemaAssetUpdateOption, schemaCurriculum, schemaDivision, schemaDivisionUpdate, schemaEnrollment, schemaGradeLevel, schemaPlantilla, schemaRegion, schemaSchool, schemaSchoolUpdate, schemaStockCard, useAssetController, useAssetRepo, useCurriculumController, useCurriculumRepo, useDivisionController, useDivisionRepo, useDivisionService, useEnrollmentController, useEnrollmentRepo, useEnrollmentService, useGradeLevelController, useGradeLevelRepo, usePlantillaController, usePlantillaRepo, usePlantillaService, useRegionController, useRegionRepo, useSchoolController, useSchoolRepo, useSchoolService, useStockCardController, useStockCardRepository, useStockCardService };
707
+ declare function useLearnerRepo(): {
708
+ createIndexes: () => Promise<void>;
709
+ add: (value: TLearner, session?: ClientSession) => Promise<ObjectId>;
710
+ getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
711
+ search?: string | undefined;
712
+ page?: number | undefined;
713
+ limit?: number | undefined;
714
+ sort?: {} | undefined;
715
+ status?: string | undefined;
716
+ school?: string | undefined;
717
+ schoolYear?: string | undefined;
718
+ gradeLevelToEnroll?: string | undefined;
719
+ }) => Promise<Record<string, any> | {
720
+ items: any[];
721
+ pages: number;
722
+ pageRange: string;
723
+ }>;
724
+ updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
725
+ getById: (_id: string | ObjectId, status?: string) => Promise<TLearner | null>;
726
+ };
727
+
728
+ declare function useLearnerController(): {
729
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
730
+ updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
731
+ };
732
+
733
+ type TBasicEduCount = {
734
+ _id?: ObjectId;
735
+ name: string;
736
+ count: number;
737
+ updatedAt?: Date | string;
738
+ };
739
+ declare const schemaBasicEduCount: Joi.ObjectSchema<any>;
740
+ declare function modelBasicEduCount(value: TBasicEduCount): {
741
+ _id: ObjectId | undefined;
742
+ name: string;
743
+ count: number;
744
+ updatedAt: string | Date;
745
+ };
746
+
747
+ declare function useBasicEduCountRepo(): {
748
+ createIndexes: () => Promise<void>;
749
+ add: (value: TBasicEduCount, session?: ClientSession) => Promise<ObjectId>;
750
+ getById: (_id: string | ObjectId, status?: string) => Promise<TBasicEduCount | null>;
751
+ incrementById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
752
+ getByName: (name: string, session?: ClientSession) => Promise<TBasicEduCount | null>;
753
+ };
754
+
755
+ export { MAsset, MCurriculum, MGradeLevel, MLearner, MPlantilla, MStockCard, TAddress, TAddressInformation, TAsset, TBasicEduCount, TCurriculum, TCurriculumSubject, TDivision, TGradeLevel, TLearner, TLearnerInfo, TLearningModality, TParentGuardianInfo, TPersonContact, TPlantilla, TRegion, TReturningLearnerInfo, TSchool, TSeniorHighInformation, TStockCard, modelBasicEduCount, modelDivision, modelRegion, modelSchool, schemaAsset, schemaAssetUpdateOption, schemaBasicEduCount, schemaCurriculum, schemaDivision, schemaDivisionUpdate, schemaEnrollment, schemaGradeLevel, schemaPlantilla, schemaRegion, schemaSchool, schemaSchoolUpdate, schemaStockCard, schemaUpdateStatus, useAssetController, useAssetRepo, useBasicEduCountRepo, useCurriculumController, useCurriculumRepo, useDivisionController, useDivisionRepo, useDivisionService, useEnrollmentController, useEnrollmentRepo, useEnrollmentService, useGradeLevelController, useGradeLevelRepo, useLearnerController, useLearnerRepo, usePlantillaController, usePlantillaRepo, usePlantillaService, useRegionController, useRegionRepo, useSchoolController, useSchoolRepo, useSchoolService, useStockCardController, useStockCardRepository, useStockCardService };