@flowselections/floriday-voorraad 1.0.154 → 1.0.156
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/TemplatePage.d.ts +2 -0
- package/dist-lib/components/TemplatePage.d.ts.map +1 -0
- package/dist-lib/components/TemplatePage.js +4 -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/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/settings/VoorraadSettingsCard.d.ts +2 -0
- package/dist-lib/components/settings/VoorraadSettingsCard.d.ts.map +1 -0
- package/dist-lib/components/settings/VoorraadSettingsCard.js +39 -0
- 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/CollapsibleText.d.ts +1 -1
- package/dist-lib/components/voorraad/CollapsibleText.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ConnectionBadge.d.ts +6 -0
- package/dist-lib/components/voorraad/ConnectionBadge.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ConnectionBadge.js +12 -0
- package/dist-lib/components/voorraad/ConnectionPicker.d.ts +8 -0
- package/dist-lib/components/voorraad/ConnectionPicker.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ConnectionPicker.js +8 -0
- 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/FloridayStatusBadge.d.ts +4 -0
- package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts.map +1 -0
- package/dist-lib/components/voorraad/FloridayStatusBadge.js +8 -0
- 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/FustAdministratie.d.ts +2 -2
- package/dist-lib/components/voorraad/FustAdministratie.d.ts.map +1 -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/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/ModuleHealthCard.d.ts +2 -0
- package/dist-lib/components/voorraad/ModuleHealthCard.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ModuleHealthCard.js +40 -0
- 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/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/VoorraadDashboard.d.ts +10 -0
- package/dist-lib/components/voorraad/VoorraadDashboard.d.ts.map +1 -0
- package/dist-lib/components/voorraad/VoorraadDashboard.js +53 -0
- 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/VoorraadPage.js +4 -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/VoorraadVeldenCard.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadVeldenCard.d.ts.map +1 -1
- 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/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/integrations/supabase/client.js +1 -1
- package/dist-lib/integrations/supabase/client.server.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +76 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/__tests__/floricode-required-features.test.js +3 -7
- package/dist-lib/lib/floriday-field-sources.d.ts +18 -0
- package/dist-lib/lib/floriday-field-sources.d.ts.map +1 -0
- package/dist-lib/lib/floriday-field-sources.js +45 -0
- package/dist-lib/lib/floriday-schema-to-zod.d.ts +9 -0
- package/dist-lib/lib/floriday-schema-to-zod.d.ts.map +1 -0
- package/dist-lib/lib/floriday-schema-to-zod.js +53 -0
- package/dist-lib/lib/merge-products.d.ts +8 -0
- package/dist-lib/lib/merge-products.d.ts.map +1 -0
- package/dist-lib/lib/merge-products.js +17 -0
- package/dist-lib/lib/module-health.functions.d.ts +53497 -0
- package/dist-lib/lib/module-health.functions.d.ts.map +1 -0
- package/dist-lib/lib/module-health.functions.js +261 -0
- package/dist-lib/lib/validationSchemas.d.ts +15 -0
- package/dist-lib/lib/validationSchemas.d.ts.map +1 -0
- package/dist-lib/lib/validationSchemas.js +25 -0
- package/dist-lib/lib/voorraad-lijst.d.ts +2 -1
- package/dist-lib/lib/voorraad-lijst.d.ts.map +1 -1
- package/dist-lib/lib/voorraad-lijst.js +2 -2
- package/dist-lib/server-hooks/floriday-stock-reconcile.d.ts.map +1 -1
- package/dist-lib/server-hooks/floriday-stock-reconcile.js +14 -1
- package/package.json +1 -1
- package/sql/floriday-voorraad-schema.sql +13 -27
- package/dist-lib/components/voorraad/__tests__/count-stock-free.test.d.ts +0 -2
- package/dist-lib/components/voorraad/__tests__/count-stock-free.test.d.ts.map +0 -1
- package/dist-lib/components/voorraad/__tests__/count-stock-free.test.js +0 -12
- package/dist-lib/lib/__tests__/article-code.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/article-code.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/article-code.test.js +0 -11
- package/dist-lib/lib/__tests__/erp-test-123.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/erp-test-123.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/erp-test-123.test.js +0 -43
- package/dist-lib/lib/__tests__/floriday-customer-offers.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/floriday-customer-offers.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/floriday-customer-offers.test.js +0 -36
- package/dist-lib/lib/__tests__/floriday-fetch-status.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/floriday-fetch-status.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/floriday-fetch-status.test.js +0 -25
- package/dist-lib/lib/__tests__/floriday-write-mode.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/floriday-write-mode.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/floriday-write-mode.test.js +0 -40
- package/dist-lib/lib/__tests__/fust-dimensions.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/fust-dimensions.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/fust-dimensions.test.js +0 -27
- package/dist-lib/lib/__tests__/load-carriers.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/load-carriers.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/load-carriers.test.js +0 -15
- package/dist-lib/lib/__tests__/mirror-products.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/mirror-products.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/mirror-products.test.js +0 -13
- package/dist-lib/lib/__tests__/product-packings.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/product-packings.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/product-packings.test.js +0 -42
- package/dist-lib/lib/__tests__/publish-114.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/publish-114.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/publish-114.test.js +0 -31
- package/dist-lib/lib/__tests__/publish-packing-block.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/publish-packing-block.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/publish-packing-block.test.js +0 -14
- package/dist-lib/lib/__tests__/release-130.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/release-130.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/release-130.test.js +0 -103
- package/dist-lib/lib/__tests__/release-134.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/release-134.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/release-134.test.js +0 -50
- package/dist-lib/lib/__tests__/release-136.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/release-136.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/release-136.test.js +0 -36
- package/dist-lib/lib/__tests__/release-140.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/release-140.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/release-140.test.js +0 -42
- package/dist-lib/lib/__tests__/request-guard.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/request-guard.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/request-guard.test.js +0 -50
- package/dist-lib/lib/__tests__/stock-save.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/stock-save.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/stock-save.test.js +0 -35
- package/dist-lib/lib/__tests__/stock-scope.test.d.ts +0 -2
- package/dist-lib/lib/__tests__/stock-scope.test.d.ts.map +0 -1
- package/dist-lib/lib/__tests__/stock-scope.test.js +0 -44
- package/dist-lib/server-hooks/__tests__/trade-item-photo.test.d.ts +0 -2
- package/dist-lib/server-hooks/__tests__/trade-item-photo.test.d.ts.map +0 -1
- package/dist-lib/server-hooks/__tests__/trade-item-photo.test.js +0 -19
|
@@ -155,8 +155,7 @@ describe("computeVbnRequiredFeatures — VBN 100023", () => {
|
|
|
155
155
|
});
|
|
156
156
|
it("sorteert verplicht vóór advies", async () => {
|
|
157
157
|
const res = await computeVbnRequiredFeatures(client, "100023");
|
|
158
|
-
|
|
159
|
-
expect(res.features.map((f) => f.code)).toEqual(["S01", "S02", "S62", "S98", "S05"]);
|
|
158
|
+
expect(res.features.map((f) => f.code)).toEqual(["S01", "S02", "S05"]);
|
|
160
159
|
});
|
|
161
160
|
it("levert toegestane waarden per feature (gededupliceerd, zonder vervallen)", async () => {
|
|
162
161
|
const res = await computeVbnRequiredFeatures(client, "100023");
|
|
@@ -164,10 +163,9 @@ describe("computeVbnRequiredFeatures — VBN 100023", () => {
|
|
|
164
163
|
expect(s01?.values.map((v) => v.code).sort()).toEqual(["003", "004"]);
|
|
165
164
|
expect(s01?.values.some((v) => v.code === "999")).toBe(false);
|
|
166
165
|
});
|
|
167
|
-
it("geeft
|
|
166
|
+
it("geeft lege lijst terug voor onbekende VBN-code", async () => {
|
|
168
167
|
const res = await computeVbnRequiredFeatures(client, "99999");
|
|
169
|
-
expect(res
|
|
170
|
-
expect(res.features.map((f) => f.code)).toEqual(["S62", "S98"]);
|
|
168
|
+
expect(res).toEqual({ vbnCode: "99999", features: [] });
|
|
171
169
|
});
|
|
172
170
|
it("vindt regulatory rows via record_id-prefix als data.product_id ontbreekt", async () => {
|
|
173
171
|
const prefixOnlyClient = makeFakeClient({
|
|
@@ -182,8 +180,6 @@ describe("computeVbnRequiredFeatures — VBN 100023", () => {
|
|
|
182
180
|
expect(res.features.map((f) => [f.code, f.regulation])).toEqual([
|
|
183
181
|
["S01", "required"],
|
|
184
182
|
["S02", "required"],
|
|
185
|
-
["S62", "required"],
|
|
186
|
-
["S98", "required"],
|
|
187
183
|
["S05", "advised"],
|
|
188
184
|
]);
|
|
189
185
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping van Floriday-veldnamen naar hun waarde-bron.
|
|
3
|
+
*
|
|
4
|
+
* - CODE_LIST_BY_FIELD: veld met vaste enum-waardes uit /gateway/code-list.
|
|
5
|
+
* - REF_ENTITY_BY_FIELD: veld dat verwijst naar een rij in een stamdata-cache,
|
|
6
|
+
* te lezen via /gateway/cached-list. Waarden zijn kebab-case Floriday-
|
|
7
|
+
* resources (GatewayEntity) — NIET de Supabase-tabelnaam.
|
|
8
|
+
* - REF_TABLE_BY_FIELD: identieke mapping naar de Supabase-cache-tabelnaam,
|
|
9
|
+
* uitsluitend voor directe `supabase.from(...)` reads in deze module.
|
|
10
|
+
*/
|
|
11
|
+
import { type GatewayEntity } from "./floriday-gateway-entities.js";
|
|
12
|
+
export declare const CODE_LIST_BY_FIELD: Record<string, string>;
|
|
13
|
+
export declare const REF_ENTITY_BY_FIELD: Record<string, GatewayEntity>;
|
|
14
|
+
export declare const REF_TABLE_BY_FIELD: Record<string, string>;
|
|
15
|
+
export declare function codeListFor(field: string): string | undefined;
|
|
16
|
+
export declare function refEntityFor(field: string): GatewayEntity | undefined;
|
|
17
|
+
export declare function refTableFor(field: string): string | undefined;
|
|
18
|
+
//# sourceMappingURL=floriday-field-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-field-sources.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-field-sources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEnF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAUrD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAM7D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMrD,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAErE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping van Floriday-veldnamen naar hun waarde-bron.
|
|
3
|
+
*
|
|
4
|
+
* - CODE_LIST_BY_FIELD: veld met vaste enum-waardes uit /gateway/code-list.
|
|
5
|
+
* - REF_ENTITY_BY_FIELD: veld dat verwijst naar een rij in een stamdata-cache,
|
|
6
|
+
* te lezen via /gateway/cached-list. Waarden zijn kebab-case Floriday-
|
|
7
|
+
* resources (GatewayEntity) — NIET de Supabase-tabelnaam.
|
|
8
|
+
* - REF_TABLE_BY_FIELD: identieke mapping naar de Supabase-cache-tabelnaam,
|
|
9
|
+
* uitsluitend voor directe `supabase.from(...)` reads in deze module.
|
|
10
|
+
*/
|
|
11
|
+
import { GATEWAY_ENTITIES } from "./floriday-gateway-entities.js";
|
|
12
|
+
export const CODE_LIST_BY_FIELD = {
|
|
13
|
+
currency: "Currency",
|
|
14
|
+
salesUnit: "SalesUnit",
|
|
15
|
+
auctionLocation: "AuctionLocation",
|
|
16
|
+
supplyType: "SupplyType",
|
|
17
|
+
loadCarrierType: "SupplyLoadCarrierType",
|
|
18
|
+
packingType: "PackingType",
|
|
19
|
+
qualityMark: "QualityMark",
|
|
20
|
+
country: "Country",
|
|
21
|
+
countryOfOrigin: "Country",
|
|
22
|
+
};
|
|
23
|
+
export const REF_ENTITY_BY_FIELD = {
|
|
24
|
+
packingId: GATEWAY_ENTITIES.packings,
|
|
25
|
+
warehouseId: GATEWAY_ENTITIES.warehouses,
|
|
26
|
+
deliveryLocationId: GATEWAY_ENTITIES.deliveryLocations,
|
|
27
|
+
priceGroupId: GATEWAY_ENTITIES.priceGroups,
|
|
28
|
+
collectionId: GATEWAY_ENTITIES.collections,
|
|
29
|
+
};
|
|
30
|
+
export const REF_TABLE_BY_FIELD = {
|
|
31
|
+
packingId: "floriday_packings_cache",
|
|
32
|
+
warehouseId: "floriday_warehouses_cache",
|
|
33
|
+
deliveryLocationId: "floriday_delivery_locations_cache",
|
|
34
|
+
priceGroupId: "floriday_price_groups_cache",
|
|
35
|
+
collectionId: "floriday_collections_cache",
|
|
36
|
+
};
|
|
37
|
+
export function codeListFor(field) {
|
|
38
|
+
return CODE_LIST_BY_FIELD[field];
|
|
39
|
+
}
|
|
40
|
+
export function refEntityFor(field) {
|
|
41
|
+
return REF_ENTITY_BY_FIELD[field];
|
|
42
|
+
}
|
|
43
|
+
export function refTableFor(field) {
|
|
44
|
+
return REF_TABLE_BY_FIELD[field];
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bouwt een Zod-schema op basis van de fields[]-projectie van /gateway/schema.
|
|
3
|
+
* Wordt gebruikt voor snelle client-side UX-feedback. De gateway valideert
|
|
4
|
+
* altijd nogmaals server-side (validateEnums + Floriday zelf).
|
|
5
|
+
*/
|
|
6
|
+
import { z, type ZodTypeAny } from "zod";
|
|
7
|
+
import type { FloridaySchemaField } from "../hooks/useFloriday.js";
|
|
8
|
+
export declare function buildZodFromFields(fields: FloridaySchemaField[]): z.ZodObject<Record<string, ZodTypeAny>>;
|
|
9
|
+
//# sourceMappingURL=floriday-schema-to-zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-schema-to-zod.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-schema-to-zod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAmChE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,EAAE,GAC5B,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAIzC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bouwt een Zod-schema op basis van de fields[]-projectie van /gateway/schema.
|
|
3
|
+
* Wordt gebruikt voor snelle client-side UX-feedback. De gateway valideert
|
|
4
|
+
* altijd nogmaals server-side (validateEnums + Floriday zelf).
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
function fieldToZod(f) {
|
|
8
|
+
let schema;
|
|
9
|
+
if (f.enum && f.enum.length > 0) {
|
|
10
|
+
schema = z.enum(f.enum);
|
|
11
|
+
}
|
|
12
|
+
else if (f.type === "number" || f.type === "integer") {
|
|
13
|
+
let n = z.number();
|
|
14
|
+
if (typeof f.minimum === "number")
|
|
15
|
+
n = n.min(f.minimum);
|
|
16
|
+
if (typeof f.maximum === "number")
|
|
17
|
+
n = n.max(f.maximum);
|
|
18
|
+
if (f.type === "integer")
|
|
19
|
+
n = n.int();
|
|
20
|
+
schema = n;
|
|
21
|
+
}
|
|
22
|
+
else if (f.type === "boolean") {
|
|
23
|
+
schema = z.boolean();
|
|
24
|
+
}
|
|
25
|
+
else if (f.type === "array") {
|
|
26
|
+
schema = z.array(z.any());
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
let s = z.string();
|
|
30
|
+
if (typeof f.minLength === "number")
|
|
31
|
+
s = s.min(f.minLength);
|
|
32
|
+
if (typeof f.maxLength === "number")
|
|
33
|
+
s = s.max(f.maxLength);
|
|
34
|
+
if (f.pattern) {
|
|
35
|
+
try {
|
|
36
|
+
s = s.regex(new RegExp(f.pattern));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// ongeldige pattern uit schema → negeren
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
schema = s;
|
|
43
|
+
}
|
|
44
|
+
if (!f.required)
|
|
45
|
+
schema = schema.optional().nullable();
|
|
46
|
+
return schema;
|
|
47
|
+
}
|
|
48
|
+
export function buildZodFromFields(fields) {
|
|
49
|
+
const shape = {};
|
|
50
|
+
for (const f of fields)
|
|
51
|
+
shape[f.name] = fieldToZod(f);
|
|
52
|
+
return z.object(shape);
|
|
53
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voegt twee producten samen: alle voorraad, samenstellingen en orderregels
|
|
3
|
+
* van `loserProductId` verhuizen naar `canonicalProductId`. Daarna wordt de
|
|
4
|
+
* loser-rij verwijderd. Roept de `merge_products`-SQL-functie aan; audit-log
|
|
5
|
+
* wordt automatisch bijgehouden in `product_merge_log`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergeProducts(canonicalProductId: string, loserProductId: string): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=merge-products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-products.d.ts","sourceRoot":"","sources":["../../src/lib/merge-products.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { supabase } from "../integrations/supabase/client.js";
|
|
2
|
+
/**
|
|
3
|
+
* Voegt twee producten samen: alle voorraad, samenstellingen en orderregels
|
|
4
|
+
* van `loserProductId` verhuizen naar `canonicalProductId`. Daarna wordt de
|
|
5
|
+
* loser-rij verwijderd. Roept de `merge_products`-SQL-functie aan; audit-log
|
|
6
|
+
* wordt automatisch bijgehouden in `product_merge_log`.
|
|
7
|
+
*/
|
|
8
|
+
export async function mergeProducts(canonicalProductId, loserProductId) {
|
|
9
|
+
if (canonicalProductId === loserProductId)
|
|
10
|
+
return;
|
|
11
|
+
const { error } = await supabase.rpc("merge_products", {
|
|
12
|
+
_canonical: canonicalProductId,
|
|
13
|
+
_loser: loserProductId,
|
|
14
|
+
});
|
|
15
|
+
if (error)
|
|
16
|
+
throw new Error(error.message);
|
|
17
|
+
}
|