@flowselections/mailbox-orders 1.0.53 → 1.0.57

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 (98) hide show
  1. package/dist-lib/components/MailboxAuthBanner.d.ts +3 -3
  2. package/dist-lib/components/MailboxAuthBanner.d.ts.map +1 -1
  3. package/dist-lib/components/MailboxAuthBanner.js +20 -7
  4. package/dist-lib/components/MailboxPageFrame.d.ts +25 -0
  5. package/dist-lib/components/MailboxPageFrame.d.ts.map +1 -0
  6. package/dist-lib/components/MailboxPageFrame.js +103 -0
  7. package/dist-lib/components/MailboxProcessedPage.d.ts.map +1 -1
  8. package/dist-lib/components/MailboxProcessedPage.js +102 -61
  9. package/dist-lib/components/MailboxProposalsPage.d.ts.map +1 -1
  10. package/dist-lib/components/MailboxProposalsPage.js +191 -76
  11. package/dist-lib/components/MailboxSkippedPage.d.ts.map +1 -1
  12. package/dist-lib/components/MailboxSkippedPage.js +97 -19
  13. package/dist-lib/components/MailboxStatusLine.d.ts +8 -2
  14. package/dist-lib/components/MailboxStatusLine.d.ts.map +1 -1
  15. package/dist-lib/components/MailboxStatusLine.js +54 -8
  16. package/dist-lib/components/TablePagination.d.ts +2 -2
  17. package/dist-lib/components/TablePagination.d.ts.map +1 -1
  18. package/dist-lib/components/TablePagination.js +8 -12
  19. package/dist-lib/components/fs-ui/DataTable.d.ts +42 -0
  20. package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -0
  21. package/dist-lib/components/fs-ui/DataTable.js +40 -0
  22. package/dist-lib/components/fs-ui/EmptyState.d.ts +9 -0
  23. package/dist-lib/components/fs-ui/EmptyState.d.ts.map +1 -0
  24. package/dist-lib/components/fs-ui/EmptyState.js +5 -0
  25. package/dist-lib/components/fs-ui/FilterChips.d.ts +13 -0
  26. package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -0
  27. package/dist-lib/components/fs-ui/FilterChips.js +8 -0
  28. package/dist-lib/components/fs-ui/FilterPanel.d.ts +32 -0
  29. package/dist-lib/components/fs-ui/FilterPanel.d.ts.map +1 -0
  30. package/dist-lib/components/fs-ui/FilterPanel.js +20 -0
  31. package/dist-lib/components/fs-ui/HoverTip.d.ts +15 -0
  32. package/dist-lib/components/fs-ui/HoverTip.d.ts.map +1 -0
  33. package/dist-lib/components/fs-ui/HoverTip.js +24 -0
  34. package/dist-lib/components/fs-ui/InlineAlert.d.ts +9 -0
  35. package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -0
  36. package/dist-lib/components/fs-ui/InlineAlert.js +6 -0
  37. package/dist-lib/components/fs-ui/KpiRow.d.ts +6 -0
  38. package/dist-lib/components/fs-ui/KpiRow.d.ts.map +1 -0
  39. package/dist-lib/components/fs-ui/KpiRow.js +7 -0
  40. package/dist-lib/components/fs-ui/KpiTile.d.ts +21 -0
  41. package/dist-lib/components/fs-ui/KpiTile.d.ts.map +1 -0
  42. package/dist-lib/components/fs-ui/KpiTile.js +40 -0
  43. package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts +10 -0
  44. package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts.map +1 -0
  45. package/dist-lib/components/fs-ui/MobilePrimaryAction.js +7 -0
  46. package/dist-lib/components/fs-ui/NoticeBar.d.ts +18 -0
  47. package/dist-lib/components/fs-ui/NoticeBar.d.ts.map +1 -0
  48. package/dist-lib/components/fs-ui/NoticeBar.js +24 -0
  49. package/dist-lib/components/fs-ui/PageHeader.d.ts +8 -0
  50. package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -0
  51. package/dist-lib/components/fs-ui/PageHeader.js +5 -0
  52. package/dist-lib/components/fs-ui/PillTabs.d.ts +16 -0
  53. package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -0
  54. package/dist-lib/components/fs-ui/PillTabs.js +29 -0
  55. package/dist-lib/components/fs-ui/RowMenu.d.ts +13 -0
  56. package/dist-lib/components/fs-ui/RowMenu.d.ts.map +1 -0
  57. package/dist-lib/components/fs-ui/RowMenu.js +10 -0
  58. package/dist-lib/components/fs-ui/SearchInput.d.ts +12 -0
  59. package/dist-lib/components/fs-ui/SearchInput.d.ts.map +1 -0
  60. package/dist-lib/components/fs-ui/SearchInput.js +38 -0
  61. package/dist-lib/components/fs-ui/ShortcutHelp.d.ts +7 -0
  62. package/dist-lib/components/fs-ui/ShortcutHelp.d.ts.map +1 -0
  63. package/dist-lib/components/fs-ui/ShortcutHelp.js +6 -0
  64. package/dist-lib/components/fs-ui/StatusIcon.d.ts +8 -0
  65. package/dist-lib/components/fs-ui/StatusIcon.d.ts.map +1 -0
  66. package/dist-lib/components/fs-ui/StatusIcon.js +16 -0
  67. package/dist-lib/components/fs-ui/TableSkeleton.d.ts +6 -0
  68. package/dist-lib/components/fs-ui/TableSkeleton.d.ts.map +1 -0
  69. package/dist-lib/components/fs-ui/TableSkeleton.js +6 -0
  70. package/dist-lib/components/fs-ui/Toolbar.d.ts +13 -0
  71. package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -0
  72. package/dist-lib/components/fs-ui/Toolbar.js +10 -0
  73. package/dist-lib/components/fs-ui/UpdatedAt.d.ts +8 -0
  74. package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -0
  75. package/dist-lib/components/fs-ui/UpdatedAt.js +17 -0
  76. package/dist-lib/components/fs-ui/useListHotkeys.d.ts +18 -0
  77. package/dist-lib/components/fs-ui/useListHotkeys.d.ts.map +1 -0
  78. package/dist-lib/components/fs-ui/useListHotkeys.js +48 -0
  79. package/dist-lib/components/settings/MailboxAiPromptCard.d.ts +2 -1
  80. package/dist-lib/components/settings/MailboxAiPromptCard.d.ts.map +1 -1
  81. package/dist-lib/components/settings/MailboxAiPromptCard.js +9 -1
  82. package/dist-lib/components/settings/MailboxFilterSettingsCard.js +1 -1
  83. package/dist-lib/components/settings/MailboxTestSetCard.d.ts +2 -1
  84. package/dist-lib/components/settings/MailboxTestSetCard.d.ts.map +1 -1
  85. package/dist-lib/components/settings/MailboxTestSetCard.js +10 -2
  86. package/dist-lib/integrations/supabase/types.d.ts +372 -0
  87. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  88. package/dist-lib/lib/format-date.d.ts +5 -0
  89. package/dist-lib/lib/format-date.d.ts.map +1 -0
  90. package/dist-lib/lib/format-date.js +30 -0
  91. package/dist-lib/lib/labels.d.ts +15 -0
  92. package/dist-lib/lib/labels.d.ts.map +1 -0
  93. package/dist-lib/lib/labels.js +57 -0
  94. package/dist-lib/lib/mailbox-list.functions.d.ts +67 -0
  95. package/dist-lib/lib/mailbox-list.functions.d.ts.map +1 -0
  96. package/dist-lib/lib/mailbox-list.functions.js +61 -0
  97. package/dist-lib/lib/mailbox.functions.js +3 -3
  98. package/package.json +1 -1
