@flowselections/mailbox-orders 1.0.53 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/MailboxAuthBanner.d.ts.map +1 -1
- package/dist-lib/components/MailboxAuthBanner.js +6 -5
- package/dist-lib/components/MailboxPageFrame.d.ts +19 -0
- package/dist-lib/components/MailboxPageFrame.d.ts.map +1 -0
- package/dist-lib/components/MailboxPageFrame.js +95 -0
- package/dist-lib/components/MailboxProcessedPage.d.ts.map +1 -1
- package/dist-lib/components/MailboxProcessedPage.js +94 -62
- package/dist-lib/components/MailboxProposalsPage.d.ts.map +1 -1
- package/dist-lib/components/MailboxProposalsPage.js +178 -71
- package/dist-lib/components/MailboxSkippedPage.d.ts.map +1 -1
- package/dist-lib/components/MailboxSkippedPage.js +80 -14
- package/dist-lib/components/MailboxStatusLine.d.ts +3 -1
- package/dist-lib/components/MailboxStatusLine.d.ts.map +1 -1
- package/dist-lib/components/MailboxStatusLine.js +31 -8
- package/dist-lib/components/fs-ui/DataTable.d.ts +36 -0
- package/dist-lib/components/fs-ui/DataTable.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/DataTable.js +33 -0
- package/dist-lib/components/fs-ui/EmptyState.d.ts +9 -0
- package/dist-lib/components/fs-ui/EmptyState.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/EmptyState.js +5 -0
- package/dist-lib/components/fs-ui/FilterChips.d.ts +13 -0
- package/dist-lib/components/fs-ui/FilterChips.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/FilterChips.js +8 -0
- package/dist-lib/components/fs-ui/HoverTip.d.ts +15 -0
- package/dist-lib/components/fs-ui/HoverTip.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/HoverTip.js +24 -0
- package/dist-lib/components/fs-ui/InlineAlert.d.ts +9 -0
- package/dist-lib/components/fs-ui/InlineAlert.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/InlineAlert.js +14 -0
- package/dist-lib/components/fs-ui/KpiRow.d.ts +6 -0
- package/dist-lib/components/fs-ui/KpiRow.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/KpiRow.js +7 -0
- package/dist-lib/components/fs-ui/KpiTile.d.ts +21 -0
- package/dist-lib/components/fs-ui/KpiTile.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/KpiTile.js +40 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts +10 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/MobilePrimaryAction.js +7 -0
- package/dist-lib/components/fs-ui/PageHeader.d.ts +8 -0
- package/dist-lib/components/fs-ui/PageHeader.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PageHeader.js +5 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts +15 -0
- package/dist-lib/components/fs-ui/PillTabs.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/PillTabs.js +14 -0
- package/dist-lib/components/fs-ui/SearchInput.d.ts +12 -0
- package/dist-lib/components/fs-ui/SearchInput.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/SearchInput.js +33 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.d.ts +7 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/ShortcutHelp.js +6 -0
- package/dist-lib/components/fs-ui/StatusIcon.d.ts +8 -0
- package/dist-lib/components/fs-ui/StatusIcon.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/StatusIcon.js +16 -0
- package/dist-lib/components/fs-ui/TableSkeleton.d.ts +6 -0
- package/dist-lib/components/fs-ui/TableSkeleton.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/TableSkeleton.js +6 -0
- package/dist-lib/components/fs-ui/Toolbar.d.ts +8 -0
- package/dist-lib/components/fs-ui/Toolbar.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/Toolbar.js +5 -0
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts +7 -0
- package/dist-lib/components/fs-ui/UpdatedAt.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/UpdatedAt.js +9 -0
- package/dist-lib/components/fs-ui/useListHotkeys.d.ts +18 -0
- package/dist-lib/components/fs-ui/useListHotkeys.d.ts.map +1 -0
- package/dist-lib/components/fs-ui/useListHotkeys.js +48 -0
- package/dist-lib/components/settings/MailboxAiPromptCard.d.ts +2 -1
- package/dist-lib/components/settings/MailboxAiPromptCard.d.ts.map +1 -1
- package/dist-lib/components/settings/MailboxAiPromptCard.js +9 -1
- package/dist-lib/components/settings/MailboxFilterSettingsCard.js +1 -1
- package/dist-lib/components/settings/MailboxTestSetCard.d.ts +2 -1
- package/dist-lib/components/settings/MailboxTestSetCard.d.ts.map +1 -1
- package/dist-lib/components/settings/MailboxTestSetCard.js +10 -2
- package/dist-lib/integrations/supabase/types.d.ts +372 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/mailbox-list.functions.d.ts +67 -0
- package/dist-lib/lib/mailbox-list.functions.d.ts.map +1 -0
- package/dist-lib/lib/mailbox-list.functions.js +63 -0
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const pageInput: z.ZodObject<{
|
|
3
|
+
statuses: z.ZodArray<z.ZodEnum<{
|
|
4
|
+
pending: "pending";
|
|
5
|
+
approved: "approved";
|
|
6
|
+
rejected: "rejected";
|
|
7
|
+
}>>;
|
|
8
|
+
search: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
period: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
all: "all";
|
|
11
|
+
today: "today";
|
|
12
|
+
"7d": "7d";
|
|
13
|
+
"30d": "30d";
|
|
14
|
+
}>>>;
|
|
15
|
+
sort: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
desc: "desc";
|
|
17
|
+
asc: "asc";
|
|
18
|
+
}>>>;
|
|
19
|
+
dateField: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
received: "received";
|
|
21
|
+
reviewed: "reviewed";
|
|
22
|
+
}>>>;
|
|
23
|
+
tz: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
filter: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
25
|
+
klant_onbekend: "klant_onbekend";
|
|
26
|
+
}>>>>;
|
|
27
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
28
|
+
pageSize: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type ProposalsPageInput = z.input<typeof pageInput>;
|
|
31
|
+
/** Eén pagina voorstellen + totaal (mailbox_proposals_page). */
|
|
32
|
+
export declare const listProposalsPage: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
33
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
34
|
+
userId: string;
|
|
35
|
+
claims: import("@supabase/auth-js").User;
|
|
36
|
+
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
37
|
+
statuses: ("pending" | "approved" | "rejected")[];
|
|
38
|
+
search: string;
|
|
39
|
+
period: "all" | "today" | "7d" | "30d";
|
|
40
|
+
sort: "desc" | "asc";
|
|
41
|
+
dateField: "received" | "reviewed";
|
|
42
|
+
tz: string;
|
|
43
|
+
filter: "klant_onbekend" | null;
|
|
44
|
+
page: number;
|
|
45
|
+
pageSize: number;
|
|
46
|
+
}, Promise<{
|
|
47
|
+
items: any;
|
|
48
|
+
total: number;
|
|
49
|
+
}>>;
|
|
50
|
+
export interface MailboxKpis {
|
|
51
|
+
pending: number;
|
|
52
|
+
pending_today: number;
|
|
53
|
+
customer_unknown: number;
|
|
54
|
+
processed: number;
|
|
55
|
+
approved_today: number;
|
|
56
|
+
skipped: number;
|
|
57
|
+
}
|
|
58
|
+
/** Tellers voor tegels en tabbladen in één aanroep (mailbox_kpis). */
|
|
59
|
+
export declare const getMailboxKpis: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
60
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
61
|
+
userId: string;
|
|
62
|
+
claims: import("@supabase/auth-js").User;
|
|
63
|
+
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
64
|
+
tz: string;
|
|
65
|
+
}, Promise<MailboxKpis>>;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=mailbox-list.functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox-list.functions.d.ts","sourceRoot":"","sources":["../../src/lib/mailbox-list.functions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUb,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAE3D,gEAAgE;AAChE,eAAO,MAAM,iBAAiB;;;;8CAEJ,OAAO;;;;;;;;;;;;;GAqB7B,CAAC;AAEL,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,sEAAsE;AACtE,eAAO,MAAM,cAAc;;;;8CAED,OAAO;;wBAiB7B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Leesfuncties voor de lijstweergaven (zoeken, filteren en pagineren op de server).
|
|
2
|
+
// Nieuwe functies; de bestaande listProposals blijft ongewijzigd bestaan.
|
|
3
|
+
import { createServerFn } from "@tanstack/react-start";
|
|
4
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { ensureMailboxDefaults } from "./mailbox.functions.js";
|
|
7
|
+
const pageInput = z.object({
|
|
8
|
+
statuses: z.array(z.enum(["pending", "approved", "rejected"])).min(1),
|
|
9
|
+
search: z.string().max(200).optional().default(""),
|
|
10
|
+
period: z.enum(["all", "today", "7d", "30d"]).optional().default("all"),
|
|
11
|
+
sort: z.enum(["asc", "desc"]).optional().default("desc"),
|
|
12
|
+
dateField: z.enum(["received", "reviewed"]).optional().default("received"),
|
|
13
|
+
tz: z.string().max(64).optional().default("UTC"),
|
|
14
|
+
filter: z.enum(["klant_onbekend"]).nullable().optional().default(null),
|
|
15
|
+
page: z.number().int().min(1).optional().default(1),
|
|
16
|
+
pageSize: z.number().int().min(10).max(200).optional().default(50),
|
|
17
|
+
});
|
|
18
|
+
/** Eén pagina voorstellen + totaal (mailbox_proposals_page). */
|
|
19
|
+
export const listProposalsPage = createServerFn({ method: "GET" })
|
|
20
|
+
.middleware([requireSupabaseAuth])
|
|
21
|
+
.inputValidator((input) => pageInput.parse(input ?? {}))
|
|
22
|
+
.handler(async ({ data }) => {
|
|
23
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
24
|
+
await ensureMailboxDefaults(supabaseAdmin);
|
|
25
|
+
const { data: res, error } = await supabaseAdmin.rpc("mailbox_proposals_page", {
|
|
26
|
+
p_statuses: data.statuses,
|
|
27
|
+
p_search: data.search?.trim() ? data.search.trim() : null,
|
|
28
|
+
p_period: data.period,
|
|
29
|
+
p_sort: data.sort,
|
|
30
|
+
p_date_field: data.dateField,
|
|
31
|
+
p_tz: data.tz,
|
|
32
|
+
p_filter: data.filter ?? null,
|
|
33
|
+
p_limit: data.pageSize,
|
|
34
|
+
p_offset: (data.page - 1) * data.pageSize,
|
|
35
|
+
});
|
|
36
|
+
if (error) {
|
|
37
|
+
console.error("[mailbox] mailbox_proposals_page", error);
|
|
38
|
+
throw new Error("De lijst kon niet worden geladen.");
|
|
39
|
+
}
|
|
40
|
+
const items = Array.isArray(res?.items) ? res.items : [];
|
|
41
|
+
return { items, total: Number(res?.total ?? 0) };
|
|
42
|
+
});
|
|
43
|
+
/** Tellers voor tegels en tabbladen in één aanroep (mailbox_kpis). */
|
|
44
|
+
export const getMailboxKpis = createServerFn({ method: "GET" })
|
|
45
|
+
.middleware([requireSupabaseAuth])
|
|
46
|
+
.inputValidator((input) => z.object({ tz: z.string().max(64).optional().default("UTC") }).parse(input ?? {}))
|
|
47
|
+
.handler(async ({ data }) => {
|
|
48
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
49
|
+
const { data: res, error } = await supabaseAdmin.rpc("mailbox_kpis", { p_tz: data.tz });
|
|
50
|
+
if (error) {
|
|
51
|
+
console.error("[mailbox] mailbox_kpis", error);
|
|
52
|
+
throw new Error("De tellers konden niet worden geladen.");
|
|
53
|
+
}
|
|
54
|
+
const n = (k) => Number(res?.[k] ?? 0) || 0;
|
|
55
|
+
return {
|
|
56
|
+
pending: n("pending"),
|
|
57
|
+
pending_today: n("pending_today"),
|
|
58
|
+
customer_unknown: n("customer_unknown"),
|
|
59
|
+
processed: n("processed"),
|
|
60
|
+
approved_today: n("approved_today"),
|
|
61
|
+
skipped: n("skipped"),
|
|
62
|
+
};
|
|
63
|
+
});
|