@flowselections/floriday-voorraad 1.0.158 → 1.0.164
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/dist-lib/components/fs-ui/ArtikelFoto.d.ts +9 -0
- package/dist-lib/components/fs-ui/ArtikelFoto.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/ArtikelFoto.js +11 -0
- package/dist-lib/components/fs-ui/DataTable.d.ts +1 -1
- package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/EmptyState.d.ts +1 -1
- package/dist-lib/components/fs-ui/EmptyState.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/FilterChips.d.ts +1 -1
- package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/FilterPanel.d.ts +2 -2
- package/dist-lib/components/fs-ui/FilterPanel.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/FiltersButton.d.ts +1 -1
- package/dist-lib/components/fs-ui/FiltersButton.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/FustNaam.d.ts +7 -0
- package/dist-lib/components/fs-ui/FustNaam.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/FustNaam.js +7 -0
- package/dist-lib/components/fs-ui/HeaderButton.d.ts +2 -2
- package/dist-lib/components/fs-ui/HeaderButton.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/HoverTip.d.ts +1 -1
- package/dist-lib/components/fs-ui/HoverTip.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/InlineAlert.d.ts +1 -1
- package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/KpiRow.d.ts +1 -1
- package/dist-lib/components/fs-ui/KpiRow.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/KpiTile.d.ts +1 -1
- package/dist-lib/components/fs-ui/KpiTile.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts +1 -1
- package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/NoticeBar.d.ts +1 -1
- package/dist-lib/components/fs-ui/NoticeBar.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/PageHeader.d.ts +1 -1
- package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/Pagination.d.ts +1 -1
- package/dist-lib/components/fs-ui/Pagination.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/PillTabs.d.ts +1 -1
- package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/RowMenu.d.ts +1 -1
- package/dist-lib/components/fs-ui/RowMenu.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/SearchInput.d.ts +1 -1
- package/dist-lib/components/fs-ui/SearchInput.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/ShortcutHelp.d.ts +1 -1
- package/dist-lib/components/fs-ui/ShortcutHelp.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/StatusIcon.d.ts +1 -1
- package/dist-lib/components/fs-ui/StatusIcon.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/TableSkeleton.d.ts +1 -1
- package/dist-lib/components/fs-ui/TableSkeleton.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/Toolbar.d.ts +1 -1
- package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -1
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts +1 -1
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -1
- package/dist-lib/components/voorraad/AdditionalPackagingDialog.d.ts +1 -1
- package/dist-lib/components/voorraad/AdditionalPackagingDialog.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ArtikelCompositionCard.d.ts +1 -1
- package/dist-lib/components/voorraad/ArtikelCompositionCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ArtikelWizard.d.ts +1 -1
- package/dist-lib/components/voorraad/ArtikelWizard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ArtikelWizard.js +5 -4
- package/dist-lib/components/voorraad/CollapsibleText.d.ts +1 -1
- package/dist-lib/components/voorraad/CollapsibleText.d.ts.map +1 -1
- package/dist-lib/components/voorraad/EditArtikelPage.d.ts +1 -1
- package/dist-lib/components/voorraad/EditArtikelPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ExcelExportButton.d.ts +1 -1
- package/dist-lib/components/voorraad/ExcelExportButton.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FloridayConnectionNotice.d.ts +1 -1
- package/dist-lib/components/voorraad/FloridayConnectionNotice.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FloridayInfoCard.d.ts +1 -1
- package/dist-lib/components/voorraad/FloridayInfoCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FloridayLoadCarriers.d.ts +1 -1
- package/dist-lib/components/voorraad/FloridayLoadCarriers.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FloridaySentCard.d.ts +1 -1
- package/dist-lib/components/voorraad/FloridaySentCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FloridayTakeoverPanel.d.ts +2 -2
- package/dist-lib/components/voorraad/FloridayTakeoverPanel.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FloridayTakeoverPanel.js +9 -2
- package/dist-lib/components/voorraad/FustAdministratie.d.ts +2 -2
- package/dist-lib/components/voorraad/FustAdministratie.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FustAdministratie.js +2 -1
- package/dist-lib/components/voorraad/FustenPage.d.ts +1 -1
- package/dist-lib/components/voorraad/FustenPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FustenPage.js +4 -2
- package/dist-lib/components/voorraad/InventorySettingsDrawer.d.ts +1 -1
- package/dist-lib/components/voorraad/InventorySettingsDrawer.d.ts.map +1 -1
- package/dist-lib/components/voorraad/InventoryStatusBadge.d.ts +1 -1
- package/dist-lib/components/voorraad/InventoryStatusBadge.d.ts.map +1 -1
- package/dist-lib/components/voorraad/KoppelingStatusPanel.d.ts +1 -1
- package/dist-lib/components/voorraad/KoppelingStatusPanel.d.ts.map +1 -1
- package/dist-lib/components/voorraad/NieuwArtikelPage.d.ts +1 -1
- package/dist-lib/components/voorraad/NieuwArtikelPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/NieuwArtikelPage.js +2 -1
- package/dist-lib/components/voorraad/OrderHistoryCard.d.ts +1 -1
- package/dist-lib/components/voorraad/OrderHistoryCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/PriceStatusBadge.d.ts +1 -1
- package/dist-lib/components/voorraad/PriceStatusBadge.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductCustomFieldsCard.d.ts +1 -1
- package/dist-lib/components/voorraad/ProductCustomFieldsCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductLinkCard.d.ts +1 -1
- package/dist-lib/components/voorraad/ProductLinkCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductSalePriceField.d.ts +2 -2
- package/dist-lib/components/voorraad/ProductSalePriceField.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductStructureCard.d.ts +2 -2
- package/dist-lib/components/voorraad/ProductStructureCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/PublicatiesPage.d.ts +1 -1
- package/dist-lib/components/voorraad/PublicatiesPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/PublishProgressCard.d.ts +1 -1
- package/dist-lib/components/voorraad/PublishProgressCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/PublishReadinessCard.d.ts +1 -1
- package/dist-lib/components/voorraad/PublishReadinessCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/Sneltoetsen.d.ts +2 -2
- package/dist-lib/components/voorraad/Sneltoetsen.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StepSamenstelling.d.ts +1 -1
- package/dist-lib/components/voorraad/StepSamenstelling.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockBulkButtons.d.ts +1 -1
- package/dist-lib/components/voorraad/StockBulkButtons.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockHistoryChart.d.ts +1 -1
- package/dist-lib/components/voorraad/StockHistoryChart.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockMutationHistoryCard.d.ts +1 -1
- package/dist-lib/components/voorraad/StockMutationHistoryCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockPushMonitor.d.ts +1 -1
- package/dist-lib/components/voorraad/StockPushMonitor.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockSyncStatus.d.ts +1 -1
- package/dist-lib/components/voorraad/StockSyncStatus.d.ts.map +1 -1
- package/dist-lib/components/voorraad/SupplyReadScopeAlert.d.ts +1 -1
- package/dist-lib/components/voorraad/SupplyReadScopeAlert.d.ts.map +1 -1
- package/dist-lib/components/voorraad/TelmomentButton.d.ts +1 -1
- package/dist-lib/components/voorraad/TelmomentButton.d.ts.map +1 -1
- package/dist-lib/components/voorraad/TrayStickerCard.d.ts +1 -1
- package/dist-lib/components/voorraad/TrayStickerCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts +1 -1
- package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ValidationPage.d.ts +1 -1
- package/dist-lib/components/voorraad/ValidationPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadBeheerCard.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadBeheerCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadPage.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadPagination.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadPagination.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadStockCard.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadStockCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadSturingCard.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadSturingCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadTable.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadTable.js +6 -3
- package/dist-lib/components/voorraad/VoorraadVeldenCard.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadVeldenCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/__tests__/count-stock-free.test.d.ts +2 -0
- package/dist-lib/components/voorraad/__tests__/count-stock-free.test.d.ts.map +1 -0
- package/dist-lib/components/voorraad/__tests__/count-stock-free.test.js +12 -0
- package/dist-lib/components/voorraad/artikel/ArtikelPagina.d.ts +1 -1
- package/dist-lib/components/voorraad/artikel/ArtikelPagina.d.ts.map +1 -1
- package/dist-lib/components/voorraad/artikel/ArtikelPagina.js +2 -1
- package/dist-lib/components/voorraad/artikel/TwijfelKiezen.d.ts +1 -1
- package/dist-lib/components/voorraad/artikel/TwijfelKiezen.d.ts.map +1 -1
- package/dist-lib/components/voorraad/lijst/ImporteerKnop.d.ts +1 -1
- package/dist-lib/components/voorraad/lijst/ImporteerKnop.d.ts.map +1 -1
- package/dist-lib/components/voorraad/lijst/LijstExportKnop.d.ts +1 -1
- package/dist-lib/components/voorraad/lijst/LijstExportKnop.d.ts.map +1 -1
- package/dist-lib/components/voorraad/lijst/SnelActieDialogen.d.ts +2 -2
- package/dist-lib/components/voorraad/lijst/SnelActieDialogen.d.ts.map +1 -1
- package/dist-lib/components/voorraad/lijst/VoorraadLijstTabel.d.ts +2 -2
- package/dist-lib/components/voorraad/lijst/VoorraadLijstTabel.d.ts.map +1 -1
- package/dist-lib/components/voorraad/lijst/VoorraadLijstTabel.js +3 -2
- package/dist-lib/hooks/useInventorySettings.d.ts.map +1 -1
- package/dist-lib/hooks/useInventorySettings.js +5 -3
- package/dist-lib/integrations/supabase/client.js +1 -1
- package/dist-lib/integrations/supabase/client.server.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +724 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/__tests__/article-code.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/article-code.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/article-code.test.js +11 -0
- package/dist-lib/lib/__tests__/erp-test-123.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/erp-test-123.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/erp-test-123.test.js +43 -0
- package/dist-lib/lib/__tests__/floricode-required-features.test.js +7 -3
- package/dist-lib/lib/__tests__/floriday-customer-offers.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/floriday-customer-offers.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/floriday-customer-offers.test.js +36 -0
- package/dist-lib/lib/__tests__/floriday-fetch-status.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/floriday-fetch-status.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/floriday-fetch-status.test.js +25 -0
- package/dist-lib/lib/__tests__/floriday-write-mode.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/floriday-write-mode.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/floriday-write-mode.test.js +40 -0
- package/dist-lib/lib/__tests__/fust-dimensions.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/fust-dimensions.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/fust-dimensions.test.js +27 -0
- package/dist-lib/lib/__tests__/load-carriers.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/load-carriers.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/load-carriers.test.js +15 -0
- package/dist-lib/lib/__tests__/mirror-products.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/mirror-products.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/mirror-products.test.js +13 -0
- package/dist-lib/lib/__tests__/product-packings.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/product-packings.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/product-packings.test.js +42 -0
- package/dist-lib/lib/__tests__/publish-114.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/publish-114.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/publish-114.test.js +31 -0
- package/dist-lib/lib/__tests__/publish-packing-block.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/publish-packing-block.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/publish-packing-block.test.js +14 -0
- package/dist-lib/lib/__tests__/release-130.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/release-130.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/release-130.test.js +103 -0
- package/dist-lib/lib/__tests__/release-134.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/release-134.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/release-134.test.js +50 -0
- package/dist-lib/lib/__tests__/release-136.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/release-136.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/release-136.test.js +36 -0
- package/dist-lib/lib/__tests__/release-140.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/release-140.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/release-140.test.js +42 -0
- package/dist-lib/lib/__tests__/request-guard.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/request-guard.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/request-guard.test.js +50 -0
- package/dist-lib/lib/__tests__/stock-save.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/stock-save.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/stock-save.test.js +35 -0
- package/dist-lib/lib/__tests__/stock-scope.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/stock-scope.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/stock-scope.test.js +44 -0
- package/dist-lib/lib/artikel-pagina.d.ts +1 -0
- package/dist-lib/lib/artikel-pagina.d.ts.map +1 -1
- package/dist-lib/lib/artikel-pagina.js +1 -1
- package/dist-lib/lib/floriday-takeover-core.d.ts +0 -13
- package/dist-lib/lib/floriday-takeover-core.d.ts.map +1 -1
- package/dist-lib/lib/floriday-takeover-core.js +10 -9
- package/dist-lib/lib/foto-reden.d.ts +26 -0
- package/dist-lib/lib/foto-reden.d.ts.map +1 -0
- package/dist-lib/lib/foto-reden.js +39 -0
- package/dist-lib/lib/fust-label.d.ts +3 -0
- package/dist-lib/lib/fust-label.d.ts.map +1 -0
- package/dist-lib/lib/fust-label.js +8 -0
- package/dist-lib/lib/fusten.d.ts.map +1 -1
- package/dist-lib/lib/fusten.js +12 -12
- package/dist-lib/lib/voorraad-lijst.d.ts +2 -0
- package/dist-lib/lib/voorraad-lijst.d.ts.map +1 -1
- package/dist-lib/server-hooks/__tests__/trade-item-photo.test.d.ts +2 -0
- package/dist-lib/server-hooks/__tests__/trade-item-photo.test.d.ts.map +1 -0
- package/dist-lib/server-hooks/__tests__/trade-item-photo.test.js +19 -0
- package/dist-lib/server-hooks/floriday-follow.d.ts.map +1 -1
- package/dist-lib/server-hooks/floriday-follow.js +5 -3
- package/package.json +35 -2
- package/sql/floriday-voorraad-schema.sql +44 -5
- package/dist-lib/components/TemplatePage.d.ts +0 -2
- package/dist-lib/components/TemplatePage.d.ts.map +0 -1
- package/dist-lib/components/TemplatePage.js +0 -4
- package/dist-lib/components/settings/VoorraadSettingsCard.d.ts +0 -2
- package/dist-lib/components/settings/VoorraadSettingsCard.d.ts.map +0 -1
- package/dist-lib/components/settings/VoorraadSettingsCard.js +0 -39
- package/dist-lib/components/voorraad/ConnectionBadge.d.ts +0 -6
- package/dist-lib/components/voorraad/ConnectionBadge.d.ts.map +0 -1
- package/dist-lib/components/voorraad/ConnectionBadge.js +0 -12
- package/dist-lib/components/voorraad/ConnectionPicker.d.ts +0 -8
- package/dist-lib/components/voorraad/ConnectionPicker.d.ts.map +0 -1
- package/dist-lib/components/voorraad/ConnectionPicker.js +0 -8
- package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts +0 -4
- package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts.map +0 -1
- package/dist-lib/components/voorraad/FloridayStatusBadge.js +0 -8
- package/dist-lib/components/voorraad/ModuleHealthCard.d.ts +0 -2
- package/dist-lib/components/voorraad/ModuleHealthCard.d.ts.map +0 -1
- package/dist-lib/components/voorraad/ModuleHealthCard.js +0 -40
- package/dist-lib/components/voorraad/VoorraadDashboard.d.ts +0 -10
- package/dist-lib/components/voorraad/VoorraadDashboard.d.ts.map +0 -1
- package/dist-lib/components/voorraad/VoorraadDashboard.js +0 -53
- package/dist-lib/lib/floriday-field-sources.d.ts +0 -18
- package/dist-lib/lib/floriday-field-sources.d.ts.map +0 -1
- package/dist-lib/lib/floriday-field-sources.js +0 -45
- package/dist-lib/lib/floriday-schema-to-zod.d.ts +0 -9
- package/dist-lib/lib/floriday-schema-to-zod.d.ts.map +0 -1
- package/dist-lib/lib/floriday-schema-to-zod.js +0 -53
- package/dist-lib/lib/merge-products.d.ts +0 -8
- package/dist-lib/lib/merge-products.d.ts.map +0 -1
- package/dist-lib/lib/merge-products.js +0 -17
- package/dist-lib/lib/module-health.functions.d.ts +0 -53497
- package/dist-lib/lib/module-health.functions.d.ts.map +0 -1
- package/dist-lib/lib/module-health.functions.js +0 -261
- package/dist-lib/lib/validationSchemas.d.ts +0 -15
- package/dist-lib/lib/validationSchemas.d.ts.map +0 -1
- package/dist-lib/lib/validationSchemas.js +0 -25
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-code.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/article-code.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { articleCodeProblem } from "../article-code.js";
|
|
3
|
+
describe("artikelcode-controle", () => {
|
|
4
|
+
it("weigert Artikelcode", () => expect(articleCodeProblem("Artikelcode", "Strelitzia")).not.toBeNull());
|
|
5
|
+
it("weigert Naam", () => expect(articleCodeProblem(" naam ", "X")).not.toBeNull());
|
|
6
|
+
it("weigert test", () => expect(articleCodeProblem("TEST", "X")).not.toBeNull());
|
|
7
|
+
it("weigert leeg", () => expect(articleCodeProblem(" ", "X")).not.toBeNull());
|
|
8
|
+
it("staat TQA2710G toe", () => expect(articleCodeProblem("TQA2710G", "Gaultheria")).toBeNull());
|
|
9
|
+
it("weigert code gelijk aan naam bij handmatig", () => expect(articleCodeProblem("Strelitzia", "strelitzia", "manual")).not.toBeNull());
|
|
10
|
+
it("staat code gelijk aan naam toe bij import", () => expect(articleCodeProblem("Strelitzia", "strelitzia", "import")).toBeNull());
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erp-test-123.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/erp-test-123.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { resolveBuyerOrganizations, isMissingFunctionError } from "../buyer-organizations.js";
|
|
3
|
+
import { missingPackingFields, simplePackingToRow, engineOordeelRegel, ENGINE_CARRIER_CODE } from "../simple-packing.js";
|
|
4
|
+
const cache = async () => ["cache-1"];
|
|
5
|
+
describe("kopers: vaste zoekvolgorde", () => {
|
|
6
|
+
it("expliciete keuze gaat voor alles", async () => {
|
|
7
|
+
const r = await resolveBuyerOrganizations({ explicit: ["a"], priceGroupCustomers: ["b"], authFunction: ["c"], connectionsCache: cache });
|
|
8
|
+
expect(r).toMatchObject({ ids: ["a"], source: "keuze" });
|
|
9
|
+
});
|
|
10
|
+
it("zonder keuze: klanten van de prijsgroep", async () => {
|
|
11
|
+
const r = await resolveBuyerOrganizations({ explicit: [], priceGroupCustomers: ["b", "b", "b2"], authFunction: ["c"], connectionsCache: cache });
|
|
12
|
+
expect(r).toMatchObject({ ids: ["b", "b2"], source: "prijsgroep" });
|
|
13
|
+
});
|
|
14
|
+
it("daarna floriday_buyer_organizations, ook als die leeg is (geen terugval op de oude cache)", async () => {
|
|
15
|
+
const r = await resolveBuyerOrganizations({ explicit: [], priceGroupCustomers: [], authFunction: [], connectionsCache: cache });
|
|
16
|
+
expect(r.source).toBe("geen");
|
|
17
|
+
expect(r.ids).toEqual([]);
|
|
18
|
+
});
|
|
19
|
+
it("alleen als de functie nog niet bestaat: de oude koppelingscache", async () => {
|
|
20
|
+
const r = await resolveBuyerOrganizations({ explicit: [], priceGroupCustomers: [], authFunction: null, connectionsCache: cache });
|
|
21
|
+
expect(r).toMatchObject({ ids: ["cache-1"], source: "floriday_connections_cache" });
|
|
22
|
+
});
|
|
23
|
+
it("herkent een ontbrekende functie", () => {
|
|
24
|
+
expect(isMissingFunctionError({ code: "PGRST202" })).toBe(true);
|
|
25
|
+
expect(isMissingFunctionError({ code: "42501", message: "geen toegang" })).toBe(false);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe("belading in de eenvoudige route", () => {
|
|
29
|
+
const full = { vbnPackageCode: "412", piecesPerPackage: "12", packagesPerLayer: "5", layersPerLoadCarrier: "8", loadCarrier: "DANISH_TROLLEY" };
|
|
30
|
+
it("alle vijf velden verplicht, ook lagen per kar en ladingdrager", () => {
|
|
31
|
+
expect(missingPackingFields({ ...full, layersPerLoadCarrier: "" })).toEqual(["lagen per kar"]);
|
|
32
|
+
expect(missingPackingFields({ ...full, loadCarrier: "" })).toEqual(["ladingdrager"]);
|
|
33
|
+
expect(missingPackingFields(full)).toEqual([]);
|
|
34
|
+
});
|
|
35
|
+
it("geen standaardwaarden: onvolledig = fout", () => {
|
|
36
|
+
expect(() => simplePackingToRow({ ...full, piecesPerPackage: "0" })).toThrow(/planten per fust/);
|
|
37
|
+
});
|
|
38
|
+
it("Deense container (DC) gaat als danish_container naar de Engine", () => {
|
|
39
|
+
expect(ENGINE_CARRIER_CODE.DANISH_TROLLEY).toBe("danish_container");
|
|
40
|
+
expect(engineOordeelRegel("p1", full)).toEqual({ product_id: "p1", carrier_code: "danish_container", plants_per_crate: 12, crates_per_layer: 5, layers_per_cart: 8 });
|
|
41
|
+
expect(simplePackingToRow(full)).toMatchObject({ vbn_package_code: 412, pieces_per_package: 12, packages_per_layer: 5, layers_per_load_carrier: 8, is_primary: true });
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -155,7 +155,8 @@ describe("computeVbnRequiredFeatures — VBN 100023", () => {
|
|
|
155
155
|
});
|
|
156
156
|
it("sorteert verplicht vóór advies", async () => {
|
|
157
157
|
const res = await computeVbnRequiredFeatures(client, "100023");
|
|
158
|
-
|
|
158
|
+
// S62 en S98 eist Floriday altijd (FORCED_REQUIRED), dus ook verplicht.
|
|
159
|
+
expect(res.features.map((f) => f.code)).toEqual(["S01", "S02", "S62", "S98", "S05"]);
|
|
159
160
|
});
|
|
160
161
|
it("levert toegestane waarden per feature (gededupliceerd, zonder vervallen)", async () => {
|
|
161
162
|
const res = await computeVbnRequiredFeatures(client, "100023");
|
|
@@ -163,9 +164,10 @@ describe("computeVbnRequiredFeatures — VBN 100023", () => {
|
|
|
163
164
|
expect(s01?.values.map((v) => v.code).sort()).toEqual(["003", "004"]);
|
|
164
165
|
expect(s01?.values.some((v) => v.code === "999")).toBe(false);
|
|
165
166
|
});
|
|
166
|
-
it("geeft
|
|
167
|
+
it("geeft alleen de door Floriday altijd verplichte kenmerken voor onbekende VBN-code", async () => {
|
|
167
168
|
const res = await computeVbnRequiredFeatures(client, "99999");
|
|
168
|
-
expect(res).
|
|
169
|
+
expect(res.vbnCode).toBe("99999");
|
|
170
|
+
expect(res.features.map((f) => f.code)).toEqual(["S62", "S98"]);
|
|
169
171
|
});
|
|
170
172
|
it("vindt regulatory rows via record_id-prefix als data.product_id ontbreekt", async () => {
|
|
171
173
|
const prefixOnlyClient = makeFakeClient({
|
|
@@ -180,6 +182,8 @@ describe("computeVbnRequiredFeatures — VBN 100023", () => {
|
|
|
180
182
|
expect(res.features.map((f) => [f.code, f.regulation])).toEqual([
|
|
181
183
|
["S01", "required"],
|
|
182
184
|
["S02", "required"],
|
|
185
|
+
["S62", "required"],
|
|
186
|
+
["S98", "required"],
|
|
183
187
|
["S05", "advised"],
|
|
184
188
|
]);
|
|
185
189
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-customer-offers.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/floriday-customer-offers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { customerOffersByTradeItem } from "../floriday-customer-offers.js";
|
|
3
|
+
const NOW = new Date("2026-10-20T10:00:00Z");
|
|
4
|
+
const TID = "AAAAAAAA-1111-2222-3333-444444444444";
|
|
5
|
+
const line = (over = {}) => ({
|
|
6
|
+
tradeItemId: TID,
|
|
7
|
+
pricePerPiece: { value: 0.85, currency: "EUR" },
|
|
8
|
+
numberOfPieces: 500,
|
|
9
|
+
tradePeriod: { startDateTime: "2026-10-01T00:00:00Z", endDateTime: "2026-11-01T00:00:00Z" },
|
|
10
|
+
isDeleted: false,
|
|
11
|
+
...over,
|
|
12
|
+
});
|
|
13
|
+
const offer = (over = {}, lines = [line()]) => ({
|
|
14
|
+
floriday_id: "o1",
|
|
15
|
+
data: { customerOfferId: "o1", customerOfferType: "SUPPLY_REQUEST", isDraft: false, isDeleted: false,
|
|
16
|
+
customerOrganizationId: "CUST-1", customerOfferLines: lines, ...over },
|
|
17
|
+
});
|
|
18
|
+
describe("klantaanbiedingen koppelen op customerOfferLines[].tradeItemId", () => {
|
|
19
|
+
it("koppelt een actuele regel op artikel-id, met klantnaam", () => {
|
|
20
|
+
const m = customerOffersByTradeItem([offer()], new Map([["cust-1", "Plantor"]]), NOW);
|
|
21
|
+
const v = m.get(TID.toLowerCase());
|
|
22
|
+
expect(v).toHaveLength(1);
|
|
23
|
+
expect(v[0].price).toBe(0.85);
|
|
24
|
+
expect(v[0].pieces).toBe(500);
|
|
25
|
+
expect(v[0].customer).toBe("Plantor");
|
|
26
|
+
});
|
|
27
|
+
it("slaat verlopen regels over", () => {
|
|
28
|
+
const m = customerOffersByTradeItem([offer({}, [line({ tradePeriod: { endDateTime: "2024-12-28T00:00:00Z" } })])], new Map(), NOW);
|
|
29
|
+
expect(m.size).toBe(0);
|
|
30
|
+
});
|
|
31
|
+
it("slaat concepten, verwijderde aanbiedingen en verwijderde regels over", () => {
|
|
32
|
+
expect(customerOffersByTradeItem([offer({ isDraft: true })], new Map(), NOW).size).toBe(0);
|
|
33
|
+
expect(customerOffersByTradeItem([offer({ isDeleted: true })], new Map(), NOW).size).toBe(0);
|
|
34
|
+
expect(customerOffersByTradeItem([offer({}, [line({ isDeleted: true })])], new Map(), NOW).size).toBe(0);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-fetch-status.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/floriday-fetch-status.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { fetchState, fetchStateBlocksTakeover } from "../floriday-fetch-status.js";
|
|
3
|
+
const row = (t, done, ok) => ({
|
|
4
|
+
backfill_target_sequence: t, backfill_done_at: done, last_success_at: ok,
|
|
5
|
+
});
|
|
6
|
+
describe("ophaalstatus artikelen", () => {
|
|
7
|
+
it("lopend ophalen blokkeert overnemen", () => {
|
|
8
|
+
expect(fetchState(row(500, null, "2026-10-20"), 120)).toBe("bezig");
|
|
9
|
+
expect(fetchStateBlocksTakeover(fetchState(row(500, null, null), 0))).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
it("nog nooit gestart blokkeert overnemen", () => {
|
|
12
|
+
expect(fetchState(null, 0)).toBe("nooit_gestart");
|
|
13
|
+
expect(fetchState(row(null, null, null), 0)).toBe("nooit_gestart");
|
|
14
|
+
expect(fetchStateBlocksTakeover("nooit_gestart")).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it("na afloop met lege target komt de knop vrij", () => {
|
|
17
|
+
expect(fetchState(row(null, "2026-10-20", "2026-10-20"), 50)).toBe("compleet");
|
|
18
|
+
expect(fetchState(row(500, "2026-10-20", "2026-10-20"), 50)).toBe("compleet");
|
|
19
|
+
expect(fetchStateBlocksTakeover(fetchState(row(null, null, "2026-10-20"), 0))).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
it("koppeling van vóór 1.0.95 zonder backfill is compleet", () => {
|
|
22
|
+
expect(fetchState(row(null, null, "2026-09-01"), 300)).toBe("compleet");
|
|
23
|
+
expect(fetchState(null, 300)).toBe("compleet");
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-write-mode.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/floriday-write-mode.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { gateBlockedText, waitCauseText, WRITE_MODE_UNREADABLE_TEXT } from "../floriday-write-mode.js";
|
|
3
|
+
import { resolveFustDimensions } from "../fusten.js";
|
|
4
|
+
import { loadCarriersFromCache } from "../../components/voorraad/FloridayLoadCarriers.js";
|
|
5
|
+
describe("oorzaak bij wachtende regels", () => {
|
|
6
|
+
it("toont reason als read_only aan staat", () => {
|
|
7
|
+
expect(waitCauseText({ read_only: true, reason: "Alleen lezen staat aan" })).toBe("Alleen lezen staat aan");
|
|
8
|
+
});
|
|
9
|
+
it("toont niets als schrijven aan staat", () => {
|
|
10
|
+
expect(waitCauseText({ read_only: false, reason: null })).toBeNull();
|
|
11
|
+
});
|
|
12
|
+
it("meldt onbekend als lezen mislukt", () => {
|
|
13
|
+
expect(waitCauseText(null)).toBe(WRITE_MODE_UNREADABLE_TEXT);
|
|
14
|
+
});
|
|
15
|
+
it("verpakkingsverschil noemt artikel en verwijst naar Verpakking", () => {
|
|
16
|
+
const t = gateBlockedText({ name: "Roos", code: "R1" });
|
|
17
|
+
expect(t).toContain("Roos (R1)");
|
|
18
|
+
expect(t).toContain("Floriday koppeling → Verpakking");
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe("fustmaten zonder standaardwaarden", () => {
|
|
22
|
+
const fc = new Map([["12", { name: "Deksel", lengthMm: 1000, widthMm: 300, heightMm: null }]]);
|
|
23
|
+
it("Floricode gaat voor, lege maat blijft leeg", () => {
|
|
24
|
+
expect(resolveFustDimensions({ vbn_code: 12, length_mm: null, width_mm: null, height_mm: null }, fc))
|
|
25
|
+
.toEqual({ length_mm: 1000, width_mm: 300, height_mm: null, source: "floricode" });
|
|
26
|
+
});
|
|
27
|
+
it("onbekend fust krijgt geen maten", () => {
|
|
28
|
+
expect(resolveFustDimensions({ vbn_code: 99, length_mm: null, width_mm: null, height_mm: null }, fc))
|
|
29
|
+
.toEqual({ length_mm: null, width_mm: null, height_mm: null, source: "onbekend" });
|
|
30
|
+
});
|
|
31
|
+
it("handmatige maat blijft staan", () => {
|
|
32
|
+
expect(resolveFustDimensions({ vbn_code: 99, length_mm: 500, width_mm: null, height_mm: null }, fc).source).toBe("handmatig");
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
describe("ladingdrager uit de Floriday-gegevens", () => {
|
|
36
|
+
it("leest loadCarrier per verpakking, leeg blijft leeg", () => {
|
|
37
|
+
expect(loadCarriersFromCache({ packingConfigurations: [{ loadCarrier: "DANISH_TROLLEY", primary: true }, {}] }))
|
|
38
|
+
.toEqual([{ loadCarrier: "DANISH_TROLLEY", primary: true }, { loadCarrier: null, primary: false }]);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fust-dimensions.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/fust-dimensions.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
vi.mock("../../integrations/supabase/client", () => ({ supabase: {} }));
|
|
3
|
+
import { customPackageDimsOf, resolveFustDimensions } from "../fusten.js";
|
|
4
|
+
const fc = new Map([["18", { name: "Trayrand", lengthMm: 560, widthMm: 250, heightMm: 170 }]]);
|
|
5
|
+
const cp = new Map([["cp-1", { lengthMm: 400, widthMm: 300, heightMm: 120 }]]);
|
|
6
|
+
const base = { vbn_code: null, custom_package_id: null, length_mm: null, width_mm: null, height_mm: null };
|
|
7
|
+
describe("fustmaten: Floricode → Floriday custom package → handmatig → leeg", () => {
|
|
8
|
+
it("Floricode wint", () => {
|
|
9
|
+
const r = resolveFustDimensions({ ...base, vbn_code: 18, custom_package_id: "cp-1", length_mm: 1 }, fc, cp);
|
|
10
|
+
expect(r).toEqual({ length_mm: 560, width_mm: 250, height_mm: 170, source: "floricode" });
|
|
11
|
+
});
|
|
12
|
+
it("anders custom package", () => {
|
|
13
|
+
const r = resolveFustDimensions({ ...base, custom_package_id: "cp-1", length_mm: 1 }, fc, cp);
|
|
14
|
+
expect(r).toEqual({ length_mm: 400, width_mm: 300, height_mm: 120, source: "floriday" });
|
|
15
|
+
});
|
|
16
|
+
it("anders handmatig", () => {
|
|
17
|
+
const r = resolveFustDimensions({ ...base, custom_package_id: "onbekend", length_mm: 7 }, fc, cp);
|
|
18
|
+
expect(r.source).toBe("handmatig");
|
|
19
|
+
expect(r.length_mm).toBe(7);
|
|
20
|
+
});
|
|
21
|
+
it("anders leeg, nooit standaardwaarden", () => {
|
|
22
|
+
expect(resolveFustDimensions(base, fc, cp)).toEqual({ length_mm: null, width_mm: null, height_mm: null, source: "onbekend" });
|
|
23
|
+
});
|
|
24
|
+
it("leest mm uit data.dimensions", () => {
|
|
25
|
+
expect(customPackageDimsOf({ dimensions: { length: 400, width: 0, height: "120" } })).toEqual({ lengthMm: 400, widthMm: null, heightMm: 120 });
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-carriers.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/load-carriers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from "vitest";
|
|
2
|
+
vi.mock("../../integrations/supabase/client", () => ({ supabase: {} }));
|
|
3
|
+
import { loadCarriersFromRows } from "../../hooks/useLoadCarriers.js";
|
|
4
|
+
describe("gedeelde lijst ladingdragers", () => {
|
|
5
|
+
it("neemt codes en namen over uit de database, op volgorde", () => {
|
|
6
|
+
const list = loadCarriersFromRows([
|
|
7
|
+
{ code: "DANISH_TROLLEY", naam: "Deense container", volgorde: 2 },
|
|
8
|
+
{ code: "AUCTION_TROLLEY", naam: "Stapelwagen", volgorde: 1 },
|
|
9
|
+
]);
|
|
10
|
+
expect(list.map((c) => c.code)).toEqual(["AUCTION_TROLLEY", "DANISH_TROLLEY"]);
|
|
11
|
+
});
|
|
12
|
+
it("vult niets zelf aan als de database niets geeft", () => {
|
|
13
|
+
expect(loadCarriersFromRows(null)).toEqual([]);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mirror-products.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/mirror-products.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { hideMirrorItems } from "../mirror-products.js";
|
|
3
|
+
describe("hideMirrorItems", () => {
|
|
4
|
+
it("verbergt een spiegel (id = Floriday-id van eigen artikel), ook met voorraad", () => {
|
|
5
|
+
const own = { productId: "27612767", floridayId: "ea7776dd", qty: 450 };
|
|
6
|
+
const mirror = { productId: "ea7776dd", floridayId: null, qty: 500 };
|
|
7
|
+
expect(hideMirrorItems([own, mirror])).toEqual([own]);
|
|
8
|
+
});
|
|
9
|
+
it("laat een spiegel staan zolang er geen canoniek artikel is", () => {
|
|
10
|
+
const mirror = { productId: "ea7776dd", floridayId: null };
|
|
11
|
+
expect(hideMirrorItems([mirror])).toEqual([mirror]);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-packings.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/product-packings.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
vi.mock("../../integrations/supabase/client", () => ({ supabase: {} }));
|
|
3
|
+
import { requireCompletePacking, packingNumberOrEmpty } from "../floriday-payload.js";
|
|
4
|
+
import { isCompletePackingRow, packingRowsFromWizard, positiveIntOrNull, primaryPacking } from "../product-packings.js";
|
|
5
|
+
import { floridayPackingsToRows, pickPrimaryPacking } from "../product-packing.js";
|
|
6
|
+
describe("verpakking: geen stille standaardwaarden", () => {
|
|
7
|
+
it("lege of ongeldige getallen blijven leeg", () => {
|
|
8
|
+
expect(positiveIntOrNull("")).toBeNull();
|
|
9
|
+
expect(positiveIntOrNull(undefined)).toBeNull();
|
|
10
|
+
expect(positiveIntOrNull(0)).toBeNull();
|
|
11
|
+
expect(positiveIntOrNull(2.5)).toBeNull();
|
|
12
|
+
expect(packingNumberOrEmpty(undefined)).toBe(0);
|
|
13
|
+
});
|
|
14
|
+
it("push weigert een onvolledige verpakking", () => {
|
|
15
|
+
expect(() => requireCompletePacking({ unitsPerPackage: 6, packagesPerLayer: 4 })).toThrow(/Verpakking onvolledig/);
|
|
16
|
+
expect(requireCompletePacking({ unitsPerPackage: 6, packagesPerLayer: 4, layersPerLoadCarrier: 8 })).toEqual({
|
|
17
|
+
pieces: 6, packages: 4, layers: 8,
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
it("Floriday-verpakking 8x4x6 (fust 306) wordt exact overgenomen", () => {
|
|
21
|
+
const rows = floridayPackingsToRows([
|
|
22
|
+
{ primary: true, piecesPerPackage: 6, packagesPerLayer: 4, layersPerLoadCarrier: 8, package: { vbnPackageCode: 306 }, loadCarrier: "DANISH_TROLLEY" },
|
|
23
|
+
{ primary: false, piecesPerPackage: 8, packagesPerLayer: 5, package: { vbnPackageCode: 408 } },
|
|
24
|
+
]);
|
|
25
|
+
expect(rows[0]).toMatchObject({ pieces_per_package: 6, packages_per_layer: 4, layers_per_load_carrier: 8, vbn_package_code: 306, is_primary: true });
|
|
26
|
+
expect(rows[1]).toMatchObject({ layers_per_load_carrier: null, is_primary: false });
|
|
27
|
+
});
|
|
28
|
+
it("zonder gemarkeerde primaire verpakking wordt niet gegokt", () => {
|
|
29
|
+
expect(pickPrimaryPacking([{ piecesPerPackage: 6, packagesPerLayer: 4, layersPerLoadCarrier: 8 }])).toBeNull();
|
|
30
|
+
});
|
|
31
|
+
it("meerdere verpakkingen: de primaire bepaalt", () => {
|
|
32
|
+
const rows = packingRowsFromWizard([
|
|
33
|
+
{ id: "a", source: "VBN", packagingType: "306", loadCarrier: "", unitsPerPackage: 6, packagesPerLayer: 4, layersPerLoadCarrier: 8, isPrimary: false, isCustomerSpecific: false, customerOrganizationIds: [] },
|
|
34
|
+
{ id: "b", source: "VBN", packagingType: "408", loadCarrier: "", unitsPerPackage: 8, packagesPerLayer: 5, layersPerLoadCarrier: 8, isPrimary: true, isCustomerSpecific: false, customerOrganizationIds: [] },
|
|
35
|
+
]);
|
|
36
|
+
const p = primaryPacking(rows);
|
|
37
|
+
expect(p?.pieces_per_package).toBe(8);
|
|
38
|
+
expect(p?.vbn_package_code).toBe(408);
|
|
39
|
+
expect(isCompletePackingRow(p)).toBe(true);
|
|
40
|
+
expect(isCompletePackingRow({ ...p, layers_per_load_carrier: null })).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-114.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/publish-114.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { translatePublishError } from "../publish-errors.js";
|
|
3
|
+
import { effectiveJobStatus } from "../../components/voorraad/PublishProgressCard.js";
|
|
4
|
+
import { countStock } from "../../components/voorraad/VoorraadPage.js";
|
|
5
|
+
describe("1.0.114 publiceren en telling", () => {
|
|
6
|
+
it("toont de echte reden als de poort schrijven tegenhoudt", () => {
|
|
7
|
+
const f = translatePublishError(new Error("publishTradeItem: gateway /api/public/gateway/write → Tegengehouden door poort: in de Floriday-kopie wijkt de verpakking af van Floriday."));
|
|
8
|
+
expect(f.code).toBe("GATE_BLOCKED");
|
|
9
|
+
expect(f.message).toContain("wijkt de verpakking af");
|
|
10
|
+
});
|
|
11
|
+
it("onbekende fout toont de technische reden", () => {
|
|
12
|
+
const f = translatePublishError(new Error("stap x → iets raars"));
|
|
13
|
+
expect(f.message).toContain("iets raars");
|
|
14
|
+
});
|
|
15
|
+
it("job blijft niet op bezig na mislukte productstap", () => {
|
|
16
|
+
expect(effectiveJobStatus("running", [
|
|
17
|
+
{ status: "failed", step_key: "trade-item" },
|
|
18
|
+
{ status: "pending", step_key: "stock" },
|
|
19
|
+
])).toBe("failed");
|
|
20
|
+
expect(effectiveJobStatus("running", [{ status: "running", step_key: "trade-item" }])).toBe("running");
|
|
21
|
+
});
|
|
22
|
+
it("volledig gereserveerd telt als op voorraad", () => {
|
|
23
|
+
const c = countStock([
|
|
24
|
+
{ quantity: 100, availableQuantity: 0, minQuantity: 0 },
|
|
25
|
+
{ quantity: 0, availableQuantity: 0, minQuantity: 0 },
|
|
26
|
+
]);
|
|
27
|
+
expect(c.inStock).toBe(1);
|
|
28
|
+
expect(c.outOfStock).toBe(1);
|
|
29
|
+
expect(c.fullyReserved).toBe(1);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-packing-block.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/publish-packing-block.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { parsePackingBlock } from "../publish-errors.js";
|
|
3
|
+
describe("parsePackingBlock", () => {
|
|
4
|
+
it("leest code, data.message en mismatchTradeItemIds", () => {
|
|
5
|
+
const r = parsePackingBlock('fout: {"code":"packing_mismatch","data":{"message":"Afwijking","mismatchTradeItemIds":["a1"]}}');
|
|
6
|
+
expect(r).toEqual({ code: "packing_mismatch", message: "Afwijking", ids: ["a1"] });
|
|
7
|
+
});
|
|
8
|
+
it("onderscheidt packing_mismatch_connection", () => {
|
|
9
|
+
expect(parsePackingBlock("packing_mismatch_connection")?.code).toBe("packing_mismatch_connection");
|
|
10
|
+
});
|
|
11
|
+
it("geeft null zonder code", () => {
|
|
12
|
+
expect(parsePackingBlock("iets anders")).toBeNull();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-130.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/release-130.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { READ_ROUTE_MISSING, chunk, interpretContinuousStock, parseReadResponse, toReadRequest, } from "../floriday-read-contract.js";
|
|
3
|
+
import { editTargetText, isPublishedToFloriday, publishOutcome } from "../publish-status.js";
|
|
4
|
+
import { priceStatus } from "../price-status.js";
|
|
5
|
+
import { validateStep } from "../floriday-payload.js";
|
|
6
|
+
vi.mock("../supabase-admin.server", () => ({
|
|
7
|
+
getAdminClient: () => ({
|
|
8
|
+
from: () => ({
|
|
9
|
+
select: () => ({ eq: () => ({ maybeSingle: async () => ({ data: null }) }) }),
|
|
10
|
+
upsert: async () => ({ error: null }),
|
|
11
|
+
}),
|
|
12
|
+
}),
|
|
13
|
+
}));
|
|
14
|
+
describe("leesroute floriday-get", () => {
|
|
15
|
+
it("haalt het voorvoegsel /suppliers-api-2026v1 weg en zet de query apart", () => {
|
|
16
|
+
expect(toReadRequest("/suppliers-api-2026v1/trade-items/abc/continuous-stock")).toEqual({
|
|
17
|
+
method: "GET",
|
|
18
|
+
path: "/trade-items/abc/continuous-stock",
|
|
19
|
+
});
|
|
20
|
+
expect(toReadRequest("/suppliers-api-2026v1/trade-items/base-supply?year=2026&week=44")).toEqual({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: "/trade-items/base-supply",
|
|
23
|
+
query: { year: "2026", week: "44" },
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
it("bundelt per 10", () => {
|
|
27
|
+
expect(chunk(Array.from({ length: 23 }, (_, i) => i)).map((c) => c.length)).toEqual([10, 10, 3]);
|
|
28
|
+
});
|
|
29
|
+
it("HTML of 404 van de route = leesroute ontbreekt, nooit ruwe HTML", () => {
|
|
30
|
+
expect(() => parseReadResponse(404, "text/html", "<html>Not found</html>", 1)).toThrow(READ_ROUTE_MISSING);
|
|
31
|
+
});
|
|
32
|
+
it("404 per artikel = geen beschikbaarheid; 429 = wachten volgens retryAfterMs", () => {
|
|
33
|
+
const [a, b, c] = parseReadResponse(200, "application/json", JSON.stringify({
|
|
34
|
+
ok: true,
|
|
35
|
+
results: [
|
|
36
|
+
{ ok: false, status: 404, path: "/trade-items/a/continuous-stock", error: "not found" },
|
|
37
|
+
{ ok: false, status: 429, path: "/trade-items/b/continuous-stock", error: "rate", retryAfterMs: 2500 },
|
|
38
|
+
{ ok: true, status: 200, path: "/trade-items/c/continuous-stock", data: { numberOfPieces: 7 } },
|
|
39
|
+
],
|
|
40
|
+
}), 3);
|
|
41
|
+
expect(interpretContinuousStock(a)).toEqual({ kind: "pieces", pieces: 0 });
|
|
42
|
+
expect(interpretContinuousStock(b)).toEqual({ kind: "retry", waitMs: 2500 });
|
|
43
|
+
expect(interpretContinuousStock(c)).toEqual({ kind: "pieces", pieces: 7 });
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe("gatewayRead via floriday-get (gemockt, niets naar Floriday)", () => {
|
|
47
|
+
const realFetch = globalThis.fetch;
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
process.env.FLORIDAY_GATEWAY_URL = "https://shell.test";
|
|
50
|
+
process.env.FLORIDAY_GATEWAY_SECRET = "test-secret";
|
|
51
|
+
});
|
|
52
|
+
afterEach(() => {
|
|
53
|
+
globalThis.fetch = realFetch;
|
|
54
|
+
});
|
|
55
|
+
it("stuurt één GET-verzoek zonder voorvoegsel naar /api/public/gateway/floriday-get", async () => {
|
|
56
|
+
const calls = [];
|
|
57
|
+
globalThis.fetch = vi.fn(async (url, init) => {
|
|
58
|
+
calls.push({ url: String(url), body: JSON.parse(init.body) });
|
|
59
|
+
return new Response(JSON.stringify({ ok: true, environment: "staging", results: [{ ok: true, status: 200, path: "/trade-items/x", data: { id: "x" } }] }), { status: 200, headers: { "content-type": "application/json" } });
|
|
60
|
+
});
|
|
61
|
+
const { gatewayRead } = await import("../floriday-gateway.server.js");
|
|
62
|
+
const res = await gatewayRead({ environment: "staging", path: "/suppliers-api-2026v1/trade-items/x" });
|
|
63
|
+
expect(calls[0].url).toBe("https://shell.test/api/public/gateway/floriday-get");
|
|
64
|
+
expect(calls[0].body.requests).toEqual([{ method: "GET", path: "/trade-items/x" }]);
|
|
65
|
+
expect(res).toMatchObject({ ok: true, status: 200, data: { id: "x" } });
|
|
66
|
+
});
|
|
67
|
+
it("ontbrekende route geeft 'leesroute ontbreekt in de shell'", async () => {
|
|
68
|
+
globalThis.fetch = vi.fn(async () => new Response("<html>404</html>", { status: 404, headers: { "content-type": "text/html" } }));
|
|
69
|
+
const { gatewayRead } = await import("../floriday-gateway.server.js");
|
|
70
|
+
await expect(gatewayRead({ environment: "staging", path: "/trade-items/x" })).rejects.toThrow(/Leesroute ontbreekt in de shell/);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe("publicatiestatus", () => {
|
|
74
|
+
it("een artikel met een Floriday-id telt als gepubliceerd", () => {
|
|
75
|
+
expect(isPublishedToFloriday(null, "ea7776dd-cdee-46e3-ab2a-ffd970bd8d7b")).toBe(true);
|
|
76
|
+
expect(isPublishedToFloriday(null, "")).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
it("artikel gelukt + controle mislukt = waarschuwing, niet mislukt", () => {
|
|
79
|
+
expect(publishOutcome([{ step_key: "trade-item", status: "succeeded" }, { step_key: "verify", status: "failed" }])).toBe("succeeded_with_warnings");
|
|
80
|
+
expect(publishOutcome([{ step_key: "trade-item", status: "failed" }])).toBe("failed");
|
|
81
|
+
});
|
|
82
|
+
it("met Floriday-id gaan wijzigingen naar Floriday, tenzij alleen-lezen (met reden)", () => {
|
|
83
|
+
expect(editTargetText({ floridayId: "x", writeReadOnly: false }).sendsToFloriday).toBe(true);
|
|
84
|
+
const blocked = editTargetText({ floridayId: "x", writeReadOnly: true, writeReason: "verpakkingsverschil" });
|
|
85
|
+
expect(blocked.sendsToFloriday).toBe(false);
|
|
86
|
+
expect(blocked.text).toContain("verpakkingsverschil");
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
describe("prijsstatus", () => {
|
|
90
|
+
const now = Date.parse("2026-10-28T12:00:00Z");
|
|
91
|
+
it("één label per prijsregel", () => {
|
|
92
|
+
expect(priceStatus(null, now)).toBe("none");
|
|
93
|
+
expect(priceStatus({ available_quantity: 500, period_end: "2026-11-30T00:00:00Z" }, now)).toBe("live");
|
|
94
|
+
expect(priceStatus({ available_quantity: 500, period_end: "2026-10-01T00:00:00Z" }, now)).toBe("expired");
|
|
95
|
+
expect(priceStatus({ available_quantity: 0, period_end: null }, now)).toBe("drained");
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
describe("artikelcode bij Volgende", () => {
|
|
99
|
+
it("weigert een invultekst al in de artikelstap", () => {
|
|
100
|
+
const r = validateStep("artikel", { articleCode: "artikelcode", name: "Gaultheria" });
|
|
101
|
+
expect(r.ok).toBe(false);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-134.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/release-134.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { contentIdempotencyKey } from "../idempotency-key.js";
|
|
3
|
+
import { compareAfterUpdate, verifyDifferenceMessage } from "../publish-verify.js";
|
|
4
|
+
import { publishOutcome } from "../publish-status.js";
|
|
5
|
+
import { translatePublishError } from "../publish-errors.js";
|
|
6
|
+
const id = "ea7776dd-cdee-46e3-ab2a-ffd970bd8d7b";
|
|
7
|
+
describe("1.0.134 idempotentiesleutel per inhoud", () => {
|
|
8
|
+
it("naam wijzigen geeft een nieuwe sleutel (nieuwe PUT)", async () => {
|
|
9
|
+
const a = await contentIdempotencyKey("inventory:trade-item:update", id, { tradeItemName: "TEST QA artikel 28-10" });
|
|
10
|
+
const b = await contentIdempotencyKey("inventory:trade-item:update", id, { tradeItemName: "TEST QA artikel 28-10 gewijzigd" });
|
|
11
|
+
expect(a).not.toBe(b);
|
|
12
|
+
});
|
|
13
|
+
it("dezelfde wijziging nog eens geeft dezelfde sleutel (geen tweede PUT)", async () => {
|
|
14
|
+
const a = await contentIdempotencyKey("inventory:trade-item:update", id, { tradeItemName: "X", vbnProductCode: 34407 });
|
|
15
|
+
const b = await contentIdempotencyKey("inventory:trade-item:update", id, { vbnProductCode: 34407, tradeItemName: "X" });
|
|
16
|
+
expect(a).toBe(b);
|
|
17
|
+
});
|
|
18
|
+
it("sleutel bevat geen vaste versie meer", async () => {
|
|
19
|
+
const k = await contentIdempotencyKey("inventory:trade-item:update", id, {});
|
|
20
|
+
expect(k).not.toMatch(/:v1$/);
|
|
21
|
+
expect(k).toMatch(new RegExp(`^inventory:trade-item:update:${id}:[0-9a-f]{64}$`));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe("1.0.134 controle na update", () => {
|
|
25
|
+
const item = {
|
|
26
|
+
tradeItemName: "TEST QA artikel 28-10",
|
|
27
|
+
vbnProductCode: 34407,
|
|
28
|
+
packingConfigurations: [{ primary: true, piecesPerPackage: 12, packagesPerLayer: 5, layersPerLoadCarrier: 8, package: { vbnPackageCode: 412 }, loadCarrier: "DANISH_TROLLEY" }],
|
|
29
|
+
};
|
|
30
|
+
it("naamafwijking is een verschil met beide waarden", () => {
|
|
31
|
+
const d = compareAfterUpdate({ name: "TEST QA artikel 28-10 gewijzigd", vbnCode: 34407 }, item);
|
|
32
|
+
expect(d).toHaveLength(1);
|
|
33
|
+
expect(verifyDifferenceMessage(d)).toContain("«TEST QA artikel 28-10»");
|
|
34
|
+
expect(verifyDifferenceMessage(d)).toContain("«TEST QA artikel 28-10 gewijzigd»");
|
|
35
|
+
});
|
|
36
|
+
it("verpakkingsafwijking telt", () => {
|
|
37
|
+
const d = compareAfterUpdate({ packing: { piecesPerPackage: 6, packagesPerLayer: 5, layersPerLoadCarrier: 8, vbnPackageCode: 412, loadCarrier: "DANISH_TROLLEY" } }, item);
|
|
38
|
+
expect(d.map((x) => x.field)).toEqual(["piecesPerPackage"]);
|
|
39
|
+
});
|
|
40
|
+
it("gelijk = geen verschil", () => {
|
|
41
|
+
expect(compareAfterUpdate({ name: "TEST QA artikel 28-10", vbnCode: "34407" }, item)).toEqual([]);
|
|
42
|
+
});
|
|
43
|
+
it("afwijking na update = job mislukt", () => {
|
|
44
|
+
expect(publishOutcome([
|
|
45
|
+
{ step_key: "trade-item", status: "done" },
|
|
46
|
+
{ step_key: "verify", status: "failed", error_code: "VERIFY_MISMATCH" },
|
|
47
|
+
])).toBe("failed");
|
|
48
|
+
expect(translatePublishError(new Error("VERIFY_MISMATCH:Naam wijkt af")).code).toBe("VERIFY_MISMATCH");
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-136.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/release-136.test.ts"],"names":[],"mappings":""}
|