@flowselections/logistiek-engine 1.0.32 → 1.0.34

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 (46) hide show
  1. package/README.md +24 -24
  2. package/dist-lib/components/FloridayPoortCard.d.ts +2 -0
  3. package/dist-lib/components/FloridayPoortCard.d.ts.map +1 -0
  4. package/dist-lib/components/FloridayPoortCard.js +29 -0
  5. package/dist-lib/components/LogistiekEnginePage.d.ts.map +1 -1
  6. package/dist-lib/components/LogistiekEnginePage.js +2 -1
  7. package/dist-lib/hooks/useFloridayGate.d.ts +40 -0
  8. package/dist-lib/hooks/useFloridayGate.d.ts.map +1 -0
  9. package/dist-lib/hooks/useFloridayGate.js +50 -0
  10. package/dist-lib/index.d.ts +2 -0
  11. package/dist-lib/index.d.ts.map +1 -1
  12. package/dist-lib/index.js +2 -0
  13. package/dist-lib/integrations/supabase/auth-middleware.d.ts +162 -0
  14. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  15. package/dist-lib/integrations/supabase/client.d.ts +158 -1515
  16. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  17. package/dist-lib/integrations/supabase/client.server.d.ts +162 -0
  18. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  19. package/dist-lib/integrations/supabase/moduleClient.d.ts +162 -0
  20. package/dist-lib/integrations/supabase/moduleClient.d.ts.map +1 -1
  21. package/dist-lib/integrations/supabase/types.d.ts +162 -0
  22. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  23. package/dist-lib/lib/floridayDocuments.functions.d.ts +486 -0
  24. package/dist-lib/lib/floridayDocuments.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/floridayDocuments.server.d.ts +3 -4
  26. package/dist-lib/lib/floridayDocuments.server.d.ts.map +1 -1
  27. package/dist-lib/lib/floridayDocuments.server.js +24 -15
  28. package/dist-lib/lib/floridayGuard.server.d.ts +32 -0
  29. package/dist-lib/lib/floridayGuard.server.d.ts.map +1 -0
  30. package/dist-lib/lib/floridayGuard.server.js +137 -0
  31. package/dist-lib/lib/floridayPush.functions.d.ts +162 -0
  32. package/dist-lib/lib/floridayPush.functions.d.ts.map +1 -1
  33. package/dist-lib/lib/floridayPush.server.d.ts.map +1 -1
  34. package/dist-lib/lib/floridayPush.server.js +1 -1
  35. package/dist-lib/lib/loadCarrierPlanning.functions.d.ts +810 -0
  36. package/dist-lib/lib/loadCarrierPlanning.functions.d.ts.map +1 -1
  37. package/dist-lib/lib/logisticsRecalcJob.functions.d.ts +324 -0
  38. package/dist-lib/lib/logisticsRecalcJob.functions.d.ts.map +1 -1
  39. package/dist-lib/lib/logisticsRecalculate.functions.d.ts +162 -0
  40. package/dist-lib/lib/logisticsRecalculate.functions.d.ts.map +1 -1
  41. package/dist-lib/lib/modulePrompts.d.ts +1 -0
  42. package/dist-lib/lib/modulePrompts.d.ts.map +1 -1
  43. package/dist-lib/lib/modulePrompts.js +2707 -2578
  44. package/dist-lib/lib/ruleEngineSchema.d.ts.map +1 -1
  45. package/dist-lib/lib/ruleEngineSchema.js +7 -0
  46. package/package.json +1 -1
