@eeplatform/basic-edu 1.3.11 → 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,17 @@
1
1
  # @eeplatform/basic-edu
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f35df69: Enrollment mgmt - initial stable release
8
+
9
+ ## 1.3.12
10
+
11
+ ### Patch Changes
12
+
13
+ - f4c3853: Revise get all enrollment query
14
+
3
15
  ## 1.3.11
4
16
 
5
17
  ### 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;
@@ -87,21 +87,21 @@ type BasicEducEnrForm = {
87
87
  cityMunicipality: string;
88
88
  division: string;
89
89
  divisionName?: string;
90
- school: string;
90
+ schoolId: string;
91
+ school: ObjectId | string;
91
92
  schoolName?: string;
92
93
  schoolYear: string;
93
94
  gradeLevel: string;
94
95
  returningLearner: boolean;
95
- learnerInfo: EnrLearnerInfo;
96
- parentGuardianInfo: EnrParentGuardianInfo;
97
- address: AddressInformation;
98
- returningLearnerInfo?: EnrReturningLearnerInfo;
99
- seniorHighInfo?: EnrSeniorHighInformation;
96
+ learnerInfo: TLearnerInfo;
97
+ parentGuardianInfo: TParentGuardianInfo;
98
+ address: TAddressInformation;
99
+ returningLearnerInfo?: TReturningLearnerInfo;
100
+ seniorHighInfo?: TSeniorHighInformation;
100
101
  alternativeLearningOptions?: string[];
101
102
  isCertifiedAndConsented: boolean;
102
103
  status?: string;
103
104
  remarks?: string;
104
- rejectionReason?: string;
105
105
  createdAt?: Date | string;
106
106
  updatedAt?: Date | string;
107
107
  deletedAt?: Date | string;
@@ -109,7 +109,7 @@ type BasicEducEnrForm = {
109
109
  updatedBy?: string;
110
110
  deletedBy?: string;
111
111
  };
112
- type EnrLearnerInfo = {
112
+ type TLearnerInfo = {
113
113
  psaBirthCertificateNo?: string;
114
114
  lrn?: string;
115
115
  lastName: string;
@@ -127,23 +127,23 @@ type EnrLearnerInfo = {
127
127
  disabilities?: string[];
128
128
  otherDisabilityDetails?: string;
129
129
  };
130
- type EnrParentGuardianInfo = {
131
- father?: PersonContact;
132
- mother?: PersonContact;
133
- legalGuardian?: PersonContact;
130
+ type TParentGuardianInfo = {
131
+ father?: TPersonContact;
132
+ mother?: TPersonContact;
133
+ legalGuardian?: TPersonContact;
134
134
  };
135
- type PersonContact = {
135
+ type TPersonContact = {
136
136
  lastName: string;
137
137
  firstName: string;
138
138
  middleName?: string;
139
139
  contactNumber?: string;
140
140
  };
141
- type AddressInformation = {
142
- current: EnrAddress;
143
- permanent: EnrAddress;
141
+ type TAddressInformation = {
142
+ current: TAddress;
143
+ permanent: TAddress;
144
144
  sameAsCurrent?: boolean;
145
145
  };
146
- type EnrAddress = {
146
+ type TAddress = {
147
147
  houseNumber?: string;
148
148
  streetName?: string;
149
149
  sitio?: string;
@@ -153,7 +153,7 @@ type EnrAddress = {
153
153
  country?: string;
154
154
  zipCode?: string;
155
155
  };
156
- type EnrReturningLearnerInfo = {
156
+ type TReturningLearnerInfo = {
157
157
  lastGradeLevelCompleted: string;
158
158
  lastSchoolYearCompleted: string;
159
159
  lastSchoolAttended: string;
@@ -161,14 +161,15 @@ type EnrReturningLearnerInfo = {
161
161
  isReturningLearner: boolean;
162
162
  isTransferIn: boolean;
163
163
  };
164
- type EnrSeniorHighInformation = {
164
+ type TSeniorHighInformation = {
165
165
  semester: "1st" | "2nd";
166
166
  track: string;
167
167
  strand: string;
168
168
  };
169
- 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>;
170
171
  declare const schemaEnrollment: Joi.ObjectSchema<any>;
171
- declare function MEnrollment(value: BasicEducEnrForm): {
172
+ declare function MLearner(value: TLearner): {
172
173
  _id: ObjectId | undefined;
173
174
  region: string;
174
175
  regionName: string;
@@ -176,21 +177,21 @@ declare function MEnrollment(value: BasicEducEnrForm): {
176
177
  cityMunicipality: string;
177
178
  division: string;
178
179
  divisionName: string;
179
- school: string;
180
+ school: string | ObjectId;
181
+ schoolId: string;
180
182
  schoolName: string;
181
183
  schoolYear: string;
182
184
  gradeLevel: string;
183
185
  returningLearner: boolean;
184
- learnerInfo: EnrLearnerInfo;
185
- parentGuardianInfo: EnrParentGuardianInfo;
186
- address: AddressInformation;
187
- returningLearnerInfo: EnrReturningLearnerInfo | undefined;
188
- seniorHighInfo: EnrSeniorHighInformation | undefined;
186
+ learnerInfo: TLearnerInfo;
187
+ parentGuardianInfo: TParentGuardianInfo;
188
+ address: TAddressInformation;
189
+ returningLearnerInfo: TReturningLearnerInfo | undefined;
190
+ seniorHighInfo: TSeniorHighInformation | undefined;
189
191
  alternativeLearningOptions: string[];
190
192
  isCertifiedAndConsented: boolean;
191
193
  status: string;
192
194
  remarks: string;
193
- rejectionReason: string;
194
195
  createdAt: string | Date;
195
196
  updatedAt: string | Date;
196
197
  deletedAt: string | Date;
@@ -201,8 +202,7 @@ declare function MEnrollment(value: BasicEducEnrForm): {
201
202
 
202
203
  declare function useEnrollmentRepo(): {
203
204
  createIndexes: () => Promise<void>;
204
- add: (value: BasicEducEnrForm, session?: ClientSession) => Promise<ObjectId>;
205
- updateById: (_id: ObjectId | string, value: Partial<BasicEducEnrForm>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
205
+ add: (value: TLearner, session?: ClientSession) => Promise<ObjectId>;
206
206
  getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
207
207
  search?: string | undefined;
208
208
  page?: number | undefined;
@@ -217,9 +217,6 @@ declare function useEnrollmentRepo(): {
217
217
  pages: number;
218
218
  pageRange: string;
219
219
  }>;
220
- getById: (_id: string | ObjectId) => Promise<BasicEducEnrForm>;
221
- getByLrn: (lrn: string, schoolYear?: string) => Promise<BasicEducEnrForm | null>;
222
- deleteById: (_id: string | ObjectId, deletedBy?: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
223
220
  getByApplicantInfo: ({ school, schoolYear, gradeLevel, firstName, lastName, middleName, birthDate, placeOfBirth, }?: {
224
221
  school?: string | undefined;
225
222
  schoolYear?: string | undefined;
@@ -233,60 +230,22 @@ declare function useEnrollmentRepo(): {
233
230
  accepted: boolean;
234
231
  length: number;
235
232
  }>;
236
- 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>;
237
235
  };
238
236
 
239
237
  declare function useEnrollmentService(): {
240
- createEnrollment: (value: BasicEducEnrForm) => Promise<{
241
- message: string;
242
- id: ObjectId;
243
- }>;
244
- updateEnrollment: (_id: string | ObjectId, value: Partial<BasicEducEnrForm>) => Promise<{
245
- message: string;
246
- modifiedCount: number;
247
- }>;
248
- getEnrollments: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
249
- search?: string | undefined;
250
- page?: number | undefined;
251
- limit?: number | undefined;
252
- sort?: {} | undefined;
253
- status?: string | undefined;
254
- school?: string | undefined;
255
- schoolYear?: string | undefined;
256
- gradeLevelToEnroll?: string | undefined;
257
- }) => Promise<Record<string, any> | {
258
- items: any[];
259
- pages: number;
260
- pageRange: string;
261
- }>;
262
- getEnrollmentById: (_id: string | ObjectId) => Promise<BasicEducEnrForm>;
263
- getEnrollmentByLrn: (lrn: string, schoolYear?: string) => Promise<BasicEducEnrForm | null>;
264
- deleteEnrollment: (_id: string | ObjectId, deletedBy?: string) => Promise<{
265
- message: string;
266
- modifiedCount: number;
267
- }>;
268
- getEnrollmentsBySchoolAndYear: (school: string | ObjectId, schoolYear: string) => Promise<BasicEducEnrForm[]>;
269
- approveEnrollment: (_id: string | ObjectId, approvedBy: string) => Promise<{
270
- message: string;
271
- modifiedCount: number;
272
- }>;
273
- rejectEnrollment: (_id: string | ObjectId, rejectedBy: string, rejectionReason?: string) => Promise<{
238
+ add: (value: TLearner) => Promise<{
274
239
  message: string;
275
- modifiedCount: number;
240
+ id: bson.ObjectId;
276
241
  }>;
242
+ updateStatusById: (_id: string, status: string) => Promise<string>;
277
243
  };
278
244
 
279
245
  declare function useEnrollmentController(): {
280
246
  add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
281
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
282
247
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
283
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
284
- getByLrn: (req: Request, res: Response, next: NextFunction) => Promise<void>;
285
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
286
- getBySchoolAndYear: (req: Request, res: Response, next: NextFunction) => Promise<void>;
287
- approve: (req: Request, res: Response, next: NextFunction) => Promise<void>;
288
- reject: (req: Request, res: Response, next: NextFunction) => Promise<void>;
289
- getStatsBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
248
+ updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
290
249
  };
291
250
 
292
251
  type TGradeLevel = {
@@ -359,7 +318,7 @@ declare function useGradeLevelRepo(): {
359
318
  school?: ObjectId | string;
360
319
  }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
361
320
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
362
- getByEducationLevel: (educationLevel: string, school?: string) => Promise<mongodb.WithId<bson.Document>[] | TGradeLevel[]>;
321
+ getByEducationLevel: (educationLevel: string, school?: string) => Promise<TGradeLevel[] | mongodb.WithId<bson.Document>[]>;
363
322
  };
364
323
 
365
324
  declare function useGradeLevelController(): {
@@ -745,4 +704,52 @@ declare function usePlantillaController(): {
745
704
  bulkAddPlantillas: (req: Request, res: Response, next: NextFunction) => Promise<void>;
746
705
  };
747
706
 
748
- 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 };