@@ -74,7 +74,7 @@ export function MailboxFilterSettingsCard() {
74
74
  const savedKeywords = Array.isArray(data?.settings?.order_keywords) ? data.settings.order_keywords : [];
75
75
  const set = (k, v) => setForm((p) => ({ ...(p ?? {}), [k]: v }));
76
76
  const u = data?.usage;
77
- return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Voorfilter en kosten bestelmails" }), _jsx(CardDescription, { children: "Bepaalt welke mails de AI leest en hoeveel analyses er maximaal mogen. Mails die geen bestelling zijn, kosten geen AI-analyse." })] }), _jsxs(CardContent, { className: "space-y-5", children: [error && _jsx("p", { className: "text-sm text-destructive", children: "De instellingen konden niet worden geladen." }), u && (_jsxs("div", { className: "rounded-md border bg-muted/30 p-3 text-sm grid gap-1 sm:grid-cols-2", children: [_jsxs("div", { children: ["AI-analyses deze maand: ", _jsx("strong", { children: u.month_analyses }), form ? ` van ${form.max_ai_per_month}` : ""] }), _jsxs("div", { children: ["Vandaag: ", _jsx("strong", { children: u.today_analyses }), form ? ` van ${form.max_ai_per_day}` : ""] }), _jsxs("div", { children: ["Tokens deze maand: ", Number(u.input_tokens).toLocaleString("nl-NL"), " in \u00B7 ", Number(u.output_tokens).toLocaleString("nl-NL"), " uit"] }), _jsxs("div", { children: ["AI-aanroepen volgens het AI-logboek: ", u.ai_calls_month] }), u.test_analyses > 0 && _jsxs("div", { children: ["Waarvan testset: ", u.test_analyses] }), u.waiting > 0 && _jsxs("div", { className: "text-amber-700", children: ["Wachten op analyse: ", u.waiting] })] })), data?.settings && savedKeywords.length === 0 && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm", children: [_jsx("span", { children: "Er zijn geen bestelwoorden; de mailbox herkent dan weinig bestellingen" }), _jsx(Button, { size: "sm", variant: "outline", onClick: () => addMut.mutate(), disabled: addMut.isPending, children: addMut.isPending ? "Toevoegen…" : "Standaardwoorden toevoegen" })] })), form && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "space-y-3", children: [_jsxs("label", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-sm", children: "Automatisch analyseren" }), _jsx(Switch, { checked: !!form.auto_analyze, onCheckedChange: (v) => set("auto_analyze", v) })] }), _jsxs("label", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-sm", children: "Onbekende afzender met bestel-signalen ook analyseren" }), _jsx(Switch, { checked: !!form.analyze_unknown_with_signals, onCheckedChange: (v) => set("analyze_unknown_with_signals", v) })] }), _jsxs("label", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-sm", children: "Klant herkennen op domein van het e-mailadres" }), _jsx(Switch, { checked: !!form.domain_match, onCheckedChange: (v) => set("domain_match", v) })] })] }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2", children: NUMBERS.map((n) => (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs", children: n.label }), _jsx(Input, { type: "number", step: n.step ?? "1", value: form[n.key] ?? "", onChange: (e) => set(n.key, e.target.value) })] }, n.key))) }), LISTS.map((l) => (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: l.label }), _jsx(Textarea, { rows: 4, className: "font-mono text-xs", value: form[l.key] ?? "", onChange: (e) => set(l.key, e.target.value) }), _jsx("p", { className: "text-xs text-muted-foreground", children: l.help })] }, l.key))), _jsx(Button, { onClick: () => mut.mutate(), disabled: mut.isPending, children: mut.isPending ? "Opslaan..." : "Opslaan" })] })), _jsxs("div", { className: "border-t pt-4 space-y-2", children: [_jsx(Label, { children: "Bestaande voorstellen tellen" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Telt hoeveel openstaande voorstellen het filter nu als \"geen bestelling\" zou zien. Er wordt niets verborgen of verwijderd." }), _jsx(Button, { variant: "outline", disabled: counting, onClick: async () => {
77
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Voorfilter en kosten bestelmails" }), _jsx(CardDescription, { children: "Bepaalt welke mails de AI leest en hoeveel analyses er maximaal mogen. Mails die geen bestelling zijn, kosten geen AI-analyse." })] }), _jsxs(CardContent, { className: "space-y-5", children: [error && _jsx("p", { className: "text-sm text-destructive", children: "De instellingen konden niet worden geladen." }), u && (_jsxs("div", { className: "rounded-md border bg-muted/30 p-3 text-sm grid gap-1 sm:grid-cols-2", children: [_jsxs("div", { children: ["AI-analyses deze maand: ", _jsx("strong", { children: u.month_analyses }), form ? ` van ${form.max_ai_per_month}` : ""] }), _jsxs("div", { children: ["Vandaag: ", _jsx("strong", { children: u.today_analyses }), form ? ` van ${form.max_ai_per_day}` : ""] }), _jsxs("div", { children: ["Tokens deze maand: ", Number(u.input_tokens).toLocaleString("nl-NL"), " in \u00B7 ", Number(u.output_tokens).toLocaleString("nl-NL"), " uit"] }), _jsxs("div", { children: ["AI-aanroepen volgens het AI-logboek: ", u.ai_calls_month] }), u.test_analyses > 0 && _jsxs("div", { children: ["Waarvan testset: ", u.test_analyses] }), u.waiting > 0 && _jsxs("div", { className: "text-warning-soft-foreground", children: ["Wachten op analyse: ", u.waiting] })] })), data?.settings && savedKeywords.length === 0 && (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm", children: [_jsx("span", { children: "Er zijn geen bestelwoorden; de mailbox herkent dan weinig bestellingen" }), _jsx(Button, { size: "sm", variant: "outline", onClick: () => addMut.mutate(), disabled: addMut.isPending, children: addMut.isPending ? "Toevoegen…" : "Standaardwoorden toevoegen" })] })), form && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "space-y-3", children: [_jsxs("label", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-sm", children: "Automatisch analyseren" }), _jsx(Switch, { checked: !!form.auto_analyze, onCheckedChange: (v) => set("auto_analyze", v) })] }), _jsxs("label", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-sm", children: "Onbekende afzender met bestel-signalen ook analyseren" }), _jsx(Switch, { checked: !!form.analyze_unknown_with_signals, onCheckedChange: (v) => set("analyze_unknown_with_signals", v) })] }), _jsxs("label", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-sm", children: "Klant herkennen op domein van het e-mailadres" }), _jsx(Switch, { checked: !!form.domain_match, onCheckedChange: (v) => set("domain_match", v) })] })] }), _jsx("div", { className: "grid gap-3 sm:grid-cols-2", children: NUMBERS.map((n) => (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs", children: n.label }), _jsx(Input, { type: "number", step: n.step ?? "1", value: form[n.key] ?? "", onChange: (e) => set(n.key, e.target.value) })] }, n.key))) }), LISTS.map((l) => (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: l.label }), _jsx(Textarea, { rows: 4, className: "font-mono text-xs", value: form[l.key] ?? "", onChange: (e) => set(l.key, e.target.value) }), _jsx("p", { className: "text-xs text-muted-foreground", children: l.help })] }, l.key))), _jsx(Button, { onClick: () => mut.mutate(), disabled: mut.isPending, children: mut.isPending ? "Opslaan..." : "Opslaan" })] })), _jsxs("div", { className: "border-t pt-4 space-y-2", children: [_jsx(Label, { children: "Bestaande voorstellen tellen" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Telt hoeveel openstaande voorstellen het filter nu als \"geen bestelling\" zou zien. Er wordt niets verborgen of verwijderd." }), _jsx(Button, { variant: "outline", disabled: counting, onClick: async () => {
78
78
  setCounting(true);
79
79
  try {
80
80
  setCount(await fetchCount());
@@ -1,2 +1,3 @@
1
- export declare function MailboxTestSetCard(): import("react").JSX.Element;
1
+ /** Beheeronderdeel: alleen zichtbaar voor admin en superadmin. */
2
+ export declare function MailboxTestSetCard(): import("react").JSX.Element | null;
2
3
  //# sourceMappingURL=MailboxTestSetCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MailboxTestSetCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/MailboxTestSetCard.tsx"],"names":[],"mappings":"AASA,wBAAgB,kBAAkB,gCAkJjC"}
1
+ {"version":3,"file":"MailboxTestSetCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/MailboxTestSetCard.tsx"],"names":[],"mappings":"AA8JA,kEAAkE;AAClE,wBAAgB,kBAAkB,uCAIjC"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useIsSuperadmin } from "@flowselections/core";
2
3
  import { useState } from "react";
3
4
  import { useQuery, useQueryClient } from "@tanstack/react-query";
4
5
  import { useServerFn } from "@tanstack/react-start";
5
6
  import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Badge, Input, Label, Textarea, Switch, toast, } from "@flowselections/core";
6
7
  import { listTestCases, runTestCase, saveTestCase, deleteTestCase } from "../../lib/mailbox-filter-settings.functions.js";
7
- export function MailboxTestSetCard() {
8
+ function MailboxTestSetCardInner() {
8
9
  const qc = useQueryClient();
9
10
  const fetchCases = useServerFn(listTestCases);
10
11
  const runOne = useServerFn(runTestCase);
@@ -60,10 +61,17 @@ export function MailboxTestSetCard() {
60
61
  };
61
62
  return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Testset bestelmails" }), _jsx(CardDescription, { children: "Voorbeeldmails met de verwachte uitkomst. \"Testset draaien\" doorloopt filter en uitlezen, maar maakt geen voorstellen of orders aan." })] }), _jsxs(CardContent, { className: "space-y-3", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { onClick: runAll, disabled: !!running || cases.length === 0, children: running ? "Bezig…" : "Testset draaien" }), _jsx(Button, { variant: "outline", onClick: () => setEdit({ name: "", subject: "", from_email: "", body_text: "", has_attachment: false, expectedText: '{"is_order": true}' }), children: "Voorbeeld toevoegen" })] }), summary && (_jsxs("div", { className: "rounded-md border bg-muted/30 p-3 text-sm", children: [summary.passed, " van ", summary.total, " goed \u00B7 ", summary.analyses, " AI-analyses \u00B7 ", summary.tokens.toLocaleString("nl-NL"), " tokens"] })), _jsx("div", { className: "divide-y rounded-md border", children: cases.map((c) => {
62
63
  const r = c.last_result;
63
- return (_jsxs("div", { className: "p-3 text-sm space-y-1", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("button", { type: "button", className: "text-left font-medium", onClick: () => setOpenId(openId === c.id ? null : c.id), children: c.name }), _jsxs("div", { className: "flex items-center gap-2", children: [running === c.id ? (_jsx(Badge, { variant: "outline", children: "Bezig\u2026" })) : r ? (_jsx(Badge, { variant: "outline", className: r.passed ? "border-emerald-300 bg-emerald-50 text-emerald-800" : "border-destructive/40 text-destructive", children: r.passed ? "Goed" : "Fout" })) : null, _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setEdit({ ...c, expectedText: JSON.stringify(c.expected ?? {}, null, 2) }), children: "Wijzigen" })] })] }), r && _jsxs("div", { className: "text-xs text-muted-foreground", children: [r.filter?.reason, r.analyzed ? ` · ${Number(r.tokens?.input ?? 0) + Number(r.tokens?.output ?? 0)} tokens` : " · geen AI-analyse"] }), openId === c.id && r && Array.isArray(r.checks) && (_jsx("ul", { className: "text-xs space-y-0.5 pt-1", children: r.checks.map((k, i) => (_jsxs("li", { className: k.ok ? "text-emerald-700" : "text-destructive", children: [k.ok ? "Goed" : "Fout", " \u2014 ", k.field, ": verwacht ", JSON.stringify(k.expected), ", gevonden ", JSON.stringify(k.actual)] }, i))) }))] }, c.id));
64
+ return (_jsxs("div", { className: "p-3 text-sm space-y-1", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("button", { type: "button", className: "text-left font-medium", onClick: () => setOpenId(openId === c.id ? null : c.id), children: c.name }), _jsxs("div", { className: "flex items-center gap-2", children: [running === c.id ? (_jsx(Badge, { variant: "outline", children: "Bezig\u2026" })) : r ? (_jsx(Badge, { variant: "outline", className: r.passed ? "border-primary/30 bg-primary/10 text-primary" : "border-destructive/40 text-destructive", children: r.passed ? "Goed" : "Fout" })) : null, _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setEdit({ ...c, expectedText: JSON.stringify(c.expected ?? {}, null, 2) }), children: "Wijzigen" })] })] }), r && _jsxs("div", { className: "text-xs text-muted-foreground", children: [r.filter?.reason, r.analyzed ? ` · ${Number(r.tokens?.input ?? 0) + Number(r.tokens?.output ?? 0)} tokens` : " · geen AI-analyse"] }), openId === c.id && r && Array.isArray(r.checks) && (_jsx("ul", { className: "text-xs space-y-0.5 pt-1", children: r.checks.map((k, i) => (_jsxs("li", { className: k.ok ? "text-primary" : "text-destructive", children: [k.ok ? "Goed" : "Fout", " \u2014 ", k.field, ": verwacht ", JSON.stringify(k.expected), ", gevonden ", JSON.stringify(k.actual)] }, i))) }))] }, c.id));
64
65
  }) }), edit && (_jsxs("div", { className: "rounded-md border p-3 space-y-2", children: [_jsxs("div", { className: "grid gap-2 sm:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Naam" }), _jsx(Input, { value: edit.name, onChange: (e) => setEdit({ ...edit, name: e.target.value }) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Afzender" }), _jsx(Input, { value: edit.from_email, onChange: (e) => setEdit({ ...edit, from_email: e.target.value }) })] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Onderwerp" }), _jsx(Input, { value: edit.subject, onChange: (e) => setEdit({ ...edit, subject: e.target.value }) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Tekst" }), _jsx(Textarea, { rows: 6, value: edit.body_text, onChange: (e) => setEdit({ ...edit, body_text: e.target.value }) })] }), _jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx(Switch, { checked: !!edit.has_attachment, onCheckedChange: (v) => setEdit({ ...edit, has_attachment: v }) }), " Met bijlage"] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Verwachte uitkomst" }), _jsx(Textarea, { rows: 6, className: "font-mono text-xs", value: edit.expectedText, onChange: (e) => setEdit({ ...edit, expectedText: e.target.value }) }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Bijvoorbeeld: is_order, known_sender, delivery_date, reference, en lines met quantity, unit, plants en unit_price." })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { onClick: saveEdit, children: "Opslaan" }), _jsx(Button, { variant: "outline", onClick: () => setEdit(null), children: "Annuleren" }), edit.id && (_jsx(Button, { variant: "destructive", onClick: async () => {
65
66
  await remove({ data: { id: edit.id } });
66
67
  setEdit(null);
67
68
  void qc.invalidateQueries({ queryKey: ["mailbox-test-cases"] });
68
69
  }, children: "Verwijderen" }))] })] }))] })] }));