package/README.md CHANGED
@@ -1,24 +1,24 @@
1
- # logistiek Engine
2
-
3
- blank project start
4
-
5
- This project was built with [Lovable](https://lovable.dev).
6
-
7
- ## Build with Lovable
8
-
9
- Continue developing this project in the [Lovable editor](https://lovable.dev/projects/316ec9c5-0f01-408a-b7ec-3d4dccf9b65d).
10
-
11
- - **Ship faster**: describe what you want to build and Lovable handles the code.
12
- - **Stay in sync**: every change made in Lovable is committed straight to this repository.
13
- - **Full ownership**: this code is yours. Push to `main` on GitHub and your changes sync back into Lovable, ready for your next prompt.
14
-
15
- ## Development
16
-
17
- Prefer working locally? You need Node.js and npm — [install with nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
18
-
19
- ```sh
20
- git clone <this-repository-url>
21
- cd <repository-name>
22
- npm i
23
- npm run dev
24
- ```
1
+ # logistiek Engine
2
+
3
+ blank project start
4
+
5
+ This project was built with [Lovable](https://lovable.dev).
6
+
7
+ ## Build with Lovable
8
+
9
+ Continue developing this project in the [Lovable editor](https://lovable.dev/projects/316ec9c5-0f01-408a-b7ec-3d4dccf9b65d).
10
+
11
+ - **Ship faster**: describe what you want to build and Lovable handles the code.
12
+ - **Stay in sync**: every change made in Lovable is committed straight to this repository.
13
+ - **Full ownership**: this code is yours. Push to `main` on GitHub and your changes sync back into Lovable, ready for your next prompt.
14
+
15
+ ## Development
16
+
17
+ Prefer working locally? You need Node.js and npm — [install with nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
18
+
19
+ ```sh
20
+ git clone <this-repository-url>
21
+ cd <repository-name>
22
+ npm i
23
+ npm run dev
24
+ ```
@@ -0,0 +1,2 @@
1
+ export declare function FloridayPoortCard(): import("react").JSX.Element;
2
+ //# sourceMappingURL=FloridayPoortCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FloridayPoortCard.d.ts","sourceRoot":"","sources":["../../src/components/FloridayPoortCard.tsx"],"names":[],"mappings":"AA6BA,wBAAgB,iBAAiB,gCAqIhC"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // ============================================================================
3
+ // src/components/FloridayPoortCard.tsx
4
+ // Laat zien of er statuswijzigingen naar Floriday mogen, en wat er vandaag is
5
+ // verstuurd of tegengehouden. Bij twijfel is dit de plek om te kijken of het
6
+ // verkeer uit onze modules kwam.
7
+ // ============================================================================
8
+ import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Skeleton, } from "@flowselections/core";
9
+ import { RefreshCw, ShieldCheck, ShieldOff } from "lucide-react";
10
+ import { useFloridayGate } from "../hooks/useFloridayGate";
11
+ function tijd(value) {
12
+ if (!value)
13
+ return "-";
14
+ try {
15
+ return new Date(value).toLocaleString("nl-NL", { dateStyle: "short", timeStyle: "short" });
16
+ }
17
+ catch {
18
+ return value;
19
+ }
20
+ }
21
+ export function FloridayPoortCard() {
22
+ const { status, loading, fout, reload } = useFloridayGate();
23
+ const refusals = Array.isArray(status.last_refusals) ? status.last_refusals : [];
24
+ const sends = Array.isArray(status.last_sends) ? status.last_sends : [];
25
+ const extern = Array.isArray(status.external_writes) ? status.external_writes : [];
26
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-row items-start justify-between gap-4", children: [_jsxs("div", { children: [_jsxs(CardTitle, { className: "flex items-center gap-2", children: [status.enabled ? (_jsx(ShieldCheck, { className: "h-4 w-4 text-primary" })) : (_jsx(ShieldOff, { className: "h-4 w-4 text-muted-foreground" })), "Statussen wijzigen in Floriday"] }), _jsx(CardDescription, { children: status.enabled
27
+ ? "Staat aan: een order wordt pas afgehandeld ná een goedgekeurde karrencontrole."
28
+ : "Staat uit: er gaat geen enkele statuswijziging naar Floriday." })] }), _jsxs(Button, { variant: "outline", size: "sm", onClick: () => void reload(), children: [_jsx(RefreshCw, { className: "mr-2 h-4 w-4" }), "Vernieuwen"] })] }), _jsx(CardContent, { className: "space-y-4", children: loading ? (_jsx(Skeleton, { className: "h-20 w-full" })) : (_jsxs(_Fragment, { children: [fout ? (_jsxs("p", { className: "text-sm text-destructive", children: [fout, " Zolang dit niet gelezen kan worden, wordt er niets verstuurd."] })) : null, _jsxs("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-4", children: [_jsxs("div", { className: "rounded-md border p-3", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Statussen" }), _jsx(Badge, { variant: status.enabled ? "default" : "outline", children: status.enabled ? "Aan" : "Uit" })] }), _jsxs("div", { className: "rounded-md border p-3", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Voorraad doorgeven" }), _jsx(Badge, { variant: status.stock_enabled ? "default" : "outline", children: status.stock_enabled ? "Aan" : "Uit" })] }), _jsxs("div", { className: "rounded-md border p-3", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Vandaag verstuurd" }), _jsx("p", { className: "text-lg font-semibold", children: status.sent_today })] }), _jsxs("div", { className: "rounded-md border p-3", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Vandaag tegengehouden" }), _jsx("p", { className: "text-lg font-semibold", children: status.blocked_today })] }), _jsxs("div", { className: "rounded-md border p-3", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Nog in de wachtrij" }), _jsx("p", { className: "text-lg font-semibold", children: status.open_pushes })] })] }), refusals.length > 0 ? (_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium", children: "Laatst tegengehouden" }), _jsx("ul", { className: "space-y-1 text-sm text-muted-foreground", children: refusals.map((r, i) => (_jsxs("li", { className: "flex flex-wrap gap-2", children: [_jsx("span", { className: "font-medium text-foreground", children: r.order_ref }), _jsx("span", { children: r.reason }), _jsx("span", { className: "ml-auto", children: tijd(r.created_at) })] }, `${r.order_ref}-${i}`))) })] })) : null, sends.length > 0 ? (_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium", children: "Laatst verstuurd" }), _jsx("ul", { className: "space-y-1 text-sm text-muted-foreground", children: sends.map((s, i) => (_jsxs("li", { className: "flex flex-wrap gap-2", children: [_jsx("span", { className: "font-medium text-foreground", children: s.order_ref }), _jsx("span", { children: s.ok ? "gelukt" : "mislukt" }), _jsx("span", { children: s.source_module ?? "onbekende bron" }), _jsx("span", { className: "ml-auto", children: tijd(s.created_at) })] }, `${s.order_ref}-${i}`))) })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "Vandaag is er vanuit deze omgeving nog niets naar Floriday gestuurd." })), extern.length > 0 ? (_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium", children: "Al het verkeer naar Floriday (48 uur)" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Ook verkeer van andere onderdelen. Zie je hier iets wat niet van ons komt, dan schrijft een ander onderdeel rechtstreeks naar Floriday." }), _jsx("ul", { className: "space-y-1 text-sm text-muted-foreground", children: extern.map((w, i) => (_jsxs("li", { className: "flex flex-wrap gap-2", children: [_jsx("span", { className: "font-medium text-foreground", children: w.action ?? "onbekend" }), _jsx("span", { children: w.module ?? "onbekende module" }), _jsx("span", { children: w.caller ?? "onbekende aanroeper" }), _jsxs("span", { children: [w.gelukt, " van ", w.pogingen, " gelukt"] }), _jsx("span", { className: "ml-auto", children: tijd(w.laatst) })] }, `${w.module}-${w.action}-${i}`))) })] })) : null] })) })] }));
29
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"LogistiekEnginePage.d.ts","sourceRoot":"","sources":["../../src/components/LogistiekEnginePage.tsx"],"names":[],"mappings":"AAsEA,wBAAgB,mBAAmB,gCA+OlC"}
1
+ {"version":3,"file":"LogistiekEnginePage.d.ts","sourceRoot":"","sources":["../../src/components/LogistiekEnginePage.tsx"],"names":[],"mappings":"AAuEA,wBAAgB,mBAAmB,gCAkPlC"}
@@ -11,6 +11,7 @@ import { Container, Pencil, Plus, Puzzle, SlidersHorizontal, Trash2, Workflow }
11
11
  import { Link } from "@tanstack/react-router";
