@axova/shared 1.0.2 → 1.1.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.
Files changed (68) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +2 -0
  3. package/dist/lib/db.d.ts +34406 -1
  4. package/dist/lib/db.js +21 -1
  5. package/dist/middleware/storeOwnership.js +22 -3
  6. package/dist/middleware/storeValidationMiddleware.js +16 -39
  7. package/dist/schemas/admin/admin-schema.d.ts +2 -2
  8. package/dist/schemas/ai-moderation/ai-moderation-schema.d.ts +6 -6
  9. package/dist/schemas/common/common-schemas.d.ts +71 -71
  10. package/dist/schemas/compliance/compliance-schema.d.ts +20 -20
  11. package/dist/schemas/compliance/kyc-schema.d.ts +8 -8
  12. package/dist/schemas/customer/customer-schema.d.ts +18 -18
  13. package/dist/schemas/index.d.ts +28 -0
  14. package/dist/schemas/index.js +134 -3
  15. package/dist/schemas/inventory/inventory-tables.d.ts +188 -188
  16. package/dist/schemas/inventory/lot-tables.d.ts +102 -102
  17. package/dist/schemas/order/cart-schema.d.ts +2865 -0
  18. package/dist/schemas/order/cart-schema.js +396 -0
  19. package/dist/schemas/order/order-schema.d.ts +19 -19
  20. package/dist/schemas/order/order-schema.js +8 -2
  21. package/dist/schemas/product/discount-schema.d.ts +3 -3
  22. package/dist/schemas/product/product-schema.d.ts +3 -3
  23. package/dist/schemas/store/store-audit-schema.d.ts +20 -20
  24. package/dist/schemas/store/store-schema.d.ts +182 -2
  25. package/dist/schemas/store/store-schema.js +19 -0
  26. package/dist/schemas/store/storefront-config-schema.d.ts +434 -823
  27. package/dist/schemas/store/storefront-config-schema.js +35 -62
  28. package/dist/utils/subdomain.d.ts +1 -1
  29. package/dist/utils/subdomain.js +10 -15
  30. package/package.json +1 -1
  31. package/src/configs/index.ts +654 -654
  32. package/src/index.ts +26 -23
  33. package/src/interfaces/customer-events.ts +106 -106
  34. package/src/interfaces/inventory-events.ts +545 -545
  35. package/src/interfaces/inventory-types.ts +1004 -1004
  36. package/src/interfaces/order-events.ts +381 -381
  37. package/src/lib/auditLogger.ts +1117 -1117
  38. package/src/lib/authOrganization.ts +153 -153
  39. package/src/lib/db.ts +84 -64
  40. package/src/middleware/serviceAuth.ts +328 -328
  41. package/src/middleware/storeOwnership.ts +199 -181
  42. package/src/middleware/storeValidationMiddleware.ts +17 -50
  43. package/src/middleware/userAuth.ts +248 -248
  44. package/src/schemas/admin/admin-schema.ts +208 -208
  45. package/src/schemas/ai-moderation/ai-moderation-schema.ts +180 -180
  46. package/src/schemas/common/common-schemas.ts +108 -108
  47. package/src/schemas/compliance/compliance-schema.ts +927 -0
  48. package/src/schemas/compliance/kyc-schema.ts +649 -0
  49. package/src/schemas/customer/customer-schema.ts +576 -0
  50. package/src/schemas/index.ts +202 -3
  51. package/src/schemas/inventory/inventory-tables.ts +1927 -0
  52. package/src/schemas/inventory/lot-tables.ts +799 -0
  53. package/src/schemas/order/cart-schema.ts +652 -0
  54. package/src/schemas/order/order-schema.ts +1406 -0
  55. package/src/schemas/product/discount-relations.ts +44 -0
  56. package/src/schemas/product/discount-schema.ts +464 -0
  57. package/src/schemas/product/product-relations.ts +187 -0
  58. package/src/schemas/product/product-schema.ts +955 -0
  59. package/src/schemas/store/ethiopian_business_api.md.resolved +212 -0
  60. package/src/schemas/store/store-audit-schema.ts +1257 -0
  61. package/src/schemas/store/store-schema.ts +682 -0
  62. package/src/schemas/store/store-settings-schema.ts +231 -0
  63. package/src/schemas/store/storefront-config-schema.ts +382 -0
  64. package/src/schemas/types.ts +67 -67
  65. package/src/types/events.ts +646 -646
  66. package/src/utils/errorHandler.ts +44 -44
  67. package/src/utils/subdomain.ts +19 -23
  68. package/tsconfig.json +21 -21
@@ -678,7 +678,7 @@ export declare const inventoryLots: import("drizzle-orm/pg-core").PgTableWithCol
678
678
  tableName: "inventory_lots";
679
679
  dataType: "string";
680
680
  columnType: "PgEnumColumn";
