@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.
Files changed (255) hide show
  1. package/dist-lib/components/TemplatePage.d.ts +2 -0
  2. package/dist-lib/components/TemplatePage.d.ts.map +1 -0
  3. package/dist-lib/components/TemplatePage.js +4 -0
  4. package/dist-lib/components/fs-ui/DataTable.d.ts +1 -1
  5. package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -1
  6. package/dist-lib/components/fs-ui/EmptyState.d.ts +1 -1
  7. package/dist-lib/components/fs-ui/EmptyState.d.ts.map +1 -1
  8. package/dist-lib/components/fs-ui/FilterChips.d.ts +1 -1
  9. package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -1
  10. package/dist-lib/components/fs-ui/FilterPanel.d.ts +2 -2
  11. package/dist-lib/components/fs-ui/FilterPanel.d.ts.map +1 -1
  12. package/dist-lib/components/fs-ui/FiltersButton.d.ts +1 -1
  13. package/dist-lib/components/fs-ui/FiltersButton.d.ts.map +1 -1
  14. package/dist-lib/components/fs-ui/HeaderButton.d.ts +2 -2
  15. package/dist-lib/components/fs-ui/HeaderButton.d.ts.map +1 -1
  16. package/dist-lib/components/fs-ui/HoverTip.d.ts +1 -1
  17. package/dist-lib/components/fs-ui/HoverTip.d.ts.map +1 -1
  18. package/dist-lib/components/fs-ui/InlineAlert.d.ts +1 -1
  19. package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -1
  20. package/dist-lib/components/fs-ui/KpiRow.d.ts +1 -1
  21. package/dist-lib/components/fs-ui/KpiRow.d.ts.map +1 -1
  22. package/dist-lib/components/fs-ui/KpiTile.d.ts +1 -1
  23. package/dist-lib/components/fs-ui/KpiTile.d.ts.map +1 -1
  24. package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts +1 -1
  25. package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts.map +1 -1
  26. package/dist-lib/components/fs-ui/NoticeBar.d.ts +1 -1
  27. package/dist-lib/components/fs-ui/NoticeBar.d.ts.map +1 -1
  28. package/dist-lib/components/fs-ui/PageHeader.d.ts +1 -1
  29. package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -1
  30. package/dist-lib/components/fs-ui/Pagination.d.ts +1 -1
  31. package/dist-lib/components/fs-ui/Pagination.d.ts.map +1 -1
  32. package/dist-lib/components/fs-ui/PillTabs.d.ts +1 -1
  33. package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -1
  34. package/dist-lib/components/fs-ui/RowMenu.d.ts +1 -1
  35. package/dist-lib/components/fs-ui/RowMenu.d.ts.map +1 -1
  36. package/dist-lib/components/fs-ui/SearchInput.d.ts +1 -1
  37. package/dist-lib/components/fs-ui/SearchInput.d.ts.map +1 -1
  38. package/dist-lib/components/fs-ui/ShortcutHelp.d.ts +1 -1
  39. package/dist-lib/components/fs-ui/ShortcutHelp.d.ts.map +1 -1
  40. package/dist-lib/components/fs-ui/StatusIcon.d.ts +1 -1
  41. package/dist-lib/components/fs-ui/StatusIcon.d.ts.map +1 -1
  42. package/dist-lib/components/fs-ui/TableSkeleton.d.ts +1 -1
  43. package/dist-lib/components/fs-ui/TableSkeleton.d.ts.map +1 -1
  44. package/dist-lib/components/fs-ui/Toolbar.d.ts +1 -1
  45. package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -1
  46. package/dist-lib/components/fs-ui/UpdatedAt.d.ts +1 -1
  47. package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -1
  48. package/dist-lib/components/settings/VoorraadSettingsCard.d.ts +2 -0
  49. package/dist-lib/components/settings/VoorraadSettingsCard.d.ts.map +1 -0
  50. package/dist-lib/components/settings/VoorraadSettingsCard.js +39 -0
  51. package/dist-lib/components/voorraad/AdditionalPackagingDialog.d.ts +1 -1
  52. package/dist-lib/components/voorraad/AdditionalPackagingDialog.d.ts.map +1 -1
  53. package/dist-lib/components/voorraad/ArtikelCompositionCard.d.ts +1 -1
  54. package/dist-lib/components/voorraad/ArtikelCompositionCard.d.ts.map +1 -1
  55. package/dist-lib/components/voorraad/ArtikelWizard.d.ts +1 -1
  56. package/dist-lib/components/voorraad/ArtikelWizard.d.ts.map +1 -1
  57. package/dist-lib/components/voorraad/CollapsibleText.d.ts +1 -1
  58. package/dist-lib/components/voorraad/CollapsibleText.d.ts.map +1 -1
  59. package/dist-lib/components/voorraad/ConnectionBadge.d.ts +6 -0
  60. package/dist-lib/components/voorraad/ConnectionBadge.d.ts.map +1 -0
  61. package/dist-lib/components/voorraad/ConnectionBadge.js +12 -0
  62. package/dist-lib/components/voorraad/ConnectionPicker.d.ts +8 -0
  63. package/dist-lib/components/voorraad/ConnectionPicker.d.ts.map +1 -0
  64. package/dist-lib/components/voorraad/ConnectionPicker.js +8 -0
  65. package/dist-lib/components/voorraad/EditArtikelPage.d.ts +1 -1
  66. package/dist-lib/components/voorraad/EditArtikelPage.d.ts.map +1 -1
  67. package/dist-lib/components/voorraad/ExcelExportButton.d.ts +1 -1
  68. package/dist-lib/components/voorraad/ExcelExportButton.d.ts.map +1 -1
  69. package/dist-lib/components/voorraad/FloridayConnectionNotice.d.ts +1 -1
  70. package/dist-lib/components/voorraad/FloridayConnectionNotice.d.ts.map +1 -1
  71. package/dist-lib/components/voorraad/FloridayInfoCard.d.ts +1 -1
  72. package/dist-lib/components/voorraad/FloridayInfoCard.d.ts.map +1 -1
  73. package/dist-lib/components/voorraad/FloridayLoadCarriers.d.ts +1 -1
  74. package/dist-lib/components/voorraad/FloridayLoadCarriers.d.ts.map +1 -1
  75. package/dist-lib/components/voorraad/FloridaySentCard.d.ts +1 -1
  76. package/dist-lib/components/voorraad/FloridaySentCard.d.ts.map +1 -1
  77. package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts +4 -0
  78. package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts.map +1 -0
  79. package/dist-lib/components/voorraad/FloridayStatusBadge.js +8 -0
  80. package/dist-lib/components/voorraad/FloridayTakeoverPanel.d.ts +2 -2
  81. package/dist-lib/components/voorraad/FloridayTakeoverPanel.d.ts.map +1 -1
  82. package/dist-lib/components/voorraad/FustAdministratie.d.ts +2 -2
  83. package/dist-lib/components/voorraad/FustAdministratie.d.ts.map +1 -1
  84. package/dist-lib/components/voorraad/FustenPage.d.ts +1 -1
  85. package/dist-lib/components/voorraad/FustenPage.d.ts.map +1 -1
  86. package/dist-lib/components/voorraad/InventorySettingsDrawer.d.ts +1 -1
  87. package/dist-lib/components/voorraad/InventorySettingsDrawer.d.ts.map +1 -1
  88. package/dist-lib/components/voorraad/InventoryStatusBadge.d.ts +1 -1
  89. package/dist-lib/components/voorraad/InventoryStatusBadge.d.ts.map +1 -1
  90. package/dist-lib/components/voorraad/KoppelingStatusPanel.d.ts +1 -1
  91. package/dist-lib/components/voorraad/KoppelingStatusPanel.d.ts.map +1 -1
  92. package/dist-lib/components/voorraad/ModuleHealthCard.d.ts +2 -0
  93. package/dist-lib/components/voorraad/ModuleHealthCard.d.ts.map +1 -0
  94. package/dist-lib/components/voorraad/ModuleHealthCard.js +40 -0
  95. package/dist-lib/components/voorraad/NieuwArtikelPage.d.ts +1 -1
  96. package/dist-lib/components/voorraad/NieuwArtikelPage.d.ts.map +1 -1
  97. package/dist-lib/components/voorraad/OrderHistoryCard.d.ts +1 -1
  98. package/dist-lib/components/voorraad/OrderHistoryCard.d.ts.map +1 -1
  99. package/dist-lib/components/voorraad/PriceStatusBadge.d.ts +1 -1
  100. package/dist-lib/components/voorraad/PriceStatusBadge.d.ts.map +1 -1
  101. package/dist-lib/components/voorraad/ProductCustomFieldsCard.d.ts +1 -1
  102. package/dist-lib/components/voorraad/ProductCustomFieldsCard.d.ts.map +1 -1
  103. package/dist-lib/components/voorraad/ProductLinkCard.d.ts +1 -1
  104. package/dist-lib/components/voorraad/ProductLinkCard.d.ts.map +1 -1
  105. package/dist-lib/components/voorraad/ProductSalePriceField.d.ts +2 -2
  106. package/dist-lib/components/voorraad/ProductSalePriceField.d.ts.map +1 -1
  107. package/dist-lib/components/voorraad/ProductStructureCard.d.ts +2 -2
  108. package/dist-lib/components/voorraad/ProductStructureCard.d.ts.map +1 -1
  109. package/dist-lib/components/voorraad/PublicatiesPage.d.ts +1 -1
  110. package/dist-lib/components/voorraad/PublicatiesPage.d.ts.map +1 -1
  111. package/dist-lib/components/voorraad/PublishProgressCard.d.ts +1 -1
  112. package/dist-lib/components/voorraad/PublishProgressCard.d.ts.map +1 -1
  113. package/dist-lib/components/voorraad/PublishReadinessCard.d.ts +1 -1
  114. package/dist-lib/components/voorraad/PublishReadinessCard.d.ts.map +1 -1
  115. package/dist-lib/components/voorraad/Sneltoetsen.d.ts +2 -2
  116. package/dist-lib/components/voorraad/Sneltoetsen.d.ts.map +1 -1
  117. package/dist-lib/components/voorraad/StepSamenstelling.d.ts +1 -1
  118. package/dist-lib/components/voorraad/StepSamenstelling.d.ts.map +1 -1
  119. package/dist-lib/components/voorraad/StockBulkButtons.d.ts +1 -1
  120. package/dist-lib/components/voorraad/StockBulkButtons.d.ts.map +1 -1
  121. package/dist-lib/components/voorraad/StockHistoryChart.d.ts +1 -1
  122. package/dist-lib/components/voorraad/StockHistoryChart.d.ts.map +1 -1
  123. package/dist-lib/components/voorraad/StockMutationHistoryCard.d.ts +1 -1
  124. package/dist-lib/components/voorraad/StockMutationHistoryCard.d.ts.map +1 -1
  125. package/dist-lib/components/voorraad/StockPushMonitor.d.ts +1 -1
  126. package/dist-lib/components/voorraad/StockPushMonitor.d.ts.map +1 -1
  127. package/dist-lib/components/voorraad/StockSyncStatus.d.ts +1 -1
  128. package/dist-lib/components/voorraad/StockSyncStatus.d.ts.map +1 -1
  129. package/dist-lib/components/voorraad/SupplyReadScopeAlert.d.ts +1 -1
  130. package/dist-lib/components/voorraad/SupplyReadScopeAlert.d.ts.map +1 -1
  131. package/dist-lib/components/voorraad/TelmomentButton.d.ts +1 -1
  132. package/dist-lib/components/voorraad/TelmomentButton.d.ts.map +1 -1
  133. package/dist-lib/components/voorraad/TrayStickerCard.d.ts +1 -1
  134. package/dist-lib/components/voorraad/TrayStickerCard.d.ts.map +1 -1
  135. package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts +1 -1
  136. package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts.map +1 -1
  137. package/dist-lib/components/voorraad/ValidationPage.d.ts +1 -1
  138. package/dist-lib/components/voorraad/ValidationPage.d.ts.map +1 -1
  139. package/dist-lib/components/voorraad/VoorraadBeheerCard.d.ts +1 -1
  140. package/dist-lib/components/voorraad/VoorraadBeheerCard.d.ts.map +1 -1
  141. package/dist-lib/components/voorraad/VoorraadDashboard.d.ts +10 -0
  142. package/dist-lib/components/voorraad/VoorraadDashboard.d.ts.map +1 -0
  143. package/dist-lib/components/voorraad/VoorraadDashboard.js +53 -0
  144. package/dist-lib/components/voorraad/VoorraadPage.d.ts +1 -1
  145. package/dist-lib/components/voorraad/VoorraadPage.d.ts.map +1 -1
  146. package/dist-lib/components/voorraad/VoorraadPage.js +4 -1
  147. package/dist-lib/components/voorraad/VoorraadPagination.d.ts +1 -1
  148. package/dist-lib/components/voorraad/VoorraadPagination.d.ts.map +1 -1
  149. package/dist-lib/components/voorraad/VoorraadStockCard.d.ts +1 -1
  150. package/dist-lib/components/voorraad/VoorraadStockCard.d.ts.map +1 -1
  151. package/dist-lib/components/voorraad/VoorraadSturingCard.d.ts +1 -1
  152. package/dist-lib/components/voorraad/VoorraadSturingCard.d.ts.map +1 -1
  153. package/dist-lib/components/voorraad/VoorraadTable.d.ts +1 -1
  154. package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
  155. package/dist-lib/components/voorraad/VoorraadVeldenCard.d.ts +1 -1
  156. package/dist-lib/components/voorraad/VoorraadVeldenCard.d.ts.map +1 -1
  157. package/dist-lib/components/voorraad/artikel/ArtikelPagina.d.ts +1 -1
  158. package/dist-lib/components/voorraad/artikel/ArtikelPagina.d.ts.map +1 -1
  159. package/dist-lib/components/voorraad/artikel/TwijfelKiezen.d.ts +1 -1
  160. package/dist-lib/components/voorraad/artikel/TwijfelKiezen.d.ts.map +1 -1
  161. package/dist-lib/components/voorraad/lijst/ImporteerKnop.d.ts +1 -1
  162. package/dist-lib/components/voorraad/lijst/ImporteerKnop.d.ts.map +1 -1
  163. package/dist-lib/components/voorraad/lijst/LijstExportKnop.d.ts +1 -1
  164. package/dist-lib/components/voorraad/lijst/LijstExportKnop.d.ts.map +1 -1
  165. package/dist-lib/components/voorraad/lijst/SnelActieDialogen.d.ts +2 -2
  166. package/dist-lib/components/voorraad/lijst/SnelActieDialogen.d.ts.map +1 -1
  167. package/dist-lib/components/voorraad/lijst/VoorraadLijstTabel.d.ts +2 -2
  168. package/dist-lib/components/voorraad/lijst/VoorraadLijstTabel.d.ts.map +1 -1
  169. package/dist-lib/integrations/supabase/client.js +1 -1
  170. package/dist-lib/integrations/supabase/client.server.js +1 -1
  171. package/dist-lib/integrations/supabase/types.d.ts +76 -0
  172. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  173. package/dist-lib/lib/__tests__/floricode-required-features.test.js +3 -7
  174. package/dist-lib/lib/floriday-field-sources.d.ts +18 -0
  175. package/dist-lib/lib/floriday-field-sources.d.ts.map +1 -0
  176. package/dist-lib/lib/floriday-field-sources.js +45 -0
  177. package/dist-lib/lib/floriday-schema-to-zod.d.ts +9 -0
  178. package/dist-lib/lib/floriday-schema-to-zod.d.ts.map +1 -0
  179. package/dist-lib/lib/floriday-schema-to-zod.js +53 -0
  180. package/dist-lib/lib/merge-products.d.ts +8 -0
  181. package/dist-lib/lib/merge-products.d.ts.map +1 -0
  182. package/dist-lib/lib/merge-products.js +17 -0
  183. package/dist-lib/lib/module-health.functions.d.ts +53497 -0
  184. package/dist-lib/lib/module-health.functions.d.ts.map +1 -0
  185. package/dist-lib/lib/module-health.functions.js +261 -0
  186. package/dist-lib/lib/validationSchemas.d.ts +15 -0
  187. package/dist-lib/lib/validationSchemas.d.ts.map +1 -0
  188. package/dist-lib/lib/validationSchemas.js +25 -0
  189. package/dist-lib/lib/voorraad-lijst.d.ts +2 -1
  190. package/dist-lib/lib/voorraad-lijst.d.ts.map +1 -1
  191. package/dist-lib/lib/voorraad-lijst.js +2 -2
  192. package/dist-lib/server-hooks/floriday-stock-reconcile.d.ts.map +1 -1
  193. package/dist-lib/server-hooks/floriday-stock-reconcile.js +14 -1
  194. package/package.json +1 -1
  195. package/sql/floriday-voorraad-schema.sql +13 -27
  196. package/dist-lib/components/voorraad/__tests__/count-stock-free.test.d.ts +0 -2
  197. package/dist-lib/components/voorraad/__tests__/count-stock-free.test.d.ts.map +0 -1
  198. package/dist-lib/components/voorraad/__tests__/count-stock-free.test.js +0 -12
  199. package/dist-lib/lib/__tests__/article-code.test.d.ts +0 -2
  200. package/dist-lib/lib/__tests__/article-code.test.d.ts.map +0 -1
  201. package/dist-lib/lib/__tests__/article-code.test.js +0 -11
  202. package/dist-lib/lib/__tests__/erp-test-123.test.d.ts +0 -2
  203. package/dist-lib/lib/__tests__/erp-test-123.test.d.ts.map +0 -1
  204. package/dist-lib/lib/__tests__/erp-test-123.test.js +0 -43
  205. package/dist-lib/lib/__tests__/floriday-customer-offers.test.d.ts +0 -2
  206. package/dist-lib/lib/__tests__/floriday-customer-offers.test.d.ts.map +0 -1
  207. package/dist-lib/lib/__tests__/floriday-customer-offers.test.js +0 -36
  208. package/dist-lib/lib/__tests__/floriday-fetch-status.test.d.ts +0 -2
  209. package/dist-lib/lib/__tests__/floriday-fetch-status.test.d.ts.map +0 -1
  210. package/dist-lib/lib/__tests__/floriday-fetch-status.test.js +0 -25
  211. package/dist-lib/lib/__tests__/floriday-write-mode.test.d.ts +0 -2
  212. package/dist-lib/lib/__tests__/floriday-write-mode.test.d.ts.map +0 -1
  213. package/dist-lib/lib/__tests__/floriday-write-mode.test.js +0 -40
  214. package/dist-lib/lib/__tests__/fust-dimensions.test.d.ts +0 -2
  215. package/dist-lib/lib/__tests__/fust-dimensions.test.d.ts.map +0 -1
  216. package/dist-lib/lib/__tests__/fust-dimensions.test.js +0 -27
  217. package/dist-lib/lib/__tests__/load-carriers.test.d.ts +0 -2
  218. package/dist-lib/lib/__tests__/load-carriers.test.d.ts.map +0 -1
  219. package/dist-lib/lib/__tests__/load-carriers.test.js +0 -15
  220. package/dist-lib/lib/__tests__/mirror-products.test.d.ts +0 -2
  221. package/dist-lib/lib/__tests__/mirror-products.test.d.ts.map +0 -1
  222. package/dist-lib/lib/__tests__/mirror-products.test.js +0 -13
  223. package/dist-lib/lib/__tests__/product-packings.test.d.ts +0 -2
  224. package/dist-lib/lib/__tests__/product-packings.test.d.ts.map +0 -1
  225. package/dist-lib/lib/__tests__/product-packings.test.js +0 -42
  226. package/dist-lib/lib/__tests__/publish-114.test.d.ts +0 -2
  227. package/dist-lib/lib/__tests__/publish-114.test.d.ts.map +0 -1
  228. package/dist-lib/lib/__tests__/publish-114.test.js +0 -31
  229. package/dist-lib/lib/__tests__/publish-packing-block.test.d.ts +0 -2
  230. package/dist-lib/lib/__tests__/publish-packing-block.test.d.ts.map +0 -1
  231. package/dist-lib/lib/__tests__/publish-packing-block.test.js +0 -14
  232. package/dist-lib/lib/__tests__/release-130.test.d.ts +0 -2
  233. package/dist-lib/lib/__tests__/release-130.test.d.ts.map +0 -1
  234. package/dist-lib/lib/__tests__/release-130.test.js +0 -103
  235. package/dist-lib/lib/__tests__/release-134.test.d.ts +0 -2
  236. package/dist-lib/lib/__tests__/release-134.test.d.ts.map +0 -1
  237. package/dist-lib/lib/__tests__/release-134.test.js +0 -50
  238. package/dist-lib/lib/__tests__/release-136.test.d.ts +0 -2
  239. package/dist-lib/lib/__tests__/release-136.test.d.ts.map +0 -1
  240. package/dist-lib/lib/__tests__/release-136.test.js +0 -36
  241. package/dist-lib/lib/__tests__/release-140.test.d.ts +0 -2
  242. package/dist-lib/lib/__tests__/release-140.test.d.ts.map +0 -1
  243. package/dist-lib/lib/__tests__/release-140.test.js +0 -42
  244. package/dist-lib/lib/__tests__/request-guard.test.d.ts +0 -2
  245. package/dist-lib/lib/__tests__/request-guard.test.d.ts.map +0 -1
  246. package/dist-lib/lib/__tests__/request-guard.test.js +0 -50
  247. package/dist-lib/lib/__tests__/stock-save.test.d.ts +0 -2
  248. package/dist-lib/lib/__tests__/stock-save.test.d.ts.map +0 -1
  249. package/dist-lib/lib/__tests__/stock-save.test.js +0 -35
  250. package/dist-lib/lib/__tests__/stock-scope.test.d.ts +0 -2
  251. package/dist-lib/lib/__tests__/stock-scope.test.d.ts.map +0 -1
  252. package/dist-lib/lib/__tests__/stock-scope.test.js +0 -44
  253. package/dist-lib/server-hooks/__tests__/trade-item-photo.test.d.ts +0 -2
  254. package/dist-lib/server-hooks/__tests__/trade-item-photo.test.d.ts.map +0 -1
  255. 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
- // 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"]);
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 alleen de door Floriday altijd verplichte kenmerken voor onbekende VBN-code", async () => {
166
+ it("geeft lege lijst terug voor onbekende VBN-code", async () => {
168
167
  const res = await computeVbnRequiredFeatures(client, "99999");
169
- expect(res.vbnCode).toBe("99999");
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
+ }