12
12
  import { StrategieDialog } from "./StrategieDialog";
13
13
  import { WerkwijzeHerindelingCard } from "./WerkwijzeHerindelingCard";
14
+ import { FloridayPoortCard } from "./FloridayPoortCard";
14
15
  import { useLogistiekStrategieen, } from "../hooks/useLogistiekStrategieen";
15
16
  const SNELKOPPELINGEN = [
16
17
  {
@@ -63,7 +64,7 @@ export function LogistiekEnginePage() {
63
64
  setEditing(item);
64
65
  setDialogOpen(true);
65
66
  };
66
- return (_jsxs("main", { className: "p-6 space-y-6", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Hier bepaal je hoe orders in je bedrijf logistiek worden afgehandeld." }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: SNELKOPPELINGEN.map(({ to, icon: Icon, titel, uitleg }) => (_jsx(Link, { to: to, className: "group", children: _jsx(Card, { className: "h-full transition-colors group-hover:border-primary", children: _jsxs(CardHeader, { className: "p-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary", children: _jsx(Icon, { className: "h-4 w-4" }) }), _jsx(CardTitle, { className: "text-sm font-semibold leading-tight", children: titel })] }), _jsx(CardDescription, { className: "pt-1 text-xs leading-relaxed", children: uitleg })] }) }) }, to))) }), _jsx(WerkwijzeHerindelingCard, {}), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx(CardTitle, { children: "Werkwijzen" }), _jsx(CardDescription, { children: "Alleen een werkwijze die aan staat wordt op je orders toegepast." })] }), _jsxs(Button, { size: "sm", onClick: openNew, children: [_jsx(Plus, { className: "h-4 w-4" }), "Nieuwe werkwijze"] })] }) }), _jsx(CardContent, { children: loading ? (_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-8 w-full" }), _jsx(Skeleton, { className: "h-8 w-full" }), _jsx(Skeleton, { className: "h-8 w-full" })] })) : error ? (_jsx("p", { className: "text-sm text-destructive", children: "Kon de gegevens niet ophalen. Probeer het over een moment opnieuw." })) : safeItems.length === 0 ? (_jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Je hebt nog geen werkwijze ingesteld." }), _jsxs(Button, { variant: "outline", size: "sm", onClick: openNew, children: [_jsx(Plus, { className: "h-4 w-4" }), "Eerste werkwijze aanmaken"] })] })) : (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Naam" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { className: "w-48 text-right", children: "Acties" })] }) }), _jsx(TableBody, { children: safeItems.map((item) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "h-3 w-3 shrink-0 rounded-full border border-border", style: { backgroundColor: item.color ?? "#3b82f6" } }), _jsxs("div", { children: [_jsx("p", { className: "font-medium", children: item.name ?? "—" }), item.description && (_jsx("p", { className: "text-xs text-muted-foreground", children: item.description }))] })] }) }), _jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx("input", { type: "radio", name: "actieve-werkwijze", className: "h-4 w-4 accent-primary", checked: !!item.is_active, disabled: saving, onChange: () => kiesWerkwijze(item), "aria-label": `${item.name ?? "Werkwijze"} als actieve werkwijze kiezen` }), _jsx("span", { className: "sr-only", children: "Actief" })] }), _jsx(Badge, { variant: item.is_active ? "default" : "secondary", children: item.is_active ? "Actief" : "Uit" }), item.is_active && (_jsx(Button, { size: "sm", variant: "ghost", disabled: saving, onClick: () => void clearActive(), children: "Uitzetten" }))] }) }), _jsx(TableCell, { className: "text-right", children: _jsxs("div", { className: "flex justify-end gap-1", children: [_jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsxs(Link, { to: "/logistiek-engine/rule-engine", search: { strategy: String(item.id), naam: item.name ?? "" }, children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), "Instellen"] }) }), _jsx(Button, { size: "icon", variant: "ghost", onClick: () => openEdit(item), "aria-label": "Bewerken", children: _jsx(Pencil, { className: "h-4 w-4" }) }), _jsx(Button, { size: "icon", variant: "ghost", onClick: () => setDeleting(item), "aria-label": "Verwijderen", children: _jsx(Trash2, { className: "h-4 w-4" }) })] }) })] }, String(item.id)))) })] })) })] }), _jsx(StrategieDialog, { open: dialogOpen, onOpenChange: setDialogOpen, strategie: editing, saving: saving, onSubmit: (input) => (editing ? update(editing.id, input) : create(input)) }), _jsx(AlertDialog, { open: !!deleting, onOpenChange: (open) => !open && setDeleting(null), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Werkwijze verwijderen?" }), _jsxs(AlertDialogDescription, { children: ["\"", deleting?.name, "\" wordt definitief verwijderd. Dit kan niet ongedaan worden gemaakt."] })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { onClick: async () => {
67
+ return (_jsxs("main", { className: "p-6 space-y-6", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Hier bepaal je hoe orders in je bedrijf logistiek worden afgehandeld." }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: SNELKOPPELINGEN.map(({ to, icon: Icon, titel, uitleg }) => (_jsx(Link, { to: to, className: "group", children: _jsx(Card, { className: "h-full transition-colors group-hover:border-primary", children: _jsxs(CardHeader, { className: "p-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary", children: _jsx(Icon, { className: "h-4 w-4" }) }), _jsx(CardTitle, { className: "text-sm font-semibold leading-tight", children: titel })] }), _jsx(CardDescription, { className: "pt-1 text-xs leading-relaxed", children: uitleg })] }) }) }, to))) }), _jsx(WerkwijzeHerindelingCard, {}), _jsx(FloridayPoortCard, {}), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx(CardTitle, { children: "Werkwijzen" }), _jsx(CardDescription, { children: "Alleen een werkwijze die aan staat wordt op je orders toegepast." })] }), _jsxs(Button, { size: "sm", onClick: openNew, children: [_jsx(Plus, { className: "h-4 w-4" }), "Nieuwe werkwijze"] })] }) }), _jsx(CardContent, { children: loading ? (_jsxs("div", { className: "space-y-2", children: [_jsx(Skeleton, { className: "h-8 w-full" }), _jsx(Skeleton, { className: "h-8 w-full" }), _jsx(Skeleton, { className: "h-8 w-full" })] })) : error ? (_jsx("p", { className: "text-sm text-destructive", children: "Kon de gegevens niet ophalen. Probeer het over een moment opnieuw." })) : safeItems.length === 0 ? (_jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Je hebt nog geen werkwijze ingesteld." }), _jsxs(Button, { variant: "outline", size: "sm", onClick: openNew, children: [_jsx(Plus, { className: "h-4 w-4" }), "Eerste werkwijze aanmaken"] })] })) : (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Naam" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { className: "w-48 text-right", children: "Acties" })] }) }), _jsx(TableBody, { children: safeItems.map((item) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "h-3 w-3 shrink-0 rounded-full border border-border", style: { backgroundColor: item.color ?? "#3b82f6" } }), _jsxs("div", { children: [_jsx("p", { className: "font-medium", children: item.name ?? "—" }), item.description && (_jsx("p", { className: "text-xs text-muted-foreground", children: item.description }))] })] }) }), _jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx("input", { type: "radio", name: "actieve-werkwijze", className: "h-4 w-4 accent-primary", checked: !!item.is_active, disabled: saving, onChange: () => kiesWerkwijze(item), "aria-label": `${item.name ?? "Werkwijze"} als actieve werkwijze kiezen` }), _jsx("span", { className: "sr-only", children: "Actief" })] }), _jsx(Badge, { variant: item.is_active ? "default" : "secondary", children: item.is_active ? "Actief" : "Uit" }), item.is_active && (_jsx(Button, { size: "sm", variant: "ghost", disabled: saving, onClick: () => void clearActive(), children: "Uitzetten" }))] }) }), _jsx(TableCell, { className: "text-right", children: _jsxs("div", { className: "flex justify-end gap-1", children: [_jsx(Button, { size: "sm", variant: "outline", asChild: true, children: _jsxs(Link, { to: "/logistiek-engine/rule-engine", search: { strategy: String(item.id), naam: item.name ?? "" }, children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), "Instellen"] }) }), _jsx(Button, { size: "icon", variant: "ghost", onClick: () => openEdit(item), "aria-label": "Bewerken", children: _jsx(Pencil, { className: "h-4 w-4" }) }), _jsx(Button, { size: "icon", variant: "ghost", onClick: () => setDeleting(item), "aria-label": "Verwijderen", children: _jsx(Trash2, { className: "h-4 w-4" }) })] }) })] }, String(item.id)))) })] })) })] }), _jsx(StrategieDialog, { open: dialogOpen, onOpenChange: setDialogOpen, strategie: editing, saving: saving, onSubmit: (input) => (editing ? update(editing.id, input) : create(input)) }), _jsx(AlertDialog, { open: !!deleting, onOpenChange: (open) => !open && setDeleting(null), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Werkwijze verwijderen?" }), _jsxs(AlertDialogDescription, { children: ["\"", deleting?.name, "\" wordt definitief verwijderd. Dit kan niet ongedaan worden gemaakt."] })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { onClick: async () => {
67
68
  if (deleting)
68
69
  await remove(deleting.id);
69
70
  setDeleting(null);
@@ -0,0 +1,40 @@
1
+ export interface FloridayGateRefusal {
2
+ order_ref: string;
3
+ reason: string;
4
+ source_module: string | null;
5
+ action: string | null;
6
+ created_at: string;
7
+ }
8
+ export interface FloridayGateSend {
9
+ order_ref: string;
10
+ action: string;
11
+ ok: boolean;
12
+ http_status: number | null;
13
+ source_module: string | null;
14
+ created_at: string;
15
+ }
16
+ export interface FloridayGateExternalWrite {
17
+ module: string | null;
18
+ caller: string | null;
19
+ action: string | null;
20
+ pogingen: number;
21
+ gelukt: number;
22
+ laatst: string;
23
+ }
24
+ export interface FloridayGateStatus {
25
+ enabled: boolean;
26
+ stock_enabled: boolean;
27
+ sent_today: number;
28
+ blocked_today: number;
29
+ open_pushes: number;
30
+ last_refusals: FloridayGateRefusal[];
31
+ last_sends: FloridayGateSend[];
32
+ external_writes: FloridayGateExternalWrite[];
33
+ }
34
+ export declare function useFloridayGate(): {
35
+ status: FloridayGateStatus;
36
+ loading: boolean;
37
+ fout: string | null;
38
+ reload: () => Promise<void>;
39
+ };
40
+ //# sourceMappingURL=useFloridayGate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFloridayGate.d.ts","sourceRoot":"","sources":["../../src/hooks/useFloridayGate.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,OAAO,CAAC;IACZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,eAAe,EAAE,yBAAyB,EAAE,CAAC;CAC9C;AAaD,wBAAgB,eAAe;;;;;EAoC9B"}
@@ -0,0 +1,50 @@
1
+ // ============================================================================
2
+ // src/hooks/useFloridayGate.ts — stand van de poort op Floriday-statussen
3
+ // ============================================================================
4
+ import { useCallback, useEffect, useState } from "react";
5
+ import { supabase } from "@flowselections/core";
6
+ const LEEG = {
7
+ enabled: false,
8
+ stock_enabled: false,
9
+ sent_today: 0,
10
+ blocked_today: 0,
11
+ open_pushes: 0,
12
+ last_refusals: [],
13
+ last_sends: [],
14
+ external_writes: [],
15
+ };
16
+ export function useFloridayGate() {
17
+ const [status, setStatus] = useState(LEEG);
18
+ const [loading, setLoading] = useState(true);
19
+ const [fout, setFout] = useState(null);
20
+ const load = useCallback(async () => {
21
+ setLoading(true);
22
+ const { data, error } = await supabase.rpc("logistics_floriday_gate_status");
23
+ if (error || !data) {
24
+ // Fail closed: onleesbaar tonen we als "uit", nooit als "aan".
25
+ setStatus(LEEG);
26
+ setFout(error?.message ?? "De stand van de poort kon niet gelezen worden.");
27
+ }
28
+ else {
29
+ const d = data;
30
+ setStatus({
31
+ enabled: d.enabled === true,
32
+ stock_enabled: d.stock_enabled === true,
33
+ sent_today: Number(d.sent_today ?? 0),
34
+ blocked_today: Number(d.blocked_today ?? 0),
35
+ open_pushes: Number(d.open_pushes ?? 0),
36
+ last_refusals: Array.isArray(d.last_refusals) ? d.last_refusals : [],
37
+ last_sends: Array.isArray(d.last_sends) ? d.last_sends : [],
38
+ external_writes: Array.isArray(d.external_writes) ? d.external_writes : [],
39
+ });
40
+ setFout(null);
41
+ }
42
+ setLoading(false);
43
+ }, []);
44
+ useEffect(() => {
45
+ void load();
46
+ const t = setInterval(() => void load(), 30000);
47
+ return () => clearInterval(t);
48
+ }, [load]);
49
+ return { status, loading, fout, reload: load };
50
+ }
@@ -14,6 +14,8 @@ export { KarplanStatusCard } from './components/KarplanStatusCard';
14
14
  export { GeblokkeerdeOrdersCard } from './components/GeblokkeerdeOrdersCard';
15
15
  export { AfmetingenBronnenCard } from './components/AfmetingenBronnenCard';
16
16
  export { WerkwijzeHerindelingCard } from './components/WerkwijzeHerindelingCard';
17
+ export { FloridayPoortCard } from './components/FloridayPoortCard';
18
+ export * from './hooks/useFloridayGate';
17
19
  export * from './hooks/useWerkwijzeStatus';
18
20
  export * from './hooks/usePrintjobs';
19
21
  export * from './components/VertragingMeldingenCard';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AAMpD,eAAO,MAAM,qBAAqB,EAAE,UAcnC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AAMpD,eAAO,MAAM,qBAAqB,EAAE,UAcnC,CAAC"}
package/dist-lib/index.js CHANGED
@@ -17,6 +17,8 @@ export { KarplanStatusCard } from './components/KarplanStatusCard';
17
17
  export { GeblokkeerdeOrdersCard } from './components/GeblokkeerdeOrdersCard';
18
18
  export { AfmetingenBronnenCard } from './components/AfmetingenBronnenCard';
19
19
  export { WerkwijzeHerindelingCard } from './components/WerkwijzeHerindelingCard';
20
+ export { FloridayPoortCard } from './components/FloridayPoortCard';
21
+ export * from './hooks/useFloridayGate';
20
22
  export * from './hooks/useWerkwijzeStatus';
21
23
  export * from './hooks/usePrintjobs';
22
24
  export * from './components/VertragingMeldingenCard';
@@ -10076,6 +10076,36 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
10076
10076
  };
