@flowselections/floriday-afhandeling-module 1.0.115 → 1.0.117
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/integrations/supabase/types.d.ts +345 -201
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/afleverlocatie.d.ts +94 -0
- package/dist-lib/lib/afleverlocatie.d.ts.map +1 -0
- package/dist-lib/lib/afleverlocatie.js +197 -0
- package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday.functions.js +35 -23
- package/package.json +1 -1
- package/dist-lib/components/afhandeling/WerkplekWaarschuwing.d.ts +0 -10
- package/dist-lib/components/afhandeling/WerkplekWaarschuwing.d.ts.map +0 -1
- package/dist-lib/components/afhandeling/WerkplekWaarschuwing.js +0 -28
- package/dist-lib/lib/aanmeldStatus.test.d.ts +0 -2
- package/dist-lib/lib/aanmeldStatus.test.d.ts.map +0 -1
- package/dist-lib/lib/aanmeldStatus.test.js +0 -15
- package/dist-lib/lib/afhandelingDefaults.test.d.ts +0 -2
- package/dist-lib/lib/afhandelingDefaults.test.d.ts.map +0 -1
- package/dist-lib/lib/afhandelingDefaults.test.js +0 -21
- package/dist-lib/lib/barcodeFormats.test.d.ts +0 -2
- package/dist-lib/lib/barcodeFormats.test.d.ts.map +0 -1
- package/dist-lib/lib/barcodeFormats.test.js +0 -10
- package/dist-lib/lib/carrierSignupMail.server.d.ts +0 -54
- package/dist-lib/lib/carrierSignupMail.server.d.ts.map +0 -1
- package/dist-lib/lib/carrierSignupMail.server.js +0 -66
- package/dist-lib/lib/carrierWizard.test.d.ts +0 -2
- package/dist-lib/lib/carrierWizard.test.d.ts.map +0 -1
- package/dist-lib/lib/carrierWizard.test.js +0 -65
- package/dist-lib/lib/controleAfwijking.test.d.ts +0 -2
- package/dist-lib/lib/controleAfwijking.test.d.ts.map +0 -1
- package/dist-lib/lib/controleAfwijking.test.js +0 -53
- package/dist-lib/lib/controleLijstPayload.test.d.ts +0 -2
- package/dist-lib/lib/controleLijstPayload.test.d.ts.map +0 -1
- package/dist-lib/lib/controleLijstPayload.test.js +0 -34
- package/dist-lib/lib/cronVak.test.d.ts +0 -2
- package/dist-lib/lib/cronVak.test.d.ts.map +0 -1
- package/dist-lib/lib/cronVak.test.js +0 -25
- package/dist-lib/lib/dayOrders.test.d.ts +0 -2
- package/dist-lib/lib/dayOrders.test.d.ts.map +0 -1
- package/dist-lib/lib/dayOrders.test.js +0 -27
- package/dist-lib/lib/deliveryDisplayStatus.test.d.ts +0 -2
- package/dist-lib/lib/deliveryDisplayStatus.test.d.ts.map +0 -1
- package/dist-lib/lib/deliveryDisplayStatus.test.js +0 -22
- package/dist-lib/lib/deliveryNotePrint.d.ts +0 -34
- package/dist-lib/lib/deliveryNotePrint.d.ts.map +0 -1
- package/dist-lib/lib/deliveryNotePrint.js +0 -219
- package/dist-lib/lib/documentKeuze.test.d.ts +0 -2
- package/dist-lib/lib/documentKeuze.test.d.ts.map +0 -1
- package/dist-lib/lib/documentKeuze.test.js +0 -44
- package/dist-lib/lib/extraPlaten.test.d.ts +0 -2
- package/dist-lib/lib/extraPlaten.test.d.ts.map +0 -1
- package/dist-lib/lib/extraPlaten.test.js +0 -21
- package/dist-lib/lib/floridayCorrectie.test.d.ts +0 -2
- package/dist-lib/lib/floridayCorrectie.test.d.ts.map +0 -1
- package/dist-lib/lib/floridayCorrectie.test.js +0 -30
- package/dist-lib/lib/floridayFulfilled.test.d.ts +0 -2
- package/dist-lib/lib/floridayFulfilled.test.d.ts.map +0 -1
- package/dist-lib/lib/floridayFulfilled.test.js +0 -28
- package/dist-lib/lib/floridayLoadingSend.test.d.ts +0 -2
- package/dist-lib/lib/floridayLoadingSend.test.d.ts.map +0 -1
- package/dist-lib/lib/floridayLoadingSend.test.js +0 -76
- package/dist-lib/lib/floridaySchrijfstand.test.d.ts +0 -2
- package/dist-lib/lib/floridaySchrijfstand.test.d.ts.map +0 -1
- package/dist-lib/lib/floridaySchrijfstand.test.js +0 -32
- package/dist-lib/lib/floridayTegengehouden.test.d.ts +0 -2
- package/dist-lib/lib/floridayTegengehouden.test.d.ts.map +0 -1
- package/dist-lib/lib/floridayTegengehouden.test.js +0 -63
- package/dist-lib/lib/floridayTerugkoppeling.test.d.ts +0 -2
- package/dist-lib/lib/floridayTerugkoppeling.test.d.ts.map +0 -1
- package/dist-lib/lib/floridayTerugkoppeling.test.js +0 -108
- package/dist-lib/lib/floridayTransporteur.test.d.ts +0 -2
- package/dist-lib/lib/floridayTransporteur.test.d.ts.map +0 -1
- package/dist-lib/lib/floridayTransporteur.test.js +0 -19
- package/dist-lib/lib/labels.test.d.ts +0 -2
- package/dist-lib/lib/labels.test.d.ts.map +0 -1
- package/dist-lib/lib/labels.test.js +0 -21
- package/dist-lib/lib/lijst-stand.test.d.ts +0 -2
- package/dist-lib/lib/lijst-stand.test.d.ts.map +0 -1
- package/dist-lib/lib/lijst-stand.test.js +0 -72
- package/dist-lib/lib/orderInzicht.test.d.ts +0 -2
- package/dist-lib/lib/orderInzicht.test.d.ts.map +0 -1
- package/dist-lib/lib/orderInzicht.test.js +0 -66
- package/dist-lib/lib/pickupMoment.test.d.ts +0 -2
- package/dist-lib/lib/pickupMoment.test.d.ts.map +0 -1
- package/dist-lib/lib/pickupMoment.test.js +0 -21
- package/dist-lib/lib/printBewaking.test.d.ts +0 -2
- package/dist-lib/lib/printBewaking.test.d.ts.map +0 -1
- package/dist-lib/lib/printBewaking.test.js +0 -53
- package/dist-lib/lib/terugkoppelingAangenomen.test.d.ts +0 -2
- package/dist-lib/lib/terugkoppelingAangenomen.test.d.ts.map +0 -1
- package/dist-lib/lib/terugkoppelingAangenomen.test.js +0 -142
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Afleverlocatie (land, provincie, plaats) per order voor de planning.
|
|
3
|
+
*
|
|
4
|
+
* In orders.custom_fields.delivery_location staat óf het id van een
|
|
5
|
+
* customer_delivery_locations-rij, óf (Floriday- en klokorders) een GLN van
|
|
6
|
+
* 13 cijfers; soms staat de GLN ook in custom_fields.delivery_location_gln.
|
|
7
|
+
* Volgorde, eerste treffer telt:
|
|
8
|
+
* 1. op id (alleen geldige uuid's);
|
|
9
|
+
* 2. op GLN in customer_delivery_locations.gln;
|
|
10
|
+
* 3. op GLN in customer_delivery_location_glns (removed_at leeg) → afleveradres;
|
|
11
|
+
* 4. op GLN in floriday_delivery_locations_cache (adres uit data.address).
|
|
12
|
+
* Bij meerdere treffers op één GLN wint het adres van de klant van de order.
|
|
13
|
+
* Elke opvraging staat los: één mislukte opvraging of één foute waarde laat de
|
|
14
|
+
* rest gewoon werken. Echte fouten worden gestructureerd gelogd en teruggegeven.
|
|
15
|
+
*/
|
|
16
|
+
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
17
|
+
export interface LocatieAdres {
|
|
18
|
+
country: string | null;
|
|
19
|
+
province: string | null;
|
|
20
|
+
city: string | null;
|
|
21
|
+
}
|
|
22
|
+
export interface OrderLocatieVraag {
|
|
23
|
+
orderId: string;
|
|
24
|
+
orderNumber: string | null;
|
|
25
|
+
customerId: string | null;
|
|
26
|
+
deliveryLocation: unknown;
|
|
27
|
+
deliveryLocationGln: unknown;
|
|
28
|
+
}
|
|
29
|
+
export declare const isUuid: (v: string) => boolean;
|
|
30
|
+
export declare const isGln: (v: string) => boolean;
|
|
31
|
+
export interface OrderSleutels {
|
|
32
|
+
id: string | null;
|
|
33
|
+
glns: string[];
|
|
34
|
+
/** Waarden die geen id en geen GLN zijn (worden overgeslagen en gemeld). */
|
|
35
|
+
ongeldig: string[];
|
|
36
|
+
}
|
|
37
|
+
/** Splitst de waarden van één order in een geldig id, GLN's en ongeldige waarden. */
|
|
38
|
+
export declare function sleutelsVanOrder(v: Pick<OrderLocatieVraag, "deliveryLocation" | "deliveryLocationGln">): OrderSleutels;
|
|
39
|
+
export interface LocatieRij extends LocatieAdres {
|
|
40
|
+
id: string;
|
|
41
|
+
customer_id: string | null;
|
|
42
|
+
gln?: string | null;
|
|
43
|
+
}
|
|
44
|
+
export interface GlnKoppelRij {
|
|
45
|
+
gln: string;
|
|
46
|
+
customer_id: string | null;
|
|
47
|
+
locatie: (LocatieAdres & {
|
|
48
|
+
customer_id: string | null;
|
|
49
|
+
}) | null;
|
|
50
|
+
}
|
|
51
|
+
export interface CacheRij {
|
|
52
|
+
gln_code: string | null;
|
|
53
|
+
is_deleted: boolean | null;
|
|
54
|
+
updated_at: string | null;
|
|
55
|
+
data: unknown;
|
|
56
|
+
}
|
|
57
|
+
export interface LocatieBronnen {
|
|
58
|
+
opId: Map<string, LocatieAdres>;
|
|
59
|
+
opGln: Map<string, Array<LocatieAdres & {
|
|
60
|
+
customer_id: string | null;
|
|
61
|
+
}>>;
|
|
62
|
+
viaKoppeling: Map<string, Array<LocatieAdres & {
|
|
63
|
+
customer_id: string | null;
|
|
64
|
+
}>>;
|
|
65
|
+
uitCache: Map<string, LocatieAdres>;
|
|
66
|
+
}
|
|
67
|
+
/** Adres uit één cacherij (data.address van Floriday). */
|
|
68
|
+
export declare function adresUitCache(data: unknown): LocatieAdres | null;
|
|
69
|
+
/** Bouwt de opzoektabellen; rijen worden deterministisch gesorteerd. */
|
|
70
|
+
export declare function bouwBronnen(input: {
|
|
71
|
+
opId: LocatieRij[];
|
|
72
|
+
opGln: LocatieRij[];
|
|
73
|
+
koppelingen: GlnKoppelRij[];
|
|
74
|
+
cache: CacheRij[];
|
|
75
|
+
}): LocatieBronnen;
|
|
76
|
+
/** Kiest het adres voor één order volgens de vaste volgorde. */
|
|
77
|
+
export declare function kiesLocatie(sleutels: OrderSleutels, customerId: string | null, bronnen: LocatieBronnen): LocatieAdres | undefined;
|
|
78
|
+
export interface LocatieFout {
|
|
79
|
+
opvraging: "op_id" | "op_gln" | "via_koppeling" | "floriday_cache";
|
|
80
|
+
message: string;
|
|
81
|
+
code: string | null;
|
|
82
|
+
orderCount: number;
|
|
83
|
+
}
|
|
84
|
+
export interface AfleverlocatiesResultaat {
|
|
85
|
+
perOrder: Map<string, LocatieAdres>;
|
|
86
|
+
fouten: LocatieFout[];
|
|
87
|
+
ongeldig: Array<{
|
|
88
|
+
orderNumber: string | null;
|
|
89
|
+
waarde: string;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
/** Laadt de afleverlocaties voor alle orders; alle opvragingen tegelijk. */
|
|
93
|
+
export declare function laadAfleverlocaties(supabase: SupabaseClient, vragen: OrderLocatieVraag[]): Promise<AfleverlocatiesResultaat>;
|
|
94
|
+
//# sourceMappingURL=afleverlocatie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"afleverlocatie.d.ts","sourceRoot":"","sources":["../../src/lib/afleverlocatie.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAcD,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,KAAG,OAA0B,CAAC;AAC9D,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,KAAG,OAAyB,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB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=== "number" && Number.isSafeInteger(v) && v >= 0)
|
|
9
|
+
return String(v);
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
export const isUuid = (v) => UUID_RE.test(v);
|
|
13
|
+
export const isGln = (v) => GLN_RE.test(v);
|
|
14
|
+
/** Splitst de waarden van één order in een geldig id, GLN's en ongeldige waarden. */
|
|
15
|
+
export function sleutelsVanOrder(v) {
|
|
16
|
+
const out = { id: null, glns: [], ongeldig: [] };
|
|
17
|
+
const loc = alsTekst(v.deliveryLocation);
|
|
18
|
+
const gln = alsTekst(v.deliveryLocationGln);
|
|
19
|
+
const voegGlnToe = (g) => { if (!out.glns.includes(g))
|
|
20
|
+
out.glns.push(g); };
|
|
21
|
+
if (loc) {
|
|
22
|
+
if (isUuid(loc))
|
|
23
|
+
out.id = loc.toLowerCase();
|
|
24
|
+
else if (isGln(loc))
|
|
25
|
+
voegGlnToe(loc);
|
|
26
|
+
else
|
|
27
|
+
out.ongeldig.push(loc);
|
|
28
|
+
}
|
|
29
|
+
if (gln) {
|
|
30
|
+
if (isGln(gln))
|
|
31
|
+
voegGlnToe(gln);
|
|
32
|
+
else if (gln !== loc)
|
|
33
|
+
out.ongeldig.push(gln);
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
const adres = (r) => ({
|
|
38
|
+
country: r.country ?? null,
|
|
39
|
+
province: r.province ?? null,
|
|
40
|
+
city: r.city ?? null,
|
|
41
|
+
});
|
|
42
|
+
function kiesVoorKlant(rijen, customerId) {
|
|
43
|
+
if (!rijen || rijen.length === 0)
|
|
44
|
+
return undefined;
|
|
45
|
+
const eigen = customerId ? rijen.find((r) => r.customer_id === customerId) : undefined;
|
|
46
|
+
return adres(eigen ?? rijen[0]);
|
|
47
|
+
}
|
|
48
|
+
function tekstOfNull(v) {
|
|
49
|
+
return typeof v === "string" && v.trim() ? v.trim() : null;
|
|
50
|
+
}
|
|
51
|
+
/** Adres uit één cacherij (data.address van Floriday). */
|
|
52
|
+
export function adresUitCache(data) {
|
|
53
|
+
if (!data || typeof data !== "object")
|
|
54
|
+
return null;
|
|
55
|
+
const a = data.address;
|
|
56
|
+
if (!a || typeof a !== "object")
|
|
57
|
+
return null;
|
|
58
|
+
const r = a;
|
|
59
|
+
const out = {
|
|
60
|
+
country: tekstOfNull(r.countryCode),
|
|
61
|
+
province: tekstOfNull(r.stateOrProvince),
|
|
62
|
+
city: tekstOfNull(r.city),
|
|
63
|
+
};
|
|
64
|
+
return out.country || out.province || out.city ? out : null;
|
|
65
|
+
}
|
|
66
|
+
/** Bouwt de opzoektabellen; rijen worden deterministisch gesorteerd. */
|
|
67
|
+
export function bouwBronnen(input) {
|
|
68
|
+
const opId = new Map();
|
|
69
|
+
for (const r of input.opId)
|
|
70
|
+
opId.set(r.id.toLowerCase(), adres(r));
|
|
71
|
+
const opGln = new Map();
|
|
72
|
+
for (const r of [...input.opGln].sort((a, b) => a.id.localeCompare(b.id))) {
|
|
73
|
+
if (!r.gln)
|
|
74
|
+
continue;
|
|
75
|
+
const lijst = opGln.get(r.gln) ?? [];
|
|
76
|
+
lijst.push({ ...adres(r), customer_id: r.customer_id ?? null });
|
|
77
|
+
opGln.set(r.gln, lijst);
|
|
78
|
+
}
|
|
79
|
+
const viaKoppeling = new Map();
|
|
80
|
+
for (const k of input.koppelingen) {
|
|
81
|
+
if (!k.locatie)
|
|
82
|
+
continue;
|
|
83
|
+
const lijst = viaKoppeling.get(k.gln) ?? [];
|
|
84
|
+
lijst.push({ ...adres(k.locatie), customer_id: k.locatie.customer_id ?? k.customer_id ?? null });
|
|
85
|
+
viaKoppeling.set(k.gln, lijst);
|
|
86
|
+
}
|
|
87
|
+
// Cache: niet-verwijderde rijen eerst, daarna de nieuwste.
|
|
88
|
+
const uitCache = new Map();
|
|
89
|
+
const gesorteerd = [...input.cache].sort((a, b) => {
|
|
90
|
+
const del = Number(!!a.is_deleted) - Number(!!b.is_deleted);
|
|
91
|
+
if (del !== 0)
|
|
92
|
+
return del;
|
|
93
|
+
return (b.updated_at ?? "").localeCompare(a.updated_at ?? "");
|
|
94
|
+
});
|
|
95
|
+
for (const r of gesorteerd) {
|
|
96
|
+
if (!r.gln_code || uitCache.has(r.gln_code))
|
|
97
|
+
continue;
|
|
98
|
+
const a = adresUitCache(r.data);
|
|
99
|
+
if (a)
|
|
100
|
+
uitCache.set(r.gln_code, a);
|
|
101
|
+
}
|
|
102
|
+
return { opId, opGln, viaKoppeling, uitCache };
|
|
103
|
+
}
|
|
104
|
+
/** Kiest het adres voor één order volgens de vaste volgorde. */
|
|
105
|
+
export function kiesLocatie(sleutels, customerId, bronnen) {
|
|
106
|
+
if (sleutels.id) {
|
|
107
|
+
const hit = bronnen.opId.get(sleutels.id);
|
|
108
|
+
if (hit)
|
|
109
|
+
return hit;
|
|
110
|
+
}
|
|
111
|
+
for (const gln of sleutels.glns) {
|
|
112
|
+
const hit = kiesVoorKlant(bronnen.opGln.get(gln), customerId) ??
|
|
113
|
+
kiesVoorKlant(bronnen.viaKoppeling.get(gln), customerId) ??
|
|
114
|
+
bronnen.uitCache.get(gln);
|
|
115
|
+
if (hit)
|
|
116
|
+
return hit;
|
|
117
|
+
}
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
async function veilig(p) {
|
|
121
|
+
if (!p)
|
|
122
|
+
return { data: [], error: null };
|
|
123
|
+
try {
|
|
124
|
+
return await p;
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
return { data: null, error: { message: e instanceof Error ? e.message : String(e), code: null } };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** Laadt de afleverlocaties voor alle orders; alle opvragingen tegelijk. */
|
|
131
|
+
export async function laadAfleverlocaties(supabase, vragen) {
|
|
132
|
+
const sleutelsPerOrder = new Map();
|
|
133
|
+
const ids = new Set();
|
|
134
|
+
const glns = new Set();
|
|
135
|
+
const ongeldig = [];
|
|
136
|
+
for (const v of vragen) {
|
|
137
|
+
const s = sleutelsVanOrder(v);
|
|
138
|
+
sleutelsPerOrder.set(v.orderId, s);
|
|
139
|
+
if (s.id)
|
|
140
|
+
ids.add(s.id);
|
|
141
|
+
for (const g of s.glns)
|
|
142
|
+
glns.add(g);
|
|
143
|
+
for (const w of s.ongeldig)
|
|
144
|
+
ongeldig.push({ orderNumber: v.orderNumber, waarde: w });
|
|
145
|
+
}
|
|
146
|
+
const idLijst = [...ids];
|
|
147
|
+
const glnLijst = [...glns];
|
|
148
|
+
const [opIdRes, opGlnRes, koppelRes, cacheRes] = await Promise.all([
|
|
149
|
+
veilig(idLijst.length
|
|
150
|
+
? supabase.from("customer_delivery_locations").select("id, customer_id, country, province, city").in("id", idLijst)
|
|
151
|
+
: null),
|
|
152
|
+
veilig(glnLijst.length
|
|
153
|
+
? supabase.from("customer_delivery_locations").select("id, customer_id, gln, country, province, city").in("gln", glnLijst)
|
|
154
|
+
: null),
|
|
155
|
+
veilig(glnLijst.length
|
|
156
|
+
? supabase
|
|
157
|
+
.from("customer_delivery_location_glns")
|
|
158
|
+
.select("gln, customer_id, locatie:customer_delivery_locations!customer_delivery_location_glns_location_id_fkey(customer_id, country, province, city)")
|
|
159
|
+
.in("gln", glnLijst)
|
|
160
|
+
.is("removed_at", null)
|
|
161
|
+
: null),
|
|
162
|
+
veilig(glnLijst.length
|
|
163
|
+
? supabase.from("floriday_delivery_locations_cache").select("gln_code, is_deleted, updated_at, data").in("gln_code", glnLijst)
|
|
164
|
+
: null),
|
|
165
|
+
]);
|
|
166
|
+
const fouten = [];
|
|
167
|
+
const telOrders = (pred) => [...sleutelsPerOrder.values()].filter(pred).length;
|
|
168
|
+
const noteer = (opvraging, res, pred) => {
|
|
169
|
+
if (!res.error)
|
|
170
|
+
return;
|
|
171
|
+
fouten.push({ opvraging, message: res.error.message, code: res.error.code ?? null, orderCount: telOrders(pred) });
|
|
172
|
+
};
|
|
173
|
+
noteer("op_id", opIdRes, (s) => !!s.id);
|
|
174
|
+
noteer("op_gln", opGlnRes, (s) => s.glns.length > 0);
|
|
175
|
+
noteer("via_koppeling", koppelRes, (s) => s.glns.length > 0);
|
|
176
|
+
noteer("floriday_cache", cacheRes, (s) => s.glns.length > 0);
|
|
177
|
+
const koppelingen = (koppelRes.data ?? []).map((k) => ({
|
|
178
|
+
...k,
|
|
179
|
+
locatie: Array.isArray(k.locatie) ? (k.locatie[0] ?? null) : k.locatie,
|
|
180
|
+
}));
|
|
181
|
+
const bronnen = bouwBronnen({
|
|
182
|
+
opId: opIdRes.data ?? [],
|
|
183
|
+
opGln: opGlnRes.data ?? [],
|
|
184
|
+
koppelingen,
|
|
185
|
+
cache: cacheRes.data ?? [],
|
|
186
|
+
});
|
|
187
|
+
const perOrder = new Map();
|
|
188
|
+
for (const v of vragen) {
|
|
189
|
+
const s = sleutelsPerOrder.get(v.orderId);
|
|
190
|
+
if (!s)
|
|
191
|
+
continue;
|
|
192
|
+
const hit = kiesLocatie(s, v.customerId, bronnen);
|
|
193
|
+
if (hit)
|
|
194
|
+
perOrder.set(v.orderId, hit);
|
|
195
|
+
}
|
|
196
|
+
return { perOrder, fouten, ongeldig };
|
|
197
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floriday.functions.d.ts","sourceRoot":"","sources":["../../src/lib/floriday.functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"floriday.functions.d.ts","sourceRoot":"","sources":["../../src/lib/floriday.functions.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC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AAG,IAAI,CAAC;IAC3B,+CAA+C;IAC/C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAGD;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;YAEsB,aAAa,EAAE;YAAU,MAAM;GAqB7E,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
2
|
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
3
3
|
import { isVisibleOrderStatus } from "./orderStatus.js";
|
|
4
|
+
import { laadAfleverlocaties } from "./afleverlocatie.js";
|
|
4
5
|
function dayKey(d) {
|
|
5
6
|
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
6
7
|
}
|
|
@@ -84,13 +85,6 @@ export const getFloridayOrders = createServerFn({ method: "GET" })
|
|
|
84
85
|
// zichtbaar; geannuleerde/vervallen/concept/gereserveerde orders niet.
|
|
85
86
|
const rows = (orderRows ?? []).filter((row) => isVisibleOrderStatus(row.status));
|
|
86
87
|
const customerIds = Array.from(new Set(rows.map((row) => row.customer_id).filter((v) => !!v)));
|
|
87
|
-
const deliveryLocationIds = Array.from(new Set(rows
|
|
88
|
-
.map((row) => {
|
|
89
|
-
const fields = (row.custom_fields ?? {});
|
|
90
|
-
const id = fields.delivery_location;
|
|
91
|
-
return typeof id === "string" && id ? id : null;
|
|
92
|
-
})
|
|
93
|
-
.filter((v) => !!v)));
|
|
94
88
|
// Floriday sales-order-id's van de orders die de Verkoop-module kent.
|
|
95
89
|
const salesOrderIdByOrderId = new Map();
|
|
96
90
|
for (const row of rows) {
|
|
@@ -105,9 +99,17 @@ export const getFloridayOrders = createServerFn({ method: "GET" })
|
|
|
105
99
|
customerIds.length > 0
|
|
106
100
|
? supabase.from("customers").select("id, country").in("id", customerIds)
|
|
107
101
|
: Promise.resolve({ data: [], error: null }),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
// Afleverlocaties: id's en GLN's apart, elke opvraging los (zie afleverlocatie.ts).
|
|
103
|
+
laadAfleverlocaties(supabase, rows.map((row) => {
|
|
104
|
+
const fields = (row.custom_fields ?? {});
|
|
105
|
+
return {
|
|
106
|
+
orderId: row.id,
|
|
107
|
+
orderNumber: row.order_number ?? null,
|
|
108
|
+
customerId: row.customer_id ?? null,
|
|
109
|
+
deliveryLocation: fields.delivery_location,
|
|
110
|
+
deliveryLocationGln: fields.delivery_location_gln,
|
|
111
|
+
};
|
|
112
|
+
})),
|
|
111
113
|
salesOrderIds.length > 0
|
|
112
114
|
? supabase.from("floriday_customer_stickers_cache").select("sales_order_id, quantity, is_deleted")
|
|
113
115
|
.in("sales_order_id", salesOrderIds).eq("is_deleted", false)
|
|
@@ -119,16 +121,27 @@ export const getFloridayOrders = createServerFn({ method: "GET" })
|
|
|
119
121
|
for (const c of (customersRes.data ?? [])) {
|
|
120
122
|
customerCountryById.set(c.id, c.country ?? null);
|
|
121
123
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
if (locationsRes.ongeldig.length > 0) {
|
|
125
|
+
console.warn("[planning-orders] delivery location value skipped", {
|
|
126
|
+
reason: "geen id en geen GLN",
|
|
127
|
+
count: locationsRes.ongeldig.length,
|
|
128
|
+
orders: locationsRes.ongeldig.slice(0, 20),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
for (const fout of locationsRes.fouten) {
|
|
132
|
+
console.error("[planning-orders] delivery location lookup failed", {
|
|
133
|
+
soort: "afleverlocatie",
|
|
134
|
+
opvraging: fout.opvraging,
|
|
135
|
+
code: fout.code,
|
|
136
|
+
message: fout.message,
|
|
137
|
+
orderCount: fout.orderCount,
|
|
138
|
+
range,
|
|
139
|
+
userId: context.userId,
|
|
130
140
|
});
|
|
131
141
|
}
|
|
142
|
+
const locatieFoutMelding = locationsRes.fouten.length > 0
|
|
143
|
+
? "Niet alle afleveradressen konden worden opgezocht; land, provincie of plaats kan bij sommige orders ontbreken. Probeer het opnieuw; blijft dit zo, neem dan contact op met de beheerder."
|
|
144
|
+
: undefined;
|
|
132
145
|
// Stickers alleen voor de bekende Floriday-orders.
|
|
133
146
|
const stickerOrderIds = new Set();
|
|
134
147
|
if (stickersRes.error) {
|
|
@@ -160,10 +173,7 @@ export const getFloridayOrders = createServerFn({ method: "GET" })
|
|
|
160
173
|
cartCount = (cartCount ?? 0) + Math.ceil(qty / perCart);
|
|
161
174
|
}
|
|
162
175
|
const fields = (row.custom_fields ?? {});
|
|
163
|
-
const
|
|
164
|
-
const deliveryLocation = deliveryLocationId
|
|
165
|
-
? deliveryLocationById.get(deliveryLocationId)
|
|
166
|
-
: undefined;
|
|
176
|
+
const deliveryLocation = locationsRes.perOrder.get(row.id);
|
|
167
177
|
const customerId = row.customer_id ?? null;
|
|
168
178
|
// Vervoerder van de order = uitsluitend orders.carrier_id (gedeeld contract), nooit custom_fields.carrier.
|
|
169
179
|
const rawCarrier = row.carrier_id;
|
|
@@ -204,7 +214,9 @@ export const getFloridayOrders = createServerFn({ method: "GET" })
|
|
|
204
214
|
nearestDeliveryDate,
|
|
205
215
|
durationMs: Date.now() - startedAt,
|
|
206
216
|
});
|
|
207
|
-
return
|
|
217
|
+
return locatieFoutMelding
|
|
218
|
+
? { orders, range, nearestDeliveryDate, error: locatieFoutMelding }
|
|
219
|
+
: { orders, range, nearestDeliveryDate };
|
|
208
220
|
});
|
|
209
221
|
/**
|
|
210
222
|
* Alle orders die in de Verkoop-module open of net afgehandeld zijn. Deze lijst
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Leest de ingestelde werkplek client-side (SSR-veilig). */
|
|
2
|
-
export declare function useWerkplek(): string | null;
|
|
3
|
-
/**
|
|
4
|
-
* Eén melding bovenaan een printscherm zolang er geen werkplek is ingesteld.
|
|
5
|
-
* Printknoppen zijn dan uitgeschakeld, zodat er geen fout per printactie komt.
|
|
6
|
-
*/
|
|
7
|
-
export declare function WerkplekWaarschuwing({ werkplek }: {
|
|
8
|
-
werkplek: string | null;
|
|
9
|
-
}): import("react").JSX.Element | null;
|
|
10
|
-
//# sourceMappingURL=WerkplekWaarschuwing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WerkplekWaarschuwing.d.ts","sourceRoot":"","sources":["../../../src/components/afhandeling/WerkplekWaarschuwing.tsx"],"names":[],"mappings":"AAIA,6DAA6D;AAC7D,wBAAgB,WAAW,IAAI,MAAM,GAAG,IAAI,CAa3C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,sCAW7E"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { AlertTriangle } from "lucide-react";
|
|
4
|
-
import { getWerkplek } from "../../lib/printing.js";
|
|
5
|
-
/** Leest de ingestelde werkplek client-side (SSR-veilig). */
|
|
6
|
-
export function useWerkplek() {
|
|
7
|
-
const [werkplek, setWerkplekState] = useState(null);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
setWerkplekState(getWerkplek());
|
|
10
|
-
const onStorage = () => setWerkplekState(getWerkplek());
|
|
11
|
-
window.addEventListener("storage", onStorage);
|
|
12
|
-
window.addEventListener("focus", onStorage);
|
|
13
|
-
return () => {
|
|
14
|
-
window.removeEventListener("storage", onStorage);
|
|
15
|
-
window.removeEventListener("focus", onStorage);
|
|
16
|
-
};
|
|
17
|
-
}, []);
|
|
18
|
-
return werkplek;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Eén melding bovenaan een printscherm zolang er geen werkplek is ingesteld.
|
|
22
|
-
* Printknoppen zijn dan uitgeschakeld, zodat er geen fout per printactie komt.
|
|
23
|
-
*/
|
|
24
|
-
export function WerkplekWaarschuwing({ werkplek }) {
|
|
25
|
-
if (werkplek)
|
|
26
|
-
return null;
|
|
27
|
-
return (_jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), _jsxs("div", { children: [_jsx("span", { className: "font-medium", children: "Geen werkplek ingesteld." }), " Printen is uitgeschakeld. Stel de werkplek (pickstation- of computernaam) in bij ", _jsx("strong", { children: "Instellingen" }), "."] })] }));
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aanmeldStatus.test.d.ts","sourceRoot":"","sources":["../../src/lib/aanmeldStatus.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { samenvattingTekst, wijzigingTekst } from "./aanmeldStatus.js";
|
|
3
|
-
describe("Aanmeldingen: samenvatting en wijzigingen", () => {
|
|
4
|
-
it("8 aanmeldingen: 5 verstuurd, 2 wachten, 1 nog niet compleet", () => {
|
|
5
|
-
expect(samenvattingTekst(8, { verstuurd: 5, wacht_goedkeuring: 2, niet_compleet: 1 }))
|
|
6
|
-
.toBe("8 aanmeldingen: 5 verstuurd, 2 wachten, 1 nog niet compleet");
|
|
7
|
-
});
|
|
8
|
-
it("een order erbij na versturen wordt genoemd", () => {
|
|
9
|
-
expect(wijzigingTekst({ orders_erbij: ["HO-1"], orders_eraf: [], karren_voor: 3, karren_nu: 4 }))
|
|
10
|
-
.toEqual(["Order erbij: HO-1", "Karren: was 3, nu 4"]);
|
|
11
|
-
});
|
|
12
|
-
it("alle orders eraf = aparte zin, geen dubbele lijst", () => {
|
|
13
|
-
expect(wijzigingTekst({ orders_eraf: ["HO-2"], alles_eraf: true, karren_voor: 2, karren_nu: 0 })[0]).toMatch(/Alle orders/);
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"afhandelingDefaults.test.d.ts","sourceRoot":"","sources":["../../src/lib/afhandelingDefaults.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
const schema = readFileSync(new URL("../../schema/90_afhandeling.sql", import.meta.url), "utf8");
|
|
4
|
-
const settings = readFileSync(new URL("./afhandelingSettings.functions.ts", import.meta.url), "utf8");
|
|
5
|
-
const control = readFileSync(new URL("./cartControl.functions.ts", import.meta.url), "utf8");
|
|
6
|
-
describe("standaardinstellingen Afhandeling", () => {
|
|
7
|
-
const values = schema.match(/VALUES \(v_uid, ([\s\S]*?), 10\)/)?.[1] + ", 10";
|
|
8
|
-
it("nieuwe rij: aanmeldmail uit, verwerken gepauzeerd, zelfde waarden als scherm zonder rij", () => {
|
|
9
|
-
expect(values.replace(/\s+/g, " ")).toBe("1, 1, false, 2, false, 60, 'afhandeling_carrier_signup', ARRAY[1,2,3,4,5]::smallint[], 0, true, false, 10");
|
|
10
|
-
});
|
|
11
|
-
it("scherm zonder rij gebruikt dezelfde waarden", () => {
|
|
12
|
-
expect(settings).toMatch(/signupMailEnabled: false/);
|
|
13
|
-
expect(settings).toMatch(/autoProcessPaused: true/);
|
|
14
|
-
expect(settings).toMatch(/pickDaysBeforeTransport: 1,[\s\S]*transportRegisterDaysBefore: 1,[\s\S]*maxWorkdaysEarlierPick: 2,[\s\S]*signupMailLeadMinutes: 2,/);
|
|
15
|
-
expect(control).toMatch(/CONSERVATIVE_BULK_MAX_CARTS = 10;/);
|
|
16
|
-
});
|
|
17
|
-
it("overschrijft nooit en is niet voor anon", () => {
|
|
18
|
-
expect(schema).toMatch(/ON CONFLICT \(user_id\) DO NOTHING/);
|
|
19
|
-
expect(schema).toMatch(/REVOKE ALL ON FUNCTION public\.afhandeling_ensure_defaults\(\) FROM PUBLIC, anon;/);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"barcodeFormats.test.d.ts","sourceRoot":"","sources":["../../src/lib/barcodeFormats.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { schoonScan, SCAN_FORMATEN } from "./barcodeFormats.js";
|
|
3
|
-
describe("camerascan", () => {
|
|
4
|
-
it("leest Code128 van de pakbon", () => {
|
|
5
|
-
expect(SCAN_FORMATEN).toContain("code_128");
|
|
6
|
-
});
|
|
7
|
-
it("haalt stuurtekens van de code", () => {
|
|
8
|
-
expect(schoonScan("\u001dLCD394854AF81A4C41\r\n")).toBe("LCD394854AF81A4C41");
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export interface SignupMailOrderItem {
|
|
2
|
-
name: string;
|
|
3
|
-
quantity: number | null;
|
|
4
|
-
unit: string | null;
|
|
5
|
-
}
|
|
6
|
-
export interface SignupMailCustomer {
|
|
7
|
-
name: string;
|
|
8
|
-
contactPerson?: string | null;
|
|
9
|
-
email?: string | null;
|
|
10
|
-
phone?: string | null;
|
|
11
|
-
customerNumber?: string | null;
|
|
12
|
-
}
|
|
13
|
-
export interface SignupMailAddress {
|
|
14
|
-
name?: string | null;
|
|
15
|
-
street?: string | null;
|
|
16
|
-
houseNumber?: string | null;
|
|
17
|
-
postalCode?: string | null;
|
|
18
|
-
city?: string | null;
|
|
19
|
-
province?: string | null;
|
|
20
|
-
country?: string | null;
|
|
21
|
-
}
|
|
22
|
-
export interface SignupMailOrderDetail {
|
|
23
|
-
orderNumber: string;
|
|
24
|
-
orderDate?: string | null;
|
|
25
|
-
deliveryDate?: string | null;
|
|
26
|
-
deliveryType: string;
|
|
27
|
-
notes?: string | null;
|
|
28
|
-
cartCount: number | null;
|
|
29
|
-
plantCount: number | null;
|
|
30
|
-
customer: SignupMailCustomer;
|
|
31
|
-
deliveryLocation?: SignupMailAddress | null;
|
|
32
|
-
pickupLocations?: string[];
|
|
33
|
-
items?: SignupMailOrderItem[];
|
|
34
|
-
}
|
|
35
|
-
export interface SignupMailOrderRow {
|
|
36
|
-
orderNumber: string;
|
|
37
|
-
customerName: string;
|
|
38
|
-
deliveryType: string;
|
|
39
|
-
cartCount: number | null;
|
|
40
|
-
}
|
|
41
|
-
export interface SignupMailInput {
|
|
42
|
-
carrierName: string;
|
|
43
|
-
pickupDate: Date;
|
|
44
|
-
pickupTime: string;
|
|
45
|
-
signupDeadline: Date;
|
|
46
|
-
orders: SignupMailOrderDetail[];
|
|
47
|
-
}
|
|
48
|
-
export declare function buildCarrierSignupMail(input: SignupMailInput): {
|
|
49
|
-
subject: string;
|
|
50
|
-
html: string;
|
|
51
|
-
text: string;
|
|
52
|
-
totalCarts: number;
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=carrierSignupMail.server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"carrierSignupMail.server.d.ts","sourceRoot":"","sources":["../../src/lib/carrierSignupMail.server.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,IA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