69
70
  }
71
+ /** Beheeronderdeel: alleen zichtbaar voor admin en superadmin. */
72
+ export function MailboxTestSetCard() {
73
+ const { isAdmin, isLoading } = useIsSuperadmin();
74
+ if (isLoading || !isAdmin)
75
+ return null;
76
+ return _jsx(MailboxTestSetCardInner, {});
77
+ }
@@ -29678,6 +29678,27 @@ export type Database = {
29678
29678
  };
29679
29679
  Relationships: [];
29680
29680
  };
29681
+ voorraad_floriday_alias: {
29682
+ Row: {
29683
+ bron: string;
29684
+ created_at: string;
29685
+ floriday_id: string;
29686
+ product_id: string;
29687
+ };
29688
+ Insert: {
29689
+ bron: string;
29690
+ created_at?: string;
29691
+ floriday_id: string;
29692
+ product_id: string;
29693
+ };
29694
+ Update: {
29695
+ bron?: string;
29696
+ created_at?: string;
29697
+ floriday_id?: string;
29698
+ product_id?: string;
29699
+ };
29700
+ Relationships: [];
29701
+ };
29681
29702
  voorraad_floriday_artikel_wachtrij: {
29682
29703
  Row: {
29683
29704
  aangemeld_at: string;
@@ -29696,6 +29717,192 @@ export type Database = {
29696
29717
  };
29697
29718
  Relationships: [];
29698
29719
  };
29720
+ voorraad_floriday_versie_fouten: {
29721
+ Row: {
29722
+ connection_id: string;
29723
+ floriday_id: string;
29724
+ laatste_reden: string | null;
29725
+ onbekend_sinds: string | null;
29726
+ opeenvolgend: number;
29727
+ updated_at: string;
29728
+ };
29729
+ Insert: {
29730
+ connection_id: string;
29731
+ floriday_id: string;
29732
+ laatste_reden?: string | null;
29733
+ onbekend_sinds?: string | null;
29734
+ opeenvolgend?: number;
29735
+ updated_at?: string;
29736
+ };
29737
+ Update: {
29738
+ connection_id?: string;
29739
+ floriday_id?: string;
29740
+ laatste_reden?: string | null;
29741
+ onbekend_sinds?: string | null;
29742
+ opeenvolgend?: number;
29743
+ updated_at?: string;
29744
+ };
29745
+ Relationships: [];
29746
+ };
29747
+ voorraad_floriday_versie_rondes: {
29748
+ Row: {
29749
+ actueel: number;
29750
+ connection_id: string | null;
29751
+ created_at: string;
29752
+ fouten: number;
29753
+ gecontroleerd: number;
29754
+ gemarkeerd: boolean;
29755
+ id: string;
29756
+ in_cache: number;
29757
+ melding: string | null;
29758
+ onbekend: number;
29759
+ status: string | null;
29760
+ uitgevoerd_at: string;
29761
+ vervallen: number;
29762
+ vervangen: number;
29763
+ volledig: boolean;
29764
+ };
29765
+ Insert: {
29766
+ actueel?: number;
29767
+ connection_id?: string | null;
29768
+ created_at?: string;
29769
+ fouten?: number;
29770
+ gecontroleerd?: number;
29771
+ gemarkeerd?: boolean;
29772
+ id?: string;
29773
+ in_cache?: number;
29774
+ melding?: string | null;
29775
+ onbekend?: number;
29776
+ status?: string | null;
29777
+ uitgevoerd_at?: string;
29778
+ vervallen?: number;
29779
+ vervangen?: number;
29780
+ volledig?: boolean;
29781
+ };
29782
+ Update: {
29783
+ actueel?: number;
29784
+ connection_id?: string | null;
29785
+ created_at?: string;
29786
+ fouten?: number;
29787
+ gecontroleerd?: number;
29788
+ gemarkeerd?: boolean;
29789
+ id?: string;
29790
+ in_cache?: number;
29791
+ melding?: string | null;
29792
+ onbekend?: number;
29793
+ status?: string | null;
29794
+ uitgevoerd_at?: string;
29795
+ vervallen?: number;
29796
+ vervangen?: number;
29797
+ volledig?: boolean;
29798
+ };
29799
+ Relationships: [];
29800
+ };
29801
+ voorraad_floriday_versieronde_stand: {
29802
+ Row: {
29803
+ connection_id: string;
29804
+ gestart_at: string | null;
29805
+ laatste_einde_at: string | null;
29806
+ laatste_poging_at: string | null;
29807
+ ronde_id: string | null;
29808
+ updated_at: string;
29809
+ };
29810
+ Insert: {
29811
+ connection_id: string;
29812
+ gestart_at?: string | null;
29813
+ laatste_einde_at?: string | null;
29814
+ laatste_poging_at?: string | null;
29815
+ ronde_id?: string | null;
29816
+ updated_at?: string;
29817
+ };
29818
+ Update: {
29819
+ connection_id?: string;
29820
+ gestart_at?: string | null;
29821
+ laatste_einde_at?: string | null;
29822
+ laatste_poging_at?: string | null;
29823
+ ronde_id?: string | null;
29824
+ updated_at?: string;
29825
+ };
29826
+ Relationships: [];
29827
+ };
29828
+ voorraad_floriday_versieronde_uitkomst: {
29829
+ Row: {
29830
+ bron: string | null;
29831
+ created_at: string;
29832
+ floriday_id: string;
29833
+ opvolger_id: string | null;
29834
+ reden: string | null;
29835
+ ronde_id: string;
29836
+ status: string;
29837
+ };
29838
+ Insert: {
29839
+ bron?: string | null;
29840
+ created_at?: string;
29841
+ floriday_id: string;
29842
+ opvolger_id?: string | null;
29843
+ reden?: string | null;
29844
+ ronde_id: string;
29845
+ status: string;
29846
+ };
29847
+ Update: {
29848
+ bron?: string | null;
29849
+ created_at?: string;
29850
+ floriday_id?: string;
29851
+ opvolger_id?: string | null;
29852
+ reden?: string | null;
29853
+ ronde_id?: string;
29854
+ status?: string;
29855
+ };
29856
+ Relationships: [];
29857
+ };
29858
+ voorraad_floriday_vervallen: {
29859
+ Row: {
29860
+ bron: string;
29861
+ connection_id: string | null;
29862
+ created_at: string;
29863
+ floriday_id: string;
29864
+ opgeheven_at: string | null;
29865
+ opvolger_id: string | null;
29866
+ product_id: string | null;
29867
+ ronde_id: string | null;
29868
+ status: string;
29869
+ uitkomst: string | null;
29870
+ updated_at: string;
29871
+ vastgesteld_at: string;
29872
+ verwerkt_at: string | null;
29873
+ };
29874
+ Insert: {
29875
+ bron: string;
29876
+ connection_id?: string | null;
29877
+ created_at?: string;
29878
+ floriday_id: string;
29879
+ opgeheven_at?: string | null;
29880
+ opvolger_id?: string | null;
29881
+ product_id?: string | null;
29882
+ ronde_id?: string | null;
29883
+ status: string;
29884
+ uitkomst?: string | null;
29885
+ updated_at?: string;
29886
+ vastgesteld_at?: string;
29887
+ verwerkt_at?: string | null;
29888
+ };
29889
+ Update: {
29890
+ bron?: string;
29891
+ connection_id?: string | null;
29892
+ created_at?: string;
29893
+ floriday_id?: string;
29894
+ opgeheven_at?: string | null;
29895
+ opvolger_id?: string | null;
29896
+ product_id?: string | null;
29897
+ ronde_id?: string | null;
29898
+ status?: string;
29899
+ uitkomst?: string | null;
29900
+ updated_at?: string;
29901
+ vastgesteld_at?: string;
29902
+ verwerkt_at?: string | null;
29903
+ };
29904
+ Relationships: [];
29905
+ };
29699
29906
  voorraad_instellingen: {
29700
29907
  Row: {
29701
29908
  id: boolean;
@@ -32827,6 +33034,12 @@ export type Database = {
32827
33034
  };
32828
33035
  Returns: Json;
32829
33036
  };
33037
+ _mailbox_norm: {
33038
+ Args: {
33039
+ p: string;
33040
+ };
33041
+ Returns: string;
33042
+ };
32830
33043
  _migrate_rewrite_stock_key: {
32831
33044
  Args: {
32832
33045
  _from_key: string;
@@ -41163,6 +41376,26 @@ export type Database = {
41163
41376
  Args: never;
41164
41377
  Returns: undefined;
41165
41378
  };
41379
+ mailbox_kpis: {
41380
+ Args: {
41381
+ p_tz?: string;
41382
+ };
41383
+ Returns: Json;
41384
+ };
41385
+ mailbox_proposals_page: {
41386
+ Args: {
41387
+ p_date_field?: string;
41388
+ p_filter?: string;
41389
+ p_limit?: number;
41390
+ p_offset?: number;
41391
+ p_period?: string;
41392
+ p_search?: string;
41393
+ p_sort?: string;
41394
+ p_statuses: string[];
41395
+ p_tz?: string;
41396
+ };
41397
+ Returns: Json;
41398
+ };
41166
41399
  mailbox_prune_ingest_runs: {
41167
41400
  Args: {
41168
41401
  p_limit?: number;
@@ -44284,6 +44517,12 @@ export type Database = {
44284
44517
  Args: never;
44285
44518
  Returns: undefined;
44286
44519
  };
44520
+ run_floriday_versieronde: {
44521
+ Args: {
44522
+ p_nieuw?: boolean;
44523
+ };
44524
+ Returns: Json;
44525
+ };
44287
44526
  run_logistics_tasks_dispatch: {
44288
44527
  Args: never;
44289
44528
  Returns: undefined;
@@ -46601,6 +46840,12 @@ export type Database = {
46601
46840
  };
46602
46841
  Returns: Json;
46603
46842
  };
46843
+ voorraad_correctie_1148: {
46844
+ Args: {
46845
+ p_uitvoeren?: boolean;
46846
+ };
46847
+ Returns: Json;
46848
+ };
46604
46849
  voorraad_correctie_status: {
46605
46850
  Args: {
46606
46851
  p_correctie?: string;
@@ -46664,6 +46909,60 @@ export type Database = {
46664
46909
  };
46665
46910
  Returns: boolean;
46666
46911
  };
46912
+ voorraad_floriday_product_van: {
46913
+ Args: {
46914
+ p_floriday_id: string;
46915
+ };
46916
+ Returns: string;
46917
+ };
46918
+ voorraad_floriday_versieronde_geslaagd: {
46919
+ Args: {
46920
+ p_connection_id: string;
46921
+ };
46922
+ Returns: boolean;
46923
+ };
46924
+ voorraad_floriday_versieronde_inplannen: {
46925
+ Args: never;
46926
+ Returns: Json;
46927
+ };
46928
+ voorraad_floriday_versieronde_melding: {
46929
+ Args: never;
46930
+ Returns: string;
46931
+ };
46932
+ voorraad_floriday_versieronde_portie: {
46933
+ Args: {
46934
+ p_connection_id: string;
46935
+ p_ronde_id: string;
46936
+ p_uitkomsten: Json;
46937
+ p_verbindingsfout?: string;
46938
+ };
46939
+ Returns: Json;
46940
+ };
46941
+ voorraad_floriday_versieronde_status: {
46942
+ Args: never;
46943
+ Returns: Json;
46944
+ };
46945
+ voorraad_floriday_versieronde_volgende: {
46946
+ Args: {
46947
+ p_aantal?: number;
46948
+ p_connection_id: string;
46949
+ };
46950
+ Returns: Json;
46951
+ };
46952
+ voorraad_floriday_versies_vastleggen: {
46953
+ Args: {
46954
+ p_connection_id: string;
46955
+ p_max_aandeel?: number;
46956
+ p_ronde: Json;
46957
+ };
46958
+ Returns: Json;
46959
+ };
46960
+ voorraad_floriday_vervallen_verwerken: {
46961
+ Args: {
46962
+ p_uitvoeren?: boolean;
46963
+ };
46964
+ Returns: Json;
46965
+ };
46667
46966
  voorraad_floriday_volgt: {
46668
46967
  Args: {
46669
46968
  p_product_id: string;
@@ -46690,6 +46989,12 @@ export type Database = {
46690
46989
  width_mm: number;
46691
46990
  }[];
46692
46991
  };
46992
+ voorraad_fust_historisch_vervallen: {
46993
+ Args: {
46994
+ p_order_item_id: string;
46995
+ };
46996
+ Returns: boolean;
46997
+ };
46693
46998
  voorraad_fust_instellingen_opslaan: {
46694
46999
  Args: {
46695
47000
  p_eigen_naam: string;
@@ -46740,6 +47045,14 @@ export type Database = {
46740
47045
  Args: never;
46741
47046
  Returns: Json;
46742
47047
  };
47048
+ voorraad_groep_volgorde_opslaan: {
47049
+ Args: {
47050
+ p_group_id: string;
47051
+ p_nieuw: Json;
47052
+ p_oud: Json;
47053
+ };
47054
+ Returns: Json;
47055
+ };
46743
47056
  voorraad_hook_base_url: {
46744
47057
  Args: never;
46745
47058
  Returns: string;
@@ -46761,12 +47074,20 @@ export type Database = {
46761
47074
  Args: never;
46762
47075
  Returns: Json;
46763
47076
  };
47077
+ voorraad_instellingen_lezen: {
47078
+ Args: never;
47079
+ Returns: Json;
47080
+ };
46764
47081
  voorraad_instellingen_opslaan: {
46765
47082
  Args: {
46766
47083
  p_standaard_sturing: string;
46767
47084
  };
46768
47085
  Returns: Json;
46769
47086
  };
47087
+ voorraad_is_beheerder: {
47088
+ Args: never;
47089
+ Returns: boolean;
47090
+ };
46770
47091
  voorraad_is_server: {
46771
47092
  Args: never;
46772
47093
  Returns: boolean;
@@ -46775,6 +47096,10 @@ export type Database = {
46775
47096
  Args: never;
46776
47097
  Returns: Json;
46777
47098
  };
47099
+ voorraad_kpi: {
47100
+ Args: never;
47101
+ Returns: Json;
47102
+ };
46778
47103
  voorraad_lever_datum: {
46779
47104
  Args: {
46780
47105
  p: string;
@@ -46792,6 +47117,46 @@ export type Database = {
46792
47117
  };
46793
47118
  Returns: Json;
46794
47119
  };
47120
+ voorraad_lijst_v2: {
47121
+ Args: {
47122
+ p_filter?: string;
47123
+ p_grootte?: number;
47124
+ p_oplopend?: boolean;
47125
+ p_pagina?: number;
47126
+ p_sort?: string;
47127
+ p_zoek?: string;
47128
+ };
47129
+ Returns: Json;
47130
+ };
47131
+ voorraad_lijst_v2_rijen: {
47132
+ Args: {
47133
+ p_zoek?: string;
47134
+ };
47135
+ Returns: {
47136
+ artikelnummer: string;
47137
+ barcode: string;
47138
+ eenheid: string;
47139
+ f_niet_gekoppeld: boolean;
47140
+ f_onder_minimum: boolean;
47141
+ f_prijs: boolean;
47142
+ f_verpakking: boolean;
47143
+ f_verwijderd_floriday: boolean;
47144
+ floriday_id: string;
47145
+ floriday_verwijderd_at: string;
47146
+ gearchiveerd_at: string;
47147
+ gereserveerd: number;
47148
+ id: string;
47149
+ inkomend: number;
47150
+ is_onderdeel: boolean;
47151
+ liggend: number;
47152
+ minimum: number;
47153
+ naam: string;
47154
+ prijs: number;
47155
+ soort: string;
47156
+ voorraad_sleutel: string;
47157
+ vrij: number;
47158
+ }[];
47159
+ };
46795
47160
  voorraad_load_carriers: {
46796
47161
  Args: never;
46797
47162
  Returns: {
@@ -46938,6 +47303,13 @@ export type Database = {
46938
47303
  };
46939
47304
  Returns: Json;
46940
47305
  };
47306
+ voorraad_validatie_pagina: {
47307
+ Args: {
47308
+ p_grootte?: number;
47309
+ p_pagina?: number;
47310
+ };
47311
+ Returns: Json;
47312
+ };
46941
47313
  voorraad_vereis: {
46942
47314
  Args: {
46943
47315
  p_functie: string;