10077
10077
  Relationships: [];
10078
10078
  };
10079
+ logistics_floriday_push_refusals: {
10080
+ Row: {
10081
+ action: string | null;
10082
+ created_at: string;
10083
+ id: string;
10084
+ order_ref: string;
10085
+ reason: string;
10086
+ source_module: string | null;
10087
+ source_shell: string | null;
10088
+ };
10089
+ Insert: {
10090
+ action?: string | null;
10091
+ created_at?: string;
10092
+ id?: string;
10093
+ order_ref: string;
10094
+ reason: string;
10095
+ source_module?: string | null;
10096
+ source_shell?: string | null;
10097
+ };
10098
+ Update: {
10099
+ action?: string | null;
10100
+ created_at?: string;
10101
+ id?: string;
10102
+ order_ref?: string;
10103
+ reason?: string;
10104
+ source_module?: string | null;
10105
+ source_shell?: string | null;
10106
+ };
10107
+ Relationships: [];
10108
+ };
10079
10109
  logistics_floriday_pushes: {
10080
10110
  Row: {
10081
10111
  attempts: number;
@@ -10151,6 +10181,42 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
10151
10181
  };
10152
10182
  Relationships: [];
10153
10183
  };
10184
+ logistics_floriday_status_sends: {
10185
+ Row: {
10186
+ action: string;
10187
+ created_at: string;
10188
+ detail: string | null;
10189
+ http_status: number | null;
10190
+ id: string;
10191
+ ok: boolean;
10192
+ order_ref: string;
10193
+ source_module: string | null;
10194
+ source_shell: string | null;
10195
+ };
10196
+ Insert: {
10197
+ action: string;
10198
+ created_at?: string;
10199
+ detail?: string | null;
10200
+ http_status?: number | null;
10201
+ id?: string;
10202
+ ok?: boolean;
10203
+ order_ref: string;
10204
+ source_module?: string | null;
10205
+ source_shell?: string | null;
10206
+ };
10207
+ Update: {
10208
+ action?: string;
10209
+ created_at?: string;
10210
+ detail?: string | null;
10211
+ http_status?: number | null;
10212
+ id?: string;
10213
+ ok?: boolean;
10214
+ order_ref?: string;
10215
+ source_module?: string | null;
10216
+ source_shell?: string | null;
10217
+ };
10218
+ Relationships: [];
10219
+ };
10154
10220
  logistics_formulas: {
10155
10221
  Row: {
10156
10222
  created_at: string;
@@ -19322,6 +19388,36 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
19322
19388
  referencedColumns: ["id"];
19323
19389
  }];
