@open-mercato/core 0.6.7-develop.6669.1.40b669666b → 0.6.7-develop.6670.1.4efa7961c6
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,463 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
const uuid = () => z.string().uuid()
|
|
4
|
+
const numericQuantity = z.coerce.number().finite()
|
|
5
|
+
const positiveQuantity = numericQuantity.gt(0)
|
|
6
|
+
const nonNegativeQuantity = numericQuantity.min(0)
|
|
7
|
+
|
|
8
|
+
const scopedSchema = z.object({
|
|
9
|
+
organizationId: uuid(),
|
|
10
|
+
tenantId: uuid(),
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const warehouseLocationTypeSchema = z.enum(['zone', 'aisle', 'rack', 'bin', 'slot', 'dock', 'staging'])
|
|
14
|
+
const inventoryStrategySchema = z.enum(['fifo', 'lifo', 'fefo'])
|
|
15
|
+
const inventoryLotStatusSchema = z.enum(['available', 'hold', 'quarantine', 'expired'])
|
|
16
|
+
const inventoryReservationSourceTypeSchema = z.enum(['order', 'transfer', 'manual'])
|
|
17
|
+
const inventoryReservationStatusSchema = z.enum(['active', 'released', 'fulfilled'])
|
|
18
|
+
const inventoryMovementTypeSchema = z.enum([
|
|
19
|
+
'receipt',
|
|
20
|
+
'putaway',
|
|
21
|
+
'pick',
|
|
22
|
+
'pack',
|
|
23
|
+
'ship',
|
|
24
|
+
'adjust',
|
|
25
|
+
'transfer',
|
|
26
|
+
'cycle_count',
|
|
27
|
+
'return_receive',
|
|
28
|
+
])
|
|
29
|
+
const inventoryMovementReferenceTypeSchema = z.enum(['po', 'so', 'transfer', 'manual', 'qc', 'rma'])
|
|
30
|
+
|
|
31
|
+
const metadataSchema = z.record(z.string(), z.unknown()).optional()
|
|
32
|
+
|
|
33
|
+
const enforcePrimaryRequiresActiveWarehouse = (
|
|
34
|
+
payload: { isActive?: boolean; isPrimary?: boolean },
|
|
35
|
+
ctx: z.RefinementCtx,
|
|
36
|
+
) => {
|
|
37
|
+
if (payload.isPrimary === true && payload.isActive === false) {
|
|
38
|
+
ctx.addIssue({
|
|
39
|
+
code: z.ZodIssueCode.custom,
|
|
40
|
+
path: ['isPrimary'],
|
|
41
|
+
message: 'Inactive warehouses cannot be marked as primary.',
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const warehouseFieldsSchema = scopedSchema.extend({
|
|
47
|
+
name: z.string().trim().min(1).max(200),
|
|
48
|
+
code: z.string().trim().min(1).max(80),
|
|
49
|
+
isActive: z.boolean().optional(),
|
|
50
|
+
isPrimary: z.boolean().optional(),
|
|
51
|
+
addressLine1: z.string().trim().max(255).optional(),
|
|
52
|
+
city: z.string().trim().max(150).optional(),
|
|
53
|
+
postalCode: z.string().trim().max(40).optional(),
|
|
54
|
+
country: z.string().trim().max(120).optional(),
|
|
55
|
+
timezone: z.string().trim().max(120).optional(),
|
|
56
|
+
metadata: metadataSchema,
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
export const warehouseCreateSchema = warehouseFieldsSchema.superRefine(enforcePrimaryRequiresActiveWarehouse)
|
|
60
|
+
|
|
61
|
+
export const warehouseUpdateSchema = z
|
|
62
|
+
.object({ id: uuid() })
|
|
63
|
+
.merge(warehouseFieldsSchema.partial())
|
|
64
|
+
.superRefine(enforcePrimaryRequiresActiveWarehouse)
|
|
65
|
+
|
|
66
|
+
export const warehouseZoneCreateSchema = scopedSchema.extend({
|
|
67
|
+
warehouseId: uuid(),
|
|
68
|
+
code: z.string().trim().min(1).max(80),
|
|
69
|
+
name: z.string().trim().min(1).max(200),
|
|
70
|
+
priority: z.coerce.number().int().min(0).optional(),
|
|
71
|
+
metadata: metadataSchema,
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
export const warehouseZoneUpdateSchema = z.object({ id: uuid() }).merge(warehouseZoneCreateSchema.partial())
|
|
75
|
+
|
|
76
|
+
export const warehouseLocationCreateSchema = scopedSchema.extend({
|
|
77
|
+
warehouseId: uuid(),
|
|
78
|
+
code: z.string().trim().min(1).max(120),
|
|
79
|
+
type: warehouseLocationTypeSchema,
|
|
80
|
+
parentId: uuid().nullable().optional(),
|
|
81
|
+
isActive: z.boolean().optional(),
|
|
82
|
+
capacityUnits: nonNegativeQuantity.optional(),
|
|
83
|
+
capacityWeight: nonNegativeQuantity.optional(),
|
|
84
|
+
constraints: z.record(z.string(), z.unknown()).optional(),
|
|
85
|
+
metadata: metadataSchema,
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
export const warehouseLocationUpdateSchema = z.object({ id: uuid() }).merge(warehouseLocationCreateSchema.partial())
|
|
89
|
+
|
|
90
|
+
const productInventoryProfileBaseSchema = scopedSchema.extend({
|
|
91
|
+
catalogProductId: uuid(),
|
|
92
|
+
catalogVariantId: uuid().nullable().optional(),
|
|
93
|
+
defaultUom: z.string().trim().min(1).max(32),
|
|
94
|
+
trackLot: z.boolean().optional(),
|
|
95
|
+
trackSerial: z.boolean().optional(),
|
|
96
|
+
trackExpiration: z.boolean().optional(),
|
|
97
|
+
defaultStrategy: inventoryStrategySchema,
|
|
98
|
+
reorderPoint: nonNegativeQuantity.optional(),
|
|
99
|
+
safetyStock: nonNegativeQuantity.optional(),
|
|
100
|
+
metadata: metadataSchema,
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
const enforceFefoWhenExpirationTracked = (
|
|
104
|
+
payload: { trackExpiration?: boolean; defaultStrategy?: 'fifo' | 'lifo' | 'fefo' },
|
|
105
|
+
ctx: z.RefinementCtx,
|
|
106
|
+
) => {
|
|
107
|
+
if (
|
|
108
|
+
payload.trackExpiration === true &&
|
|
109
|
+
payload.defaultStrategy !== undefined &&
|
|
110
|
+
payload.defaultStrategy !== 'fefo'
|
|
111
|
+
) {
|
|
112
|
+
ctx.addIssue({
|
|
113
|
+
code: z.ZodIssueCode.custom,
|
|
114
|
+
path: ['defaultStrategy'],
|
|
115
|
+
message: 'FEFO is required when expiration tracking is enabled.',
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const productInventoryProfileCreateSchema =
|
|
121
|
+
productInventoryProfileBaseSchema.superRefine(enforceFefoWhenExpirationTracked)
|
|
122
|
+
|
|
123
|
+
export const productInventoryProfileUpdateSchema = z
|
|
124
|
+
.object({ id: uuid() })
|
|
125
|
+
.merge(productInventoryProfileBaseSchema.partial())
|
|
126
|
+
.superRefine(enforceFefoWhenExpirationTracked)
|
|
127
|
+
|
|
128
|
+
const inventoryLotBaseSchema = scopedSchema.extend({
|
|
129
|
+
catalogVariantId: uuid(),
|
|
130
|
+
sku: z.string().trim().min(1).max(120),
|
|
131
|
+
lotNumber: z.string().trim().min(1).max(120),
|
|
132
|
+
batchNumber: z.string().trim().max(120).optional(),
|
|
133
|
+
manufacturedAt: z.coerce.date().optional(),
|
|
134
|
+
bestBeforeAt: z.coerce.date().optional(),
|
|
135
|
+
expiresAt: z.coerce.date().optional(),
|
|
136
|
+
status: inventoryLotStatusSchema.optional(),
|
|
137
|
+
metadata: metadataSchema,
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
const enforceLotDateOrdering = (
|
|
141
|
+
payload: { manufacturedAt?: Date; bestBeforeAt?: Date; expiresAt?: Date },
|
|
142
|
+
ctx: z.RefinementCtx,
|
|
143
|
+
) => {
|
|
144
|
+
if (payload.manufacturedAt && payload.bestBeforeAt && payload.bestBeforeAt < payload.manufacturedAt) {
|
|
145
|
+
ctx.addIssue({
|
|
146
|
+
code: z.ZodIssueCode.custom,
|
|
147
|
+
path: ['bestBeforeAt'],
|
|
148
|
+
message: 'Best-before date must be on or after manufactured date.',
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
if (payload.bestBeforeAt && payload.expiresAt && payload.expiresAt < payload.bestBeforeAt) {
|
|
152
|
+
ctx.addIssue({
|
|
153
|
+
code: z.ZodIssueCode.custom,
|
|
154
|
+
path: ['expiresAt'],
|
|
155
|
+
message: 'Expiration date must be on or after best-before date.',
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
if (payload.manufacturedAt && payload.expiresAt && payload.expiresAt < payload.manufacturedAt) {
|
|
159
|
+
ctx.addIssue({
|
|
160
|
+
code: z.ZodIssueCode.custom,
|
|
161
|
+
path: ['expiresAt'],
|
|
162
|
+
message: 'Expiration date must be on or after manufactured date.',
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export const inventoryLotCreateSchema = inventoryLotBaseSchema.superRefine(enforceLotDateOrdering)
|
|
168
|
+
|
|
169
|
+
export const inventoryLotUpdateSchema = z
|
|
170
|
+
.object({
|
|
171
|
+
id: uuid(),
|
|
172
|
+
// Optional status-change note merged into lot.metadata.notes by the update command.
|
|
173
|
+
notes: z.string().trim().max(500).optional(),
|
|
174
|
+
})
|
|
175
|
+
.merge(inventoryLotBaseSchema.partial())
|
|
176
|
+
.superRefine(enforceLotDateOrdering)
|
|
177
|
+
|
|
178
|
+
const inventoryLowStockFilterSchema = z.enum(['belowReorder', 'belowSafety'])
|
|
179
|
+
|
|
180
|
+
export const inventoryBalanceListQuerySchema = z.object({
|
|
181
|
+
page: z.coerce.number().min(1).default(1),
|
|
182
|
+
pageSize: z.coerce.number().min(1).max(100).default(25),
|
|
183
|
+
warehouseId: uuid().optional(),
|
|
184
|
+
locationId: uuid().optional(),
|
|
185
|
+
catalogVariantId: uuid().optional(),
|
|
186
|
+
lotId: uuid().optional(),
|
|
187
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
188
|
+
lowStock: inventoryLowStockFilterSchema.optional(),
|
|
189
|
+
search: z.string().optional(),
|
|
190
|
+
}).passthrough()
|
|
191
|
+
|
|
192
|
+
export const inventoryMovementListQuerySchema = z.object({
|
|
193
|
+
page: z.coerce.number().min(1).default(1),
|
|
194
|
+
pageSize: z.coerce.number().min(1).max(100).default(25),
|
|
195
|
+
warehouseId: uuid().optional(),
|
|
196
|
+
locationId: uuid().optional(),
|
|
197
|
+
catalogVariantId: uuid().optional(),
|
|
198
|
+
lotId: uuid().optional(),
|
|
199
|
+
referenceType: inventoryMovementReferenceTypeSchema.optional(),
|
|
200
|
+
referenceId: uuid().optional(),
|
|
201
|
+
type: inventoryMovementTypeSchema.optional(),
|
|
202
|
+
search: z.string().optional(),
|
|
203
|
+
}).passthrough()
|
|
204
|
+
|
|
205
|
+
export const inventoryReservationListQuerySchema = z.object({
|
|
206
|
+
page: z.coerce.number().min(1).default(1),
|
|
207
|
+
pageSize: z.coerce.number().min(1).max(100).default(25),
|
|
208
|
+
warehouseId: uuid().optional(),
|
|
209
|
+
catalogVariantId: uuid().optional(),
|
|
210
|
+
lotId: uuid().optional(),
|
|
211
|
+
sourceType: inventoryReservationSourceTypeSchema.optional(),
|
|
212
|
+
sourceId: uuid().optional(),
|
|
213
|
+
status: inventoryReservationStatusSchema.optional(),
|
|
214
|
+
search: z.string().optional(),
|
|
215
|
+
}).passthrough()
|
|
216
|
+
|
|
217
|
+
export const inventoryReceiveSchema = scopedSchema.extend({
|
|
218
|
+
warehouseId: uuid(),
|
|
219
|
+
locationId: uuid(),
|
|
220
|
+
catalogVariantId: uuid(),
|
|
221
|
+
lotId: uuid().optional(),
|
|
222
|
+
lotNumber: z.string().trim().max(120).optional(),
|
|
223
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
224
|
+
quantity: positiveQuantity,
|
|
225
|
+
referenceType: inventoryMovementReferenceTypeSchema,
|
|
226
|
+
referenceId: uuid(),
|
|
227
|
+
performedBy: uuid(),
|
|
228
|
+
receivedAt: z.coerce.date().optional(),
|
|
229
|
+
performedAt: z.coerce.date().optional(),
|
|
230
|
+
reason: z.string().trim().max(500).optional(),
|
|
231
|
+
metadata: metadataSchema,
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
export const inventoryReservationCreateSchema = scopedSchema.extend({
|
|
235
|
+
warehouseId: uuid(),
|
|
236
|
+
catalogVariantId: uuid(),
|
|
237
|
+
lotId: uuid().optional(),
|
|
238
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
239
|
+
quantity: positiveQuantity,
|
|
240
|
+
sourceType: inventoryReservationSourceTypeSchema,
|
|
241
|
+
sourceId: uuid(),
|
|
242
|
+
expiresAt: z.coerce.date().optional(),
|
|
243
|
+
strategy: inventoryStrategySchema.optional(),
|
|
244
|
+
metadata: metadataSchema,
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
export const inventoryReservationReleaseSchema = scopedSchema.extend({
|
|
248
|
+
reservationId: uuid(),
|
|
249
|
+
reason: z.string().trim().min(1).max(120),
|
|
250
|
+
reasonCode: z.string().trim().max(80).optional(),
|
|
251
|
+
metadata: metadataSchema,
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
export const inventoryReservationAllocateSchema = scopedSchema.extend({
|
|
255
|
+
reservationId: uuid(),
|
|
256
|
+
metadata: metadataSchema,
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
export const inventoryAdjustSchema = scopedSchema.extend({
|
|
260
|
+
warehouseId: uuid(),
|
|
261
|
+
locationId: uuid(),
|
|
262
|
+
catalogVariantId: uuid(),
|
|
263
|
+
lotId: uuid().optional(),
|
|
264
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
265
|
+
delta: numericQuantity.refine((value) => value !== 0, {
|
|
266
|
+
message: 'Inventory delta must be non-zero.',
|
|
267
|
+
}),
|
|
268
|
+
reason: z.string().trim().min(1).max(500),
|
|
269
|
+
reasonCode: z.string().trim().max(80).optional(),
|
|
270
|
+
referenceType: inventoryMovementReferenceTypeSchema.default('manual'),
|
|
271
|
+
referenceId: uuid(),
|
|
272
|
+
performedBy: uuid(),
|
|
273
|
+
performedAt: z.coerce.date().optional(),
|
|
274
|
+
metadata: metadataSchema,
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
export const inventoryMoveSchema = scopedSchema.extend({
|
|
278
|
+
warehouseId: uuid(),
|
|
279
|
+
fromLocationId: uuid(),
|
|
280
|
+
toLocationId: uuid(),
|
|
281
|
+
catalogVariantId: uuid(),
|
|
282
|
+
lotId: uuid().optional(),
|
|
283
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
284
|
+
quantity: positiveQuantity,
|
|
285
|
+
type: inventoryMovementTypeSchema.optional(),
|
|
286
|
+
reason: z.string().trim().min(1).max(500),
|
|
287
|
+
reasonCode: z.string().trim().max(80).optional(),
|
|
288
|
+
referenceType: inventoryMovementReferenceTypeSchema.default('manual'),
|
|
289
|
+
referenceId: uuid(),
|
|
290
|
+
performedBy: uuid(),
|
|
291
|
+
performedAt: z.coerce.date().optional(),
|
|
292
|
+
metadata: metadataSchema,
|
|
293
|
+
})
|
|
294
|
+
|
|
295
|
+
export const inventoryCycleCountSchema = scopedSchema.extend({
|
|
296
|
+
warehouseId: uuid(),
|
|
297
|
+
locationId: uuid(),
|
|
298
|
+
catalogVariantId: uuid(),
|
|
299
|
+
lotId: uuid().optional(),
|
|
300
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
301
|
+
countedQuantity: nonNegativeQuantity,
|
|
302
|
+
autoAdjust: z.boolean().default(true),
|
|
303
|
+
reason: z.string().trim().min(1).max(500),
|
|
304
|
+
referenceId: uuid(),
|
|
305
|
+
performedBy: uuid(),
|
|
306
|
+
performedAt: z.coerce.date().optional(),
|
|
307
|
+
metadata: metadataSchema,
|
|
308
|
+
})
|
|
309
|
+
|
|
310
|
+
export const inventoryMovementCreateSchema = scopedSchema.extend({
|
|
311
|
+
warehouseId: uuid(),
|
|
312
|
+
locationFromId: uuid().optional(),
|
|
313
|
+
locationToId: uuid().optional(),
|
|
314
|
+
catalogVariantId: uuid(),
|
|
315
|
+
lotId: uuid().optional(),
|
|
316
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
317
|
+
quantity: positiveQuantity,
|
|
318
|
+
type: inventoryMovementTypeSchema,
|
|
319
|
+
referenceType: inventoryMovementReferenceTypeSchema,
|
|
320
|
+
referenceId: uuid(),
|
|
321
|
+
performedBy: uuid(),
|
|
322
|
+
performedAt: z.coerce.date(),
|
|
323
|
+
receivedAt: z.coerce.date(),
|
|
324
|
+
reason: z.string().trim().max(500).optional(),
|
|
325
|
+
metadata: metadataSchema,
|
|
326
|
+
})
|
|
327
|
+
|
|
328
|
+
export type WarehouseCreateInput = z.infer<typeof warehouseCreateSchema>
|
|
329
|
+
export type WarehouseUpdateInput = z.infer<typeof warehouseUpdateSchema>
|
|
330
|
+
export type WarehouseZoneCreateInput = z.infer<typeof warehouseZoneCreateSchema>
|
|
331
|
+
export type WarehouseZoneUpdateInput = z.infer<typeof warehouseZoneUpdateSchema>
|
|
332
|
+
export type WarehouseLocationCreateInput = z.infer<typeof warehouseLocationCreateSchema>
|
|
333
|
+
export type WarehouseLocationUpdateInput = z.infer<typeof warehouseLocationUpdateSchema>
|
|
334
|
+
export type ProductInventoryProfileCreateInput = z.infer<typeof productInventoryProfileCreateSchema>
|
|
335
|
+
export type ProductInventoryProfileUpdateInput = z.infer<typeof productInventoryProfileUpdateSchema>
|
|
336
|
+
export type InventoryLotCreateInput = z.infer<typeof inventoryLotCreateSchema>
|
|
337
|
+
export type InventoryLotUpdateInput = z.infer<typeof inventoryLotUpdateSchema>
|
|
338
|
+
export type InventoryReceiveInput = z.infer<typeof inventoryReceiveSchema>
|
|
339
|
+
export type InventoryReservationCreateInput = z.infer<typeof inventoryReservationCreateSchema>
|
|
340
|
+
export type InventoryReservationReleaseInput = z.infer<typeof inventoryReservationReleaseSchema>
|
|
341
|
+
export type InventoryReservationAllocateInput = z.infer<typeof inventoryReservationAllocateSchema>
|
|
342
|
+
export type InventoryAdjustInput = z.infer<typeof inventoryAdjustSchema>
|
|
343
|
+
export type InventoryMoveInput = z.infer<typeof inventoryMoveSchema>
|
|
344
|
+
export type InventoryCycleCountInput = z.infer<typeof inventoryCycleCountSchema>
|
|
345
|
+
|
|
346
|
+
export const salesOrderWarehouseAssignBodySchema = scopedSchema.extend({
|
|
347
|
+
warehouseId: uuid(),
|
|
348
|
+
notes: z.string().trim().max(500).optional(),
|
|
349
|
+
metadata: metadataSchema,
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
export const salesOrderWarehouseAssignSchema = salesOrderWarehouseAssignBodySchema.extend({
|
|
353
|
+
salesOrderId: uuid(),
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
export const salesOrderWarehouseUnassignSchema = scopedSchema.extend({
|
|
357
|
+
salesOrderId: uuid(),
|
|
358
|
+
metadata: metadataSchema,
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
export type SalesOrderWarehouseAssignInput = z.infer<typeof salesOrderWarehouseAssignSchema>
|
|
362
|
+
export type SalesOrderWarehouseUnassignInput = z.infer<typeof salesOrderWarehouseUnassignSchema>
|
|
363
|
+
|
|
364
|
+
export const inventoryImportRawRowSchema = z.object({
|
|
365
|
+
warehouseCode: z.string().trim().optional(),
|
|
366
|
+
warehouseId: uuid().optional(),
|
|
367
|
+
locationCode: z.string().trim().optional(),
|
|
368
|
+
locationId: uuid().optional(),
|
|
369
|
+
sku: z.string().trim().optional(),
|
|
370
|
+
catalogVariantId: uuid().optional(),
|
|
371
|
+
quantity: z.string().trim().optional(),
|
|
372
|
+
lotNumber: z.string().trim().optional(),
|
|
373
|
+
lotId: uuid().optional(),
|
|
374
|
+
serialNumber: z.string().trim().optional(),
|
|
375
|
+
})
|
|
376
|
+
|
|
377
|
+
export const inventoryImportModeSchema = z.enum(['additive', 'reconcile']).default('additive')
|
|
378
|
+
|
|
379
|
+
export const inventoryImportValidateSchema = scopedSchema.extend({
|
|
380
|
+
importBatchId: uuid().optional(),
|
|
381
|
+
skipDuplicates: z.boolean().optional(),
|
|
382
|
+
mode: inventoryImportModeSchema,
|
|
383
|
+
rows: z.array(inventoryImportRawRowSchema).min(1).max(5000),
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
export const inventoryImportApplyRowSchema = z.object({
|
|
387
|
+
rowNumber: z.number().int().positive(),
|
|
388
|
+
warehouseId: uuid(),
|
|
389
|
+
locationId: uuid(),
|
|
390
|
+
catalogVariantId: uuid(),
|
|
391
|
+
quantity: nonNegativeQuantity,
|
|
392
|
+
delta: numericQuantity,
|
|
393
|
+
lotId: uuid().optional(),
|
|
394
|
+
serialNumber: z.string().trim().max(120).optional(),
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
export const inventoryImportApplySchema = scopedSchema.extend({
|
|
398
|
+
importBatchId: uuid(),
|
|
399
|
+
reason: z.string().trim().min(1).max(500).default('CSV import inventory receipt'),
|
|
400
|
+
continueOnError: z.boolean().optional(),
|
|
401
|
+
mode: inventoryImportModeSchema,
|
|
402
|
+
rows: z.array(inventoryImportApplyRowSchema).min(1).max(5000),
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
export type InventoryImportApplyServerInput = z.infer<typeof inventoryImportApplySchema> & {
|
|
406
|
+
performedBy: string
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export type InventoryImportMode = z.infer<typeof inventoryImportModeSchema>
|
|
410
|
+
export type InventoryImportValidateInput = z.infer<typeof inventoryImportValidateSchema>
|
|
411
|
+
export type InventoryImportApplyInput = InventoryImportApplyServerInput
|
|
412
|
+
export type InventoryImportApplyRowInput = z.infer<typeof inventoryImportApplyRowSchema>
|
|
413
|
+
|
|
414
|
+
export const operationalDashboardQuerySchema = z.object({
|
|
415
|
+
warehouseId: z.string().uuid().optional(),
|
|
416
|
+
})
|
|
417
|
+
|
|
418
|
+
export const operationalDashboardKpiSchema = z.object({
|
|
419
|
+
id: z.enum(['lowStock', 'reorderCritical', 'expiringSoon', 'pastDue', 'agingReservations', 'todaysMoves']),
|
|
420
|
+
count: z.number(),
|
|
421
|
+
deltaSinceYesterday: z.number().nullable(),
|
|
422
|
+
sparkline: z.array(z.number()),
|
|
423
|
+
})
|
|
424
|
+
|
|
425
|
+
export const operationalDashboardExpiryLotSchema = z.object({
|
|
426
|
+
id: z.string().uuid(),
|
|
427
|
+
lotNumber: z.string(),
|
|
428
|
+
sku: z.string(),
|
|
429
|
+
expiresAt: z.string(),
|
|
430
|
+
availableQuantity: z.number(),
|
|
431
|
+
category: z.enum(['expiringSoon', 'pastDue']),
|
|
432
|
+
})
|
|
433
|
+
|
|
434
|
+
export const operationalDashboardResponseSchema = z.object({
|
|
435
|
+
lastUpdatedAt: z.string(),
|
|
436
|
+
warehouseId: z.string().uuid().nullable(),
|
|
437
|
+
kpis: z.array(operationalDashboardKpiSchema),
|
|
438
|
+
expiryLots: z.array(operationalDashboardExpiryLotSchema),
|
|
439
|
+
monthlyTrends: z.array(
|
|
440
|
+
z.object({
|
|
441
|
+
month: z.string(),
|
|
442
|
+
receive: z.number(),
|
|
443
|
+
allocate: z.number(),
|
|
444
|
+
}),
|
|
445
|
+
),
|
|
446
|
+
recentActivity: z.array(
|
|
447
|
+
z.object({
|
|
448
|
+
id: z.string().uuid(),
|
|
449
|
+
movementType: z.string(),
|
|
450
|
+
quantity: z.number(),
|
|
451
|
+
variantSku: z.string().nullable(),
|
|
452
|
+
variantId: z.string().uuid(),
|
|
453
|
+
referenceType: z.string().nullable(),
|
|
454
|
+
referenceId: z.string().nullable(),
|
|
455
|
+
reason: z.string().nullable(),
|
|
456
|
+
locationLabel: z.string(),
|
|
457
|
+
performedAt: z.string(),
|
|
458
|
+
}),
|
|
459
|
+
),
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
export type OperationalDashboardQueryInput = z.infer<typeof operationalDashboardQuerySchema>
|
|
463
|
+
export type OperationalDashboardResponse = z.infer<typeof operationalDashboardResponseSchema>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { asValue } from 'awilix'
|
|
2
|
+
import type { AppContainer } from '@open-mercato/shared/lib/di/container'
|
|
3
|
+
import {
|
|
4
|
+
InventoryBalance,
|
|
5
|
+
InventoryLot,
|
|
6
|
+
InventoryMovement,
|
|
7
|
+
InventoryReservation,
|
|
8
|
+
ProductInventoryProfile,
|
|
9
|
+
Warehouse,
|
|
10
|
+
WarehouseLocation,
|
|
11
|
+
WarehouseZone,
|
|
12
|
+
} from './data/entities'
|
|
13
|
+
|
|
14
|
+
export function register(container: AppContainer) {
|
|
15
|
+
container.register({
|
|
16
|
+
Warehouse: asValue(Warehouse),
|
|
17
|
+
WarehouseZone: asValue(WarehouseZone),
|
|
18
|
+
WarehouseLocation: asValue(WarehouseLocation),
|
|
19
|
+
ProductInventoryProfile: asValue(ProductInventoryProfile),
|
|
20
|
+
InventoryLot: asValue(InventoryLot),
|
|
21
|
+
InventoryBalance: asValue(InventoryBalance),
|
|
22
|
+
InventoryReservation: asValue(InventoryReservation),
|
|
23
|
+
InventoryMovement: asValue(InventoryMovement),
|
|
24
|
+
})
|
|
25
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createModuleEvents } from '@open-mercato/shared/modules/events'
|
|
2
|
+
|
|
3
|
+
const events = [
|
|
4
|
+
{ id: 'wms.warehouse.created', label: 'Warehouse Created', entity: 'warehouse', category: 'crud' },
|
|
5
|
+
{ id: 'wms.warehouse.updated', label: 'Warehouse Updated', entity: 'warehouse', category: 'crud' },
|
|
6
|
+
{ id: 'wms.zone.created', label: 'Warehouse Zone Created', entity: 'zone', category: 'crud' },
|
|
7
|
+
{ id: 'wms.zone.updated', label: 'Warehouse Zone Updated', entity: 'zone', category: 'crud' },
|
|
8
|
+
{ id: 'wms.location.created', label: 'Warehouse Location Created', entity: 'location', category: 'crud' },
|
|
9
|
+
{ id: 'wms.location.updated', label: 'Warehouse Location Updated', entity: 'location', category: 'crud' },
|
|
10
|
+
{ id: 'wms.inventory_profile.created', label: 'Inventory Profile Created', entity: 'inventory_profile', category: 'crud' },
|
|
11
|
+
{ id: 'wms.inventory_profile.updated', label: 'Inventory Profile Updated', entity: 'inventory_profile', category: 'crud' },
|
|
12
|
+
{ id: 'wms.inventory_balance.created', label: 'Inventory Balance Created', entity: 'inventory_balance', category: 'crud' },
|
|
13
|
+
{ id: 'wms.inventory_balance.updated', label: 'Inventory Balance Updated', entity: 'inventory_balance', category: 'crud' },
|
|
14
|
+
{ id: 'wms.inventory_balance.deleted', label: 'Inventory Balance Deleted', entity: 'inventory_balance', category: 'crud' },
|
|
15
|
+
{ id: 'wms.inventory_reservation.created', label: 'Inventory Reservation Created', entity: 'inventory_reservation', category: 'crud' },
|
|
16
|
+
{ id: 'wms.inventory_reservation.updated', label: 'Inventory Reservation Updated', entity: 'inventory_reservation', category: 'crud' },
|
|
17
|
+
{ id: 'wms.inventory_reservation.deleted', label: 'Inventory Reservation Deleted', entity: 'inventory_reservation', category: 'crud' },
|
|
18
|
+
{ id: 'wms.inventory_movement.created', label: 'Inventory Movement Created', entity: 'inventory_movement', category: 'crud' },
|
|
19
|
+
{ id: 'wms.inventory_movement.updated', label: 'Inventory Movement Updated', entity: 'inventory_movement', category: 'crud' },
|
|
20
|
+
{ id: 'wms.inventory_movement.deleted', label: 'Inventory Movement Deleted', entity: 'inventory_movement', category: 'crud' },
|
|
21
|
+
{ id: 'wms.inventory.received', label: 'Inventory Received', entity: 'inventory', category: 'custom' },
|
|
22
|
+
{ id: 'wms.inventory.adjusted', label: 'Inventory Adjusted', entity: 'inventory', category: 'custom' },
|
|
23
|
+
{ id: 'wms.inventory.reserved', label: 'Inventory Reserved', entity: 'inventory', category: 'custom' },
|
|
24
|
+
{ id: 'wms.inventory.released', label: 'Inventory Released', entity: 'inventory', category: 'custom' },
|
|
25
|
+
{ id: 'wms.inventory.allocated', label: 'Inventory Allocated', entity: 'inventory', category: 'custom' },
|
|
26
|
+
{ id: 'wms.inventory.moved', label: 'Inventory Moved', entity: 'inventory', category: 'custom' },
|
|
27
|
+
{ id: 'wms.inventory.reconciled', label: 'Inventory Reconciled', entity: 'inventory', category: 'custom' },
|
|
28
|
+
{ id: 'wms.inventory.low_stock', label: 'Inventory Low Stock', entity: 'inventory', category: 'lifecycle' },
|
|
29
|
+
{ id: 'wms.inventory.balance_drift', label: 'Inventory Balance Drift', entity: 'inventory', category: 'lifecycle' },
|
|
30
|
+
{ id: 'wms.inventory.reservation_shortfall', label: 'Inventory Reservation Shortfall', entity: 'inventory', category: 'lifecycle' },
|
|
31
|
+
] as const
|
|
32
|
+
|
|
33
|
+
export const eventsConfig = createModuleEvents({
|
|
34
|
+
moduleId: 'wms',
|
|
35
|
+
events,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export const emitWmsEvent = eventsConfig.emit
|
|
39
|
+
export type WmsEventId = typeof events[number]['id']
|
|
40
|
+
|
|
41
|
+
export default eventsConfig
|