@eeplatform/basic-edu 1.4.3 → 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,11 @@
1
1
  # @eeplatform/basic-edu
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1dab40b: Section generation initial release
8
+
3
9
  ## 1.4.3
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -258,6 +258,7 @@ type TGradeLevel = {
258
258
  trackStrands?: string[];
259
259
  teachingStyle: string;
260
260
  maxNumberOfLearners: number;
261
+ minNumberOfLearners: number;
261
262
  defaultStartTime?: string;
262
263
  defaultEndTime?: string;
263
264
  status?: string;
@@ -278,6 +279,7 @@ declare function MGradeLevel(value: TGradeLevel): {
278
279
  trackStrands: string[];
279
280
  teachingStyle: string;
280
281
  maxNumberOfLearners: number;
282
+ minNumberOfLearners: number;
281
283
  defaultStartTime: string;
282
284
  defaultEndTime: string;
283
285
  status: string;
@@ -320,6 +322,11 @@ declare function useGradeLevelRepo(): {
320
322
  }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
321
323
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
322
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>;
323
330
  };
324
331
 
325
332
  declare function useGradeLevelController(): {
@@ -708,7 +715,7 @@ declare function usePlantillaController(): {
708
715
  declare function useLearnerRepo(): {
709
716
  createIndexes: () => Promise<void>;
710
717
  add: (value: TLearner, session?: ClientSession) => Promise<ObjectId>;
711
- getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
718
+ getAll: ({ search, page, limit, sort, status, school, schoolYear, level, }?: {
712
719
  search?: string | undefined;
713
720
  page?: number | undefined;
714
721
  limit?: number | undefined;
@@ -716,14 +723,27 @@ declare function useLearnerRepo(): {
716
723
  status?: string | undefined;
717
724
  school?: string | undefined;
718
725
  schoolYear?: string | undefined;
719
- gradeLevelToEnroll?: string | undefined;
726
+ level?: string | undefined;
720
727
  }) => Promise<Record<string, any> | {
721
728
  items: any[];
722
729
  pages: number;
723
730
  pageRange: string;
724
731
  }>;
732
+ getCountByGradeLevel: (value: {
733
+ school: string | ObjectId;
734
+ schoolYear: string;
735
+ gradeLevel: string;
736
+ status?: string;
737
+ }, session?: ClientSession) => Promise<number>;
725
738
  updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
726
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[]>;
727
747
  };
728
748
 
729
749
  declare function useLearnerController(): {
@@ -754,4 +774,115 @@ declare function useBasicEduCountRepo(): {
754
774
  resetById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
755
775
  };
756
776
 
757
- 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 };