19324
19390
  };
19391
+ voorraad_buffer_state: {
19392
+ Row: {
19393
+ buffer_id: string;
19394
+ buffer_key: string | null;
19395
+ closed_at: string | null;
19396
+ created_at: string;
19397
+ detached_orders: import("./types").Json;
19398
+ reason: string | null;
19399
+ updated_at: string;
19400
+ };
19401
+ Insert: {
19402
+ buffer_id: string;
19403
+ buffer_key?: string | null;
19404
+ closed_at?: string | null;
19405
+ created_at?: string;
19406
+ detached_orders?: import("./types").Json;
19407
+ reason?: string | null;
19408
+ updated_at?: string;
19409
+ };
19410
+ Update: {
19411
+ buffer_id?: string;
19412
+ buffer_key?: string | null;
19413
+ closed_at?: string | null;
19414
+ created_at?: string;
19415
+ detached_orders?: import("./types").Json;
19416
+ reason?: string | null;
19417
+ updated_at?: string;
19418
+ };
19419
+ Relationships: [];
19420
+ };
19325
19421
  voorraad_custom_fields: {
19326
19422
  Row: {
19327
19423
  created_at: string;
@@ -19364,6 +19460,36 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
19364
19460
  };
19365
19461
  Relationships: [];
19366
19462
  };
