@eeplatform/basic-edu 1.4.2 → 1.5.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.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1dab40b: Section generation initial release
8
+
9
+ ## 1.4.3
10
+
11
+ ### Patch Changes
12
+
13
+ - e813099: Add createdBy filter to enrollment getAll()
14
+
3
15
  ## 1.4.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -203,7 +203,7 @@ declare function MLearner(value: TLearner): {
203
203
  declare function useEnrollmentRepo(): {
204
204
  createIndexes: () => Promise<void>;
205
205
  add: (value: TLearner, session?: ClientSession) => Promise<ObjectId>;
206
- getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
206
+ getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, createdBy, }?: {
207
207
  search?: string | undefined;
208
208
  page?: number | undefined;
209
209
  limit?: number | undefined;
@@ -212,6 +212,7 @@ declare function useEnrollmentRepo(): {
212
212
  school?: string | undefined;
213
213
  schoolYear?: string | undefined;
214
214
  gradeLevelToEnroll?: string | undefined;
215
+ createdBy?: string | undefined;
215
216
  }) => Promise<Record<string, any> | {
216
217
  items: any[];
217
218
  pages: number;
@@ -257,6 +258,7 @@ type TGradeLevel = {
257
258
  trackStrands?: string[];
258
259
  teachingStyle: string;
259
260
  maxNumberOfLearners: number;
261
+ minNumberOfLearners: number;
260
262
  defaultStartTime?: string;
261
263
  defaultEndTime?: string;
262
264
  status?: string;
@@ -277,6 +279,7 @@ declare function MGradeLevel(value: TGradeLevel): {
277
279
  trackStrands: string[];
278
280
  teachingStyle: string;
279
281
  maxNumberOfLearners: number;
282
+ minNumberOfLearners: number;
280
283
  defaultStartTime: string;
281
284
  defaultEndTime: string;
282
285
  status: string;
@@ -319,6 +322,11 @@ declare function useGradeLevelRepo(): {
319
322
  }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
320
323
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
321
324
  getByEducationLevel: (educationLevel: string, school?: string) => Promise<TGradeLevel[] | mongodb.WithId<bson.Document>[]>;
325
+ getByGradeLevel: (value: {
326
+ school: string | ObjectId;
327
+ gradeLevel: string;
328
+ status?: string;
329
+ }, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TGradeLevel | null>;
322
330
  };
323
331
 
324
332
  declare function useGradeLevelController(): {
@@ -707,7 +715,7 @@ declare function usePlantillaController(): {
707
715
  declare function useLearnerRepo(): {
708
716
  createIndexes: () => Promise<void>;
709
717
  add: (value: TLearner, session?: ClientSession) => Promise<ObjectId>;
710
- getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
718
+ getAll: ({ search, page, limit, sort, status, school, schoolYear, level, }?: {
711
719
  search?: string | undefined;
712
720
  page?: number | undefined;
713
721
  limit?: number | undefined;
@@ -715,14 +723,27 @@ declare function useLearnerRepo(): {
715
723
  status?: string | undefined;
716
724
  school?: string | undefined;
717
725
  schoolYear?: string | undefined;
718
- gradeLevelToEnroll?: string | undefined;
726
+ level?: string | undefined;
719
727
  }) => Promise<Record<string, any> | {
720
728
  items: any[];
721
729
  pages: number;
722
730
  pageRange: string;
723
731
  }>;
732
+ getCountByGradeLevel: (value: {
733
+ school: string | ObjectId;
734
+ schoolYear: string;
735
+ gradeLevel: string;
736
+ status?: string;
737
+ }, session?: ClientSession) => Promise<number>;
724
738
  updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
725
739
  getById: (_id: string | ObjectId, status?: string) => Promise<TLearner | null>;
740
+ getByGradeLevel: (value: {
741
+ school: string | ObjectId;
742
+ gradeLevel: string;
743
+ status?: string;
744
+ limit?: number;
745
+ skip?: number;
746
+ }, session?: ClientSession) => Promise<TLearner[]>;
726
747
  };
727
748
 
728
749
  declare function useLearnerController(): {
@@ -753,4 +774,115 @@ declare function useBasicEduCountRepo(): {
753
774
  resetById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
754
775
  };
755
776
 
756
- 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 };
777
+ type TSectionPreset = {
778
+ _id?: ObjectId;
779
+ name: string;
780
+ description?: string;
781
+ set: Array<string>;
782
+ status: string;
783
+ school: ObjectId | string;
784
+ createdBy: ObjectId | string;
785
+ createdAt?: string;
786
+ updatedAt?: string;
787
+ deletedAt?: string;
788
+ };
789
+ declare const schemaSectionPreset: Joi.ObjectSchema<any>;
790
+ declare function modelSectionPreset(value: TSectionPreset): TSectionPreset;
791
+
792
+ declare function useSectionPresetRepo(): {
793
+ createIndexes: () => Promise<void>;
794
+ add: (value: TSectionPreset, session?: ClientSession) => Promise<ObjectId>;
795
+ getAll: ({ search, page, limit, sort, status, createdBy, school, }?: {
796
+ search?: string;
797
+ page?: number;
798
+ limit?: number;
799
+ sort?: Record<string, any>;
800
+ status?: string;
801
+ createdBy?: string | ObjectId;
802
+ school?: string;
803
+ }) => Promise<Record<string, any> | {
804
+ items: any[];
805
+ pages: number;
806
+ pageRange: string;
807
+ }>;
808
+ getById: (_id: string | ObjectId) => Promise<TSectionPreset>;
809
+ updateFieldById: ({ _id, field, value }?: {
810
+ _id: string | ObjectId;
811
+ field: string;
812
+ value: string | Array<string>;
813
+ }, session?: ClientSession) => Promise<string>;
814
+ deleteById: (_id: string | ObjectId) => Promise<string>;
815
+ getByName: (name: string) => Promise<TSectionPreset>;
816
+ };
817
+
818
+ declare function useSectionPresetController(): {
819
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
820
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
821
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
822
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
823
+ updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
824
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
825
+ };
826
+
827
+ type TSection = {
828
+ _id?: ObjectId;
829
+ school: ObjectId | string;
830
+ name: string;
831
+ schoolYear: string;
832
+ gradeLevel: string;
833
+ adviser?: ObjectId | string;
834
+ adviserName?: string;
835
+ students: number;
836
+ status?: string;
837
+ createdAt?: string | Date;
838
+ updatedAt?: string | Date;
839
+ deletedAt?: string | Date;
840
+ };
841
+ declare const schemaSection: Joi.ObjectSchema<any>;
842
+ declare const schemaGenerateSections: Joi.ObjectSchema<any>;
843
+ declare function modelSection(value: TSection): TSection;
844
+
845
+ declare function useSectionRepo(): {
846
+ createIndexes: () => Promise<void>;
847
+ add: (value: TSection, session?: ClientSession) => Promise<ObjectId>;
848
+ getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevel, }?: {
849
+ search?: string | undefined;
850
+ page?: number | undefined;
851
+ limit?: number | undefined;
852
+ sort?: {} | undefined;
853
+ status?: string | undefined;
854
+ school?: string | undefined;
855
+ schoolYear?: string | undefined;
856
+ gradeLevel?: string | undefined;
857
+ }) => Promise<Record<string, any> | {
858
+ items: any[];
859
+ pages: number;
860
+ pageRange: string;
861
+ }>;
862
+ getById: (_id: string | ObjectId) => Promise<TSection>;
863
+ getByName: (name: string) => Promise<TSection>;
864
+ getBySchool: (school: string | ObjectId) => Promise<TSection[]>;
865
+ updateFieldById: ({ _id, field, value }?: {
866
+ _id: string | ObjectId;
867
+ field: string;
868
+ value: string;
869
+ }, session?: ClientSession) => Promise<string>;
870
+ addStudentToSection: (_id: string | ObjectId, studentId: string, session?: ClientSession) => Promise<string>;
871
+ removeStudentFromSection: (_id: string | ObjectId, studentId: string, session?: ClientSession) => Promise<string>;
872
+ deleteById: (_id: string | ObjectId) => Promise<string>;
873
+ };
874
+
875
+ declare function useSectionController(): {
876
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
877
+ generateSections: (req: Request, res: Response, next: NextFunction) => Promise<void>;
878
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
879
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
880
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
881
+ getBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
882
+ updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
883
+ addStudent: (req: Request, res: Response, next: NextFunction) => Promise<void>;
884
+ removeStudent: (req: Request, res: Response, next: NextFunction) => Promise<void>;
885
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
886
+ };
887
+
888
+ export { MAsset, MCurriculum, MGradeLevel, MLearner, MPlantilla, MStockCard, TAddress, TAddressInformation, TAsset, TBasicEduCount, TCurriculum, TCurriculumSubject, TDivision, TGradeLevel, TLearner, TLearnerInfo, TLearningModality, TParentGuardianInfo, TPersonContact, TPlantilla, TRegion, TReturningLearnerInfo, TSchool, TSection, TSectionPreset, TSeniorHighInformation, TStockCard, modelBasicEduCount, modelDivision, modelRegion, modelSchool, modelSection, modelSectionPreset, schemaAsset, schemaAssetUpdateOption, schemaBasicEduCount, schemaCurriculum, schemaDivision, schemaDivisionUpdate, schemaEnrollment, schemaGenerateSections, schemaGradeLevel, schemaPlantilla, schemaRegion, schemaSchool, schemaSchoolUpdate, schemaSection, schemaSectionPreset, 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, useSectionController, useSectionPresetController, useSectionPresetRepo, useSectionRepo, useStockCardController, useStockCardRepository, useStockCardService };