681
- data: "PENDING" | "QUARANTINED" | "ACTIVE" | "EXPIRED" | "RETURNED" | "PO_INCOMING" | "ALLOCATED" | "RECALLED" | "DEPLETED" | "DISPOSED";
681
+ data: "PENDING" | "EXPIRED" | "ACTIVE" | "RETURNED" | "ALLOCATED" | "QUARANTINED" | "PO_INCOMING" | "RECALLED" | "DEPLETED" | "DISPOSED";
682
682
  driverParam: string;
683
683
  notNull: true;
684
684
  hasDefault: true;
@@ -1508,7 +1508,7 @@ export declare const inventoryLotMovements: import("drizzle-orm/pg-core").PgTabl
1508
1508
  tableName: "inventory_lot_movements";
1509
1509
  dataType: "string";
1510
1510
  columnType: "PgEnumColumn";
1511
- data: "DAMAGED" | "RETURN_FROM_CUSTOMER" | "ADJUSTMENT_INCREASE" | "SALE" | "RETURN_TO_SUPPLIER" | "ADJUSTMENT_DECREASE" | "SAMPLE" | "CYCLE_COUNT_ADJUSTMENT" | "RESERVE" | "UNRESERVE" | "QUARANTINE" | "PO_INCOMING" | "RECEIPT" | "TRANSFER" | "ADJUSTMENT" | "RELEASE" | "SPLIT" | "MERGE" | "DISPOSAL" | "RECALL" | "EXPIRY" | "PRODUCTION_USE";
1511
+ data: "ADJUSTMENT" | "DAMAGED" | "RETURN_FROM_CUSTOMER" | "ADJUSTMENT_INCREASE" | "SALE" | "RETURN_TO_SUPPLIER" | "ADJUSTMENT_DECREASE" | "SAMPLE" | "CYCLE_COUNT_ADJUSTMENT" | "RESERVE" | "UNRESERVE" | "QUARANTINE" | "PO_INCOMING" | "RECEIPT" | "TRANSFER" | "RELEASE" | "SPLIT" | "MERGE" | "DISPOSAL" | "RECALL" | "EXPIRY" | "PRODUCTION_USE";
1512
1512
  driverParam: string;
1513
1513
  notNull: true;
1514
1514
  hasDefault: false;
@@ -1610,7 +1610,7 @@ export declare const inventoryLotMovements: import("drizzle-orm/pg-core").PgTabl
1610
1610
  tableName: "inventory_lot_movements";
1611
1611
  dataType: "string";
1612
1612
  columnType: "PgEnumColumn";
1613
- data: "PENDING" | "QUARANTINED" | "ACTIVE" | "EXPIRED" | "RETURNED" | "PO_INCOMING" | "ALLOCATED" | "RECALLED" | "DEPLETED" | "DISPOSED";
1613
+ data: "PENDING" | "EXPIRED" | "ACTIVE" | "RETURNED" | "ALLOCATED" | "QUARANTINED" | "PO_INCOMING" | "RECALLED" | "DEPLETED" | "DISPOSED";
1614
1614
  driverParam: string;
1615
1615
  notNull: false;
1616
1616
  hasDefault: false;
@@ -1627,7 +1627,7 @@ export declare const inventoryLotMovements: import("drizzle-orm/pg-core").PgTabl
1627
1627
  tableName: "inventory_lot_movements";
1628
1628
  dataType: "string";
1629
1629
  columnType: "PgEnumColumn";
1630
- data: "PENDING" | "QUARANTINED" | "ACTIVE" | "EXPIRED" | "RETURNED" | "PO_INCOMING" | "ALLOCATED" | "RECALLED" | "DEPLETED" | "DISPOSED";
1630
+ data: "PENDING" | "EXPIRED" | "ACTIVE" | "RETURNED" | "ALLOCATED" | "QUARANTINED" | "PO_INCOMING" | "RECALLED" | "DEPLETED" | "DISPOSED";
1631
1631
  driverParam: string;
1632
1632
  notNull: false;
1633
1633
  hasDefault: false;
@@ -2245,7 +2245,7 @@ export declare const inventoryLotAlerts: import("drizzle-orm/pg-core").PgTableWi
2245
2245
  tableName: "inventory_lot_alerts";
2246
2246
  dataType: "string";
2247
2247
  columnType: "PgEnumColumn";
2248
- data: "EXPIRED" | "EXPIRY_WARNING" | "EXPIRING_SOON" | "LOW_QUANTITY" | "QUALITY_ISSUE" | "RECALL_REQUIRED" | "TEMPERATURE_BREACH" | "STORAGE_VIOLATION" | "COMPLIANCE_DUE";
2248
+ data: "EXPIRED" | "QUALITY_ISSUE" | "EXPIRY_WARNING" | "EXPIRING_SOON" | "LOW_QUANTITY" | "RECALL_REQUIRED" | "TEMPERATURE_BREACH" | "STORAGE_VIOLATION" | "COMPLIANCE_DUE";
2249
2249
  driverParam: string;
2250
2250
  notNull: true;
2251
2251
  hasDefault: false;
@@ -2296,7 +2296,7 @@ export declare const inventoryLotAlerts: import("drizzle-orm/pg-core").PgTableWi
2296
2296
  tableName: "inventory_lot_alerts";
