@eeplatform/core 1.3.0 → 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/core
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d40981f: Asset mgmt - stock card mgmt initial release
8
+
3
9
  ## 1.3.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -2553,14 +2553,14 @@ declare function useBuildingUnitController(): {
2553
2553
  deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2554
2554
  };
2555
2555
 
2556
- type TInventory = {
2556
+ type TAsset = {
2557
2557
  _id?: ObjectId;
2558
2558
  school: ObjectId;
2559
+ asset_type: "supply" | "furniture-equipment" | "fixed-asset";
2559
2560
  name: string;
2560
2561
  category: string;
2561
2562
  type: string;
2562
- unit_of_measurement_category: string;
2563
- unit_of_measurement_type: string;
2563
+ unit: string;
2564
2564
  status?: string;
2565
2565
  qty?: number;
2566
2566
  brand?: string;
@@ -2584,61 +2584,82 @@ type TInventory = {
2584
2584
  language?: string;
2585
2585
  };
2586
2586
  };
2587
- declare const schemaInventory: Joi.ObjectSchema<any>;
2588
- declare const schemaInventoryUpdateOption: Joi.ObjectSchema<any>;
2589
- declare function MInventory(value: TInventory): {
2590
- _id: ObjectId;
2591
- school: ObjectId;
2592
- name: string;
2593
- category: string;
2594
- type: string;
2595
- brand: string;
2596
- qty: number;
2597
- condition: {
2598
- good: number;
2599
- disposal: number;
2600
- lost: number;
2601
- damaged: number;
2602
- };
2603
- unit_of_measurement_category: string;
2604
- unit_of_measurement_type: string;
2605
- status: string;
2606
- createdAt: Date;
2607
- updatedAt: string | Date;
2608
- deletedAt: string | Date;
2609
- metadata: {
2610
- title?: string | undefined;
2611
- isbn?: string | undefined;
2612
- author?: string | undefined;
2613
- edition?: string | undefined;
2614
- subject?: string | undefined;
2615
- grade_level?: number | undefined;
2616
- publisher?: string | undefined;
2617
- language?: string | undefined;
2618
- };
2619
- };
2587
+ declare const schemaAsset: Joi.ObjectSchema<any>;
2588
+ declare const schemaAssetUpdateOption: Joi.ObjectSchema<any>;
2589
+ declare function MAsset(value: TAsset): TAsset;
2620
2590
 
2621
- declare function useInventoryRepo(): {
2591
+ declare function useAssetRepo(): {
2622
2592
  createIndex: () => Promise<void>;
2623
- add: (value: TInventory) => Promise<ObjectId>;
2624
- updateById: (_id: string | ObjectId, value: Partial<Pick<TInventory, "name" | "brand" | "category" | "type" | "unit_of_measurement_category" | "unit_of_measurement_type">>) => Promise<string>;
2593
+ add: (value: TAsset) => Promise<ObjectId>;
2594
+ updateById: (_id: string | ObjectId, value: Partial<Pick<TAsset, "name" | "brand" | "category" | "type" | "unit" | "qty">>, session?: ClientSession) => Promise<string>;
2625
2595
  deleteById: (_id: string | ObjectId) => Promise<string>;
2626
- getById: (_id: string | ObjectId) => Promise<{}>;
2627
- getAll: ({ page, search, limit, status, school, sort, }?: {
2596
+ getById: (_id: string | ObjectId) => Promise<TAsset>;
2597
+ getAll: ({ page, search, limit, status, school, sort, asset_type, }?: {
2628
2598
  page?: number | undefined;
2629
2599
  search?: string | undefined;
2630
2600
  limit?: number | undefined;
2631
2601
  status?: string | undefined;
2632
2602
  school?: string | ObjectId | undefined;
2633
2603
  sort?: Record<string, any> | undefined;
2604
+ asset_type: string;
2634
2605
  }) => Promise<{}>;
2606
+ getCategories: (school: string | ObjectId, asset_type: string) => Promise<{}>;
2607
+ getTypes: (school: string | ObjectId, asset_type: string) => Promise<{}>;
2608
+ getUnitsBySchool: (school: string | ObjectId) => Promise<{}>;
2635
2609
  };
2636
2610
 
2637
- declare function useInventoryController(): {
2611
+ declare function useAssetController(): {
2638
2612
  add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2639
2613
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2640
2614
  deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2641
2615
  updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2616
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2617
+ getCategories: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2618
+ getTypes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2619
+ getUnitsBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2620
+ };
2621
+
2622
+ type TStockCard = {
2623
+ _id?: ObjectId;
2624
+ school: ObjectId;
2625
+ item: ObjectId;
2626
+ balance: number;
2627
+ qty: number;
2628
+ unitCost?: number;
2629
+ totalCost?: number;
2630
+ status: string;
2631
+ condition: string;
2632
+ supplier?: string;
2633
+ location?: ObjectId;
2634
+ locationName?: string;
2635
+ reason?: string;
2636
+ remarks?: string;
2637
+ createdAt?: Date | string;
2638
+ updatedAt?: Date | string;
2639
+ deletedAt?: Date | string;
2640
+ };
2641
+ declare const schemaStockCard: Joi.ObjectSchema<any>;
2642
+ declare function MStockCard(value: TStockCard): TStockCard;
2643
+
2644
+ declare function useStockCardRepository(): {
2645
+ createIndex: () => Promise<void>;
2646
+ add: (value: TStockCard, session?: ClientSession) => Promise<ObjectId>;
2647
+ getById: (_id: string | ObjectId) => Promise<{}>;
2648
+ getAll: ({ page, limit, school, sort, id }?: {
2649
+ page?: number | undefined;
2650
+ limit?: number | undefined;
2651
+ school?: string | ObjectId | undefined;
2652
+ sort?: Record<string, any> | undefined;
2653
+ id: string | ObjectId;
2654
+ }) => Promise<{}>;
2655
+ getSuppliers: (school: string | ObjectId) => Promise<{}>;
2656
+ };
2657
+
2658
+ declare function useStockCardController(): {
2659
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2660
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2661
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2662
+ getSuppliers: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2642
2663
  };
2643
2664
 
2644
2665
  declare const MONGO_URI: string;
@@ -2677,4 +2698,4 @@ declare const PAYPAL_API_URL: string;
2677
2698
  declare const XENDIT_SECRET_KEY: string;
2678
2699
  declare const XENDIT_BASE_URL: string;
2679
2700
 
2680
- 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, MBuilding, MBuildingUnit, MDivision, MEntity, MFile, MInventory, MMember, MONGO_DB, MONGO_URI, MOrder, MOrg, MPaymentMethod, MPromoCode, MRegion, MRole, MSchool, 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, TBillingRecipient, TBuilding, TBuildingUnit, TCounter, TDivision, TEntity, TFile, TInventory, TInvoice, TMember, TMiniRole, TOrder, TOrderMetadata, TOrg, TPayment, TPaymentMethod$1 as TPaymentMethod, TPaymentMethodType, TPrice, TPriceType, TPromoCode, TPromoTier, TRegion, TRole, TSchool, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schema, schemaBuilding, schemaBuildingUnit, schemaDivision, schemaInventory, schemaInventoryUpdateOption, schemaRegion, schemaSchool, schemaUpdateOptions, useAddressController, useAddressRepo, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingUnitController, useBuildingUnitRepo, useCounterModel, useCounterRepo, useDivisionController, useDivisionRepo, useDivisionService, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useInventoryController, useInventoryRepo, useInvoiceController, useInvoiceModel, useInvoiceRepo, useInvoiceService, useMemberController, useMemberRepo, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRegionController, useRegionRepo, useRegionService, useRoleController, useRoleRepo, useSchoolController, useSchoolRepo, useSchoolService, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };
2701
+ 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, 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, 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, schemaRegion, schemaSchool, schemaStockCard, schemaUpdateOptions, useAddressController, useAddressRepo, useAssetController, useAssetRepo, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingUnitController, useBuildingUnitRepo, useCounterModel, useCounterRepo, useDivisionController, useDivisionRepo, useDivisionService, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useInvoiceService, useMemberController, useMemberRepo, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRegionController, useRegionRepo, useRegionService, useRoleController, useRoleRepo, useSchoolController, useSchoolRepo, useSchoolService, useStockCardController, useStockCardRepository, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };