@eeplatform/core 1.4.4 → 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/core
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3eb24f7: Basic education - curriculum mgmt initial release
8
+
9
+ ## 1.4.5
10
+
11
+ ### Patch Changes
12
+
13
+ - 8be695c: School Mgmt - Implement add school and bulk school upload
14
+
3
15
  ## 1.4.4
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -2364,16 +2364,17 @@ type TSchool = {
2364
2364
  _id?: ObjectId;
2365
2365
  id: string;
2366
2366
  name: string;
2367
- country: string;
2368
- address: string;
2369
- continuedAddress: string;
2370
- city: string;
2371
- province: string;
2372
- postalCode: string;
2373
- courses: Array<string>;
2374
- principalName: string;
2375
- principalEmail: string;
2376
- principalNumber: string;
2367
+ country?: string;
2368
+ address?: string;
2369
+ continuedAddress?: string;
2370
+ city?: string;
2371
+ province?: string;
2372
+ district?: string;
2373
+ postalCode?: string;
2374
+ courses?: Array<string>;
2375
+ principalName?: string;
2376
+ principalEmail?: string;
2377
+ principalNumber?: string;
2377
2378
  region: string | ObjectId;
2378
2379
  regionName?: string;
2379
2380
  division: string | ObjectId;
@@ -2411,6 +2412,17 @@ declare function useSchoolRepo(): {
2411
2412
  declare function useSchoolService(): {
2412
2413
  register: (value: TSchool) => Promise<string>;
2413
2414
  approve: (id: string) => Promise<string>;
2415
+ add: (value: TSchool) => Promise<string>;
2416
+ addBulk: (file: Express.Multer.File, region: string, division: string) => Promise<{
2417
+ message: string;
2418
+ details: {
2419
+ successful: number;
2420
+ failed: number;
2421
+ total: number;
2422
+ totalSizeMB: number;
2423
+ errors: string[];
2424
+ };
2425
+ }>;
2414
2426
  };
2415
2427
 
2416
2428
  declare function useSchoolController(): {
@@ -2420,6 +2432,7 @@ declare function useSchoolController(): {
2420
2432
  updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2421
2433
  registerSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2422
2434
  approveSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2435
+ addBulk: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2423
2436
  };
2424
2437
 
2425
2438
  type TBuilding = {
@@ -2677,22 +2690,33 @@ declare function useUtilController(): {
2677
2690
 
2678
2691
  type TPlantilla = {
2679
2692
  _id?: ObjectId;
2693
+ org: string;
2680
2694
  itemNumber: string;
2695
+ orgUnitCode?: string;
2681
2696
  positionTitle: string;
2682
- officeAssignmentType: string;
2683
- officeAssignment: string;
2684
- status: string;
2685
- employeeId?: ObjectId;
2686
- createdAt: Date | string;
2697
+ positionCategory: string;
2698
+ salaryGrade: number;
2699
+ employmentType?: string;
2700
+ personnelType: string;
2701
+ region?: ObjectId | string;
2702
+ regionName?: string;
2703
+ division?: ObjectId | string;
2704
+ divisionName?: string;
2705
+ employee?: string | ObjectId;
2706
+ employeeName?: string;
2707
+ annualSalary?: number;
2708
+ monthlySalary?: number;
2709
+ status?: string;
2710
+ createdAt?: Date | string;
2687
2711
  updatedAt?: Date | string;
2688
2712
  deletedAt?: Date | string;
2689
2713
  };
2690
- declare const schemaPlantilla: Joi.ObjectSchema<any>;
2714
+ declare const schemaPlantilla: Joi.ObjectSchema<TPlantilla>;
2691
2715
  declare function MPlantilla(data: Partial<TPlantilla>): TPlantilla;
2692
2716
 
2693
2717
  declare function usePlantillaRepo(): {
2694
2718
  createIndexes: () => Promise<void>;
2695
- add: (value: TPlantilla, session?: ClientSession) => Promise<ObjectId>;
2719
+ add: (value: TPlantilla, session?: ClientSession, clearCache?: boolean) => Promise<ObjectId>;
2696
2720
  getAll: ({ search, page, limit, sort, org, status, }?: {
2697
2721
  search?: string | undefined;
2698
2722
  page?: number | undefined;
@@ -2702,8 +2726,9 @@ declare function usePlantillaRepo(): {
2702
2726
  status?: string | undefined;
2703
2727
  }) => Promise<Record<string, any>>;
2704
2728
  getById: (_id: string | ObjectId) => Promise<TPlantilla | null>;
2705
- updateById: (_id: ObjectId | string, value: Partial<Pick<TPlantilla, "employeeId" | "status" | "positionTitle" | "updatedAt">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2729
+ updateById: (_id: ObjectId | string, value: Partial<Pick<TPlantilla, "status" | "positionTitle" | "updatedAt">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2706
2730
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2731
+ delCachedData: () => void;
2707
2732
  };
2708
2733
 
2709
2734
  declare function usePlantillaController(): {
@@ -2712,6 +2737,139 @@ declare function usePlantillaController(): {
2712
2737
  getPlantillaById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2713
2738
  updatePlantilla: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2714
2739
  deletePlantilla: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2740
+ bulkAddPlantillas: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2741
+ };
2742
+
2743
+ type TOffice = {
2744
+ _id?: ObjectId;
2745
+ name: string;
2746
+ code: string;
2747
+ type: string;
2748
+ parent?: ObjectId | string;
2749
+ path: string;
2750
+ status: string;
2751
+ createdAt?: Date | string;
2752
+ updatedAt?: Date | string;
2753
+ deletedAt?: Date | string;
2754
+ };
2755
+ declare const schemaOffice: Joi.ObjectSchema<TOffice>;
2756
+ declare function MOffice(data: Partial<TOffice>): TOffice;
2757
+
2758
+ declare function useOfficeRepo(): {
2759
+ createIndexes: () => Promise<void>;
2760
+ add: (value: TOffice, session?: ClientSession, clearCache?: boolean) => Promise<ObjectId>;
2761
+ getAll: ({ search, page, limit, sort, type, parent, status, }?: {
2762
+ search?: string | undefined;
2763
+ page?: number | undefined;
2764
+ limit?: number | undefined;
2765
+ sort?: {} | undefined;
2766
+ type?: string | undefined;
2767
+ parent?: string | undefined;
2768
+ status?: string | undefined;
2769
+ }) => Promise<Record<string, any>>;
2770
+ getById: (_id: string | ObjectId) => Promise<TOffice | null>;
2771
+ updateById: (_id: ObjectId | string, value: Partial<Pick<TOffice, "status" | "name" | "code" | "type" | "parent" | "path" | "updatedAt">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2772
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2773
+ delCachedData: () => void;
2774
+ };
2775
+
2776
+ declare function useOfficeService(): {
2777
+ addBulk: (file: Express.Multer.File) => Promise<{
2778
+ total: number;
2779
+ successful: number;
2780
+ failed: number;
2781
+ errors: string[];
2782
+ }>;
2783
+ };
2784
+
2785
+ declare function useOfficeController(): {
2786
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2787
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2788
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2789
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2790
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2791
+ bulkAddOffices: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2792
+ };
2793
+
2794
+ type TCurriculum = {
2795
+ _id?: ObjectId;
2796
+ school: ObjectId | string;
2797
+ code: string;
2798
+ educationLevel: string;
2799
+ gradeLevel: string;
2800
+ subjectCode: string;
2801
+ subjectName: string;
2802
+ subjectType: string;
2803
+ sessionFrequency: number;
2804
+ sessionDuration: number;
2805
+ totalMinutesPerWeek: number;
2806
+ curriculumMemoRef?: string;
2807
+ status?: string;
2808
+ createdAt?: Date | string;
2809
+ updatedAt?: Date | string;
2810
+ deletedAt?: Date | string;
2811
+ createdBy?: string;
2812
+ updatedBy?: string;
2813
+ deletedBy?: string;
2814
+ };
2815
+ declare const schemaCurriculum: Joi.ObjectSchema<any>;
2816
+ declare function MCurriculum(value: TCurriculum): {
2817
+ _id: ObjectId | undefined;
2818
+ school: string | ObjectId;
2819
+ code: string;
2820
+ educationLevel: string;
2821
+ gradeLevel: string;
2822
+ subjectCode: string;
2823
+ subjectName: string;
2824
+ subjectType: string;
2825
+ sessionFrequency: number;
2826
+ sessionDuration: number;
2827
+ totalMinutesPerWeek: number;
2828
+ curriculumMemoRef: string;
2829
+ status: string;
2830
+ createdAt: string | Date;
2831
+ updatedAt: string | Date;
2832
+ deletedAt: string | Date;
2833
+ createdBy: string;
2834
+ updatedBy: string;
2835
+ deletedBy: string;
2836
+ };
2837
+
2838
+ declare function useCurriculumRepo(): {
2839
+ createIndexes: () => Promise<void>;
2840
+ add: (value: TCurriculum, session?: ClientSession) => Promise<ObjectId>;
2841
+ getAll: ({ search, page, limit, sort, educationLevel, gradeLevel, subjectCode, status, }?: {
2842
+ search?: string | undefined;
2843
+ page?: number | undefined;
2844
+ limit?: number | undefined;
2845
+ sort?: {} | undefined;
2846
+ educationLevel?: string | undefined;
2847
+ gradeLevel?: string | undefined;
2848
+ subjectCode?: string | undefined;
2849
+ status?: string | undefined;
2850
+ }) => Promise<Record<string, any>>;
2851
+ getById: (_id: string | ObjectId) => Promise<TCurriculum | null>;
2852
+ updateById: (_id: ObjectId | string, value: {
2853
+ code?: string;
2854
+ educationLevel?: string;
2855
+ gradeLevel?: string;
2856
+ subjectCode?: string;
2857
+ subjectName?: string;
2858
+ subjectType?: string;
2859
+ sessionFrequency?: number;
2860
+ sessionDuration?: number;
2861
+ totalMinutesPerWeek?: number;
2862
+ curriculumMemoRef?: string;
2863
+ }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2864
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2865
+ };
2866
+
2867
+ declare function useCurriculumController(): {
2868
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2869
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2870
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2871
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2872
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2715
2873
  };
2716
2874
 
2717
2875
  declare const MONGO_URI: string;
@@ -2750,4 +2908,4 @@ declare const PAYPAL_API_URL: string;
2750
2908
  declare const XENDIT_SECRET_KEY: string;
2751
2909
  declare const XENDIT_BASE_URL: string;
2752
2910
 
2753
- export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, CardPayment, CardPaymentSchema, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DirectDebit, DirectDebitSchema, EWalletPayment, EWalletPaymentSchema, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MAsset, MBuilding, MBuildingUnit, MDivision, MEntity, MFile, MMember, MONGO_DB, MONGO_URI, MOrder, MOrg, MPaymentMethod, MPlantilla, MPromoCode, MRegion, MRole, MSchool, MStockCard, MSubscription, MToken, MUser, MUserRole, MVerification, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PORT, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TAddress, TAsset, TBillingRecipient, TBuilding, TBuildingUnit, TCounter, TDivision, TEntity, TFile, TInvoice, TMember, TMiniRole, TOrder, TOrderMetadata, TOrg, TPayment, TPaymentMethod$1 as TPaymentMethod, TPaymentMethodType, TPlantilla, TPrice, TPriceType, TPromoCode, TPromoTier, TRegion, TRole, TSchool, TStockCard, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schema, schemaAsset, schemaAssetUpdateOption, schemaBuilding, schemaBuildingUnit, schemaDivision, schemaPlantilla, schemaRegion, schemaSchool, schemaStockCard, schemaUpdateOptions, useAddressController, useAddressRepo, useAssetController, useAssetRepo, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingUnitController, useBuildingUnitRepo, useCounterModel, useCounterRepo, useDivisionController, useDivisionRepo, useDivisionService, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useGitHubService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useInvoiceService, useMemberController, useMemberRepo, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePlantillaController, usePlantillaRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRegionController, useRegionRepo, useRegionService, useRoleController, useRoleRepo, useSchoolController, useSchoolRepo, useSchoolService, useStockCardController, useStockCardRepository, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };
2911
+ export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, CardPayment, CardPaymentSchema, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DirectDebit, DirectDebitSchema, EWalletPayment, EWalletPaymentSchema, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MAsset, MBuilding, MBuildingUnit, MCurriculum, MDivision, MEntity, MFile, MMember, MONGO_DB, MONGO_URI, MOffice, MOrder, MOrg, MPaymentMethod, MPlantilla, MPromoCode, MRegion, MRole, MSchool, MStockCard, MSubscription, MToken, MUser, MUserRole, MVerification, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PORT, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TAddress, TAsset, TBillingRecipient, TBuilding, TBuildingUnit, TCounter, TCurriculum, TDivision, TEntity, TFile, TInvoice, TMember, TMiniRole, TOffice, TOrder, TOrderMetadata, TOrg, TPayment, TPaymentMethod$1 as TPaymentMethod, TPaymentMethodType, TPlantilla, TPrice, TPriceType, TPromoCode, TPromoTier, TRegion, TRole, TSchool, TStockCard, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schema, schemaAsset, schemaAssetUpdateOption, schemaBuilding, schemaBuildingUnit, schemaCurriculum, schemaDivision, schemaOffice, schemaPlantilla, schemaRegion, schemaSchool, schemaStockCard, schemaUpdateOptions, useAddressController, useAddressRepo, useAssetController, useAssetRepo, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingUnitController, useBuildingUnitRepo, useCounterModel, useCounterRepo, useCurriculumController, useCurriculumRepo, useDivisionController, useDivisionRepo, useDivisionService, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useGitHubService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useInvoiceService, useMemberController, useMemberRepo, useOfficeController, useOfficeRepo, useOfficeService, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePlantillaController, usePlantillaRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRegionController, useRegionRepo, useRegionService, useRoleController, useRoleRepo, useSchoolController, useSchoolRepo, useSchoolService, useStockCardController, useStockCardRepository, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };