@open-mercato/core 0.6.7-develop.6669.1.40b669666b → 0.6.7-develop.6671.1.4b925c5096
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/.turbo/turbo-build.log +2 -2
- package/dist/generated/entities/inventory_balance/index.js +21 -0
- package/dist/generated/entities/inventory_balance/index.js.map +7 -0
- package/dist/generated/entities/inventory_lot/index.js +19 -0
- package/dist/generated/entities/inventory_lot/index.js.map +7 -0
- package/dist/generated/entities/inventory_movement/index.js +35 -0
- package/dist/generated/entities/inventory_movement/index.js.map +7 -0
- package/dist/generated/entities/inventory_reservation/index.js +23 -0
- package/dist/generated/entities/inventory_reservation/index.js.map +7 -0
- package/dist/generated/entities/product_inventory_profile/index.js +21 -0
- package/dist/generated/entities/product_inventory_profile/index.js.map +7 -0
- package/dist/generated/entities/sales_order_warehouse_assignment/index.js +11 -0
- package/dist/generated/entities/sales_order_warehouse_assignment/index.js.map +7 -0
- package/dist/generated/entities/warehouse/index.js +25 -0
- package/dist/generated/entities/warehouse/index.js.map +7 -0
- package/dist/generated/entities/warehouse_location/index.js +21 -0
- package/dist/generated/entities/warehouse_location/index.js.map +7 -0
- package/dist/generated/entities/warehouse_zone/index.js +11 -0
- package/dist/generated/entities/warehouse_zone/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +12 -0
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +98 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/auth/backend/roles/page.js +12 -4
- package/dist/modules/auth/backend/roles/page.js.map +2 -2
- package/dist/modules/auth/lib/backendChrome.js +1 -0
- package/dist/modules/auth/lib/backendChrome.js.map +2 -2
- package/dist/modules/auth/services/rbacService.js +16 -17
- package/dist/modules/auth/services/rbacService.js.map +2 -2
- package/dist/modules/catalog/api/products/route.js +3 -0
- package/dist/modules/catalog/api/products/route.js.map +2 -2
- package/dist/modules/catalog/api/variants/route.js +3 -0
- package/dist/modules/catalog/api/variants/route.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +6 -6
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/sales/api/documents/factory.js +1 -0
- package/dist/modules/sales/api/documents/factory.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +53 -0
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +51 -2
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/events.js +2 -0
- package/dist/modules/sales/events.js.map +2 -2
- package/dist/modules/sales/widgets/injection/order-items-context.js +11 -0
- package/dist/modules/sales/widgets/injection/order-items-context.js.map +7 -0
- package/dist/modules/wms/acl.js +18 -0
- package/dist/modules/wms/acl.js.map +7 -0
- package/dist/modules/wms/analytics.js +11 -0
- package/dist/modules/wms/analytics.js.map +7 -0
- package/dist/modules/wms/api/dashboard/operational/route.js +80 -0
- package/dist/modules/wms/api/dashboard/operational/route.js.map +7 -0
- package/dist/modules/wms/api/interceptors.js +90 -0
- package/dist/modules/wms/api/interceptors.js.map +7 -0
- package/dist/modules/wms/api/inventory/adjust/route.js +51 -0
- package/dist/modules/wms/api/inventory/adjust/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/allocate/route.js +51 -0
- package/dist/modules/wms/api/inventory/allocate/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/balances/route.js +172 -0
- package/dist/modules/wms/api/inventory/balances/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/cycle-count/route.js +52 -0
- package/dist/modules/wms/api/inventory/cycle-count/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/helpers.js +113 -0
- package/dist/modules/wms/api/inventory/helpers.js.map +7 -0
- package/dist/modules/wms/api/inventory/import/apply/route.js +46 -0
- package/dist/modules/wms/api/inventory/import/apply/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/import/helpers.js +195 -0
- package/dist/modules/wms/api/inventory/import/helpers.js.map +7 -0
- package/dist/modules/wms/api/inventory/import/template/route.js +32 -0
- package/dist/modules/wms/api/inventory/import/template/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/import/validate/route.js +54 -0
- package/dist/modules/wms/api/inventory/import/validate/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/move/route.js +51 -0
- package/dist/modules/wms/api/inventory/move/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/movements/route.js +164 -0
- package/dist/modules/wms/api/inventory/movements/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/receive/route.js +50 -0
- package/dist/modules/wms/api/inventory/receive/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/release/route.js +44 -0
- package/dist/modules/wms/api/inventory/release/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/reservations/route.js +128 -0
- package/dist/modules/wms/api/inventory/reservations/route.js.map +7 -0
- package/dist/modules/wms/api/inventory/reserve/route.js +59 -0
- package/dist/modules/wms/api/inventory/reserve/route.js.map +7 -0
- package/dist/modules/wms/api/inventory-profiles/route.js +178 -0
- package/dist/modules/wms/api/inventory-profiles/route.js.map +7 -0
- package/dist/modules/wms/api/listEnrichers.js +181 -0
- package/dist/modules/wms/api/listEnrichers.js.map +7 -0
- package/dist/modules/wms/api/listSearch.js +77 -0
- package/dist/modules/wms/api/listSearch.js.map +7 -0
- package/dist/modules/wms/api/locations/route.js +172 -0
- package/dist/modules/wms/api/locations/route.js.map +7 -0
- package/dist/modules/wms/api/lots/route.js +204 -0
- package/dist/modules/wms/api/lots/route.js.map +7 -0
- package/dist/modules/wms/api/openapi.js +27 -0
- package/dist/modules/wms/api/openapi.js.map +7 -0
- package/dist/modules/wms/api/sales-orders/[salesOrderId]/re-run-reservation/route.js +54 -0
- package/dist/modules/wms/api/sales-orders/[salesOrderId]/re-run-reservation/route.js.map +7 -0
- package/dist/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.js +279 -0
- package/dist/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.js.map +7 -0
- package/dist/modules/wms/api/sales-orders/assign-warehouse/route.js +56 -0
- package/dist/modules/wms/api/sales-orders/assign-warehouse/route.js.map +7 -0
- package/dist/modules/wms/api/sales-orders/unassign-warehouse/route.js +43 -0
- package/dist/modules/wms/api/sales-orders/unassign-warehouse/route.js.map +7 -0
- package/dist/modules/wms/api/warehouses/route.js +181 -0
- package/dist/modules/wms/api/warehouses/route.js.map +7 -0
- package/dist/modules/wms/api/zones/route.js +159 -0
- package/dist/modules/wms/api/zones/route.js.map +7 -0
- package/dist/modules/wms/backend/config/wms/page.js +9 -0
- package/dist/modules/wms/backend/config/wms/page.js.map +7 -0
- package/dist/modules/wms/backend/config/wms/page.meta.js +18 -0
- package/dist/modules/wms/backend/config/wms/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/page.js +9 -0
- package/dist/modules/wms/backend/page.js.map +7 -0
- package/dist/modules/wms/backend/page.meta.js +16 -0
- package/dist/modules/wms/backend/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/inventory/page.js +9 -0
- package/dist/modules/wms/backend/wms/inventory/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/inventory/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/inventory/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/location/[id]/page.js +9 -0
- package/dist/modules/wms/backend/wms/location/[id]/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/location/[id]/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/location/[id]/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/locations/page.js +10 -0
- package/dist/modules/wms/backend/wms/locations/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/locations/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/locations/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/lot/[id]/page.js +9 -0
- package/dist/modules/wms/backend/wms/lot/[id]/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/lot/[id]/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/lot/[id]/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/lots/page.js +9 -0
- package/dist/modules/wms/backend/wms/lots/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/lots/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/lots/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/movements/page.js +22 -0
- package/dist/modules/wms/backend/wms/movements/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/movements/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/movements/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/reservations/page.js +23 -0
- package/dist/modules/wms/backend/wms/reservations/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/reservations/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/reservations/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/sku/[id]/page.js +9 -0
- package/dist/modules/wms/backend/wms/sku/[id]/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/sku/[id]/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/sku/[id]/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/warehouses/page.js +10 -0
- package/dist/modules/wms/backend/wms/warehouses/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/warehouses/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/warehouses/page.meta.js.map +7 -0
- package/dist/modules/wms/backend/wms/zones/page.js +10 -0
- package/dist/modules/wms/backend/wms/zones/page.js.map +7 -0
- package/dist/modules/wms/backend/wms/zones/page.meta.js +18 -0
- package/dist/modules/wms/backend/wms/zones/page.meta.js.map +7 -0
- package/dist/modules/wms/ce.js +80 -0
- package/dist/modules/wms/ce.js.map +7 -0
- package/dist/modules/wms/cli.js +83 -0
- package/dist/modules/wms/cli.js.map +7 -0
- package/dist/modules/wms/commands/configuration.js +1519 -0
- package/dist/modules/wms/commands/configuration.js.map +7 -0
- package/dist/modules/wms/commands/index.js +4 -0
- package/dist/modules/wms/commands/index.js.map +7 -0
- package/dist/modules/wms/commands/inventory-actions.js +1539 -0
- package/dist/modules/wms/commands/inventory-actions.js.map +7 -0
- package/dist/modules/wms/commands/sales-order-assignment.js +277 -0
- package/dist/modules/wms/commands/sales-order-assignment.js.map +7 -0
- package/dist/modules/wms/commands/shared.js +82 -0
- package/dist/modules/wms/commands/shared.js.map +7 -0
- package/dist/modules/wms/components/backend/AdjustInventoryDialog.js +755 -0
- package/dist/modules/wms/components/backend/AdjustInventoryDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/ChangeLotStatusDialog.js +269 -0
- package/dist/modules/wms/components/backend/ChangeLotStatusDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/CycleCountWizardDialog.js +1783 -0
- package/dist/modules/wms/components/backend/CycleCountWizardDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/ImportInventoryDialog.js +766 -0
- package/dist/modules/wms/components/backend/ImportInventoryDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/InventoryOperationsSection.js +119 -0
- package/dist/modules/wms/components/backend/InventoryOperationsSection.js.map +7 -0
- package/dist/modules/wms/components/backend/LocationEditDialog.js +140 -0
- package/dist/modules/wms/components/backend/LocationEditDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/MoveInventoryDialog.js +791 -0
- package/dist/modules/wms/components/backend/MoveInventoryDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/ReceiveInventoryDialog.js +656 -0
- package/dist/modules/wms/components/backend/ReceiveInventoryDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/ReleaseReservationDialog.js +344 -0
- package/dist/modules/wms/components/backend/ReleaseReservationDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/ReserveInventoryDialog.js +475 -0
- package/dist/modules/wms/components/backend/ReserveInventoryDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/WmsConfigurationPage.js +1112 -0
- package/dist/modules/wms/components/backend/WmsConfigurationPage.js.map +7 -0
- package/dist/modules/wms/components/backend/WmsInventoryConsolePage.js +908 -0
- package/dist/modules/wms/components/backend/WmsInventoryConsolePage.js.map +7 -0
- package/dist/modules/wms/components/backend/WmsLocationDetailPage.js +1015 -0
- package/dist/modules/wms/components/backend/WmsLocationDetailPage.js.map +7 -0
- package/dist/modules/wms/components/backend/WmsLotDetailPage.js +1049 -0
- package/dist/modules/wms/components/backend/WmsLotDetailPage.js.map +7 -0
- package/dist/modules/wms/components/backend/WmsLotsListPage.js +297 -0
- package/dist/modules/wms/components/backend/WmsLotsListPage.js.map +7 -0
- package/dist/modules/wms/components/backend/WmsOperationalDashboardPage.js +757 -0
- package/dist/modules/wms/components/backend/WmsOperationalDashboardPage.js.map +7 -0
- package/dist/modules/wms/components/backend/WmsSkuDetailPage.js +975 -0
- package/dist/modules/wms/components/backend/WmsSkuDetailPage.js.map +7 -0
- package/dist/modules/wms/components/backend/inventoryMutationLoaders.js +710 -0
- package/dist/modules/wms/components/backend/inventoryMutationLoaders.js.map +7 -0
- package/dist/modules/wms/components/backend/useWmsInventoryMutationAccess.js +79 -0
- package/dist/modules/wms/components/backend/useWmsInventoryMutationAccess.js.map +7 -0
- package/dist/modules/wms/components/backend/useWmsInventoryScopeFromSearchParams.js +24 -0
- package/dist/modules/wms/components/backend/useWmsInventoryScopeFromSearchParams.js.map +7 -0
- package/dist/modules/wms/components/backend/wmsLookupLoaders.js +55 -0
- package/dist/modules/wms/components/backend/wmsLookupLoaders.js.map +7 -0
- package/dist/modules/wms/data/enrichers.js +501 -0
- package/dist/modules/wms/data/enrichers.js.map +7 -0
- package/dist/modules/wms/data/entities.js +467 -0
- package/dist/modules/wms/data/entities.js.map +7 -0
- package/dist/modules/wms/data/validators.js +399 -0
- package/dist/modules/wms/data/validators.js.map +7 -0
- package/dist/modules/wms/di.js +27 -0
- package/dist/modules/wms/di.js.map +7 -0
- package/dist/modules/wms/events.js +42 -0
- package/dist/modules/wms/events.js.map +7 -0
- package/dist/modules/wms/index.js +17 -0
- package/dist/modules/wms/index.js.map +7 -0
- package/dist/modules/wms/lib/catalogInventoryProfileIntent.js +54 -0
- package/dist/modules/wms/lib/catalogInventoryProfileIntent.js.map +7 -0
- package/dist/modules/wms/lib/catalogInventoryProfileSync.js +144 -0
- package/dist/modules/wms/lib/catalogInventoryProfileSync.js.map +7 -0
- package/dist/modules/wms/lib/expiry.js +29 -0
- package/dist/modules/wms/lib/expiry.js.map +7 -0
- package/dist/modules/wms/lib/flashMutationError.js +51 -0
- package/dist/modules/wms/lib/flashMutationError.js.map +7 -0
- package/dist/modules/wms/lib/inventoryDisplayUi.js +188 -0
- package/dist/modules/wms/lib/inventoryDisplayUi.js.map +7 -0
- package/dist/modules/wms/lib/inventoryIdempotency.js +37 -0
- package/dist/modules/wms/lib/inventoryIdempotency.js.map +7 -0
- package/dist/modules/wms/lib/inventoryImportCsv.js +173 -0
- package/dist/modules/wms/lib/inventoryImportCsv.js.map +7 -0
- package/dist/modules/wms/lib/inventoryImportService.js +468 -0
- package/dist/modules/wms/lib/inventoryImportService.js.map +7 -0
- package/dist/modules/wms/lib/inventoryMutationUi.js +25 -0
- package/dist/modules/wms/lib/inventoryMutationUi.js.map +7 -0
- package/dist/modules/wms/lib/inventoryPolicy.js +61 -0
- package/dist/modules/wms/lib/inventoryPolicy.js.map +7 -0
- package/dist/modules/wms/lib/inventoryReconciliation.js +193 -0
- package/dist/modules/wms/lib/inventoryReconciliation.js.map +7 -0
- package/dist/modules/wms/lib/inventoryTrackingValidation.js +13 -0
- package/dist/modules/wms/lib/inventoryTrackingValidation.js.map +7 -0
- package/dist/modules/wms/lib/loadOperationalDashboard.js +580 -0
- package/dist/modules/wms/lib/loadOperationalDashboard.js.map +7 -0
- package/dist/modules/wms/lib/lowStockBalanceFilter.js +49 -0
- package/dist/modules/wms/lib/lowStockBalanceFilter.js.map +7 -0
- package/dist/modules/wms/lib/primaryWarehousePolicy.js +32 -0
- package/dist/modules/wms/lib/primaryWarehousePolicy.js.map +7 -0
- package/dist/modules/wms/lib/roleFeatures.js +30 -0
- package/dist/modules/wms/lib/roleFeatures.js.map +7 -0
- package/dist/modules/wms/lib/salesOrderInventoryAutomation.js +291 -0
- package/dist/modules/wms/lib/salesOrderInventoryAutomation.js.map +7 -0
- package/dist/modules/wms/lib/salesOrderWarehouseAssignment.js +54 -0
- package/dist/modules/wms/lib/salesOrderWarehouseAssignment.js.map +7 -0
- package/dist/modules/wms/lib/wmsIntegrationToggles.js +71 -0
- package/dist/modules/wms/lib/wmsIntegrationToggles.js.map +7 -0
- package/dist/modules/wms/migrations/Migration20260428110546.js +78 -0
- package/dist/modules/wms/migrations/Migration20260428110546.js.map +7 -0
- package/dist/modules/wms/migrations/Migration20260527120000.js +15 -0
- package/dist/modules/wms/migrations/Migration20260527120000.js.map +7 -0
- package/dist/modules/wms/migrations/Migration20260527140000.js +37 -0
- package/dist/modules/wms/migrations/Migration20260527140000.js.map +7 -0
- package/dist/modules/wms/migrations/Migration20260613120000.js +23 -0
- package/dist/modules/wms/migrations/Migration20260613120000.js.map +7 -0
- package/dist/modules/wms/migrations/Migration20260616090000.js +13 -0
- package/dist/modules/wms/migrations/Migration20260616090000.js.map +7 -0
- package/dist/modules/wms/migrations/Migration20260707180000.js +15 -0
- package/dist/modules/wms/migrations/Migration20260707180000.js.map +7 -0
- package/dist/modules/wms/notifications.client.js +18 -0
- package/dist/modules/wms/notifications.client.js.map +7 -0
- package/dist/modules/wms/notifications.js +53 -0
- package/dist/modules/wms/notifications.js.map +7 -0
- package/dist/modules/wms/search.js +196 -0
- package/dist/modules/wms/search.js.map +7 -0
- package/dist/modules/wms/setup.js +30 -0
- package/dist/modules/wms/setup.js.map +7 -0
- package/dist/modules/wms/subscribers/low-stock-notification.js +40 -0
- package/dist/modules/wms/subscribers/low-stock-notification.js.map +7 -0
- package/dist/modules/wms/subscribers/reservation-shortfall-notification.js +69 -0
- package/dist/modules/wms/subscribers/reservation-shortfall-notification.js.map +7 -0
- package/dist/modules/wms/subscribers/sales-order-cancelled-release.js +14 -0
- package/dist/modules/wms/subscribers/sales-order-cancelled-release.js.map +7 -0
- package/dist/modules/wms/subscribers/sales-order-confirmed-reserve.js +14 -0
- package/dist/modules/wms/subscribers/sales-order-confirmed-reserve.js.map +7 -0
- package/dist/modules/wms/translations.js +10 -0
- package/dist/modules/wms/translations.js.map +7 -0
- package/dist/modules/wms/vector.js +9 -0
- package/dist/modules/wms/vector.js.map +7 -0
- package/dist/modules/wms/widgets/injection/catalog-inventory-profile/widget.js +200 -0
- package/dist/modules/wms/widgets/injection/catalog-inventory-profile/widget.js.map +7 -0
- package/dist/modules/wms/widgets/injection/order-items-stock-column/widget.js +104 -0
- package/dist/modules/wms/widgets/injection/order-items-stock-column/widget.js.map +7 -0
- package/dist/modules/wms/widgets/injection/sales-order-stock-context/widget.client.js +389 -0
- package/dist/modules/wms/widgets/injection/sales-order-stock-context/widget.client.js.map +7 -0
- package/dist/modules/wms/widgets/injection/sales-order-stock-context/widget.js +16 -0
- package/dist/modules/wms/widgets/injection/sales-order-stock-context/widget.js.map +7 -0
- package/dist/modules/wms/widgets/injection-table.js +36 -0
- package/dist/modules/wms/widgets/injection-table.js.map +7 -0
- package/dist/modules/wms/widgets/notifications/WmsLowStockRenderer.js +150 -0
- package/dist/modules/wms/widgets/notifications/WmsLowStockRenderer.js.map +7 -0
- package/dist/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.js +186 -0
- package/dist/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.js.map +7 -0
- package/dist/modules/wms/widgets/notifications/index.js +7 -0
- package/dist/modules/wms/widgets/notifications/index.js.map +7 -0
- package/generated/entities/inventory_balance/index.ts +9 -0
- package/generated/entities/inventory_lot/index.ts +8 -0
- package/generated/entities/inventory_movement/index.ts +16 -0
- package/generated/entities/inventory_reservation/index.ts +10 -0
- package/generated/entities/product_inventory_profile/index.ts +9 -0
- package/generated/entities/sales_order_warehouse_assignment/index.ts +4 -0
- package/generated/entities/warehouse/index.ts +11 -0
- package/generated/entities/warehouse_location/index.ts +9 -0
- package/generated/entities/warehouse_zone/index.ts +4 -0
- package/generated/entities.ids.generated.ts +12 -0
- package/generated/entity-fields-registry.ts +98 -0
- package/package.json +7 -7
- package/src/modules/auth/backend/roles/page.tsx +13 -4
- package/src/modules/auth/i18n/de.json +2 -0
- package/src/modules/auth/i18n/en.json +2 -0
- package/src/modules/auth/i18n/es.json +2 -0
- package/src/modules/auth/i18n/pl.json +2 -0
- package/src/modules/auth/lib/backendChrome.tsx +1 -0
- package/src/modules/auth/services/rbacService.ts +25 -21
- package/src/modules/catalog/api/products/route.ts +3 -0
- package/src/modules/catalog/api/variants/route.ts +3 -0
- package/src/modules/query_index/lib/engine.ts +18 -6
- package/src/modules/sales/api/documents/factory.ts +1 -0
- package/src/modules/sales/commands/documents.ts +71 -0
- package/src/modules/sales/components/documents/ItemsSection.tsx +58 -0
- package/src/modules/sales/events.ts +2 -0
- package/src/modules/sales/widgets/injection/order-items-context.ts +15 -0
- package/src/modules/wms/acl.ts +14 -0
- package/src/modules/wms/analytics.ts +9 -0
- package/src/modules/wms/api/dashboard/operational/route.ts +83 -0
- package/src/modules/wms/api/interceptors.ts +108 -0
- package/src/modules/wms/api/inventory/adjust/route.ts +50 -0
- package/src/modules/wms/api/inventory/allocate/route.ts +50 -0
- package/src/modules/wms/api/inventory/balances/route.ts +178 -0
- package/src/modules/wms/api/inventory/cycle-count/route.ts +51 -0
- package/src/modules/wms/api/inventory/helpers.ts +128 -0
- package/src/modules/wms/api/inventory/import/apply/route.ts +47 -0
- package/src/modules/wms/api/inventory/import/helpers.ts +223 -0
- package/src/modules/wms/api/inventory/import/template/route.ts +31 -0
- package/src/modules/wms/api/inventory/import/validate/route.ts +56 -0
- package/src/modules/wms/api/inventory/move/route.ts +50 -0
- package/src/modules/wms/api/inventory/movements/route.ts +164 -0
- package/src/modules/wms/api/inventory/receive/route.ts +49 -0
- package/src/modules/wms/api/inventory/release/route.ts +43 -0
- package/src/modules/wms/api/inventory/reservations/route.ts +128 -0
- package/src/modules/wms/api/inventory/reserve/route.ts +59 -0
- package/src/modules/wms/api/inventory-profiles/route.ts +177 -0
- package/src/modules/wms/api/listEnrichers.ts +312 -0
- package/src/modules/wms/api/listSearch.ts +121 -0
- package/src/modules/wms/api/locations/route.ts +171 -0
- package/src/modules/wms/api/lots/route.ts +205 -0
- package/src/modules/wms/api/openapi.ts +28 -0
- package/src/modules/wms/api/sales-orders/[salesOrderId]/re-run-reservation/route.ts +58 -0
- package/src/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.ts +306 -0
- package/src/modules/wms/api/sales-orders/assign-warehouse/route.ts +57 -0
- package/src/modules/wms/api/sales-orders/unassign-warehouse/route.ts +43 -0
- package/src/modules/wms/api/warehouses/route.ts +181 -0
- package/src/modules/wms/api/zones/route.ts +158 -0
- package/src/modules/wms/backend/config/wms/page.meta.ts +14 -0
- package/src/modules/wms/backend/config/wms/page.tsx +5 -0
- package/src/modules/wms/backend/page.meta.ts +12 -0
- package/src/modules/wms/backend/page.tsx +5 -0
- package/src/modules/wms/backend/wms/inventory/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/inventory/page.tsx +5 -0
- package/src/modules/wms/backend/wms/location/[id]/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/location/[id]/page.tsx +5 -0
- package/src/modules/wms/backend/wms/locations/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/locations/page.tsx +12 -0
- package/src/modules/wms/backend/wms/lot/[id]/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/lot/[id]/page.tsx +5 -0
- package/src/modules/wms/backend/wms/lots/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/lots/page.tsx +5 -0
- package/src/modules/wms/backend/wms/movements/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/movements/page.tsx +23 -0
- package/src/modules/wms/backend/wms/reservations/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/reservations/page.tsx +24 -0
- package/src/modules/wms/backend/wms/sku/[id]/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/sku/[id]/page.tsx +5 -0
- package/src/modules/wms/backend/wms/warehouses/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/warehouses/page.tsx +12 -0
- package/src/modules/wms/backend/wms/zones/page.meta.ts +14 -0
- package/src/modules/wms/backend/wms/zones/page.tsx +12 -0
- package/src/modules/wms/ce.ts +76 -0
- package/src/modules/wms/cli.ts +96 -0
- package/src/modules/wms/commands/configuration.ts +1844 -0
- package/src/modules/wms/commands/index.ts +3 -0
- package/src/modules/wms/commands/inventory-actions.ts +1866 -0
- package/src/modules/wms/commands/sales-order-assignment.ts +346 -0
- package/src/modules/wms/commands/shared.ts +90 -0
- package/src/modules/wms/components/backend/AdjustInventoryDialog.tsx +820 -0
- package/src/modules/wms/components/backend/ChangeLotStatusDialog.tsx +312 -0
- package/src/modules/wms/components/backend/CycleCountWizardDialog.tsx +2007 -0
- package/src/modules/wms/components/backend/ImportInventoryDialog.tsx +1018 -0
- package/src/modules/wms/components/backend/InventoryOperationsSection.tsx +159 -0
- package/src/modules/wms/components/backend/LocationEditDialog.tsx +185 -0
- package/src/modules/wms/components/backend/MoveInventoryDialog.tsx +907 -0
- package/src/modules/wms/components/backend/ReceiveInventoryDialog.tsx +695 -0
- package/src/modules/wms/components/backend/ReleaseReservationDialog.tsx +424 -0
- package/src/modules/wms/components/backend/ReserveInventoryDialog.tsx +511 -0
- package/src/modules/wms/components/backend/WmsConfigurationPage.tsx +1340 -0
- package/src/modules/wms/components/backend/WmsInventoryConsolePage.tsx +1132 -0
- package/src/modules/wms/components/backend/WmsLocationDetailPage.tsx +1310 -0
- package/src/modules/wms/components/backend/WmsLotDetailPage.tsx +1355 -0
- package/src/modules/wms/components/backend/WmsLotsListPage.tsx +359 -0
- package/src/modules/wms/components/backend/WmsOperationalDashboardPage.tsx +958 -0
- package/src/modules/wms/components/backend/WmsSkuDetailPage.tsx +1245 -0
- package/src/modules/wms/components/backend/inventoryMutationLoaders.ts +960 -0
- package/src/modules/wms/components/backend/useWmsInventoryMutationAccess.ts +89 -0
- package/src/modules/wms/components/backend/useWmsInventoryScopeFromSearchParams.ts +32 -0
- package/src/modules/wms/components/backend/wmsLookupLoaders.ts +78 -0
- package/src/modules/wms/data/enrichers.ts +718 -0
- package/src/modules/wms/data/entities.ts +436 -0
- package/src/modules/wms/data/validators.ts +463 -0
- package/src/modules/wms/di.ts +25 -0
- package/src/modules/wms/events.ts +41 -0
- package/src/modules/wms/i18n/de.json +1051 -0
- package/src/modules/wms/i18n/en.json +1051 -0
- package/src/modules/wms/i18n/es.json +1051 -0
- package/src/modules/wms/i18n/pl.json +1051 -0
- package/src/modules/wms/index.ts +15 -0
- package/src/modules/wms/lib/catalogInventoryProfileIntent.ts +65 -0
- package/src/modules/wms/lib/catalogInventoryProfileSync.ts +199 -0
- package/src/modules/wms/lib/expiry.ts +30 -0
- package/src/modules/wms/lib/flashMutationError.ts +74 -0
- package/src/modules/wms/lib/inventoryDisplayUi.ts +249 -0
- package/src/modules/wms/lib/inventoryIdempotency.ts +54 -0
- package/src/modules/wms/lib/inventoryImportCsv.ts +212 -0
- package/src/modules/wms/lib/inventoryImportService.ts +629 -0
- package/src/modules/wms/lib/inventoryMutationUi.ts +21 -0
- package/src/modules/wms/lib/inventoryPolicy.ts +111 -0
- package/src/modules/wms/lib/inventoryReconciliation.ts +263 -0
- package/src/modules/wms/lib/inventoryTrackingValidation.ts +23 -0
- package/src/modules/wms/lib/loadOperationalDashboard.ts +776 -0
- package/src/modules/wms/lib/lowStockBalanceFilter.ts +74 -0
- package/src/modules/wms/lib/primaryWarehousePolicy.ts +46 -0
- package/src/modules/wms/lib/roleFeatures.ts +32 -0
- package/src/modules/wms/lib/salesOrderInventoryAutomation.ts +390 -0
- package/src/modules/wms/lib/salesOrderWarehouseAssignment.ts +78 -0
- package/src/modules/wms/lib/wmsIntegrationToggles.ts +81 -0
- package/src/modules/wms/migrations/.snapshot-open-mercato.json +2880 -0
- package/src/modules/wms/migrations/Migration20260428110546.ts +91 -0
- package/src/modules/wms/migrations/Migration20260527120000.ts +15 -0
- package/src/modules/wms/migrations/Migration20260527140000.ts +35 -0
- package/src/modules/wms/migrations/Migration20260613120000.ts +21 -0
- package/src/modules/wms/migrations/Migration20260616090000.ts +11 -0
- package/src/modules/wms/migrations/Migration20260707180000.ts +13 -0
- package/src/modules/wms/notifications.client.ts +18 -0
- package/src/modules/wms/notifications.ts +51 -0
- package/src/modules/wms/search.ts +230 -0
- package/src/modules/wms/setup.ts +29 -0
- package/src/modules/wms/subscribers/low-stock-notification.ts +54 -0
- package/src/modules/wms/subscribers/reservation-shortfall-notification.ts +98 -0
- package/src/modules/wms/subscribers/sales-order-cancelled-release.ts +21 -0
- package/src/modules/wms/subscribers/sales-order-confirmed-reserve.ts +21 -0
- package/src/modules/wms/translations.ts +6 -0
- package/src/modules/wms/vector.ts +7 -0
- package/src/modules/wms/widgets/injection/catalog-inventory-profile/widget.ts +238 -0
- package/src/modules/wms/widgets/injection/order-items-stock-column/widget.tsx +153 -0
- package/src/modules/wms/widgets/injection/sales-order-stock-context/widget.client.tsx +476 -0
- package/src/modules/wms/widgets/injection/sales-order-stock-context/widget.ts +15 -0
- package/src/modules/wms/widgets/injection-table.ts +34 -0
- package/src/modules/wms/widgets/notifications/WmsLowStockRenderer.tsx +153 -0
- package/src/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.tsx +194 -0
- package/src/modules/wms/widgets/notifications/index.ts +2 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const uuid = () => z.string().uuid();
|
|
3
|
+
const numericQuantity = z.coerce.number().finite();
|
|
4
|
+
const positiveQuantity = numericQuantity.gt(0);
|
|
5
|
+
const nonNegativeQuantity = numericQuantity.min(0);
|
|
6
|
+
const scopedSchema = z.object({
|
|
7
|
+
organizationId: uuid(),
|
|
8
|
+
tenantId: uuid()
|
|
9
|
+
});
|
|
10
|
+
const warehouseLocationTypeSchema = z.enum(["zone", "aisle", "rack", "bin", "slot", "dock", "staging"]);
|
|
11
|
+
const inventoryStrategySchema = z.enum(["fifo", "lifo", "fefo"]);
|
|
12
|
+
const inventoryLotStatusSchema = z.enum(["available", "hold", "quarantine", "expired"]);
|
|
13
|
+
const inventoryReservationSourceTypeSchema = z.enum(["order", "transfer", "manual"]);
|
|
14
|
+
const inventoryReservationStatusSchema = z.enum(["active", "released", "fulfilled"]);
|
|
15
|
+
const inventoryMovementTypeSchema = z.enum([
|
|
16
|
+
"receipt",
|
|
17
|
+
"putaway",
|
|
18
|
+
"pick",
|
|
19
|
+
"pack",
|
|
20
|
+
"ship",
|
|
21
|
+
"adjust",
|
|
22
|
+
"transfer",
|
|
23
|
+
"cycle_count",
|
|
24
|
+
"return_receive"
|
|
25
|
+
]);
|
|
26
|
+
const inventoryMovementReferenceTypeSchema = z.enum(["po", "so", "transfer", "manual", "qc", "rma"]);
|
|
27
|
+
const metadataSchema = z.record(z.string(), z.unknown()).optional();
|
|
28
|
+
const enforcePrimaryRequiresActiveWarehouse = (payload, ctx) => {
|
|
29
|
+
if (payload.isPrimary === true && payload.isActive === false) {
|
|
30
|
+
ctx.addIssue({
|
|
31
|
+
code: z.ZodIssueCode.custom,
|
|
32
|
+
path: ["isPrimary"],
|
|
33
|
+
message: "Inactive warehouses cannot be marked as primary."
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const warehouseFieldsSchema = scopedSchema.extend({
|
|
38
|
+
name: z.string().trim().min(1).max(200),
|
|
39
|
+
code: z.string().trim().min(1).max(80),
|
|
40
|
+
isActive: z.boolean().optional(),
|
|
41
|
+
isPrimary: z.boolean().optional(),
|
|
42
|
+
addressLine1: z.string().trim().max(255).optional(),
|
|
43
|
+
city: z.string().trim().max(150).optional(),
|
|
44
|
+
postalCode: z.string().trim().max(40).optional(),
|
|
45
|
+
country: z.string().trim().max(120).optional(),
|
|
46
|
+
timezone: z.string().trim().max(120).optional(),
|
|
47
|
+
metadata: metadataSchema
|
|
48
|
+
});
|
|
49
|
+
const warehouseCreateSchema = warehouseFieldsSchema.superRefine(enforcePrimaryRequiresActiveWarehouse);
|
|
50
|
+
const warehouseUpdateSchema = z.object({ id: uuid() }).merge(warehouseFieldsSchema.partial()).superRefine(enforcePrimaryRequiresActiveWarehouse);
|
|
51
|
+
const warehouseZoneCreateSchema = scopedSchema.extend({
|
|
52
|
+
warehouseId: uuid(),
|
|
53
|
+
code: z.string().trim().min(1).max(80),
|
|
54
|
+
name: z.string().trim().min(1).max(200),
|
|
55
|
+
priority: z.coerce.number().int().min(0).optional(),
|
|
56
|
+
metadata: metadataSchema
|
|
57
|
+
});
|
|
58
|
+
const warehouseZoneUpdateSchema = z.object({ id: uuid() }).merge(warehouseZoneCreateSchema.partial());
|
|
59
|
+
const warehouseLocationCreateSchema = scopedSchema.extend({
|
|
60
|
+
warehouseId: uuid(),
|
|
61
|
+
code: z.string().trim().min(1).max(120),
|
|
62
|
+
type: warehouseLocationTypeSchema,
|
|
63
|
+
parentId: uuid().nullable().optional(),
|
|
64
|
+
isActive: z.boolean().optional(),
|
|
65
|
+
capacityUnits: nonNegativeQuantity.optional(),
|
|
66
|
+
capacityWeight: nonNegativeQuantity.optional(),
|
|
67
|
+
constraints: z.record(z.string(), z.unknown()).optional(),
|
|
68
|
+
metadata: metadataSchema
|
|
69
|
+
});
|
|
70
|
+
const warehouseLocationUpdateSchema = z.object({ id: uuid() }).merge(warehouseLocationCreateSchema.partial());
|
|
71
|
+
const productInventoryProfileBaseSchema = scopedSchema.extend({
|
|
72
|
+
catalogProductId: uuid(),
|
|
73
|
+
catalogVariantId: uuid().nullable().optional(),
|
|
74
|
+
defaultUom: z.string().trim().min(1).max(32),
|
|
75
|
+
trackLot: z.boolean().optional(),
|
|
76
|
+
trackSerial: z.boolean().optional(),
|
|
77
|
+
trackExpiration: z.boolean().optional(),
|
|
78
|
+
defaultStrategy: inventoryStrategySchema,
|
|
79
|
+
reorderPoint: nonNegativeQuantity.optional(),
|
|
80
|
+
safetyStock: nonNegativeQuantity.optional(),
|
|
81
|
+
metadata: metadataSchema
|
|
82
|
+
});
|
|
83
|
+
const enforceFefoWhenExpirationTracked = (payload, ctx) => {
|
|
84
|
+
if (payload.trackExpiration === true && payload.defaultStrategy !== void 0 && payload.defaultStrategy !== "fefo") {
|
|
85
|
+
ctx.addIssue({
|
|
86
|
+
code: z.ZodIssueCode.custom,
|
|
87
|
+
path: ["defaultStrategy"],
|
|
88
|
+
message: "FEFO is required when expiration tracking is enabled."
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const productInventoryProfileCreateSchema = productInventoryProfileBaseSchema.superRefine(enforceFefoWhenExpirationTracked);
|
|
93
|
+
const productInventoryProfileUpdateSchema = z.object({ id: uuid() }).merge(productInventoryProfileBaseSchema.partial()).superRefine(enforceFefoWhenExpirationTracked);
|
|
94
|
+
const inventoryLotBaseSchema = scopedSchema.extend({
|
|
95
|
+
catalogVariantId: uuid(),
|
|
96
|
+
sku: z.string().trim().min(1).max(120),
|
|
97
|
+
lotNumber: z.string().trim().min(1).max(120),
|
|
98
|
+
batchNumber: z.string().trim().max(120).optional(),
|
|
99
|
+
manufacturedAt: z.coerce.date().optional(),
|
|
100
|
+
bestBeforeAt: z.coerce.date().optional(),
|
|
101
|
+
expiresAt: z.coerce.date().optional(),
|
|
102
|
+
status: inventoryLotStatusSchema.optional(),
|
|
103
|
+
metadata: metadataSchema
|
|
104
|
+
});
|
|
105
|
+
const enforceLotDateOrdering = (payload, ctx) => {
|
|
106
|
+
if (payload.manufacturedAt && payload.bestBeforeAt && payload.bestBeforeAt < payload.manufacturedAt) {
|
|
107
|
+
ctx.addIssue({
|
|
108
|
+
code: z.ZodIssueCode.custom,
|
|
109
|
+
path: ["bestBeforeAt"],
|
|
110
|
+
message: "Best-before date must be on or after manufactured date."
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (payload.bestBeforeAt && payload.expiresAt && payload.expiresAt < payload.bestBeforeAt) {
|
|
114
|
+
ctx.addIssue({
|
|
115
|
+
code: z.ZodIssueCode.custom,
|
|
116
|
+
path: ["expiresAt"],
|
|
117
|
+
message: "Expiration date must be on or after best-before date."
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (payload.manufacturedAt && payload.expiresAt && payload.expiresAt < payload.manufacturedAt) {
|
|
121
|
+
ctx.addIssue({
|
|
122
|
+
code: z.ZodIssueCode.custom,
|
|
123
|
+
path: ["expiresAt"],
|
|
124
|
+
message: "Expiration date must be on or after manufactured date."
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const inventoryLotCreateSchema = inventoryLotBaseSchema.superRefine(enforceLotDateOrdering);
|
|
129
|
+
const inventoryLotUpdateSchema = z.object({
|
|
130
|
+
id: uuid(),
|
|
131
|
+
// Optional status-change note merged into lot.metadata.notes by the update command.
|
|
132
|
+
notes: z.string().trim().max(500).optional()
|
|
133
|
+
}).merge(inventoryLotBaseSchema.partial()).superRefine(enforceLotDateOrdering);
|
|
134
|
+
const inventoryLowStockFilterSchema = z.enum(["belowReorder", "belowSafety"]);
|
|
135
|
+
const inventoryBalanceListQuerySchema = z.object({
|
|
136
|
+
page: z.coerce.number().min(1).default(1),
|
|
137
|
+
pageSize: z.coerce.number().min(1).max(100).default(25),
|
|
138
|
+
warehouseId: uuid().optional(),
|
|
139
|
+
locationId: uuid().optional(),
|
|
140
|
+
catalogVariantId: uuid().optional(),
|
|
141
|
+
lotId: uuid().optional(),
|
|
142
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
143
|
+
lowStock: inventoryLowStockFilterSchema.optional(),
|
|
144
|
+
search: z.string().optional()
|
|
145
|
+
}).passthrough();
|
|
146
|
+
const inventoryMovementListQuerySchema = z.object({
|
|
147
|
+
page: z.coerce.number().min(1).default(1),
|
|
148
|
+
pageSize: z.coerce.number().min(1).max(100).default(25),
|
|
149
|
+
warehouseId: uuid().optional(),
|
|
150
|
+
locationId: uuid().optional(),
|
|
151
|
+
catalogVariantId: uuid().optional(),
|
|
152
|
+
lotId: uuid().optional(),
|
|
153
|
+
referenceType: inventoryMovementReferenceTypeSchema.optional(),
|
|
154
|
+
referenceId: uuid().optional(),
|
|
155
|
+
type: inventoryMovementTypeSchema.optional(),
|
|
156
|
+
search: z.string().optional()
|
|
157
|
+
}).passthrough();
|
|
158
|
+
const inventoryReservationListQuerySchema = z.object({
|
|
159
|
+
page: z.coerce.number().min(1).default(1),
|
|
160
|
+
pageSize: z.coerce.number().min(1).max(100).default(25),
|
|
161
|
+
warehouseId: uuid().optional(),
|
|
162
|
+
catalogVariantId: uuid().optional(),
|
|
163
|
+
lotId: uuid().optional(),
|
|
164
|
+
sourceType: inventoryReservationSourceTypeSchema.optional(),
|
|
165
|
+
sourceId: uuid().optional(),
|
|
166
|
+
status: inventoryReservationStatusSchema.optional(),
|
|
167
|
+
search: z.string().optional()
|
|
168
|
+
}).passthrough();
|
|
169
|
+
const inventoryReceiveSchema = scopedSchema.extend({
|
|
170
|
+
warehouseId: uuid(),
|
|
171
|
+
locationId: uuid(),
|
|
172
|
+
catalogVariantId: uuid(),
|
|
173
|
+
lotId: uuid().optional(),
|
|
174
|
+
lotNumber: z.string().trim().max(120).optional(),
|
|
175
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
176
|
+
quantity: positiveQuantity,
|
|
177
|
+
referenceType: inventoryMovementReferenceTypeSchema,
|
|
178
|
+
referenceId: uuid(),
|
|
179
|
+
performedBy: uuid(),
|
|
180
|
+
receivedAt: z.coerce.date().optional(),
|
|
181
|
+
performedAt: z.coerce.date().optional(),
|
|
182
|
+
reason: z.string().trim().max(500).optional(),
|
|
183
|
+
metadata: metadataSchema
|
|
184
|
+
});
|
|
185
|
+
const inventoryReservationCreateSchema = scopedSchema.extend({
|
|
186
|
+
warehouseId: uuid(),
|
|
187
|
+
catalogVariantId: uuid(),
|
|
188
|
+
lotId: uuid().optional(),
|
|
189
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
190
|
+
quantity: positiveQuantity,
|
|
191
|
+
sourceType: inventoryReservationSourceTypeSchema,
|
|
192
|
+
sourceId: uuid(),
|
|
193
|
+
expiresAt: z.coerce.date().optional(),
|
|
194
|
+
strategy: inventoryStrategySchema.optional(),
|
|
195
|
+
metadata: metadataSchema
|
|
196
|
+
});
|
|
197
|
+
const inventoryReservationReleaseSchema = scopedSchema.extend({
|
|
198
|
+
reservationId: uuid(),
|
|
199
|
+
reason: z.string().trim().min(1).max(120),
|
|
200
|
+
reasonCode: z.string().trim().max(80).optional(),
|
|
201
|
+
metadata: metadataSchema
|
|
202
|
+
});
|
|
203
|
+
const inventoryReservationAllocateSchema = scopedSchema.extend({
|
|
204
|
+
reservationId: uuid(),
|
|
205
|
+
metadata: metadataSchema
|
|
206
|
+
});
|
|
207
|
+
const inventoryAdjustSchema = scopedSchema.extend({
|
|
208
|
+
warehouseId: uuid(),
|
|
209
|
+
locationId: uuid(),
|
|
210
|
+
catalogVariantId: uuid(),
|
|
211
|
+
lotId: uuid().optional(),
|
|
212
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
213
|
+
delta: numericQuantity.refine((value) => value !== 0, {
|
|
214
|
+
message: "Inventory delta must be non-zero."
|
|
215
|
+
}),
|
|
216
|
+
reason: z.string().trim().min(1).max(500),
|
|
217
|
+
reasonCode: z.string().trim().max(80).optional(),
|
|
218
|
+
referenceType: inventoryMovementReferenceTypeSchema.default("manual"),
|
|
219
|
+
referenceId: uuid(),
|
|
220
|
+
performedBy: uuid(),
|
|
221
|
+
performedAt: z.coerce.date().optional(),
|
|
222
|
+
metadata: metadataSchema
|
|
223
|
+
});
|
|
224
|
+
const inventoryMoveSchema = scopedSchema.extend({
|
|
225
|
+
warehouseId: uuid(),
|
|
226
|
+
fromLocationId: uuid(),
|
|
227
|
+
toLocationId: uuid(),
|
|
228
|
+
catalogVariantId: uuid(),
|
|
229
|
+
lotId: uuid().optional(),
|
|
230
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
231
|
+
quantity: positiveQuantity,
|
|
232
|
+
type: inventoryMovementTypeSchema.optional(),
|
|
233
|
+
reason: z.string().trim().min(1).max(500),
|
|
234
|
+
reasonCode: z.string().trim().max(80).optional(),
|
|
235
|
+
referenceType: inventoryMovementReferenceTypeSchema.default("manual"),
|
|
236
|
+
referenceId: uuid(),
|
|
237
|
+
performedBy: uuid(),
|
|
238
|
+
performedAt: z.coerce.date().optional(),
|
|
239
|
+
metadata: metadataSchema
|
|
240
|
+
});
|
|
241
|
+
const inventoryCycleCountSchema = scopedSchema.extend({
|
|
242
|
+
warehouseId: uuid(),
|
|
243
|
+
locationId: uuid(),
|
|
244
|
+
catalogVariantId: uuid(),
|
|
245
|
+
lotId: uuid().optional(),
|
|
246
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
247
|
+
countedQuantity: nonNegativeQuantity,
|
|
248
|
+
autoAdjust: z.boolean().default(true),
|
|
249
|
+
reason: z.string().trim().min(1).max(500),
|
|
250
|
+
referenceId: uuid(),
|
|
251
|
+
performedBy: uuid(),
|
|
252
|
+
performedAt: z.coerce.date().optional(),
|
|
253
|
+
metadata: metadataSchema
|
|
254
|
+
});
|
|
255
|
+
const inventoryMovementCreateSchema = scopedSchema.extend({
|
|
256
|
+
warehouseId: uuid(),
|
|
257
|
+
locationFromId: uuid().optional(),
|
|
258
|
+
locationToId: uuid().optional(),
|
|
259
|
+
catalogVariantId: uuid(),
|
|
260
|
+
lotId: uuid().optional(),
|
|
261
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
262
|
+
quantity: positiveQuantity,
|
|
263
|
+
type: inventoryMovementTypeSchema,
|
|
264
|
+
referenceType: inventoryMovementReferenceTypeSchema,
|
|
265
|
+
referenceId: uuid(),
|
|
266
|
+
performedBy: uuid(),
|
|
267
|
+
performedAt: z.coerce.date(),
|
|
268
|
+
receivedAt: z.coerce.date(),
|
|
269
|
+
reason: z.string().trim().max(500).optional(),
|
|
270
|
+
metadata: metadataSchema
|
|
271
|
+
});
|
|
272
|
+
const salesOrderWarehouseAssignBodySchema = scopedSchema.extend({
|
|
273
|
+
warehouseId: uuid(),
|
|
274
|
+
notes: z.string().trim().max(500).optional(),
|
|
275
|
+
metadata: metadataSchema
|
|
276
|
+
});
|
|
277
|
+
const salesOrderWarehouseAssignSchema = salesOrderWarehouseAssignBodySchema.extend({
|
|
278
|
+
salesOrderId: uuid()
|
|
279
|
+
});
|
|
280
|
+
const salesOrderWarehouseUnassignSchema = scopedSchema.extend({
|
|
281
|
+
salesOrderId: uuid(),
|
|
282
|
+
metadata: metadataSchema
|
|
283
|
+
});
|
|
284
|
+
const inventoryImportRawRowSchema = z.object({
|
|
285
|
+
warehouseCode: z.string().trim().optional(),
|
|
286
|
+
warehouseId: uuid().optional(),
|
|
287
|
+
locationCode: z.string().trim().optional(),
|
|
288
|
+
locationId: uuid().optional(),
|
|
289
|
+
sku: z.string().trim().optional(),
|
|
290
|
+
catalogVariantId: uuid().optional(),
|
|
291
|
+
quantity: z.string().trim().optional(),
|
|
292
|
+
lotNumber: z.string().trim().optional(),
|
|
293
|
+
lotId: uuid().optional(),
|
|
294
|
+
serialNumber: z.string().trim().optional()
|
|
295
|
+
});
|
|
296
|
+
const inventoryImportModeSchema = z.enum(["additive", "reconcile"]).default("additive");
|
|
297
|
+
const inventoryImportValidateSchema = scopedSchema.extend({
|
|
298
|
+
importBatchId: uuid().optional(),
|
|
299
|
+
skipDuplicates: z.boolean().optional(),
|
|
300
|
+
mode: inventoryImportModeSchema,
|
|
301
|
+
rows: z.array(inventoryImportRawRowSchema).min(1).max(5e3)
|
|
302
|
+
});
|
|
303
|
+
const inventoryImportApplyRowSchema = z.object({
|
|
304
|
+
rowNumber: z.number().int().positive(),
|
|
305
|
+
warehouseId: uuid(),
|
|
306
|
+
locationId: uuid(),
|
|
307
|
+
catalogVariantId: uuid(),
|
|
308
|
+
quantity: nonNegativeQuantity,
|
|
309
|
+
delta: numericQuantity,
|
|
310
|
+
lotId: uuid().optional(),
|
|
311
|
+
serialNumber: z.string().trim().max(120).optional()
|
|
312
|
+
});
|
|
313
|
+
const inventoryImportApplySchema = scopedSchema.extend({
|
|
314
|
+
importBatchId: uuid(),
|
|
315
|
+
reason: z.string().trim().min(1).max(500).default("CSV import inventory receipt"),
|
|
316
|
+
continueOnError: z.boolean().optional(),
|
|
317
|
+
mode: inventoryImportModeSchema,
|
|
318
|
+
rows: z.array(inventoryImportApplyRowSchema).min(1).max(5e3)
|
|
319
|
+
});
|
|
320
|
+
const operationalDashboardQuerySchema = z.object({
|
|
321
|
+
warehouseId: z.string().uuid().optional()
|
|
322
|
+
});
|
|
323
|
+
const operationalDashboardKpiSchema = z.object({
|
|
324
|
+
id: z.enum(["lowStock", "reorderCritical", "expiringSoon", "pastDue", "agingReservations", "todaysMoves"]),
|
|
325
|
+
count: z.number(),
|
|
326
|
+
deltaSinceYesterday: z.number().nullable(),
|
|
327
|
+
sparkline: z.array(z.number())
|
|
328
|
+
});
|
|
329
|
+
const operationalDashboardExpiryLotSchema = z.object({
|
|
330
|
+
id: z.string().uuid(),
|
|
331
|
+
lotNumber: z.string(),
|
|
332
|
+
sku: z.string(),
|
|
333
|
+
expiresAt: z.string(),
|
|
334
|
+
availableQuantity: z.number(),
|
|
335
|
+
category: z.enum(["expiringSoon", "pastDue"])
|
|
336
|
+
});
|
|
337
|
+
const operationalDashboardResponseSchema = z.object({
|
|
338
|
+
lastUpdatedAt: z.string(),
|
|
339
|
+
warehouseId: z.string().uuid().nullable(),
|
|
340
|
+
kpis: z.array(operationalDashboardKpiSchema),
|
|
341
|
+
expiryLots: z.array(operationalDashboardExpiryLotSchema),
|
|
342
|
+
monthlyTrends: z.array(
|
|
343
|
+
z.object({
|
|
344
|
+
month: z.string(),
|
|
345
|
+
receive: z.number(),
|
|
346
|
+
allocate: z.number()
|
|
347
|
+
})
|
|
348
|
+
),
|
|
349
|
+
recentActivity: z.array(
|
|
350
|
+
z.object({
|
|
351
|
+
id: z.string().uuid(),
|
|
352
|
+
movementType: z.string(),
|
|
353
|
+
quantity: z.number(),
|
|
354
|
+
variantSku: z.string().nullable(),
|
|
355
|
+
variantId: z.string().uuid(),
|
|
356
|
+
referenceType: z.string().nullable(),
|
|
357
|
+
referenceId: z.string().nullable(),
|
|
358
|
+
reason: z.string().nullable(),
|
|
359
|
+
locationLabel: z.string(),
|
|
360
|
+
performedAt: z.string()
|
|
361
|
+
})
|
|
362
|
+
)
|
|
363
|
+
});
|
|
364
|
+
export {
|
|
365
|
+
inventoryAdjustSchema,
|
|
366
|
+
inventoryBalanceListQuerySchema,
|
|
367
|
+
inventoryCycleCountSchema,
|
|
368
|
+
inventoryImportApplyRowSchema,
|
|
369
|
+
inventoryImportApplySchema,
|
|
370
|
+
inventoryImportModeSchema,
|
|
371
|
+
inventoryImportRawRowSchema,
|
|
372
|
+
inventoryImportValidateSchema,
|
|
373
|
+
inventoryLotCreateSchema,
|
|
374
|
+
inventoryLotUpdateSchema,
|
|
375
|
+
inventoryMoveSchema,
|
|
376
|
+
inventoryMovementCreateSchema,
|
|
377
|
+
inventoryMovementListQuerySchema,
|
|
378
|
+
inventoryReceiveSchema,
|
|
379
|
+
inventoryReservationAllocateSchema,
|
|
380
|
+
inventoryReservationCreateSchema,
|
|
381
|
+
inventoryReservationListQuerySchema,
|
|
382
|
+
inventoryReservationReleaseSchema,
|
|
383
|
+
operationalDashboardExpiryLotSchema,
|
|
384
|
+
operationalDashboardKpiSchema,
|
|
385
|
+
operationalDashboardQuerySchema,
|
|
386
|
+
operationalDashboardResponseSchema,
|
|
387
|
+
productInventoryProfileCreateSchema,
|
|
388
|
+
productInventoryProfileUpdateSchema,
|
|
389
|
+
salesOrderWarehouseAssignBodySchema,
|
|
390
|
+
salesOrderWarehouseAssignSchema,
|
|
391
|
+
salesOrderWarehouseUnassignSchema,
|
|
392
|
+
warehouseCreateSchema,
|
|
393
|
+
warehouseLocationCreateSchema,
|
|
394
|
+
warehouseLocationUpdateSchema,
|
|
395
|
+
warehouseUpdateSchema,
|
|
396
|
+
warehouseZoneCreateSchema,
|
|
397
|
+
warehouseZoneUpdateSchema
|
|
398
|
+
};
|
|
399
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/wms/data/validators.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\nconst uuid = () => z.string().uuid()\nconst numericQuantity = z.coerce.number().finite()\nconst positiveQuantity = numericQuantity.gt(0)\nconst nonNegativeQuantity = numericQuantity.min(0)\n\nconst scopedSchema = z.object({\n organizationId: uuid(),\n tenantId: uuid(),\n})\n\nconst warehouseLocationTypeSchema = z.enum(['zone', 'aisle', 'rack', 'bin', 'slot', 'dock', 'staging'])\nconst inventoryStrategySchema = z.enum(['fifo', 'lifo', 'fefo'])\nconst inventoryLotStatusSchema = z.enum(['available', 'hold', 'quarantine', 'expired'])\nconst inventoryReservationSourceTypeSchema = z.enum(['order', 'transfer', 'manual'])\nconst inventoryReservationStatusSchema = z.enum(['active', 'released', 'fulfilled'])\nconst inventoryMovementTypeSchema = z.enum([\n 'receipt',\n 'putaway',\n 'pick',\n 'pack',\n 'ship',\n 'adjust',\n 'transfer',\n 'cycle_count',\n 'return_receive',\n])\nconst inventoryMovementReferenceTypeSchema = z.enum(['po', 'so', 'transfer', 'manual', 'qc', 'rma'])\n\nconst metadataSchema = z.record(z.string(), z.unknown()).optional()\n\nconst enforcePrimaryRequiresActiveWarehouse = (\n payload: { isActive?: boolean; isPrimary?: boolean },\n ctx: z.RefinementCtx,\n) => {\n if (payload.isPrimary === true && payload.isActive === false) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['isPrimary'],\n message: 'Inactive warehouses cannot be marked as primary.',\n })\n }\n}\n\nconst warehouseFieldsSchema = scopedSchema.extend({\n name: z.string().trim().min(1).max(200),\n code: z.string().trim().min(1).max(80),\n isActive: z.boolean().optional(),\n isPrimary: z.boolean().optional(),\n addressLine1: z.string().trim().max(255).optional(),\n city: z.string().trim().max(150).optional(),\n postalCode: z.string().trim().max(40).optional(),\n country: z.string().trim().max(120).optional(),\n timezone: z.string().trim().max(120).optional(),\n metadata: metadataSchema,\n})\n\nexport const warehouseCreateSchema = warehouseFieldsSchema.superRefine(enforcePrimaryRequiresActiveWarehouse)\n\nexport const warehouseUpdateSchema = z\n .object({ id: uuid() })\n .merge(warehouseFieldsSchema.partial())\n .superRefine(enforcePrimaryRequiresActiveWarehouse)\n\nexport const warehouseZoneCreateSchema = scopedSchema.extend({\n warehouseId: uuid(),\n code: z.string().trim().min(1).max(80),\n name: z.string().trim().min(1).max(200),\n priority: z.coerce.number().int().min(0).optional(),\n metadata: metadataSchema,\n})\n\nexport const warehouseZoneUpdateSchema = z.object({ id: uuid() }).merge(warehouseZoneCreateSchema.partial())\n\nexport const warehouseLocationCreateSchema = scopedSchema.extend({\n warehouseId: uuid(),\n code: z.string().trim().min(1).max(120),\n type: warehouseLocationTypeSchema,\n parentId: uuid().nullable().optional(),\n isActive: z.boolean().optional(),\n capacityUnits: nonNegativeQuantity.optional(),\n capacityWeight: nonNegativeQuantity.optional(),\n constraints: z.record(z.string(), z.unknown()).optional(),\n metadata: metadataSchema,\n})\n\nexport const warehouseLocationUpdateSchema = z.object({ id: uuid() }).merge(warehouseLocationCreateSchema.partial())\n\nconst productInventoryProfileBaseSchema = scopedSchema.extend({\n catalogProductId: uuid(),\n catalogVariantId: uuid().nullable().optional(),\n defaultUom: z.string().trim().min(1).max(32),\n trackLot: z.boolean().optional(),\n trackSerial: z.boolean().optional(),\n trackExpiration: z.boolean().optional(),\n defaultStrategy: inventoryStrategySchema,\n reorderPoint: nonNegativeQuantity.optional(),\n safetyStock: nonNegativeQuantity.optional(),\n metadata: metadataSchema,\n})\n\nconst enforceFefoWhenExpirationTracked = (\n payload: { trackExpiration?: boolean; defaultStrategy?: 'fifo' | 'lifo' | 'fefo' },\n ctx: z.RefinementCtx,\n) => {\n if (\n payload.trackExpiration === true &&\n payload.defaultStrategy !== undefined &&\n payload.defaultStrategy !== 'fefo'\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['defaultStrategy'],\n message: 'FEFO is required when expiration tracking is enabled.',\n })\n }\n}\n\nexport const productInventoryProfileCreateSchema =\n productInventoryProfileBaseSchema.superRefine(enforceFefoWhenExpirationTracked)\n\nexport const productInventoryProfileUpdateSchema = z\n .object({ id: uuid() })\n .merge(productInventoryProfileBaseSchema.partial())\n .superRefine(enforceFefoWhenExpirationTracked)\n\nconst inventoryLotBaseSchema = scopedSchema.extend({\n catalogVariantId: uuid(),\n sku: z.string().trim().min(1).max(120),\n lotNumber: z.string().trim().min(1).max(120),\n batchNumber: z.string().trim().max(120).optional(),\n manufacturedAt: z.coerce.date().optional(),\n bestBeforeAt: z.coerce.date().optional(),\n expiresAt: z.coerce.date().optional(),\n status: inventoryLotStatusSchema.optional(),\n metadata: metadataSchema,\n})\n\nconst enforceLotDateOrdering = (\n payload: { manufacturedAt?: Date; bestBeforeAt?: Date; expiresAt?: Date },\n ctx: z.RefinementCtx,\n) => {\n if (payload.manufacturedAt && payload.bestBeforeAt && payload.bestBeforeAt < payload.manufacturedAt) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['bestBeforeAt'],\n message: 'Best-before date must be on or after manufactured date.',\n })\n }\n if (payload.bestBeforeAt && payload.expiresAt && payload.expiresAt < payload.bestBeforeAt) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['expiresAt'],\n message: 'Expiration date must be on or after best-before date.',\n })\n }\n if (payload.manufacturedAt && payload.expiresAt && payload.expiresAt < payload.manufacturedAt) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['expiresAt'],\n message: 'Expiration date must be on or after manufactured date.',\n })\n }\n}\n\nexport const inventoryLotCreateSchema = inventoryLotBaseSchema.superRefine(enforceLotDateOrdering)\n\nexport const inventoryLotUpdateSchema = z\n .object({\n id: uuid(),\n // Optional status-change note merged into lot.metadata.notes by the update command.\n notes: z.string().trim().max(500).optional(),\n })\n .merge(inventoryLotBaseSchema.partial())\n .superRefine(enforceLotDateOrdering)\n\nconst inventoryLowStockFilterSchema = z.enum(['belowReorder', 'belowSafety'])\n\nexport const inventoryBalanceListQuerySchema = z.object({\n page: z.coerce.number().min(1).default(1),\n pageSize: z.coerce.number().min(1).max(100).default(25),\n warehouseId: uuid().optional(),\n locationId: uuid().optional(),\n catalogVariantId: uuid().optional(),\n lotId: uuid().optional(),\n serialNumber: z.string().trim().max(120).optional(),\n lowStock: inventoryLowStockFilterSchema.optional(),\n search: z.string().optional(),\n}).passthrough()\n\nexport const inventoryMovementListQuerySchema = z.object({\n page: z.coerce.number().min(1).default(1),\n pageSize: z.coerce.number().min(1).max(100).default(25),\n warehouseId: uuid().optional(),\n locationId: uuid().optional(),\n catalogVariantId: uuid().optional(),\n lotId: uuid().optional(),\n referenceType: inventoryMovementReferenceTypeSchema.optional(),\n referenceId: uuid().optional(),\n type: inventoryMovementTypeSchema.optional(),\n search: z.string().optional(),\n}).passthrough()\n\nexport const inventoryReservationListQuerySchema = z.object({\n page: z.coerce.number().min(1).default(1),\n pageSize: z.coerce.number().min(1).max(100).default(25),\n warehouseId: uuid().optional(),\n catalogVariantId: uuid().optional(),\n lotId: uuid().optional(),\n sourceType: inventoryReservationSourceTypeSchema.optional(),\n sourceId: uuid().optional(),\n status: inventoryReservationStatusSchema.optional(),\n search: z.string().optional(),\n}).passthrough()\n\nexport const inventoryReceiveSchema = scopedSchema.extend({\n warehouseId: uuid(),\n locationId: uuid(),\n catalogVariantId: uuid(),\n lotId: uuid().optional(),\n lotNumber: z.string().trim().max(120).optional(),\n serialNumber: z.string().trim().max(120).optional(),\n quantity: positiveQuantity,\n referenceType: inventoryMovementReferenceTypeSchema,\n referenceId: uuid(),\n performedBy: uuid(),\n receivedAt: z.coerce.date().optional(),\n performedAt: z.coerce.date().optional(),\n reason: z.string().trim().max(500).optional(),\n metadata: metadataSchema,\n})\n\nexport const inventoryReservationCreateSchema = scopedSchema.extend({\n warehouseId: uuid(),\n catalogVariantId: uuid(),\n lotId: uuid().optional(),\n serialNumber: z.string().trim().max(120).optional(),\n quantity: positiveQuantity,\n sourceType: inventoryReservationSourceTypeSchema,\n sourceId: uuid(),\n expiresAt: z.coerce.date().optional(),\n strategy: inventoryStrategySchema.optional(),\n metadata: metadataSchema,\n})\n\nexport const inventoryReservationReleaseSchema = scopedSchema.extend({\n reservationId: uuid(),\n reason: z.string().trim().min(1).max(120),\n reasonCode: z.string().trim().max(80).optional(),\n metadata: metadataSchema,\n})\n\nexport const inventoryReservationAllocateSchema = scopedSchema.extend({\n reservationId: uuid(),\n metadata: metadataSchema,\n})\n\nexport const inventoryAdjustSchema = scopedSchema.extend({\n warehouseId: uuid(),\n locationId: uuid(),\n catalogVariantId: uuid(),\n lotId: uuid().optional(),\n serialNumber: z.string().trim().max(120).optional(),\n delta: numericQuantity.refine((value) => value !== 0, {\n message: 'Inventory delta must be non-zero.',\n }),\n reason: z.string().trim().min(1).max(500),\n reasonCode: z.string().trim().max(80).optional(),\n referenceType: inventoryMovementReferenceTypeSchema.default('manual'),\n referenceId: uuid(),\n performedBy: uuid(),\n performedAt: z.coerce.date().optional(),\n metadata: metadataSchema,\n})\n\nexport const inventoryMoveSchema = scopedSchema.extend({\n warehouseId: uuid(),\n fromLocationId: uuid(),\n toLocationId: uuid(),\n catalogVariantId: uuid(),\n lotId: uuid().optional(),\n serialNumber: z.string().trim().max(120).optional(),\n quantity: positiveQuantity,\n type: inventoryMovementTypeSchema.optional(),\n reason: z.string().trim().min(1).max(500),\n reasonCode: z.string().trim().max(80).optional(),\n referenceType: inventoryMovementReferenceTypeSchema.default('manual'),\n referenceId: uuid(),\n performedBy: uuid(),\n performedAt: z.coerce.date().optional(),\n metadata: metadataSchema,\n})\n\nexport const inventoryCycleCountSchema = scopedSchema.extend({\n warehouseId: uuid(),\n locationId: uuid(),\n catalogVariantId: uuid(),\n lotId: uuid().optional(),\n serialNumber: z.string().trim().max(120).optional(),\n countedQuantity: nonNegativeQuantity,\n autoAdjust: z.boolean().default(true),\n reason: z.string().trim().min(1).max(500),\n referenceId: uuid(),\n performedBy: uuid(),\n performedAt: z.coerce.date().optional(),\n metadata: metadataSchema,\n})\n\nexport const inventoryMovementCreateSchema = scopedSchema.extend({\n warehouseId: uuid(),\n locationFromId: uuid().optional(),\n locationToId: uuid().optional(),\n catalogVariantId: uuid(),\n lotId: uuid().optional(),\n serialNumber: z.string().trim().max(120).optional(),\n quantity: positiveQuantity,\n type: inventoryMovementTypeSchema,\n referenceType: inventoryMovementReferenceTypeSchema,\n referenceId: uuid(),\n performedBy: uuid(),\n performedAt: z.coerce.date(),\n receivedAt: z.coerce.date(),\n reason: z.string().trim().max(500).optional(),\n metadata: metadataSchema,\n})\n\nexport type WarehouseCreateInput = z.infer<typeof warehouseCreateSchema>\nexport type WarehouseUpdateInput = z.infer<typeof warehouseUpdateSchema>\nexport type WarehouseZoneCreateInput = z.infer<typeof warehouseZoneCreateSchema>\nexport type WarehouseZoneUpdateInput = z.infer<typeof warehouseZoneUpdateSchema>\nexport type WarehouseLocationCreateInput = z.infer<typeof warehouseLocationCreateSchema>\nexport type WarehouseLocationUpdateInput = z.infer<typeof warehouseLocationUpdateSchema>\nexport type ProductInventoryProfileCreateInput = z.infer<typeof productInventoryProfileCreateSchema>\nexport type ProductInventoryProfileUpdateInput = z.infer<typeof productInventoryProfileUpdateSchema>\nexport type InventoryLotCreateInput = z.infer<typeof inventoryLotCreateSchema>\nexport type InventoryLotUpdateInput = z.infer<typeof inventoryLotUpdateSchema>\nexport type InventoryReceiveInput = z.infer<typeof inventoryReceiveSchema>\nexport type InventoryReservationCreateInput = z.infer<typeof inventoryReservationCreateSchema>\nexport type InventoryReservationReleaseInput = z.infer<typeof inventoryReservationReleaseSchema>\nexport type InventoryReservationAllocateInput = z.infer<typeof inventoryReservationAllocateSchema>\nexport type InventoryAdjustInput = z.infer<typeof inventoryAdjustSchema>\nexport type InventoryMoveInput = z.infer<typeof inventoryMoveSchema>\nexport type InventoryCycleCountInput = z.infer<typeof inventoryCycleCountSchema>\n\nexport const salesOrderWarehouseAssignBodySchema = scopedSchema.extend({\n warehouseId: uuid(),\n notes: z.string().trim().max(500).optional(),\n metadata: metadataSchema,\n})\n\nexport const salesOrderWarehouseAssignSchema = salesOrderWarehouseAssignBodySchema.extend({\n salesOrderId: uuid(),\n})\n\nexport const salesOrderWarehouseUnassignSchema = scopedSchema.extend({\n salesOrderId: uuid(),\n metadata: metadataSchema,\n})\n\nexport type SalesOrderWarehouseAssignInput = z.infer<typeof salesOrderWarehouseAssignSchema>\nexport type SalesOrderWarehouseUnassignInput = z.infer<typeof salesOrderWarehouseUnassignSchema>\n\nexport const inventoryImportRawRowSchema = z.object({\n warehouseCode: z.string().trim().optional(),\n warehouseId: uuid().optional(),\n locationCode: z.string().trim().optional(),\n locationId: uuid().optional(),\n sku: z.string().trim().optional(),\n catalogVariantId: uuid().optional(),\n quantity: z.string().trim().optional(),\n lotNumber: z.string().trim().optional(),\n lotId: uuid().optional(),\n serialNumber: z.string().trim().optional(),\n})\n\nexport const inventoryImportModeSchema = z.enum(['additive', 'reconcile']).default('additive')\n\nexport const inventoryImportValidateSchema = scopedSchema.extend({\n importBatchId: uuid().optional(),\n skipDuplicates: z.boolean().optional(),\n mode: inventoryImportModeSchema,\n rows: z.array(inventoryImportRawRowSchema).min(1).max(5000),\n})\n\nexport const inventoryImportApplyRowSchema = z.object({\n rowNumber: z.number().int().positive(),\n warehouseId: uuid(),\n locationId: uuid(),\n catalogVariantId: uuid(),\n quantity: nonNegativeQuantity,\n delta: numericQuantity,\n lotId: uuid().optional(),\n serialNumber: z.string().trim().max(120).optional(),\n})\n\nexport const inventoryImportApplySchema = scopedSchema.extend({\n importBatchId: uuid(),\n reason: z.string().trim().min(1).max(500).default('CSV import inventory receipt'),\n continueOnError: z.boolean().optional(),\n mode: inventoryImportModeSchema,\n rows: z.array(inventoryImportApplyRowSchema).min(1).max(5000),\n})\n\nexport type InventoryImportApplyServerInput = z.infer<typeof inventoryImportApplySchema> & {\n performedBy: string\n}\n\nexport type InventoryImportMode = z.infer<typeof inventoryImportModeSchema>\nexport type InventoryImportValidateInput = z.infer<typeof inventoryImportValidateSchema>\nexport type InventoryImportApplyInput = InventoryImportApplyServerInput\nexport type InventoryImportApplyRowInput = z.infer<typeof inventoryImportApplyRowSchema>\n\nexport const operationalDashboardQuerySchema = z.object({\n warehouseId: z.string().uuid().optional(),\n})\n\nexport const operationalDashboardKpiSchema = z.object({\n id: z.enum(['lowStock', 'reorderCritical', 'expiringSoon', 'pastDue', 'agingReservations', 'todaysMoves']),\n count: z.number(),\n deltaSinceYesterday: z.number().nullable(),\n sparkline: z.array(z.number()),\n})\n\nexport const operationalDashboardExpiryLotSchema = z.object({\n id: z.string().uuid(),\n lotNumber: z.string(),\n sku: z.string(),\n expiresAt: z.string(),\n availableQuantity: z.number(),\n category: z.enum(['expiringSoon', 'pastDue']),\n})\n\nexport const operationalDashboardResponseSchema = z.object({\n lastUpdatedAt: z.string(),\n warehouseId: z.string().uuid().nullable(),\n kpis: z.array(operationalDashboardKpiSchema),\n expiryLots: z.array(operationalDashboardExpiryLotSchema),\n monthlyTrends: z.array(\n z.object({\n month: z.string(),\n receive: z.number(),\n allocate: z.number(),\n }),\n ),\n recentActivity: z.array(\n z.object({\n id: z.string().uuid(),\n movementType: z.string(),\n quantity: z.number(),\n variantSku: z.string().nullable(),\n variantId: z.string().uuid(),\n referenceType: z.string().nullable(),\n referenceId: z.string().nullable(),\n reason: z.string().nullable(),\n locationLabel: z.string(),\n performedAt: z.string(),\n }),\n ),\n})\n\nexport type OperationalDashboardQueryInput = z.infer<typeof operationalDashboardQuerySchema>\nexport type OperationalDashboardResponse = z.infer<typeof operationalDashboardResponseSchema>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAElB,MAAM,OAAO,MAAM,EAAE,OAAO,EAAE,KAAK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ot,
|
|
5
|
+
InventoryMovement,
|
|
6
|
+
InventoryReservation,
|
|
7
|
+
ProductInventoryProfile,
|
|
8
|
+
Warehouse,
|
|
9
|
+
WarehouseLocation,
|
|
10
|
+
WarehouseZone
|
|
11
|
+
} from "./data/entities.js";
|
|
12
|
+
function register(container) {
|
|
13
|
+
container.register({
|
|
14
|
+
Warehouse: asValue(Warehouse),
|
|
15
|
+
WarehouseZone: asValue(WarehouseZone),
|
|
16
|
+
WarehouseLocation: asValue(WarehouseLocation),
|
|
17
|
+
ProductInventoryProfile: asValue(ProductInventoryProfile),
|
|
18
|
+
InventoryLot: asValue(InventoryLot),
|
|
19
|
+
InventoryBalance: asValue(InventoryBalance),
|
|
20
|
+
InventoryReservation: asValue(InventoryReservation),
|
|
21
|
+
InventoryMovement: asValue(InventoryMovement)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
register
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=di.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/wms/di.ts"],
|
|
4
|
+
"sourcesContent": ["import { asValue } from 'awilix'\nimport type { AppContainer } from '@open-mercato/shared/lib/di/container'\nimport {\n InventoryBalance,\n InventoryLot,\n InventoryMovement,\n InventoryReservation,\n ProductInventoryProfile,\n Warehouse,\n WarehouseLocation,\n WarehouseZone,\n} from './data/entities'\n\nexport function register(container: AppContainer) {\n container.register({\n Warehouse: asValue(Warehouse),\n WarehouseZone: asValue(WarehouseZone),\n WarehouseLocation: asValue(WarehouseLocation),\n ProductInventoryProfile: asValue(ProductInventoryProfile),\n InventoryLot: asValue(InventoryLot),\n InventoryBalance: asValue(InventoryBalance),\n InventoryReservation: asValue(InventoryReservation),\n InventoryMovement: asValue(InventoryMovement),\n })\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,SAAS,SAAS,WAAyB;AAChD,YAAU,SAAS;AAAA,IACjB,WAAW,QAAQ,SAAS;AAAA,IAC5B,eAAe,QAAQ,aAAa;AAAA,IACpC,mBAAmB,QAAQ,iBAAiB;AAAA,IAC5C,yBAAyB,QAAQ,uBAAuB;AAAA,IACxD,cAAc,QAAQ,YAAY;AAAA,IAClC,kBAAkB,QAAQ,gBAAgB;AAAA,IAC1C,sBAAsB,QAAQ,oBAAoB;AAAA,IAClD,mBAAmB,QAAQ,iBAAiB;AAAA,EAC9C,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createModuleEvents } from "@open-mercato/shared/modules/events";
|
|
2
|
+
const events = [
|
|
3
|
+
{ id: "wms.warehouse.created", label: "Warehouse Created", entity: "warehouse", category: "crud" },
|
|
4
|
+
{ id: "wms.warehouse.updated", label: "Warehouse Updated", entity: "warehouse", category: "crud" },
|
|
5
|
+
{ id: "wms.zone.created", label: "Warehouse Zone Created", entity: "zone", category: "crud" },
|
|
6
|
+
{ id: "wms.zone.updated", label: "Warehouse Zone Updated", entity: "zone", category: "crud" },
|
|
7
|
+
{ id: "wms.location.created", label: "Warehouse Location Created", entity: "location", category: "crud" },
|
|
8
|
+
{ id: "wms.location.updated", label: "Warehouse Location Updated", entity: "location", category: "crud" },
|
|
9
|
+
{ id: "wms.inventory_profile.created", label: "Inventory Profile Created", entity: "inventory_profile", category: "crud" },
|
|
10
|
+
{ id: "wms.inventory_profile.updated", label: "Inventory Profile Updated", entity: "inventory_profile", category: "crud" },
|
|
11
|
+
{ id: "wms.inventory_balance.created", label: "Inventory Balance Created", entity: "inventory_balance", category: "crud" },
|
|
12
|
+
{ id: "wms.inventory_balance.updated", label: "Inventory Balance Updated", entity: "inventory_balance", category: "crud" },
|
|
13
|
+
{ id: "wms.inventory_balance.deleted", label: "Inventory Balance Deleted", entity: "inventory_balance", category: "crud" },
|
|
14
|
+
{ id: "wms.inventory_reservation.created", label: "Inventory Reservation Created", entity: "inventory_reservation", category: "crud" },
|
|
15
|
+
{ id: "wms.inventory_reservation.updated", label: "Inventory Reservation Updated", entity: "inventory_reservation", category: "crud" },
|
|
16
|
+
{ id: "wms.inventory_reservation.deleted", label: "Inventory Reservation Deleted", entity: "inventory_reservation", category: "crud" },
|
|
17
|
+
{ id: "wms.inventory_movement.created", label: "Inventory Movement Created", entity: "inventory_movement", category: "crud" },
|
|
18
|
+
{ id: "wms.inventory_movement.updated", label: "Inventory Movement Updated", entity: "inventory_movement", category: "crud" },
|
|
19
|
+
{ id: "wms.inventory_movement.deleted", label: "Inventory Movement Deleted", entity: "inventory_movement", category: "crud" },
|
|
20
|
+
{ id: "wms.inventory.received", label: "Inventory Received", entity: "inventory", category: "custom" },
|
|
21
|
+
{ id: "wms.inventory.adjusted", label: "Inventory Adjusted", entity: "inventory", category: "custom" },
|
|
22
|
+
{ id: "wms.inventory.reserved", label: "Inventory Reserved", entity: "inventory", category: "custom" },
|
|
23
|
+
{ id: "wms.inventory.released", label: "Inventory Released", entity: "inventory", category: "custom" },
|
|
24
|
+
{ id: "wms.inventory.allocated", label: "Inventory Allocated", entity: "inventory", category: "custom" },
|
|
25
|
+
{ id: "wms.inventory.moved", label: "Inventory Moved", entity: "inventory", category: "custom" },
|
|
26
|
+
{ id: "wms.inventory.reconciled", label: "Inventory Reconciled", entity: "inventory", category: "custom" },
|
|
27
|
+
{ id: "wms.inventory.low_stock", label: "Inventory Low Stock", entity: "inventory", category: "lifecycle" },
|
|
28
|
+
{ id: "wms.inventory.balance_drift", label: "Inventory Balance Drift", entity: "inventory", category: "lifecycle" },
|
|
29
|
+
{ id: "wms.inventory.reservation_shortfall", label: "Inventory Reservation Shortfall", entity: "inventory", category: "lifecycle" }
|
|
30
|
+
];
|
|
31
|
+
const eventsConfig = createModuleEvents({
|
|
32
|
+
moduleId: "wms",
|
|
33
|
+
events
|
|
34
|
+
});
|
|
35
|
+
const emitWmsEvent = eventsConfig.emit;
|
|
36
|
+
var events_default = eventsConfig;
|
|
37
|
+
export {
|
|
38
|
+
events_default as default,
|
|
39
|
+
emitWmsEvent,
|
|
40
|
+
eventsConfig
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/wms/events.ts"],
|
|
4
|
+
"sourcesContent": ["import { createModuleEvents } from '@open-mercato/shared/modules/events'\n\nconst events = [\n { id: 'wms.warehouse.created', label: 'Warehouse Created', entity: 'warehouse', category: 'crud' },\n { id: 'wms.warehouse.updated', label: 'Warehouse Updated', entity: 'warehouse', category: 'crud' },\n { id: 'wms.zone.created', label: 'Warehouse Zone Created', entity: 'zone', category: 'crud' },\n { id: 'wms.zone.updated', label: 'Warehouse Zone Updated', entity: 'zone', category: 'crud' },\n { id: 'wms.location.created', label: 'Warehouse Location Created', entity: 'location', category: 'crud' },\n { id: 'wms.location.updated', label: 'Warehouse Location Updated', entity: 'location', category: 'crud' },\n { id: 'wms.inventory_profile.created', label: 'Inventory Profile Created', entity: 'inventory_profile', category: 'crud' },\n { id: 'wms.inventory_profile.updated', label: 'Inventory Profile Updated', entity: 'inventory_profile', category: 'crud' },\n { id: 'wms.inventory_balance.created', label: 'Inventory Balance Created', entity: 'inventory_balance', category: 'crud' },\n { id: 'wms.inventory_balance.updated', label: 'Inventory Balance Updated', entity: 'inventory_balance', category: 'crud' },\n { id: 'wms.inventory_balance.deleted', label: 'Inventory Balance Deleted', entity: 'inventory_balance', category: 'crud' },\n { id: 'wms.inventory_reservation.created', label: 'Inventory Reservation Created', entity: 'inventory_reservation', category: 'crud' },\n { id: 'wms.inventory_reservation.updated', label: 'Inventory Reservation Updated', entity: 'inventory_reservation', category: 'crud' },\n { id: 'wms.inventory_reservation.deleted', label: 'Inventory Reservation Deleted', entity: 'inventory_reservation', category: 'crud' },\n { id: 'wms.inventory_movement.created', label: 'Inventory Movement Created', entity: 'inventory_movement', category: 'crud' },\n { id: 'wms.inventory_movement.updated', label: 'Inventory Movement Updated', entity: 'inventory_movement', category: 'crud' },\n { id: 'wms.inventory_movement.deleted', label: 'Inventory Movement Deleted', entity: 'inventory_movement', category: 'crud' },\n { id: 'wms.inventory.received', label: 'Inventory Received', entity: 'inventory', category: 'custom' },\n { id: 'wms.inventory.adjusted', label: 'Inventory Adjusted', entity: 'inventory', category: 'custom' },\n { id: 'wms.inventory.reserved', label: 'Inventory Reserved', entity: 'inventory', category: 'custom' },\n { id: 'wms.inventory.released', label: 'Inventory Released', entity: 'inventory', category: 'custom' },\n { id: 'wms.inventory.allocated', label: 'Inventory Allocated', entity: 'inventory', category: 'custom' },\n { id: 'wms.inventory.moved', label: 'Inventory Moved', entity: 'inventory', category: 'custom' },\n { id: 'wms.inventory.reconciled', label: 'Inventory Reconciled', entity: 'inventory', category: 'custom' },\n { id: 'wms.inventory.low_stock', label: 'Inventory Low Stock', entity: 'inventory', category: 'lifecycle' },\n { id: 'wms.inventory.balance_drift', label: 'Inventory Balance Drift', entity: 'inventory', category: 'lifecycle' },\n { id: 'wms.inventory.reservation_shortfall', label: 'Inventory Reservation Shortfall', entity: 'inventory', category: 'lifecycle' },\n] as const\n\nexport const eventsConfig = createModuleEvents({\n moduleId: 'wms',\n events,\n})\n\nexport const emitWmsEvent = eventsConfig.emit\nexport type WmsEventId = typeof events[number]['id']\n\nexport default eventsConfig\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,0BAA0B;AAEnC,MAAM,SAAS;AAAA,EACb,EAAE,IAAI,yBAAyB,OAAO,qBAAqB,QAAQ,aAAa,UAAU,OAAO;AAAA,EACjG,EAAE,IAAI,yBAAyB,OAAO,qBAAqB,QAAQ,aAAa,UAAU,OAAO;AAAA,EACjG,EAAE,IAAI,oBAAoB,OAAO,0BAA0B,QA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AAI,0BAA0B,OAAO,sBAAsB,QAAQ,aAAa,UAAU,SAAS;AAAA,EACrG,EAAE,IAAI,0BAA0B,OAAO,sBAAsB,QAAQ,aAAa,UAAU,SAAS;AAAA,EACrG,EAAE,IAAI,2BAA2B,OAAO,uBAAuB,QAAQ,aAAa,UAAU,SAAS;AAAA,EACvG,EAAE,IAAI,uBAAuB,OAAO,mBAAmB,QAAQ,aAAa,UAAU,SAAS;AAAA,EAC/F,EAAE,IAAI,4BAA4B,OAAO,wBAAwB,QAAQ,aAAa,UAAU,SAAS;AAAA,EACzG,EAAE,IAAI,2BAA2B,OAAO,uBAAuB,QAAQ,aAAa,UAAU,YAAY;AAAA,EAC1G,EAAE,IAAI,+BAA+B,OAAO,2BAA2B,QAAQ,aAAa,UAAU,YAAY;AAAA,EAClH,EAAE,IAAI,uCAAuC,OAAO,mCAAmC,QAAQ,aAAa,UAAU,YAAY;AACpI;AAEO,MAAM,eAAe,mBAAmB;AAAA,EAC7C,UAAU;AAAA,EACV;AACF,CAAC;AAEM,MAAM,eAAe,aAAa;AAGzC,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./commands/index.js";
|
|
2
|
+
const metadata = {
|
|
3
|
+
name: "wms",
|
|
4
|
+
title: "Warehouse Management System",
|
|
5
|
+
version: "0.1.0",
|
|
6
|
+
description: "Warehouse topology, inventory balances, reservations, and movement ledger.",
|
|
7
|
+
author: "Open Mercato Team",
|
|
8
|
+
license: "MIT",
|
|
9
|
+
ejectable: true,
|
|
10
|
+
requires: ["catalog", "sales", "feature_toggles"]
|
|
11
|
+
};
|
|
12
|
+
import { features } from "./acl.js";
|
|
13
|
+
export {
|
|
14
|
+
features,
|
|
15
|
+
metadata
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/wms/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ModuleInfo } from '@open-mercato/shared/modules/registry'\nimport './commands'\n\nexport const metadata: ModuleInfo = {\n name: 'wms',\n title: 'Warehouse Management System',\n version: '0.1.0',\n description: 'Warehouse topology, inventory balances, reservations, and movement ledger.',\n author: 'Open Mercato Team',\n license: 'MIT',\n ejectable: true,\n requires: ['catalog', 'sales', 'feature_toggles'],\n}\n\nexport { features } from './acl'\n"],
|
|
5
|
+
"mappings": "AACA,OAAO;AAEA,MAAM,WAAuB;AAAA,EAClC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU,CAAC,WAAW,SAAS,iBAAiB;AAClD;AAEA,SAAS,gBAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const inventoryStrategySchema = z.enum(["fifo", "lifo", "fefo"]);
|
|
3
|
+
const catalogInventoryProfileIntentSchema = z.object({
|
|
4
|
+
manageInventory: z.boolean(),
|
|
5
|
+
defaultUom: z.string().trim().max(32).nullable().optional(),
|
|
6
|
+
defaultStrategy: inventoryStrategySchema.optional(),
|
|
7
|
+
trackLot: z.boolean().optional(),
|
|
8
|
+
trackSerial: z.boolean().optional(),
|
|
9
|
+
trackExpiration: z.boolean().optional(),
|
|
10
|
+
reorderPoint: z.coerce.number().finite().min(0).nullable().optional(),
|
|
11
|
+
safetyStock: z.coerce.number().finite().min(0).nullable().optional()
|
|
12
|
+
}).superRefine((payload, ctx) => {
|
|
13
|
+
if (!payload.manageInventory) return;
|
|
14
|
+
if (!payload.defaultUom || payload.defaultUom.trim().length === 0) {
|
|
15
|
+
ctx.addIssue({
|
|
16
|
+
code: z.ZodIssueCode.custom,
|
|
17
|
+
path: ["defaultUom"],
|
|
18
|
+
message: "wms.widgets.catalog.inventoryProfile.errors.defaultUomRequired"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (!payload.defaultStrategy) {
|
|
22
|
+
ctx.addIssue({
|
|
23
|
+
code: z.ZodIssueCode.custom,
|
|
24
|
+
path: ["defaultStrategy"],
|
|
25
|
+
message: "wms.widgets.catalog.inventoryProfile.errors.strategyRequired"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (payload.trackExpiration && payload.defaultStrategy !== "fefo") {
|
|
29
|
+
ctx.addIssue({
|
|
30
|
+
code: z.ZodIssueCode.custom,
|
|
31
|
+
path: ["defaultStrategy"],
|
|
32
|
+
message: "wms.widgets.catalog.inventoryProfile.errors.fefoRequired"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const WMS_CATALOG_PROFILE_HEADER = "x-open-mercato-wms-catalog-profile";
|
|
37
|
+
function encodeCatalogInventoryProfileIntent(intent) {
|
|
38
|
+
return encodeURIComponent(JSON.stringify(intent));
|
|
39
|
+
}
|
|
40
|
+
function decodeCatalogInventoryProfileIntent(rawHeader) {
|
|
41
|
+
if (typeof rawHeader !== "string" || rawHeader.trim().length === 0) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const decoded = decodeURIComponent(rawHeader);
|
|
45
|
+
const parsed = JSON.parse(decoded);
|
|
46
|
+
return catalogInventoryProfileIntentSchema.parse(parsed);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
WMS_CATALOG_PROFILE_HEADER,
|
|
50
|
+
catalogInventoryProfileIntentSchema,
|
|
51
|
+
decodeCatalogInventoryProfileIntent,
|
|
52
|
+
encodeCatalogInventoryProfileIntent
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=catalogInventoryProfileIntent.js.map
|