@flowselections/floriday-voorraad 1.0.127 → 1.0.129
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/voorraad/NieuwArtikelPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/NieuwArtikelPage.js +2 -0
- package/dist-lib/hooks/useLocalTradeItems.d.ts.map +1 -1
- package/dist-lib/hooks/useLocalTradeItems.js +4 -0
- package/dist-lib/integrations/supabase/types.d.ts +22 -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/article-code.d.ts +12 -0
- package/dist-lib/lib/article-code.d.ts.map +1 -0
- package/dist-lib/lib/article-code.js +29 -0
- package/dist-lib/lib/floriday-payload.d.ts.map +1 -1
- package/dist-lib/lib/floriday-payload.js +3 -0
- package/package.json +1 -1
- package/sql/floriday-voorraad-schema.sql +59 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NieuwArtikelPage.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/NieuwArtikelPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NieuwArtikelPage.d.ts","sourceRoot":"","sources":["../../../src/components/voorraad/NieuwArtikelPage.tsx"],"names":[],"mappings":"AA6BA,wBAAgB,gBAAgB,gCA4X/B"}
|
|
@@ -17,6 +17,7 @@ import { LOCAL_STOCK_TEXT } from "../../lib/stock-scope.js";
|
|
|
17
17
|
import { FloridayConnectionNotice } from "./FloridayConnectionNotice.js";
|
|
18
18
|
import { useLoadCarriers } from "../../hooks/useLoadCarriers.js";
|
|
19
19
|
import { saveOwnPackings } from "../../lib/product-packings.js";
|
|
20
|
+
import { assertArticleCode } from "../../lib/article-code.js";
|
|
20
21
|
import { EMPTY_SIMPLE_PACKING, engineOordeelRegel, missingPackingFields, simplePackingToRow, } from "../../lib/simple-packing.js";
|
|
21
22
|
const STEPS = ["Naam en code", "Voorraad", "Prijs", "Belading"];
|
|
22
23
|
export function NieuwArtikelPage() {
|
|
@@ -95,6 +96,7 @@ export function NieuwArtikelPage() {
|
|
|
95
96
|
const priceNum = price.trim() === "" ? null : Number(price.replace(",", "."));
|
|
96
97
|
if (priceNum !== null && !(priceNum > 0))
|
|
97
98
|
throw new Error("Vul een geldige prijs in (groter dan 0)");
|
|
99
|
+
assertArticleCode(code, name, "manual");
|
|
98
100
|
const packingRow = simplePackingToRow(packing);
|
|
99
101
|
let id = insertedIdRef.current;
|
|
100
102
|
if (!id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalTradeItems.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocalTradeItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAwB,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLocalTradeItems.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocalTradeItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAwB,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIvG;;;;;GAKG;AAEH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mBA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M,GAAG,IAAI,CAAC;IACpC,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuGlB;AAED,wEAAwE;AACxE,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAqBf;AAGD;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhF;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGpE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from "react";
|
|
2
2
|
import { supabase } from "../integrations/supabase/client.js";
|
|
3
3
|
import { derivePrimaryPacking } from "../lib/floriday-client.js";
|
|
4
|
+
import { assertArticleCode } from "../lib/article-code.js";
|
|
4
5
|
function asRecord(value) {
|
|
5
6
|
return value && typeof value === "object" && !Array.isArray(value)
|
|
6
7
|
? value
|
|
@@ -150,6 +151,9 @@ export async function upsertLocalTradeItem(params) {
|
|
|
150
151
|
if (!userId)
|
|
151
152
|
throw new Error("Niet ingelogd");
|
|
152
153
|
const payload = params.data ?? {};
|
|
154
|
+
// Handmatig opslaan in het scherm: invultekst of code gelijk aan naam weigeren (concept mag nog leeg zijn).
|
|
155
|
+
if ((payload.articleCode ?? "").trim())
|
|
156
|
+
assertArticleCode(payload.articleCode, payload.name, "manual");
|
|
153
157
|
const linkedProductId = typeof payload.linkedProductId === "string" && payload.linkedProductId
|
|
154
158
|
? String(payload.linkedProductId)
|
|
155
159
|
: null;
|
|
@@ -28593,6 +28593,21 @@ export type Database = {
|
|
|
28593
28593
|
};
|
|
28594
28594
|
Relationships: [];
|
|
28595
28595
|
};
|
|
28596
|
+
voorraad_placeholder_codes: {
|
|
28597
|
+
Row: {
|
|
28598
|
+
code: string;
|
|
28599
|
+
created_at: string;
|
|
28600
|
+
};
|
|
28601
|
+
Insert: {
|
|
28602
|
+
code: string;
|
|
28603
|
+
created_at?: string;
|
|
28604
|
+
};
|
|
28605
|
+
Update: {
|
|
28606
|
+
code?: string;
|
|
28607
|
+
created_at?: string;
|
|
28608
|
+
};
|
|
28609
|
+
Relationships: [];
|
|
28610
|
+
};
|
|
28596
28611
|
voorraad_publish_attempts: {
|
|
28597
28612
|
Row: {
|
|
28598
28613
|
action: string;
|
|
@@ -44116,6 +44131,13 @@ export type Database = {
|
|
|
44116
44131
|
};
|
|
44117
44132
|
Returns: string[];
|
|
44118
44133
|
};
|
|
44134
|
+
voorraad_placeholder_code_reason: {
|
|
44135
|
+
Args: {
|
|
44136
|
+
p_code: string;
|
|
44137
|
+
p_name: string;
|
|
44138
|
+
};
|
|
44139
|
+
Returns: string;
|
|
44140
|
+
};
|
|
44119
44141
|
voorraad_production_enabled: {
|
|
44120
44142
|
Args: never;
|
|
44121
44143
|
Returns: boolean;
|