19463
+ voorraad_logistics_event_log: {
19464
+ Row: {
19465
+ created_at: string;
19466
+ event_id: string;
19467
+ event_type: string;
19468
+ order_ref: string | null;
19469
+ processed_at: string;
19470
+ result: import("./types").Json;
19471
+ updated_at: string;
19472
+ };
19473
+ Insert: {
19474
+ created_at?: string;
19475
+ event_id: string;
19476
+ event_type: string;
19477
+ order_ref?: string | null;
19478
+ processed_at?: string;
19479
+ result?: import("./types").Json;
19480
+ updated_at?: string;
19481
+ };
19482
+ Update: {
19483
+ created_at?: string;
19484
+ event_id?: string;
19485
+ event_type?: string;
19486
+ order_ref?: string | null;
19487
+ processed_at?: string;
19488
+ result?: import("./types").Json;
19489
+ updated_at?: string;
19490
+ };
19491
+ Relationships: [];
19492
+ };
19367
19493
  voorraad_media_upload_failures: {
19368
19494
  Row: {
19369
19495
  action: string;
@@ -23617,6 +23743,38 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
23617
23743
  };
23618
23744
  Returns: string;
23619
23745
  };
23746
+ logistics_floriday_gate_status: {
23747
+ Args: never;
23748
+ Returns: import("./types").Json;
23749
+ };
23750
+ logistics_floriday_log_refusal: {
23751
+ Args: {
23752
+ _action?: string;
23753
+ _module?: string;
23754
+ _order_ref: string;
23755
+ _reason: string;
23756
+ _shell?: string;
23757
+ };
23758
+ Returns: undefined;
23759
+ };
23760
+ logistics_floriday_log_send: {
23761
+ Args: {
23762
+ _action: string;
23763
+ _detail?: string;
23764
+ _http_status?: number;
23765
+ _module?: string;
23766
+ _ok: boolean;
23767
+ _order_ref: string;
23768
+ _shell?: string;
23769
+ };
23770
+ Returns: undefined;
23771
+ };
23772
+ logistics_floriday_order_approved: {
23773
+ Args: {
23774
+ _order_ref: string;
23775
+ };
23776
+ Returns: boolean;
23777
+ };
23620
23778
  logistics_floriday_prune_pushes: {
23621
23779
  Args: {
23622
23780
  _days?: number;
@@ -23631,6 +23789,10 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
23631
23789
  };
23632
23790
  Returns: string;
23633
23791
  };
23792
+ logistics_floriday_status_updates_enabled: {
23793
+ Args: never;
23794
+ Returns: boolean;
23795
+ };
23634
23796
  logistics_fulfill_barcode_requests: {
23635
23797
  Args: {
23636
23798
  p_limit?: number;