2297
2297
  dataType: "string";
2298
2298
  columnType: "PgEnumColumn";
2299
- data: "PENDING" | "RESOLVED" | "DISMISSED" | "ACKNOWLEDGED";
2299
+ data: "PENDING" | "ACKNOWLEDGED" | "RESOLVED" | "DISMISSED";
2300
2300
  driverParam: string;
2301
2301
  notNull: true;
2302
2302
  hasDefault: true;
@@ -2540,14 +2540,14 @@ export declare const LotSchema: z.ZodObject<{
2540
2540
  reservedFor: z.ZodOptional<z.ZodString>;
2541
2541
  reservedDate: z.ZodOptional<z.ZodString>;
2542
2542
  }, "strip", z.ZodTypeAny, {
2543
- status: "RESERVED" | "DAMAGED" | "RETURNED" | "AVAILABLE" | "SOLD";
2543
+ status: "RETURNED" | "RESERVED" | "DAMAGED" | "AVAILABLE" | "SOLD";
2544
2544
  serialNumber: string;
2545
2545
  soldTo?: string | undefined;
2546
2546
  soldDate?: string | undefined;
2547
2547
  reservedFor?: string | undefined;
2548
2548
  reservedDate?: string | undefined;
2549
2549
  }, {
2550
- status: "RESERVED" | "DAMAGED" | "RETURNED" | "AVAILABLE" | "SOLD";
2550
+ status: "RETURNED" | "RESERVED" | "DAMAGED" | "AVAILABLE" | "SOLD";
2551
2551
  serialNumber: string;
2552
2552
  soldTo?: string | undefined;
2553
2553
  soldDate?: string | undefined;
@@ -2579,7 +2579,7 @@ export declare const LotSchema: z.ZodObject<{
2579
2579
  isActive: z.ZodDefault<z.ZodBoolean>;
2580
2580
  }, "strip", z.ZodTypeAny, {
2581
2581
  id: string;
2582
- status: "PENDING" | "QUARANTINED" | "ACTIVE" | "EXPIRED" | "RETURNED" | "ALLOCATED" | "RECALLED" | "DEPLETED" | "DISPOSED";
2582
+ status: "PENDING" | "EXPIRED" | "ACTIVE" | "RETURNED" | "ALLOCATED" | "QUARANTINED" | "RECALLED" | "DEPLETED" | "DISPOSED";
2583
2583
  storeId: string;
2584
2584
  currency: string;
2585
2585
  isActive: boolean;
@@ -2587,11 +2587,12 @@ export declare const LotSchema: z.ZodObject<{
2587
2587
  sku: string;
2588
2588
  updatedAt: Date;
2589
2589
  createdAt: Date;
2590
+ availableQuantity: number;
2591
+ unitOfMeasure: string;
2590
2592
  locationId: string;
2591
- locationType: "WAREHOUSE" | "POS";
2593
+ locationType: "POS" | "WAREHOUSE";
2592
2594
  lotNumber: string;
2593
2595
  safetyStock: number;
2594
- unitOfMeasure: string;
2595
2596
  receivedDate: Date;
2596
2597
  trackSerial: boolean;
2597
2598
  damagedQuantity: number;
@@ -2601,20 +2602,20 @@ export declare const LotSchema: z.ZodObject<{
2601
2602
  allocatedQuantity: number;
2602
2603
  soldQuantity: number;
2603
2604
  returnedQuantity: number;
2604
- availableQuantity: number;
2605
2605
  reservedQuantity: number;
2606
2606
  isInitialInventory: boolean;
2607
2607
  createdBy?: string | undefined;
2608
2608
  variantId?: string | undefined;
2609
2609
  tags?: string[] | undefined;
2610
- batchNumber?: string | undefined;
2610
+ updatedBy?: string | undefined;
2611
2611
  notes?: string | undefined;
2612
- expiryDate?: Date | undefined;
2612
+ supplierId?: string | undefined;
2613
2613
  unitCost?: number | undefined;
2614
- updatedBy?: string | undefined;
2614
+ batchNumber?: string | undefined;
2615
+ expiryDate?: Date | undefined;
2615
2616
  customAttributes?: Record<string, any> | undefined;
2616
2617
  serialNumbers?: {
2617
- status: "RESERVED" | "DAMAGED" | "RETURNED" | "AVAILABLE" | "SOLD";
2618
+ status: "RETURNED" | "RESERVED" | "DAMAGED" | "AVAILABLE" | "SOLD";
2618
2619
  serialNumber: string;
2619
2620
  soldTo?: string | undefined;
2620
2621
  soldDate?: string | undefined;
@@ -2625,7 +2626,6 @@ export declare const LotSchema: z.ZodObject<{
2625
2626
  maxStockLevel?: number | undefined;
2626
2627
  manufactureDate?: Date | undefined;
2627
2628
  lastMovementDate?: Date | undefined;
2628
- supplierId?: string | undefined;
2629
2629
  totalCost?: number | undefined;
2630
2630
  internalCode?: string | undefined;
2631
2631
  supplierLotNumber?: string | undefined;
@@ -2639,32 +2639,34 @@ export declare const LotSchema: z.ZodObject<{
2639
2639
  landedCost?: number | undefined;
2640
2640
  }, {
2641
2641
  id: string;
2642
- status: "PENDING" | "QUARANTINED" | "ACTIVE" | "EXPIRED" | "RETURNED" | "ALLOCATED" | "RECALLED" | "DEPLETED" | "DISPOSED";
2642
+ status: "PENDING" | "EXPIRED" | "ACTIVE" | "RETURNED" | "ALLOCATED" | "QUARANTINED" | "RECALLED" | "DEPLETED" | "DISPOSED";
2643
2643
  storeId: string;
2644
2644
  productId: string;
2645
2645
  sku: string;
2646
2646
  updatedAt: Date;
2647
2647
  createdAt: Date;
2648
+ availableQuantity: number;
2648
2649
  locationId: string;
2649
- locationType: "WAREHOUSE" | "POS";
2650
+ locationType: "POS" | "WAREHOUSE";
2650
2651
  lotNumber: string;
2651
2652
  receivedDate: Date;
2652
2653
  originalQuantity: number;
2653
2654
  currentQuantity: number;
2654
- availableQuantity: number;
2655
2655
  currency?: string | undefined;
2656
2656
  isActive?: boolean | undefined;
2657
2657
  createdBy?: string | undefined;
2658
2658
  variantId?: string | undefined;
2659
2659
  tags?: string[] | undefined;
2660
- batchNumber?: string | undefined;
2660
+ updatedBy?: string | undefined;
2661
2661
  notes?: string | undefined;
2662
- expiryDate?: Date | undefined;
2662
+ supplierId?: string | undefined;
2663
+ unitOfMeasure?: string | undefined;
2663
2664
  unitCost?: number | undefined;
2664
- updatedBy?: string | undefined;
2665
+ batchNumber?: string | undefined;
2666
+ expiryDate?: Date | undefined;
2665
2667
  customAttributes?: Record<string, any> | undefined;
2666
2668
  serialNumbers?: {
2667
- status: "RESERVED" | "DAMAGED" | "RETURNED" | "AVAILABLE" | "SOLD";
2669
+ status: "RETURNED" | "RESERVED" | "DAMAGED" | "AVAILABLE" | "SOLD";
2668
2670
  serialNumber: string;
2669
2671
  soldTo?: string | undefined;
2670
2672
  soldDate?: string | undefined;
@@ -2674,10 +2676,8 @@ export declare const LotSchema: z.ZodObject<{
2674
2676
  reorderPoint?: number | undefined;
2675
2677
  maxStockLevel?: number | undefined;
2676
2678
  safetyStock?: number | undefined;
2677
- unitOfMeasure?: string | undefined;
2678
2679
  manufactureDate?: Date | undefined;
2679
2680
  lastMovementDate?: Date | undefined;
2680
- supplierId?: string | undefined;
2681
2681
  trackSerial?: boolean | undefined;
2682
2682
  damagedQuantity?: number | undefined;
2683
2683
  quarantinedQuantity?: number | undefined;
@@ -2722,40 +2722,40 @@ export declare const InitializeProductInventorySchema: z.ZodObject<{
2722
2722
  notes: z.ZodOptional<z.ZodString>;
2723
2723
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2724
2724
  }, "strip", z.ZodTypeAny, {
2725
+ unitOfMeasure: string;
2725
2726
  locationId: string;
2726
- locationType: "WAREHOUSE" | "POS";
2727
+ locationType: "POS" | "WAREHOUSE";
2727
2728
  safetyStock: number;
2728
- unitOfMeasure: string;
2729
2729
  trackSerial: boolean;
2730
2730
  initialQuantity: number;
2731
2731
  tags?: string[] | undefined;
2732
- barcode?: string | undefined;
2733
2732
  notes?: string | undefined;
2734
- expiryDate?: Date | undefined;
2733
+ supplierId?: string | undefined;
2734
+ barcode?: string | undefined;
2735
2735
  unitCost?: number | undefined;
2736
+ expiryDate?: Date | undefined;
2736
2737
  serialNumbers?: string[] | undefined;
2737
2738
  reorderPoint?: number | undefined;
2738
2739
  maxStockLevel?: number | undefined;
2739
2740
  manufactureDate?: Date | undefined;
2740
- supplierId?: string | undefined;
2741
2741
  supplierLotNumber?: string | undefined;
2742
2742
  landedCost?: number | undefined;
2743
2743
  }, {
2744
2744
  locationId: string;
2745
- locationType: "WAREHOUSE" | "POS";
2745
+ locationType: "POS" | "WAREHOUSE";
2746
2746
  initialQuantity: number;
2747
2747
  tags?: string[] | undefined;
2748
- barcode?: string | undefined;
2749
2748
  notes?: string | undefined;
2750
- expiryDate?: Date | undefined;
2749
+ supplierId?: string | undefined;
2750
+ unitOfMeasure?: string | undefined;
2751
+ barcode?: string | undefined;
2751
2752
  unitCost?: number | undefined;
2753
+ expiryDate?: Date | undefined;
2752
2754
  serialNumbers?: string[] | undefined;
2753
2755
  reorderPoint?: number | undefined;
2754
2756
  maxStockLevel?: number | undefined;
2755
2757
  safetyStock?: number | undefined;
2756
- unitOfMeasure?: string | undefined;
2757
2758
  manufactureDate?: Date | undefined;
2758
- supplierId?: string | undefined;
2759
2759
  trackSerial?: boolean | undefined;
2760
2760
  supplierLotNumber?: string | undefined;
2761
2761
  landedCost?: number | undefined;
@@ -2763,22 +2763,22 @@ export declare const InitializeProductInventorySchema: z.ZodObject<{
2763
2763
  }, "strip", z.ZodTypeAny, {
2764
2764
  productId: string;
2765
2765
  locations: {
2766
+ unitOfMeasure: string;
2766
2767
  locationId: string;
2767
- locationType: "WAREHOUSE" | "POS";
2768
+ locationType: "POS" | "WAREHOUSE";
2768
2769
  safetyStock: number;
2769
- unitOfMeasure: string;
2770
2770
  trackSerial: boolean;
2771
2771
  initialQuantity: number;
2772
2772
  tags?: string[] | undefined;
2773
- barcode?: string | undefined;
2774
2773
  notes?: string | undefined;
2775
- expiryDate?: Date | undefined;
2774
+ supplierId?: string | undefined;
2775
+ barcode?: string | undefined;
2776
2776
  unitCost?: number | undefined;
2777
+ expiryDate?: Date | undefined;
2777
2778
  serialNumbers?: string[] | undefined;
2778
2779
  reorderPoint?: number | undefined;
2779
2780
  maxStockLevel?: number | undefined;
2780
2781
  manufactureDate?: Date | undefined;
2781
- supplierId?: string | undefined;
2782
2782
  supplierLotNumber?: string | undefined;
2783
2783
  landedCost?: number | undefined;
2784
2784
  }[];
@@ -2788,20 +2788,20 @@ export declare const InitializeProductInventorySchema: z.ZodObject<{
2788
2788
  productId: string;
2789
2789
  locations: {
2790
2790
  locationId: string;
2791
- locationType: "WAREHOUSE" | "POS";
2791
+ locationType: "POS" | "WAREHOUSE";
2792
2792
  initialQuantity: number;
2793
2793
  tags?: string[] | undefined;
2794
- barcode?: string | undefined;
2795
2794
  notes?: string | undefined;
2796
- expiryDate?: Date | undefined;
2795
+ supplierId?: string | undefined;
2796
+ unitOfMeasure?: string | undefined;
2797
+ barcode?: string | undefined;
2797
2798
  unitCost?: number | undefined;
2799
+ expiryDate?: Date | undefined;
2798
2800
  serialNumbers?: string[] | undefined;
2799
2801
  reorderPoint?: number | undefined;
2800
2802
  maxStockLevel?: number | undefined;
2801
2803
  safetyStock?: number | undefined;
2802
- unitOfMeasure?: string | undefined;
2803
2804
  manufactureDate?: Date | undefined;
2804
- supplierId?: string | undefined;
2805
2805
  trackSerial?: boolean | undefined;
2806
2806
  supplierLotNumber?: string | undefined;
2807
2807
  landedCost?: number | undefined;
@@ -2849,28 +2849,28 @@ export declare const CreateLotSchema: z.ZodObject<{
2849
2849
  createdBy: string;
2850
2850
  productId: string;
2851
2851
  sku: string;
2852
+ unitOfMeasure: string;
2852
2853
  locationId: string;
2853
- locationType: "WAREHOUSE" | "POS";
2854
+ locationType: "POS" | "WAREHOUSE";
2854
2855
  safetyStock: number;
2855
- unitOfMeasure: string;
2856
2856
  receivedDate: Date;
2857
2857
  trackSerial: boolean;
2858
2858
  originalQuantity: number;
2859
2859
  isInitialInventory: boolean;
2860
2860
  variantId?: string | undefined;
2861
2861
  tags?: string[] | undefined;
2862
- batchNumber?: string | undefined;
2863
- barcode?: string | undefined;
2864
2862
  notes?: string | undefined;
2865
- expiryDate?: Date | undefined;
2863
+ supplierId?: string | undefined;
2864
+ barcode?: string | undefined;
2866
2865
  unitCost?: number | undefined;
2866
+ batchNumber?: string | undefined;
2867
2867
  lotNumber?: string | undefined;
2868
+ expiryDate?: Date | undefined;
2868
2869
  customAttributes?: Record<string, any> | undefined;
2869
2870
  serialNumbers?: string[] | undefined;
2870
2871
  reorderPoint?: number | undefined;
2871
2872
  maxStockLevel?: number | undefined;
2872
2873
  manufactureDate?: Date | undefined;
2873
- supplierId?: string | undefined;
2874
2874
  supplierLotNumber?: string | undefined;
2875
2875
  supplierBatchNumber?: string | undefined;
2876
2876
  supplierInvoiceNumber?: string | undefined;
@@ -2885,25 +2885,25 @@ export declare const CreateLotSchema: z.ZodObject<{
2885
2885
  productId: string;
2886
2886
  sku: string;
2887
2887
  locationId: string;
2888
- locationType: "WAREHOUSE" | "POS";
2888
+ locationType: "POS" | "WAREHOUSE";
2889
2889
  originalQuantity: number;
2890
2890
  variantId?: string | undefined;
2891
2891
  tags?: string[] | undefined;
2892
- batchNumber?: string | undefined;
2893
- barcode?: string | undefined;
2894
2892
  notes?: string | undefined;
2895
- expiryDate?: Date | undefined;
2893
+ supplierId?: string | undefined;
2894
+ unitOfMeasure?: string | undefined;
2895
+ barcode?: string | undefined;
2896
2896
  unitCost?: number | undefined;
2897
+ batchNumber?: string | undefined;
2897
2898
  lotNumber?: string | undefined;
2899
+ expiryDate?: Date | undefined;
2898
2900
  customAttributes?: Record<string, any> | undefined;
2899
2901
  serialNumbers?: string[] | undefined;
2900
2902
  reorderPoint?: number | undefined;
2901
2903
  maxStockLevel?: number | undefined;
2902
2904
  safetyStock?: number | undefined;
2903
- unitOfMeasure?: string | undefined;
2904
2905
  manufactureDate?: Date | undefined;
2905
2906
  receivedDate?: Date | undefined;
2906
- supplierId?: string | undefined;
2907
2907
  trackSerial?: boolean | undefined;
2908
2908
  supplierLotNumber?: string | undefined;
2909
2909
  supplierBatchNumber?: string | undefined;
@@ -2931,8 +2931,8 @@ export declare const ReserveLotQuantitySchema: z.ZodObject<{
2931
2931
  lotId: string;
2932
2932
  customerId?: string | undefined;
2933
2933
  orderId?: string | undefined;
2934
- notes?: string | undefined;
2935
2934
  expiresAt?: Date | undefined;
2935
+ notes?: string | undefined;
2936
2936
  }, {
2937
2937
  reason: string;
2938
2938
  performedBy: string;
@@ -2940,8 +2940,8 @@ export declare const ReserveLotQuantitySchema: z.ZodObject<{
2940
2940
  lotId: string;
2941
2941
  customerId?: string | undefined;
2942
2942
  orderId?: string | undefined;
2943
- notes?: string | undefined;
2944
2943
  expiresAt?: Date | undefined;
2944
+ notes?: string | undefined;
2945
2945
  }>;
2946
2946
  export declare const ReleaseLotReservationSchema: z.ZodObject<{
2947
2947
  lotId: z.ZodString;
@@ -2998,7 +2998,7 @@ export declare const TransferLotSchema: z.ZodObject<{
2998
2998
  reason: string;
2999
2999
  performedBy: string;
3000
3000
  toLocationId: string;
3001
- toLocationType: "WAREHOUSE" | "POS";
3001
+ toLocationType: "POS" | "WAREHOUSE";
3002
3002
  lotId: string;
3003
3003
  splitIfPartial: boolean;
3004
3004
  quantity?: number | undefined;
@@ -3008,7 +3008,7 @@ export declare const TransferLotSchema: z.ZodObject<{
3008
3008
  reason: string;
3009
3009
  performedBy: string;
3010
3010
  toLocationId: string;
3011
- toLocationType: "WAREHOUSE" | "POS";
3011
+ toLocationType: "POS" | "WAREHOUSE";
3012
3012
  lotId: string;
3013
3013
  quantity?: number | undefined;
3014
3014
  notes?: string | undefined;
@@ -3027,15 +3027,15 @@ export declare const MergeLotsSchema: z.ZodObject<{
3027
3027
  performedBy: string;
3028
3028
  targetLotId: string;
3029
3029
  sourceLotIds: string[];
3030
- notes?: string | undefined;
3031
3030
  approvedBy?: string | undefined;
3031
+ notes?: string | undefined;
3032
3032
  }, {
3033
3033
  reason: string;
3034
3034
  performedBy: string;
3035
3035
  targetLotId: string;
3036
3036
  sourceLotIds: string[];
3037
- notes?: string | undefined;
3038
3037
  approvedBy?: string | undefined;
3038
+ notes?: string | undefined;
3039
3039
  }>;
3040
3040
  export declare const SplitLotSchema: z.ZodObject<{
3041
3041
  parentLotId: z.ZodString;
@@ -3046,14 +3046,14 @@ export declare const SplitLotSchema: z.ZodObject<{
3046
3046
  notes: z.ZodOptional<z.ZodString>;
3047
3047
  }, "strip", z.ZodTypeAny, {
3048
3048
  quantity: number;
3049
- locationId?: string | undefined;
3050
3049
  notes?: string | undefined;
3051
- locationType?: "WAREHOUSE" | "POS" | undefined;
3050
+ locationId?: string | undefined;
3051
+ locationType?: "POS" | "WAREHOUSE" | undefined;
3052
3052
  }, {
3053
3053
  quantity: number;
3054
- locationId?: string | undefined;
3055
3054
  notes?: string | undefined;
3056
- locationType?: "WAREHOUSE" | "POS" | undefined;
3055
+ locationId?: string | undefined;
3056
+ locationType?: "POS" | "WAREHOUSE" | undefined;
3057
3057
  }>, "many">;
3058
3058
  reason: z.ZodString;
3059
3059
  performedBy: z.ZodString;
@@ -3063,9 +3063,9 @@ export declare const SplitLotSchema: z.ZodObject<{
3063
3063
  parentLotId: string;
3064
3064
  splits: {
3065
3065
  quantity: number;
3066
- locationId?: string | undefined;
3067
3066
  notes?: string | undefined;
3068
- locationType?: "WAREHOUSE" | "POS" | undefined;
3067
+ locationId?: string | undefined;
3068
+ locationType?: "POS" | "WAREHOUSE" | undefined;
3069
3069
  }[];
3070
3070
  }, {
3071
3071
  reason: string;
@@ -3073,9 +3073,9 @@ export declare const SplitLotSchema: z.ZodObject<{
3073
3073
  parentLotId: string;
3074
3074
  splits: {
3075
3075
  quantity: number;
3076
- locationId?: string | undefined;
3077
3076
  notes?: string | undefined;
3078
- locationType?: "WAREHOUSE" | "POS" | undefined;
3077
+ locationId?: string | undefined;
3078
+ locationType?: "POS" | "WAREHOUSE" | undefined;
3079
3079
  }[];
3080
3080
  }>;
3081
3081
  export declare const GetLotsQuerySchema: z.ZodObject<{
@@ -3096,34 +3096,34 @@ export declare const GetLotsQuerySchema: z.ZodObject<{
3096
3096
  sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
3097
3097
  }, "strip", z.ZodTypeAny, {
3098
3098
  storeId: string;
3099
+ sortOrder: "asc" | "desc";
3099
3100
  limit: number;
3100
3101
  page: number;
3101
- sortBy: "status" | "expiryDate" | "lotNumber" | "receivedDate" | "currentQuantity" | "availableQuantity";
3102
- sortOrder: "asc" | "desc";
3103
- status?: "PENDING" | "QUARANTINED" | "ACTIVE" | "EXPIRED" | "RETURNED" | "ALLOCATED" | "RECALLED" | "DEPLETED" | "DISPOSED" | undefined;
3102
+ sortBy: "status" | "availableQuantity" | "lotNumber" | "expiryDate" | "receivedDate" | "currentQuantity";
3103
+ status?: "PENDING" | "EXPIRED" | "ACTIVE" | "RETURNED" | "ALLOCATED" | "QUARANTINED" | "RECALLED" | "DEPLETED" | "DISPOSED" | undefined;
3104
3104
  productId?: string | undefined;
3105
3105
  variantId?: string | undefined;
3106
3106
  sku?: string | undefined;
3107
+ locationId?: string | undefined;
3108
+ locationType?: "POS" | "WAREHOUSE" | undefined;
3107
3109
  lowStock?: boolean | undefined;
3108
3110
  expiringBefore?: Date | undefined;
3109
- locationId?: string | undefined;
3110
- locationType?: "WAREHOUSE" | "POS" | undefined;
3111
3111
  isInitialInventory?: boolean | undefined;
3112
3112
  qualityControlId?: string | undefined;
3113
3113
  }, {
3114
3114
  storeId: string;
3115
- status?: "PENDING" | "QUARANTINED" | "ACTIVE" | "EXPIRED" | "RETURNED" | "ALLOCATED" | "RECALLED" | "DEPLETED" | "DISPOSED" | undefined;
3115
+ status?: "PENDING" | "EXPIRED" | "ACTIVE" | "RETURNED" | "ALLOCATED" | "QUARANTINED" | "RECALLED" | "DEPLETED" | "DISPOSED" | undefined;
3116
3116
  productId?: string | undefined;
3117
3117
  variantId?: string | undefined;
3118
3118
  sku?: string | undefined;
3119
+ sortOrder?: "asc" | "desc" | undefined;
3120
+ locationId?: string | undefined;
3121
+ locationType?: "POS" | "WAREHOUSE" | undefined;
3119
3122
  limit?: number | undefined;
3120
3123
  lowStock?: boolean | undefined;
3121
3124
  page?: number | undefined;
3122
- sortBy?: "status" | "expiryDate" | "lotNumber" | "receivedDate" | "currentQuantity" | "availableQuantity" | undefined;
3123
- sortOrder?: "asc" | "desc" | undefined;
3125
+ sortBy?: "status" | "availableQuantity" | "lotNumber" | "expiryDate" | "receivedDate" | "currentQuantity" | undefined;
3124
3126
  expiringBefore?: Date | undefined;
3125
- locationId?: string | undefined;
3126
- locationType?: "WAREHOUSE" | "POS" | undefined;
3127
3127
  isInitialInventory?: boolean | undefined;
3128
3128
  qualityControlId?: string | undefined;
3129
3129
  }>;
@@ -3165,16 +3165,16 @@ export declare const LotAnalyticsSchema: z.ZodObject<{
3165
3165
  totalQuantity: z.ZodNumber;
3166
3166
  availableQuantity: z.ZodNumber;
3167
3167
  }, "strip", z.ZodTypeAny, {
3168
- locationId: string;
3169
- locationType: "WAREHOUSE" | "POS";
3170
- availableQuantity: number;
3171
3168
  totalQuantity: number;
3169
+ availableQuantity: number;
3170
+ locationId: string;
3171
+ locationType: "POS" | "WAREHOUSE";
3172
3172
  lotCount: number;
3173
3173
  }, {
3174
- locationId: string;
3175
- locationType: "WAREHOUSE" | "POS";
3176
- availableQuantity: number;
3177
3174
  totalQuantity: number;
3175
+ availableQuantity: number;
3176
+ locationId: string;
3177
+ locationType: "POS" | "WAREHOUSE";
3178
3178
  lotCount: number;
3179
3179
  }>, "many">;
3180
3180
  byStatus: z.ZodRecord<z.ZodString, z.ZodNumber>;
@@ -3185,14 +3185,14 @@ export declare const LotAnalyticsSchema: z.ZodObject<{
3185
3185
  daysUntilExpiry: z.ZodNumber;
3186
3186
  currentQuantity: z.ZodNumber;
3187
3187
  }, "strip", z.ZodTypeAny, {
3188
- expiryDate: Date;
3189
3188
  lotNumber: string;
3189
+ expiryDate: Date;
3190
3190
  lotId: string;
3191
3191
  currentQuantity: number;
3192
3192
  daysUntilExpiry: number;
3193
3193
  }, {
3194
- expiryDate: Date;
3195
3194
  lotNumber: string;
3195
+ expiryDate: Date;
3196
3196
  lotId: string;
3197
3197
  currentQuantity: number;
3198
3198
  daysUntilExpiry: number;
@@ -3218,24 +3218,24 @@ export declare const LotAnalyticsSchema: z.ZodObject<{
3218
3218
  }>, "many">;
3219
3219
  }, "strip", z.ZodTypeAny, {
3220
3220
  productId: string;
3221
+ totalQuantity: number;
3222
+ availableQuantity: number;
3221
3223
  damagedQuantity: number;
3222
3224
  quarantinedQuantity: number;
3223
3225
  allocatedQuantity: number;
3224
- availableQuantity: number;
3225
3226
  reservedQuantity: number;
3226
- totalQuantity: number;
3227
3227
  totalLots: number;
3228
3228
  byLocation: {
3229
- locationId: string;
3230
- locationType: "WAREHOUSE" | "POS";
3231
- availableQuantity: number;
3232
3229
  totalQuantity: number;
3230
+ availableQuantity: number;
3231
+ locationId: string;
3232
+ locationType: "POS" | "WAREHOUSE";
3233
3233
  lotCount: number;
3234
3234
  }[];
3235
3235
  byStatus: Record<string, number>;
3236
3236
  expiringLots: {
3237
- expiryDate: Date;
3238
3237
  lotNumber: string;
3238
+ expiryDate: Date;
3239
3239
  lotId: string;
3240
3240
  currentQuantity: number;
3241
3241
  daysUntilExpiry: number;
@@ -3249,24 +3249,24 @@ export declare const LotAnalyticsSchema: z.ZodObject<{
3249
3249
  }[];
3250
3250
  }, {
3251
3251
  productId: string;
3252
+ totalQuantity: number;
3253
+ availableQuantity: number;
3252
3254
  damagedQuantity: number;
3253
3255
  quarantinedQuantity: number;
3254
3256
  allocatedQuantity: number;
3255
- availableQuantity: number;
3256
3257
  reservedQuantity: number;
3257
- totalQuantity: number;
3258
3258
  totalLots: number;
3259
3259
  byLocation: {
3260
- locationId: string;
3261
- locationType: "WAREHOUSE" | "POS";
3262
- availableQuantity: number;
3263
3260
  totalQuantity: number;
3261
+ availableQuantity: number;
3262
+ locationId: string;
3263
+ locationType: "POS" | "WAREHOUSE";
3264
3264
  lotCount: number;
3265
3265
  }[];
3266
3266
  byStatus: Record<string, number>;
3267
3267
  expiringLots: {
3268
- expiryDate: Date;
3269
3268
  lotNumber: string;
3269
+ expiryDate: Date;
3270
3270
  lotId: string;
3271
3271
  currentQuantity: number;
3272
3272
  daysUntilExpiry: number;