@flowselections/dashboard-erp-kwekers 1.0.1
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/_core-safelist.d.ts +2 -0
- package/dist-lib/_core-safelist.d.ts.map +1 -0
- package/dist-lib/_core-safelist.js +15 -0
- package/dist-lib/components/DashboardErpLogo.d.ts +6 -0
- package/dist-lib/components/DashboardErpLogo.d.ts.map +1 -0
- package/dist-lib/components/DashboardErpLogo.js +4 -0
- package/dist-lib/components/dashboard/AiSettingsCard.d.ts +2 -0
- package/dist-lib/components/dashboard/AiSettingsCard.d.ts.map +1 -0
- package/dist-lib/components/dashboard/AiSettingsCard.js +37 -0
- package/dist-lib/components/dashboard/AlertHistoryPanel.d.ts +4 -0
- package/dist-lib/components/dashboard/AlertHistoryPanel.d.ts.map +1 -0
- package/dist-lib/components/dashboard/AlertHistoryPanel.js +18 -0
- package/dist-lib/components/dashboard/BlockEditorDialog.d.ts +15 -0
- package/dist-lib/components/dashboard/BlockEditorDialog.d.ts.map +1 -0
- package/dist-lib/components/dashboard/BlockEditorDialog.js +89 -0
- package/dist-lib/components/dashboard/BlockRenderer.d.ts +5 -0
- package/dist-lib/components/dashboard/BlockRenderer.d.ts.map +1 -0
- package/dist-lib/components/dashboard/BlockRenderer.js +25 -0
- package/dist-lib/components/dashboard/DashboardBuilderPage.d.ts +4 -0
- package/dist-lib/components/dashboard/DashboardBuilderPage.d.ts.map +1 -0
- package/dist-lib/components/dashboard/DashboardBuilderPage.js +49 -0
- package/dist-lib/components/dashboard/DashboardErpLayoutPage.d.ts +2 -0
- package/dist-lib/components/dashboard/DashboardErpLayoutPage.d.ts.map +1 -0
- package/dist-lib/components/dashboard/DashboardErpLayoutPage.js +30 -0
- package/dist-lib/components/dashboard/DashboardSummary.d.ts +9 -0
- package/dist-lib/components/dashboard/DashboardSummary.d.ts.map +1 -0
- package/dist-lib/components/dashboard/DashboardSummary.js +136 -0
- package/dist-lib/components/dashboard/DashboardViewPage.d.ts +3 -0
- package/dist-lib/components/dashboard/DashboardViewPage.d.ts.map +1 -0
- package/dist-lib/components/dashboard/DashboardViewPage.js +37 -0
- package/dist-lib/components/dashboard/FilterBar.d.ts +17 -0
- package/dist-lib/components/dashboard/FilterBar.d.ts.map +1 -0
- package/dist-lib/components/dashboard/FilterBar.js +66 -0
- package/dist-lib/components/dashboard/QuickAddDialog.d.ts +15 -0
- package/dist-lib/components/dashboard/QuickAddDialog.d.ts.map +1 -0
- package/dist-lib/components/dashboard/QuickAddDialog.js +168 -0
- package/dist-lib/components/dashboard/SuggestionBanner.d.ts +15 -0
- package/dist-lib/components/dashboard/SuggestionBanner.d.ts.map +1 -0
- package/dist-lib/components/dashboard/SuggestionBanner.js +13 -0
- package/dist-lib/components/dashboard/TileGallery.d.ts +17 -0
- package/dist-lib/components/dashboard/TileGallery.d.ts.map +1 -0
- package/dist-lib/components/dashboard/TileGallery.js +60 -0
- package/dist-lib/components/dashboard/ai/AiChatPanel.d.ts +6 -0
- package/dist-lib/components/dashboard/ai/AiChatPanel.d.ts.map +1 -0
- package/dist-lib/components/dashboard/ai/AiChatPanel.js +57 -0
- package/dist-lib/components/dashboard/ai/BlockGeneratorDialog.d.ts +14 -0
- package/dist-lib/components/dashboard/ai/BlockGeneratorDialog.d.ts.map +1 -0
- package/dist-lib/components/dashboard/ai/BlockGeneratorDialog.js +61 -0
- package/dist-lib/components/dashboard/blocks/AiAnalysisBlock.d.ts +5 -0
- package/dist-lib/components/dashboard/blocks/AiAnalysisBlock.d.ts.map +1 -0
- package/dist-lib/components/dashboard/blocks/AiAnalysisBlock.js +58 -0
- package/dist-lib/components/dashboard/blocks/AlertBlock.d.ts +5 -0
- package/dist-lib/components/dashboard/blocks/AlertBlock.d.ts.map +1 -0
- package/dist-lib/components/dashboard/blocks/AlertBlock.js +107 -0
- package/dist-lib/components/dashboard/blocks/BlockShell.d.ts +10 -0
- package/dist-lib/components/dashboard/blocks/BlockShell.d.ts.map +1 -0
- package/dist-lib/components/dashboard/blocks/BlockShell.js +39 -0
- package/dist-lib/components/dashboard/blocks/ChartBlock.d.ts +5 -0
- package/dist-lib/components/dashboard/blocks/ChartBlock.d.ts.map +1 -0
- package/dist-lib/components/dashboard/blocks/ChartBlock.js +31 -0
- package/dist-lib/components/dashboard/blocks/ForecastBlock.d.ts +5 -0
- package/dist-lib/components/dashboard/blocks/ForecastBlock.d.ts.map +1 -0
- package/dist-lib/components/dashboard/blocks/ForecastBlock.js +86 -0
- package/dist-lib/components/dashboard/blocks/KpiBlock.d.ts +5 -0
- package/dist-lib/components/dashboard/blocks/KpiBlock.d.ts.map +1 -0
- package/dist-lib/components/dashboard/blocks/KpiBlock.js +17 -0
- package/dist-lib/components/dashboard/blocks/TableBlock.d.ts +5 -0
- package/dist-lib/components/dashboard/blocks/TableBlock.d.ts.map +1 -0
- package/dist-lib/components/dashboard/blocks/TableBlock.js +12 -0
- package/dist-lib/components/dashboard/types.d.ts +129 -0
- package/dist-lib/components/dashboard/types.d.ts.map +1 -0
- package/dist-lib/components/dashboard/types.js +1 -0
- package/dist-lib/hooks/useAlertEvents.d.ts +9 -0
- package/dist-lib/hooks/useAlertEvents.d.ts.map +1 -0
- package/dist-lib/hooks/useAlertEvents.js +32 -0
- package/dist-lib/hooks/useBlockData.d.ts +10 -0
- package/dist-lib/hooks/useBlockData.d.ts.map +1 -0
- package/dist-lib/hooks/useBlockData.js +130 -0
- package/dist-lib/hooks/useDashboardBlocks.d.ts +25 -0
- package/dist-lib/hooks/useDashboardBlocks.d.ts.map +1 -0
- package/dist-lib/hooks/useDashboardBlocks.js +66 -0
- package/dist-lib/hooks/useDashboardPages.d.ts +10 -0
- package/dist-lib/hooks/useDashboardPages.d.ts.map +1 -0
- package/dist-lib/hooks/useDashboardPages.js +56 -0
- package/dist-lib/hooks/useSchema.d.ts +13 -0
- package/dist-lib/hooks/useSchema.d.ts.map +1 -0
- package/dist-lib/hooks/useSchema.js +23 -0
- package/dist-lib/hooks/useUserRoles.d.ts +5 -0
- package/dist-lib/hooks/useUserRoles.d.ts.map +1 -0
- package/dist-lib/hooks/useUserRoles.js +23 -0
- package/dist-lib/index.d.ts +17 -0
- package/dist-lib/index.d.ts.map +1 -0
- package/dist-lib/index.js +47 -0
- package/dist-lib/integrations/supabase/auth-attacher.d.ts +2 -0
- package/dist-lib/integrations/supabase/auth-attacher.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/auth-attacher.js +12 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +2555 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/auth-middleware.js +52 -0
- package/dist-lib/integrations/supabase/client.d.ts +2551 -0
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/client.js +13 -0
- package/dist-lib/integrations/supabase/client.server.d.ts +2551 -0
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/client.server.js +30 -0
- package/dist-lib/integrations/supabase/types.d.ts +2685 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/types.js +8 -0
- package/dist-lib/lib/ai-gateway.server.d.ts +2 -0
- package/dist-lib/lib/ai-gateway.server.d.ts.map +1 -0
- package/dist-lib/lib/ai-gateway.server.js +11 -0
- package/dist-lib/lib/ai-insights.functions.d.ts +10271 -0
- package/dist-lib/lib/ai-insights.functions.d.ts.map +1 -0
- package/dist-lib/lib/ai-insights.functions.js +118 -0
- package/dist-lib/lib/aiSettings.d.ts +22 -0
- package/dist-lib/lib/aiSettings.d.ts.map +1 -0
- package/dist-lib/lib/aiSettings.js +107 -0
- package/dist-lib/lib/dashboard-eval.functions.d.ts +5130 -0
- package/dist-lib/lib/dashboard-eval.functions.d.ts.map +1 -0
- package/dist-lib/lib/dashboard-eval.functions.js +87 -0
- package/dist-lib/lib/dashboard.functions.d.ts +2562 -0
- package/dist-lib/lib/dashboard.functions.d.ts.map +1 -0
- package/dist-lib/lib/dashboard.functions.js +21 -0
- package/dist-lib/lib/dashboardTemplates.d.ts +11 -0
- package/dist-lib/lib/dashboardTemplates.d.ts.map +1 -0
- package/dist-lib/lib/dashboardTemplates.js +44 -0
- package/dist-lib/lib/format.d.ts +20 -0
- package/dist-lib/lib/format.d.ts.map +1 -0
- package/dist-lib/lib/format.js +121 -0
- package/dist-lib/lib/query.functions.d.ts +2583 -0
- package/dist-lib/lib/query.functions.d.ts.map +1 -0
- package/dist-lib/lib/query.functions.js +85 -0
- package/dist-lib/lib/quickBlocks.d.ts +28 -0
- package/dist-lib/lib/quickBlocks.d.ts.map +1 -0
- package/dist-lib/lib/quickBlocks.js +297 -0
- package/dist-lib/lib/roles.functions.d.ts +2556 -0
- package/dist-lib/lib/roles.functions.d.ts.map +1 -0
- package/dist-lib/lib/roles.functions.js +14 -0
- package/dist-lib/lib/suggestions.d.ts +8 -0
- package/dist-lib/lib/suggestions.d.ts.map +1 -0
- package/dist-lib/lib/suggestions.js +41 -0
- package/dist-lib/lib/utils.d.ts +3 -0
- package/dist-lib/lib/utils.d.ts.map +1 -0
- package/dist-lib/lib/utils.js +5 -0
- package/dist-lib/lib/validationSchemas.d.ts +15 -0
- package/dist-lib/lib/validationSchemas.d.ts.map +1 -0
- package/dist-lib/lib/validationSchemas.js +25 -0
- package/dist-lib/styles.css +1 -0
- package/package.json +95 -0
- package/public/flowselections-assets/template-module/README.md +15 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.functions.d.ts","sourceRoot":"","sources":["../../src/lib/query.functions.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;AACvD,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,I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;;;;;;2BAAwzB,2DAAmB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAjDjvrE,kBAAkB;;;;;;;;;;;;GAiDxC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createServerFn } from '@tanstack/react-start';
|
|
2
|
+
import { requireSupabaseAuth } from '../integrations/supabase/auth-middleware';
|
|
3
|
+
// Whitelist via information_schema. Voorkomt dat clients willekeurige tabellen/kolommen kunnen targeten.
|
|
4
|
+
async function loadWhitelist(client) {
|
|
5
|
+
const { data } = await client.rpc('dashboard_list_public_schema');
|
|
6
|
+
const map = new Map();
|
|
7
|
+
for (const row of (data ?? [])) {
|
|
8
|
+
if (!map.has(row.table_name))
|
|
9
|
+
map.set(row.table_name, new Set());
|
|
10
|
+
map.get(row.table_name).add(row.column_name);
|
|
11
|
+
}
|
|
12
|
+
return map;
|
|
13
|
+
}
|
|
14
|
+
function applyFilters(q, filters, allowedCols) {
|
|
15
|
+
for (const f of filters ?? []) {
|
|
16
|
+
if (!allowedCols.has(f.column))
|
|
17
|
+
continue;
|
|
18
|
+
if (f.value === '' || f.value === null || f.value === undefined)
|
|
19
|
+
continue;
|
|
20
|
+
const op = f.op ?? 'eq';
|
|
21
|
+
q = q[op](f.column, f.value);
|
|
22
|
+
}
|
|
23
|
+
return q;
|
|
24
|
+
}
|
|
25
|
+
export const runBlockQuery = createServerFn({ method: 'POST' })
|
|
26
|
+
.middleware([requireSupabaseAuth])
|
|
27
|
+
.inputValidator((input) => input)
|
|
28
|
+
.handler(async ({ data, context }) => {
|
|
29
|
+
const { supabase } = context;
|
|
30
|
+
const wl = await loadWhitelist(supabase);
|
|
31
|
+
const cols = wl.get(data.table);
|
|
32
|
+
if (!cols)
|
|
33
|
+
throw new Error(`Tabel niet toegestaan: ${data.table}`);
|
|
34
|
+
const limit = Math.min(Math.max(1, Number(data.limit ?? 100)), 5000);
|
|
35
|
+
if (data.mode === 'count') {
|
|
36
|
+
let q = supabase.from(data.table).select('*', { count: 'exact', head: true });
|
|
37
|
+
q = applyFilters(q, data.filters, cols);
|
|
38
|
+
const { count, error } = await q;
|
|
39
|
+
if (error)
|
|
40
|
+
throw new Error(error.message);
|
|
41
|
+
return { count: count ?? 0, rows: [] };
|
|
42
|
+
}
|
|
43
|
+
if (data.mode === 'aggregate') {
|
|
44
|
+
const col = data.aggColumn;
|
|
45
|
+
if (!col || !cols.has(col))
|
|
46
|
+
throw new Error('Aggregatie-kolom ongeldig');
|
|
47
|
+
let q = supabase.from(data.table).select(col).limit(limit);
|
|
48
|
+
q = applyFilters(q, data.filters, cols);
|
|
49
|
+
const { data: rows, error } = await q;
|
|
50
|
+
if (error)
|
|
51
|
+
throw new Error(error.message);
|
|
52
|
+
const nums = (rows ?? []).map(r => Number(r?.[col])).filter(n => !Number.isNaN(n));
|
|
53
|
+
let value = 0;
|
|
54
|
+
if (nums.length) {
|
|
55
|
+
switch (data.agg) {
|
|
56
|
+
case 'sum':
|
|
57
|
+
value = nums.reduce((a, b) => a + b, 0);
|
|
58
|
+
break;
|
|
59
|
+
case 'avg':
|
|
60
|
+
value = nums.reduce((a, b) => a + b, 0) / nums.length;
|
|
61
|
+
break;
|
|
62
|
+
case 'min':
|
|
63
|
+
value = Math.min(...nums);
|
|
64
|
+
break;
|
|
65
|
+
case 'max':
|
|
66
|
+
value = Math.max(...nums);
|
|
67
|
+
break;
|
|
68
|
+
default: value = nums.length;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { count: 0, value, rows: [] };
|
|
72
|
+
}
|
|
73
|
+
// mode === 'select'
|
|
74
|
+
const selectCols = (data.columns ?? []).filter(c => cols.has(c));
|
|
75
|
+
const select = selectCols.length ? selectCols.join(',') : '*';
|
|
76
|
+
let q = supabase.from(data.table).select(select).limit(limit);
|
|
77
|
+
if (data.orderBy && cols.has(data.orderBy)) {
|
|
78
|
+
q = q.order(data.orderBy, { ascending: (data.orderDir ?? 'desc') === 'asc' });
|
|
79
|
+
}
|
|
80
|
+
q = applyFilters(q, data.filters, cols);
|
|
81
|
+
const { data: rows, error } = await q;
|
|
82
|
+
if (error)
|
|
83
|
+
throw new Error(error.message);
|
|
84
|
+
return { count: 0, rows: Array.isArray(rows) ? rows : [] };
|
|
85
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BlockType, AnyBlockConfig } from '../components/dashboard/types';
|
|
2
|
+
export type QuickCategory = 'verkoop' | 'voorraad' | 'klanten' | 'orders' | 'inkoop' | 'financieel' | 'producten' | 'leveranciers' | 'mailbox' | 'logistiek' | 'ai' | 'management';
|
|
3
|
+
export interface QuickBlock {
|
|
4
|
+
id: string;
|
|
5
|
+
category: QuickCategory;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
type: BlockType;
|
|
10
|
+
title: string;
|
|
11
|
+
config: AnyBlockConfig;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Catalogus van kant-en-klare blokken. Mensentaal in de UI — onder water
|
|
15
|
+
* mappen ze naar bestaande tabellen/kolommen in het publieke schema.
|
|
16
|
+
*
|
|
17
|
+
* BELANGRIJK: alleen tegels opnemen die mappen op kolommen die nu in het
|
|
18
|
+
* schema bestaan. Geen data? Tegel blijft staan en toont 0 — kan later
|
|
19
|
+
* vanzelf gaan werken zodra er rijen komen.
|
|
20
|
+
*/
|
|
21
|
+
export declare const QUICK_BLOCKS: QuickBlock[];
|
|
22
|
+
export declare const QUICK_CATEGORIES: {
|
|
23
|
+
id: QuickCategory;
|
|
24
|
+
label: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
}[];
|
|
27
|
+
export declare function getQuickBlock(id: string): QuickBlock | undefined;
|
|
28
|
+
//# sourceMappingURL=quickBlocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quickBlocks.d.ts","sourceRoot":"","sources":["../../src/lib/quickBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAuC,MAAM,8BAA8B,CAAC;AAEnH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,UAAU,GACV,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,cAAc,GACd,SAAS,GACT,WAAW,GACX,IAAI,GACJ,YAAY,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,EA0RpC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE;IAAE,EAAE,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAahF,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAEhE"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalogus van kant-en-klare blokken. Mensentaal in de UI — onder water
|
|
3
|
+
* mappen ze naar bestaande tabellen/kolommen in het publieke schema.
|
|
4
|
+
*
|
|
5
|
+
* BELANGRIJK: alleen tegels opnemen die mappen op kolommen die nu in het
|
|
6
|
+
* schema bestaan. Geen data? Tegel blijft staan en toont 0 — kan later
|
|
7
|
+
* vanzelf gaan werken zodra er rijen komen.
|
|
8
|
+
*/
|
|
9
|
+
export const QUICK_BLOCKS = [
|
|
10
|
+
// ============================================================
|
|
11
|
+
// VERKOOP — periode wordt bepaald door het globale datumfilter
|
|
12
|
+
// ============================================================
|
|
13
|
+
{ id: 'omzet', category: 'verkoop', label: 'Omzet', description: 'Totale omzet (€) in de gekozen periode', icon: 'Euro', type: 'kpi', title: 'Omzet',
|
|
14
|
+
config: { table: 'orders', agg: 'sum', column: 'total', format: 'currency' } },
|
|
15
|
+
{ id: 'avg-orderwaarde', category: 'verkoop', label: 'Gemiddelde orderwaarde', description: 'Gemiddeld bedrag per order (€)', icon: 'Calculator', type: 'kpi', title: 'Gemiddelde orderwaarde',
|
|
16
|
+
config: { table: 'orders', agg: 'avg', column: 'total', format: 'currency' } },
|
|
17
|
+
{ id: 'aantal-verkocht', category: 'verkoop', label: 'Verkochte producten', description: 'Som van verkochte stuks', icon: 'Package', type: 'kpi', title: 'Verkochte producten',
|
|
18
|
+
config: { table: 'order_items', agg: 'sum', column: 'quantity', format: 'number' } },
|
|
19
|
+
{ id: 'omzet-trend', category: 'verkoop', label: 'Omzetontwikkeling', description: 'Grafiek van omzet per dag (€)', icon: 'TrendingUp', type: 'chart', title: 'Omzetontwikkeling',
|
|
20
|
+
config: { kind: 'area', table: 'orders', xColumn: 'created_at', yColumn: 'total', agg: 'sum', limit: 2000 } },
|
|
21
|
+
{ id: 'omzet-per-klant', category: 'verkoop', label: 'Omzet per klant', description: 'Top klanten op omzet (€)', icon: 'Users', type: 'chart', title: 'Omzet per klant',
|
|
22
|
+
config: { kind: 'bar', table: 'orders', xColumn: 'customer_name', yColumn: 'total', agg: 'sum', limit: 1000 } },
|
|
23
|
+
{ id: 'omzet-per-productgroep', category: 'verkoop', label: 'Omzet per producttype', description: 'Omzet verdeeld over producttypes', icon: 'PieChart', type: 'chart', title: 'Omzet per producttype',
|
|
24
|
+
config: { kind: 'pie', table: 'order_items', xColumn: 'unit', yColumn: 'unit_price', agg: 'sum', limit: 500 } },
|
|
25
|
+
{ id: 'top-products', category: 'verkoop', label: 'Best verkochte producten', description: 'Top producten op aantal verkochte stuks', icon: 'Trophy', type: 'chart', title: 'Top producten',
|
|
26
|
+
config: { kind: 'bar', table: 'order_items', xColumn: 'product_name', yColumn: 'quantity', agg: 'sum', limit: 1000 } },
|
|
27
|
+
{ id: 'omzet-forecast', category: 'verkoop', label: 'Omzetforecast', description: 'AI-prognose van omzet voor de komende periode', icon: 'LineChart', type: 'forecast', title: 'Omzetforecast',
|
|
28
|
+
config: { table: 'orders', xColumn: 'created_at', yColumn: 'total', agg: 'sum', horizon: 30, history: 365 } },
|
|
29
|
+
// ============================================================
|
|
30
|
+
// VOORRAAD
|
|
31
|
+
// ============================================================
|
|
32
|
+
{ id: 'stock-count', category: 'voorraad', label: 'Aantal producten op voorraad', description: 'Totaal aantal artikelen', icon: 'Package', type: 'kpi', title: 'Aantal producten',
|
|
33
|
+
config: { table: 'products', agg: 'count', format: 'number' } },
|
|
34
|
+
{ id: 'stock-units', category: 'voorraad', label: 'Totaal aantal stuks', description: 'Som van de voorraad (stuks)', icon: 'Boxes', type: 'kpi', title: 'Totaal stuks op voorraad',
|
|
35
|
+
config: { table: 'products', agg: 'sum', column: 'quantity', format: 'number' } },
|
|
36
|
+
{ id: 'stock-value', category: 'voorraad', label: 'Voorraadwaarde (verkoop)', description: 'Som van verkoopprijzen (€)', icon: 'Wallet', type: 'kpi', title: 'Voorraadwaarde',
|
|
37
|
+
config: { table: 'products', agg: 'sum', column: 'sale_price', format: 'currency' } },
|
|
38
|
+
{ id: 'stock-value-purchase', category: 'voorraad', label: 'Voorraadwaarde (inkoop)', description: 'Som van inkoopprijzen (€)', icon: 'Wallet', type: 'kpi', title: 'Voorraadwaarde inkoop',
|
|
39
|
+
config: { table: 'products', agg: 'sum', column: 'purchase_price', format: 'currency' } },
|
|
40
|
+
{ id: 'stock-incoming', category: 'voorraad', label: 'Verwachte binnenkomst', description: 'Som van inkomende stuks', icon: 'Truck', type: 'kpi', title: 'Verwachte binnenkomst',
|
|
41
|
+
config: { table: 'products', agg: 'sum', column: 'incoming_quantity', format: 'number' } },
|
|
42
|
+
{ id: 'stock-low', category: 'voorraad', label: 'Bijna uitverkocht', description: 'Producten waar nog weinig van is', icon: 'AlertTriangle', type: 'table', title: 'Producten bijna op',
|
|
43
|
+
config: { table: 'products', columns: ['product', 'quantity', 'min_quantity', 'location'], orderBy: 'quantity', orderDir: 'asc', limit: 25 } },
|
|
44
|
+
{ id: 'stock-largest', category: 'voorraad', label: 'Grootste voorraadposities', description: 'Producten met de meeste stuks', icon: 'Boxes', type: 'table', title: 'Grootste voorraad',
|
|
45
|
+
config: { table: 'products', columns: ['product', 'quantity', 'sale_price', 'location'], orderBy: 'quantity', orderDir: 'desc', limit: 25 } },
|
|
46
|
+
{ id: 'stock-by-type', category: 'voorraad', label: 'Voorraad per producttype', description: 'Aantal stuks per producttype', icon: 'PieChart', type: 'chart', title: 'Voorraad per type',
|
|
47
|
+
config: { kind: 'pie', table: 'products', xColumn: 'product_type', yColumn: 'quantity', agg: 'sum', limit: 500 } },
|
|
48
|
+
{ id: 'stock-by-location', category: 'voorraad', label: 'Voorraad per locatie', description: 'Verdeling van voorraad per locatie', icon: 'MapPin', type: 'chart', title: 'Voorraad per locatie',
|
|
49
|
+
config: { kind: 'bar', table: 'products', xColumn: 'location', yColumn: 'quantity', agg: 'sum', limit: 500 } },
|
|
50
|
+
{ id: 'stock-new', category: 'voorraad', label: 'Nieuw toegevoegde producten', description: 'Producten toegevoegd in de gekozen periode', icon: 'Sparkles', type: 'table', title: 'Nieuwe producten',
|
|
51
|
+
config: { table: 'products', columns: ['product', 'quantity', 'sale_price', 'created_at'], orderBy: 'created_at', orderDir: 'desc', limit: 25 } },
|
|
52
|
+
{ id: 'stock-forecast', category: 'voorraad', label: 'Voorraadforecast', description: 'AI-prognose van voorraadontwikkeling', icon: 'LineChart', type: 'forecast', title: 'Voorraadforecast',
|
|
53
|
+
config: { table: 'products', xColumn: 'updated_at', yColumn: 'quantity', agg: 'sum', horizon: 30, history: 200 } },
|
|
54
|
+
{ id: 'stock-ai', category: 'voorraad', label: 'AI-analyse voorraad', description: 'Risico\'s en kansen in je voorraad', icon: 'Sparkles', type: 'ai_analysis', title: 'AI-analyse voorraad',
|
|
55
|
+
config: { table: 'products', columns: [], limit: 100, question: 'Welke producten lopen risico om uit te raken, en welke staan stil?' } },
|
|
56
|
+
// ============================================================
|
|
57
|
+
// KLANTEN
|
|
58
|
+
// ============================================================
|
|
59
|
+
{ id: 'customers-total', category: 'klanten', label: 'Aantal klanten', description: 'Totaal aantal klanten', icon: 'Users', type: 'kpi', title: 'Aantal klanten',
|
|
60
|
+
config: { table: 'customers', agg: 'count', format: 'number' } },
|
|
61
|
+
{ id: 'customers-active', category: 'klanten', label: 'Actieve klanten', description: 'Klanten die actief zijn in je systeem', icon: 'UserCheck', type: 'kpi', title: 'Actieve klanten',
|
|
62
|
+
config: { table: 'customers', agg: 'count', format: 'number', filterColumn: 'is_active', filterValue: 'true' } },
|
|
63
|
+
{ id: 'customers-inactive', category: 'klanten', label: 'Inactieve klanten', description: 'Klanten die op inactief staan', icon: 'UserMinus', type: 'kpi', title: 'Inactieve klanten',
|
|
64
|
+
config: { table: 'customers', agg: 'count', format: 'number', filterColumn: 'is_active', filterValue: 'false' } },
|
|
65
|
+
{ id: 'customers-new', category: 'klanten', label: 'Nieuwe klanten', description: 'Nieuwe klanten in de gekozen periode', icon: 'UserPlus', type: 'kpi', title: 'Nieuwe klanten',
|
|
66
|
+
config: { table: 'customers', agg: 'count', format: 'number' } },
|
|
67
|
+
{ id: 'customers-growth', category: 'klanten', label: 'Klantgroei', description: 'Nieuwe klanten per dag', icon: 'TrendingUp', type: 'chart', title: 'Klantgroei',
|
|
68
|
+
config: { kind: 'area', table: 'customers', xColumn: 'created_at', yColumn: 'id', agg: 'count', limit: 2000 } },
|
|
69
|
+
{ id: 'customers-list', category: 'klanten', label: 'Klantenlijst', description: 'Overzicht van klanten met contactgegevens', icon: 'List', type: 'table', title: 'Klantenlijst',
|
|
70
|
+
config: { table: 'customers', columns: ['company_name', 'city', 'email', 'phone'], orderBy: 'created_at', orderDir: 'desc', limit: 25 } },
|
|
71
|
+
{ id: 'customers-by-country', category: 'klanten', label: 'Klanten per land', description: 'Verdeling van klanten over landen', icon: 'Globe', type: 'chart', title: 'Klanten per land',
|
|
72
|
+
config: { kind: 'pie', table: 'customers', xColumn: 'country', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
73
|
+
{ id: 'customers-by-city', category: 'klanten', label: 'Klanten per stad', description: 'Top steden op aantal klanten', icon: 'MapPin', type: 'chart', title: 'Klanten per stad',
|
|
74
|
+
config: { kind: 'bar', table: 'customers', xColumn: 'city', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
75
|
+
{ id: 'customers-by-class', category: 'klanten', label: 'Klanten per klantgroep', description: 'Verdeling van klanten per klantklasse', icon: 'PieChart', type: 'chart', title: 'Klanten per groep',
|
|
76
|
+
config: { kind: 'pie', table: 'customers', xColumn: 'customer_class', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
77
|
+
{ id: 'customers-revenue-top', category: 'klanten', label: 'Top klanten op omzet', description: 'Klanten met de hoogste omzet', icon: 'Trophy', type: 'chart', title: 'Top klanten op omzet',
|
|
78
|
+
config: { kind: 'bar', table: 'orders', xColumn: 'customer_name', yColumn: 'total', agg: 'sum', limit: 500 } },
|
|
79
|
+
{ id: 'customers-ai', category: 'klanten', label: 'AI-analyse klanten', description: 'Welke klanten verdienen extra aandacht?', icon: 'Sparkles', type: 'ai_analysis', title: 'AI-analyse klanten',
|
|
80
|
+
config: { table: 'customers', columns: [], limit: 100, question: 'Welke klanten zijn het meest waardevol en welke worden inactief?' } },
|
|
81
|
+
// ============================================================
|
|
82
|
+
// ORDERS
|
|
83
|
+
// ============================================================
|
|
84
|
+
{ id: 'orders', category: 'orders', label: 'Orders', description: 'Aantal orders in de gekozen periode', icon: 'ShoppingCart', type: 'kpi', title: 'Orders',
|
|
85
|
+
config: { table: 'orders', agg: 'count', format: 'number' } },
|
|
86
|
+
{ id: 'orders-avg-value', category: 'orders', label: 'Gemiddelde orderwaarde', description: 'Gemiddeld bedrag per order (€)', icon: 'Calculator', type: 'kpi', title: 'Gemiddelde orderwaarde',
|
|
87
|
+
config: { table: 'orders', agg: 'avg', column: 'total', format: 'currency' } },
|
|
88
|
+
{ id: 'orders-by-status', category: 'orders', label: 'Orders per status', description: 'Verdeling van orders over statussen', icon: 'PieChart', type: 'chart', title: 'Orders per status',
|
|
89
|
+
config: { kind: 'pie', table: 'orders', xColumn: 'status', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
90
|
+
{ id: 'orders-trend', category: 'orders', label: 'Ordertrend', description: 'Aantal orders per dag', icon: 'TrendingUp', type: 'chart', title: 'Ordertrend',
|
|
91
|
+
config: { kind: 'line', table: 'orders', xColumn: 'created_at', yColumn: 'id', agg: 'count', limit: 2000 } },
|
|
92
|
+
{ id: 'orders-recent', category: 'orders', label: 'Recente orders', description: 'Laatste 25 binnengekomen orders', icon: 'List', type: 'table', title: 'Recente orders',
|
|
93
|
+
config: { table: 'orders', columns: ['order_number', 'customer_name', 'status', 'total', 'created_at'], orderBy: 'created_at', orderDir: 'desc', limit: 25 } },
|
|
94
|
+
{ id: 'orders-by-customer', category: 'orders', label: 'Orders per klant', description: 'Top klanten op aantal orders', icon: 'Users', type: 'chart', title: 'Orders per klant',
|
|
95
|
+
config: { kind: 'bar', table: 'orders', xColumn: 'customer_name', yColumn: 'id', agg: 'count', limit: 500 } },
|
|
96
|
+
{ id: 'orders-delivery-upcoming', category: 'orders', label: 'Komende leverdata', description: 'Orders gesorteerd op leverdatum', icon: 'CalendarDays', type: 'table', title: 'Komende leveringen',
|
|
97
|
+
config: { table: 'orders', columns: ['order_number', 'customer_name', 'delivery_date', 'status', 'total'], orderBy: 'delivery_date', orderDir: 'asc', limit: 25 } },
|
|
98
|
+
{ id: 'orders-forecast', category: 'orders', label: 'Orderforecast', description: 'AI-prognose van het aantal orders', icon: 'LineChart', type: 'forecast', title: 'Orderforecast',
|
|
99
|
+
config: { table: 'orders', xColumn: 'created_at', yColumn: 'id', agg: 'count', horizon: 30, history: 200 } },
|
|
100
|
+
// ============================================================
|
|
101
|
+
// INKOOP
|
|
102
|
+
// ============================================================
|
|
103
|
+
{ id: 'po-total', category: 'inkoop', label: 'Inkooporders', description: 'Aantal inkooporders in de gekozen periode', icon: 'ClipboardList', type: 'kpi', title: 'Inkooporders',
|
|
104
|
+
config: { table: 'purchase_orders', agg: 'count', format: 'number' } },
|
|
105
|
+
{ id: 'po-units', category: 'inkoop', label: 'Ingekochte stuks', description: 'Som van bestelde aantallen', icon: 'Boxes', type: 'kpi', title: 'Ingekochte stuks',
|
|
106
|
+
config: { table: 'purchase_order_items', agg: 'sum', column: 'quantity', format: 'number' } },
|
|
107
|
+
{ id: 'po-by-status', category: 'inkoop', label: 'Inkooporders per status', description: 'Verdeling per status', icon: 'PieChart', type: 'chart', title: 'Inkoop per status',
|
|
108
|
+
config: { kind: 'pie', table: 'purchase_orders', xColumn: 'status', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
109
|
+
{ id: 'po-by-supplier', category: 'inkoop', label: 'Inkoop per leverancier', description: 'Top leveranciers op aantal inkooporders', icon: 'Truck', type: 'chart', title: 'Inkoop per leverancier',
|
|
110
|
+
config: { kind: 'bar', table: 'purchase_orders', xColumn: 'supplier_name', yColumn: 'id', agg: 'count', limit: 500 } },
|
|
111
|
+
{ id: 'po-list', category: 'inkoop', label: 'Inkooporders lijst', description: 'Overzicht van recente inkooporders', icon: 'List', type: 'table', title: 'Inkooporders',
|
|
112
|
+
config: { table: 'purchase_orders', columns: ['order_number', 'supplier_name', 'status', 'expected_delivery_date'], orderBy: 'created_at', orderDir: 'desc', limit: 25 } },
|
|
113
|
+
{ id: 'po-upcoming', category: 'inkoop', label: 'Verwachte leveringen', description: 'Inkooporders gesorteerd op verwachte leverdatum', icon: 'Truck', type: 'table', title: 'Verwachte leveringen',
|
|
114
|
+
config: { table: 'purchase_orders', columns: ['order_number', 'supplier_name', 'expected_delivery_date', 'status'], orderBy: 'expected_delivery_date', orderDir: 'asc', limit: 25 } },
|
|
115
|
+
{ id: 'po-trend', category: 'inkoop', label: 'Inkooptrend', description: 'Aantal inkooporders per dag', icon: 'TrendingUp', type: 'chart', title: 'Inkooptrend',
|
|
116
|
+
config: { kind: 'line', table: 'purchase_orders', xColumn: 'created_at', yColumn: 'id', agg: 'count', limit: 2000 } },
|
|
117
|
+
{ id: 'po-forecast', category: 'inkoop', label: 'Inkoopforecast', description: 'AI-prognose van inkoopvolume', icon: 'LineChart', type: 'forecast', title: 'Inkoopforecast',
|
|
118
|
+
config: { table: 'purchase_orders', xColumn: 'created_at', yColumn: 'id', agg: 'count', horizon: 30, history: 200 } },
|
|
119
|
+
{ id: 'po-ai', category: 'inkoop', label: 'AI-inkoopadvies', description: 'Wat moet je bijbestellen?', icon: 'Sparkles', type: 'ai_analysis', title: 'AI-inkoopadvies',
|
|
120
|
+
config: { table: 'products', columns: [], limit: 100, question: 'Welke producten moet ik op basis van voorraad en min_quantity bijbestellen?' } },
|
|
121
|
+
// ============================================================
|
|
122
|
+
// FINANCIEEL
|
|
123
|
+
// ============================================================
|
|
124
|
+
{ id: 'fin-omzet', category: 'financieel', label: 'Omzet', description: 'Totale omzet (€) in de gekozen periode', icon: 'Euro', type: 'kpi', title: 'Omzet',
|
|
125
|
+
config: { table: 'orders', agg: 'sum', column: 'total', format: 'currency' } },
|
|
126
|
+
{ id: 'fin-stock-purchase-value', category: 'financieel', label: 'Voorraadwaarde (inkoop)', description: 'Wat ligt er aan inkoopwaarde op de plank (€)', icon: 'Wallet', type: 'kpi', title: 'Voorraadwaarde inkoop',
|
|
127
|
+
config: { table: 'products', agg: 'sum', column: 'purchase_price', format: 'currency' } },
|
|
128
|
+
{ id: 'fin-stock-sale-value', category: 'financieel', label: 'Voorraadwaarde (verkoop)', description: 'Wat is je voorraad waard in verkoopprijs (€)', icon: 'Wallet', type: 'kpi', title: 'Voorraadwaarde verkoop',
|
|
129
|
+
config: { table: 'products', agg: 'sum', column: 'sale_price', format: 'currency' } },
|
|
130
|
+
{ id: 'fin-avg-order', category: 'financieel', label: 'Gemiddelde orderwaarde', description: 'Gemiddeld bedrag per order (€)', icon: 'Calculator', type: 'kpi', title: 'Gemiddelde orderwaarde',
|
|
131
|
+
config: { table: 'orders', agg: 'avg', column: 'total', format: 'currency' } },
|
|
132
|
+
{ id: 'fin-max-order', category: 'financieel', label: 'Grootste order', description: 'Hoogste orderwaarde (€)', icon: 'TrendingUp', type: 'kpi', title: 'Grootste order',
|
|
133
|
+
config: { table: 'orders', agg: 'max', column: 'total', format: 'currency' } },
|
|
134
|
+
{ id: 'fin-omzet-trend', category: 'financieel', label: 'Omzettrend', description: 'Omzetontwikkeling over tijd (€)', icon: 'LineChart', type: 'chart', title: 'Omzetontwikkeling',
|
|
135
|
+
config: { kind: 'area', table: 'orders', xColumn: 'created_at', yColumn: 'total', agg: 'sum', limit: 2000 } },
|
|
136
|
+
{ id: 'fin-omzet-per-status', category: 'financieel', label: 'Omzet per orderstatus', description: 'Totaalbedrag verdeeld per status (€)', icon: 'PieChart', type: 'chart', title: 'Omzet per status',
|
|
137
|
+
config: { kind: 'pie', table: 'orders', xColumn: 'status', yColumn: 'total', agg: 'sum', limit: 100 } },
|
|
138
|
+
{ id: 'fin-forecast', category: 'financieel', label: 'Winstforecast', description: 'AI-prognose van omzet (basis voor winst)', icon: 'TrendingUp', type: 'forecast', title: 'Omzet-/winstforecast',
|
|
139
|
+
config: { table: 'orders', xColumn: 'created_at', yColumn: 'total', agg: 'sum', horizon: 30, history: 365 } },
|
|
140
|
+
{ id: 'fin-ai', category: 'financieel', label: 'Financiële AI-analyse', description: 'Kansen en risico\'s in je cijfers', icon: 'Sparkles', type: 'ai_analysis', title: 'Financiële analyse',
|
|
141
|
+
config: { table: 'orders', columns: [], limit: 200, question: 'Wat zijn de belangrijkste financiële trends, risico\'s en kansen in deze ordergegevens?' } },
|
|
142
|
+
// ============================================================
|
|
143
|
+
// PRODUCTEN
|
|
144
|
+
// ============================================================
|
|
145
|
+
{ id: 'products-total', category: 'producten', label: 'Aantal producten', description: 'Totaal aantal artikelen in je assortiment', icon: 'Package', type: 'kpi', title: 'Aantal producten',
|
|
146
|
+
config: { table: 'products', agg: 'count', format: 'number' } },
|
|
147
|
+
{ id: 'products-bestselling', category: 'producten', label: 'Best verkopende producten', description: 'Top producten op verkochte stuks', icon: 'Trophy', type: 'chart', title: 'Best verkopend',
|
|
148
|
+
config: { kind: 'bar', table: 'order_items', xColumn: 'product_name', yColumn: 'quantity', agg: 'sum', limit: 1000 } },
|
|
149
|
+
{ id: 'products-revenue', category: 'producten', label: 'Producten met hoogste omzet', description: 'Producten gesorteerd op omzet (€)', icon: 'Euro', type: 'chart', title: 'Omzet per product',
|
|
150
|
+
config: { kind: 'bar', table: 'order_items', xColumn: 'product_name', yColumn: 'unit_price', agg: 'sum', limit: 1000 } },
|
|
151
|
+
{ id: 'products-new', category: 'producten', label: 'Nieuwe producten', description: 'Producten toegevoegd in de gekozen periode', icon: 'Sparkles', type: 'table', title: 'Nieuwe producten',
|
|
152
|
+
config: { table: 'products', columns: ['product', 'quantity', 'sale_price', 'created_at'], orderBy: 'created_at', orderDir: 'desc', limit: 25 } },
|
|
153
|
+
{ id: 'products-high-price', category: 'producten', label: 'Duurste producten', description: 'Producten met de hoogste verkoopprijs', icon: 'TrendingUp', type: 'table', title: 'Duurste producten',
|
|
154
|
+
config: { table: 'products', columns: ['product', 'sale_price', 'quantity'], orderBy: 'sale_price', orderDir: 'desc', limit: 25 } },
|
|
155
|
+
{ id: 'products-low-price', category: 'producten', label: 'Goedkoopste producten', description: 'Producten met de laagste verkoopprijs', icon: 'TrendingDown', type: 'table', title: 'Goedkoopste producten',
|
|
156
|
+
config: { table: 'products', columns: ['product', 'sale_price', 'quantity'], orderBy: 'sale_price', orderDir: 'asc', limit: 25 } },
|
|
157
|
+
{ id: 'products-by-type', category: 'producten', label: 'Producten per type', description: 'Verdeling per producttype', icon: 'PieChart', type: 'chart', title: 'Producten per type',
|
|
158
|
+
config: { kind: 'pie', table: 'products', xColumn: 'product_type', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
159
|
+
{ id: 'products-low-stock', category: 'producten', label: 'Producten met voorraadrisico', description: 'Producten waar nog weinig van is', icon: 'AlertTriangle', type: 'table', title: 'Voorraadrisico',
|
|
160
|
+
config: { table: 'products', columns: ['product', 'quantity', 'min_quantity'], orderBy: 'quantity', orderDir: 'asc', limit: 25 } },
|
|
161
|
+
{ id: 'products-forecast', category: 'producten', label: 'Productforecast', description: 'AI-prognose van verkochte stuks', icon: 'LineChart', type: 'forecast', title: 'Productforecast',
|
|
162
|
+
config: { table: 'order_items', xColumn: 'created_at', yColumn: 'quantity', agg: 'sum', horizon: 30, history: 200 } },
|
|
163
|
+
{ id: 'products-trend', category: 'producten', label: 'Producttrend', description: 'Verkochte stuks per dag', icon: 'TrendingUp', type: 'chart', title: 'Producttrend',
|
|
164
|
+
config: { kind: 'line', table: 'order_items', xColumn: 'created_at', yColumn: 'quantity', agg: 'sum', limit: 2000 } },
|
|
165
|
+
{ id: 'products-ai', category: 'producten', label: 'AI-productanalyse', description: 'Welke producten groeien, welke staan stil?', icon: 'Sparkles', type: 'ai_analysis', title: 'AI-productanalyse',
|
|
166
|
+
config: { table: 'products', columns: [], limit: 100, question: 'Welke producten presteren goed en welke verdienen aandacht?' } },
|
|
167
|
+
// ============================================================
|
|
168
|
+
// LEVERANCIERS
|
|
169
|
+
// ============================================================
|
|
170
|
+
{ id: 'sup-total', category: 'leveranciers', label: 'Aantal leveranciers', description: 'Totaal aantal leveranciers', icon: 'Truck', type: 'kpi', title: 'Aantal leveranciers',
|
|
171
|
+
config: { table: 'suppliers', agg: 'count', format: 'number' } },
|
|
172
|
+
{ id: 'sup-products', category: 'leveranciers', label: 'Leveranciersproducten', description: 'Producten beschikbaar via leveranciers', icon: 'Package', type: 'kpi', title: 'Leveranciersproducten',
|
|
173
|
+
config: { table: 'supplier_products', agg: 'count', format: 'number' } },
|
|
174
|
+
{ id: 'sup-list', category: 'leveranciers', label: 'Leverancierslijst', description: 'Overzicht van leveranciers met contact', icon: 'List', type: 'table', title: 'Leveranciers',
|
|
175
|
+
config: { table: 'suppliers', columns: ['name', 'contact_person', 'email', 'phone'], orderBy: 'created_at', orderDir: 'desc', limit: 25 } },
|
|
176
|
+
{ id: 'sup-by-orders', category: 'leveranciers', label: 'Inkoop per leverancier', description: 'Aantal inkooporders per leverancier', icon: 'Trophy', type: 'chart', title: 'Inkoop per leverancier',
|
|
177
|
+
config: { kind: 'bar', table: 'purchase_orders', xColumn: 'supplier_name', yColumn: 'id', agg: 'count', limit: 500 } },
|
|
178
|
+
{ id: 'sup-stock-value', category: 'leveranciers', label: 'Waarde leveranciersproducten', description: 'Totale prijswaarde (€)', icon: 'Wallet', type: 'kpi', title: 'Waarde supplier-aanbod',
|
|
179
|
+
config: { table: 'supplier_products', agg: 'sum', column: 'price', format: 'currency' } },
|
|
180
|
+
{ id: 'sup-product-units', category: 'leveranciers', label: 'Beschikbare stuks bij leveranciers', description: 'Som van beschikbare voorraad', icon: 'Boxes', type: 'kpi', title: 'Stuks bij leveranciers',
|
|
181
|
+
config: { table: 'supplier_products', agg: 'sum', column: 'quantity', format: 'number' } },
|
|
182
|
+
{ id: 'sup-new', category: 'leveranciers', label: 'Nieuwe leveranciers', description: 'Leveranciers toegevoegd in de gekozen periode', icon: 'UserPlus', type: 'table', title: 'Nieuwe leveranciers',
|
|
183
|
+
config: { table: 'suppliers', columns: ['name', 'contact_person', 'email', 'created_at'], orderBy: 'created_at', orderDir: 'desc', limit: 25 } },
|
|
184
|
+
{ id: 'sup-by-type', category: 'leveranciers', label: 'Leveranciers per producttype', description: 'Verdeling per standaard producttype', icon: 'PieChart', type: 'chart', title: 'Leveranciers per type',
|
|
185
|
+
config: { kind: 'pie', table: 'suppliers', xColumn: 'default_product_type', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
186
|
+
{ id: 'sup-deliveries-upcoming', category: 'leveranciers', label: 'Verwachte leveringen', description: 'Komende leveringen per leverancier', icon: 'Truck', type: 'table', title: 'Verwachte leveringen',
|
|
187
|
+
config: { table: 'purchase_orders', columns: ['supplier_name', 'order_number', 'expected_delivery_date', 'status'], orderBy: 'expected_delivery_date', orderDir: 'asc', limit: 25 } },
|
|
188
|
+
{ id: 'sup-trend', category: 'leveranciers', label: 'Leverancierstrend', description: 'Aantal inkooporders per dag', icon: 'TrendingUp', type: 'chart', title: 'Leverancierstrend',
|
|
189
|
+
config: { kind: 'line', table: 'purchase_orders', xColumn: 'created_at', yColumn: 'id', agg: 'count', limit: 2000 } },
|
|
190
|
+
{ id: 'sup-ai', category: 'leveranciers', label: 'AI-leveranciersanalyse', description: 'Welke leveranciers presteren onder gemiddeld?', icon: 'Sparkles', type: 'ai_analysis', title: 'AI-leveranciersanalyse',
|
|
191
|
+
config: { table: 'purchase_orders', columns: [], limit: 200, question: 'Welke leveranciers leveren het meest betrouwbaar en welke vallen op door vertraging of weinig orders?' } },
|
|
192
|
+
// ============================================================
|
|
193
|
+
// E-MAIL & MAILBOX
|
|
194
|
+
// ============================================================
|
|
195
|
+
{ id: 'mail-total', category: 'mailbox', label: 'E-mails', description: 'Aantal ontvangen e-mails in de gekozen periode', icon: 'Mail', type: 'kpi', title: 'E-mails',
|
|
196
|
+
config: { table: 'mailbox_messages', agg: 'count', format: 'number' } },
|
|
197
|
+
{ id: 'mail-by-status', category: 'mailbox', label: 'E-mails per status', description: 'Verdeling per verwerkingsstatus', icon: 'PieChart', type: 'chart', title: 'E-mails per status',
|
|
198
|
+
config: { kind: 'pie', table: 'mailbox_messages', xColumn: 'status', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
199
|
+
{ id: 'mail-trend', category: 'mailbox', label: 'Mailverkeer trend', description: 'Aantal e-mails per dag', icon: 'TrendingUp', type: 'chart', title: 'Mailverkeer',
|
|
200
|
+
config: { kind: 'line', table: 'mailbox_messages', xColumn: 'received_at', yColumn: 'id', agg: 'count', limit: 2000 } },
|
|
201
|
+
{ id: 'mail-by-sender', category: 'mailbox', label: 'Meest actieve afzenders', description: 'Top afzenders op aantal e-mails', icon: 'Users', type: 'chart', title: 'Top afzenders',
|
|
202
|
+
config: { kind: 'bar', table: 'mailbox_messages', xColumn: 'from_email', yColumn: 'id', agg: 'count', limit: 500 } },
|
|
203
|
+
{ id: 'mail-recent', category: 'mailbox', label: 'Recente e-mails', description: 'Laatste binnenkomende e-mails', icon: 'List', type: 'table', title: 'Recente e-mails',
|
|
204
|
+
config: { table: 'mailbox_messages', columns: ['from_name', 'from_email', 'subject', 'status', 'received_at'], orderBy: 'received_at', orderDir: 'desc', limit: 25 } },
|
|
205
|
+
{ id: 'mail-proposals', category: 'mailbox', label: 'AI-orderverwerking', description: 'Aantal AI-voorstellen uit e-mails', icon: 'Sparkles', type: 'kpi', title: 'AI-orderverwerking',
|
|
206
|
+
config: { table: 'mailbox_order_proposals', agg: 'count', format: 'number' } },
|
|
207
|
+
{ id: 'mail-proposal-status', category: 'mailbox', label: 'AI-voorstellen per status', description: 'Verdeling van AI-voorstellen', icon: 'PieChart', type: 'chart', title: 'AI-voorstellen',
|
|
208
|
+
config: { kind: 'pie', table: 'mailbox_order_proposals', xColumn: 'status', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
209
|
+
{ id: 'mail-forecast', category: 'mailbox', label: 'Mailforecast', description: 'AI-prognose van mailvolume', icon: 'LineChart', type: 'forecast', title: 'Mailforecast',
|
|
210
|
+
config: { table: 'mailbox_messages', xColumn: 'received_at', yColumn: 'id', agg: 'count', horizon: 14, history: 180 } },
|
|
211
|
+
// ============================================================
|
|
212
|
+
// LOGISTIEK
|
|
213
|
+
// ============================================================
|
|
214
|
+
{ id: 'log-deliveries', category: 'logistiek', label: 'Leveringen', description: 'Orders met leverdatum in de gekozen periode', icon: 'Truck', type: 'kpi', title: 'Leveringen',
|
|
215
|
+
config: { table: 'orders', agg: 'count', format: 'number' } },
|
|
216
|
+
{ id: 'log-upcoming', category: 'logistiek', label: 'Te leveren orders', description: 'Komende leveringen gesorteerd op datum', icon: 'List', type: 'table', title: 'Te leveren orders',
|
|
217
|
+
config: { table: 'orders', columns: ['order_number', 'customer_name', 'delivery_date', 'status'], orderBy: 'delivery_date', orderDir: 'asc', limit: 25 } },
|
|
218
|
+
{ id: 'log-trend', category: 'logistiek', label: 'Leveringstrend', description: 'Aantal leveringen per dag', icon: 'TrendingUp', type: 'chart', title: 'Leveringstrend',
|
|
219
|
+
config: { kind: 'line', table: 'orders', xColumn: 'delivery_date', yColumn: 'id', agg: 'count', limit: 2000 } },
|
|
220
|
+
{ id: 'log-by-status', category: 'logistiek', label: 'Leveringen per status', description: 'Verdeling van orders per orderstatus', icon: 'PieChart', type: 'chart', title: 'Status van leveringen',
|
|
221
|
+
config: { kind: 'pie', table: 'orders', xColumn: 'status', yColumn: 'id', agg: 'count', limit: 100 } },
|
|
222
|
+
{ id: 'log-po-upcoming', category: 'logistiek', label: 'Binnenkomende leveringen', description: 'Inkooporders op verwachte leverdatum', icon: 'Truck', type: 'table', title: 'Binnenkomend',
|
|
223
|
+
config: { table: 'purchase_orders', columns: ['order_number', 'supplier_name', 'expected_delivery_date', 'status'], orderBy: 'expected_delivery_date', orderDir: 'asc', limit: 25 } },
|
|
224
|
+
{ id: 'log-volume', category: 'logistiek', label: 'Te leveren stuks', description: 'Som van verkochte stuks die nog moeten worden geleverd', icon: 'Boxes', type: 'kpi', title: 'Te leveren stuks',
|
|
225
|
+
config: { table: 'order_items', agg: 'sum', column: 'quantity', format: 'number' } },
|
|
226
|
+
{ id: 'log-locations', category: 'logistiek', label: 'Voorraad per locatie', description: 'Verdeling van voorraad over locaties', icon: 'MapPin', type: 'chart', title: 'Per locatie',
|
|
227
|
+
config: { kind: 'bar', table: 'products', xColumn: 'location', yColumn: 'quantity', agg: 'sum', limit: 500 } },
|
|
228
|
+
{ id: 'log-forecast', category: 'logistiek', label: 'Logistieke forecast', description: 'AI-prognose van leveringsvolume', icon: 'LineChart', type: 'forecast', title: 'Logistieke forecast',
|
|
229
|
+
config: { table: 'orders', xColumn: 'delivery_date', yColumn: 'id', agg: 'count', horizon: 30, history: 200 } },
|
|
230
|
+
{ id: 'log-ai', category: 'logistiek', label: 'AI-capaciteitsanalyse', description: 'Wat staat er logistiek op de planning?', icon: 'Sparkles', type: 'ai_analysis', title: 'Capaciteitsanalyse',
|
|
231
|
+
config: { table: 'orders', columns: [], limit: 200, question: 'Wat zijn de logistieke piekdagen en risico\'s in de komende periode?' } },
|
|
232
|
+
// ============================================================
|
|
233
|
+
// AI SLIMME TEGELS
|
|
234
|
+
// ============================================================
|
|
235
|
+
{ id: 'ai-restock', category: 'ai', label: 'Wat moet ik bijbestellen?', description: 'AI-inkoopadvies op basis van voorraad', icon: 'Sparkles', type: 'ai_analysis', title: 'Bijbestellen advies',
|
|
236
|
+
config: { table: 'products', columns: [], limit: 100, question: 'Welke producten moet ik nu bijbestellen op basis van quantity en min_quantity?' } },
|
|
237
|
+
{ id: 'ai-quiet-customers', category: 'ai', label: 'Welke klanten bestellen minder?', description: 'AI-analyse van bestelpatroon', icon: 'Sparkles', type: 'ai_analysis', title: 'Stille klanten',
|
|
238
|
+
config: { table: 'orders', columns: [], limit: 300, question: 'Welke klanten bestellen duidelijk minder dan normaal?' } },
|
|
239
|
+
{ id: 'ai-stockout-risk', category: 'ai', label: 'Risico op uitverkoop', description: 'AI: welke producten dreigen op te raken?', icon: 'AlertTriangle', type: 'ai_analysis', title: 'Uitverkooprisico',
|
|
240
|
+
config: { table: 'products', columns: [], limit: 100, question: 'Welke producten lopen het risico om uit te raken?' } },
|
|
241
|
+
{ id: 'ai-fast-growers', category: 'ai', label: 'Welke producten groeien?', description: 'AI: snelst groeiende producten', icon: 'TrendingUp', type: 'ai_analysis', title: 'Snelle groeiers',
|
|
242
|
+
config: { table: 'order_items', columns: [], limit: 300, question: 'Welke producten groeien het hardst in verkoop?' } },
|
|
243
|
+
{ id: 'ai-valuable-customers', category: 'ai', label: 'Meest waardevolle klanten', description: 'AI-analyse van klantwaarde', icon: 'Trophy', type: 'ai_analysis', title: 'Top klanten',
|
|
244
|
+
config: { table: 'orders', columns: [], limit: 300, question: 'Welke klanten zijn de meest waardevolle op basis van omzet en frequentie?' } },
|
|
245
|
+
{ id: 'ai-weak-suppliers', category: 'ai', label: 'Zwakke leveranciers', description: 'AI: welke leveranciers vallen tegen?', icon: 'Truck', type: 'ai_analysis', title: 'Zwakke leveranciers',
|
|
246
|
+
config: { table: 'purchase_orders', columns: [], limit: 200, question: 'Welke leveranciers presteren onder gemiddeld qua leverdata?' } },
|
|
247
|
+
{ id: 'ai-missed-revenue', category: 'ai', label: 'Welke omzetkansen mis je?', description: 'AI-analyse van potentiële omzet', icon: 'Sparkles', type: 'ai_analysis', title: 'Gemiste kansen',
|
|
248
|
+
config: { table: 'orders', columns: [], limit: 300, question: 'Welke omzetkansen lijken te worden gemist op basis van klant- en productpatronen?' } },
|
|
249
|
+
{ id: 'ai-stockheavy', category: 'ai', label: 'Producten die ruimte innemen', description: 'AI: voorraad die niet beweegt', icon: 'Boxes', type: 'ai_analysis', title: 'Onbeweeglijke voorraad',
|
|
250
|
+
config: { table: 'products', columns: [], limit: 100, question: 'Welke producten nemen veel voorraadruimte in zonder snel te verkopen?' } },
|
|
251
|
+
{ id: 'ai-trends', category: 'ai', label: 'Trends voor komende maand', description: 'AI: welke trends voorziet AI?', icon: 'LineChart', type: 'ai_analysis', title: 'Komende trends',
|
|
252
|
+
config: { table: 'orders', columns: [], limit: 300, question: 'Welke trends zie je voor de komende maand?' } },
|
|
253
|
+
{ id: 'ai-today-focus', category: 'ai', label: 'Aandachtspunten vandaag', description: 'AI: wat is vandaag belangrijk?', icon: 'Sparkles', type: 'ai_analysis', title: 'Aandachtspunten vandaag',
|
|
254
|
+
config: { table: 'orders', columns: [], limit: 100, question: 'Wat zijn vandaag de belangrijkste aandachtspunten voor mijn bedrijf?' } },
|
|
255
|
+
// ============================================================
|
|
256
|
+
// MANAGEMENT
|
|
257
|
+
// ============================================================
|
|
258
|
+
{ id: 'mgmt-kpi-omzet', category: 'management', label: 'KPI Omzet', description: 'Belangrijkste cijfer: omzet (€)', icon: 'Euro', type: 'kpi', title: 'Omzet',
|
|
259
|
+
config: { table: 'orders', agg: 'sum', column: 'total', format: 'currency' } },
|
|
260
|
+
{ id: 'mgmt-kpi-orders', category: 'management', label: 'KPI Orders', description: 'Aantal orders in de gekozen periode', icon: 'ShoppingCart', type: 'kpi', title: 'Orders',
|
|
261
|
+
config: { table: 'orders', agg: 'count', format: 'number' } },
|
|
262
|
+
{ id: 'mgmt-kpi-customers', category: 'management', label: 'KPI Klanten', description: 'Totaal aantal klanten', icon: 'Users', type: 'kpi', title: 'Klanten',
|
|
263
|
+
config: { table: 'customers', agg: 'count', format: 'number' } },
|
|
264
|
+
{ id: 'mgmt-kpi-stock-value', category: 'management', label: 'KPI Voorraadwaarde', description: 'Voorraadwaarde verkoop (€)', icon: 'Wallet', type: 'kpi', title: 'Voorraadwaarde',
|
|
265
|
+
config: { table: 'products', agg: 'sum', column: 'sale_price', format: 'currency' } },
|
|
266
|
+
{ id: 'mgmt-omzet-trend', category: 'management', label: 'Omzettrend', description: 'Omzet per dag, lange termijn', icon: 'TrendingUp', type: 'chart', title: 'Omzettrend',
|
|
267
|
+
config: { kind: 'area', table: 'orders', xColumn: 'created_at', yColumn: 'total', agg: 'sum', limit: 2000 } },
|
|
268
|
+
{ id: 'mgmt-order-trend', category: 'management', label: 'Ordertrend', description: 'Orderaantallen per dag', icon: 'LineChart', type: 'chart', title: 'Ordertrend',
|
|
269
|
+
config: { kind: 'line', table: 'orders', xColumn: 'created_at', yColumn: 'id', agg: 'count', limit: 2000 } },
|
|
270
|
+
{ id: 'mgmt-customer-growth', category: 'management', label: 'Klantgroei', description: 'Nieuwe klanten per dag', icon: 'UserPlus', type: 'chart', title: 'Klantgroei',
|
|
271
|
+
config: { kind: 'area', table: 'customers', xColumn: 'created_at', yColumn: 'id', agg: 'count', limit: 2000 } },
|
|
272
|
+
{ id: 'mgmt-alerts', category: 'management', label: 'Risico-overzicht', description: 'Onbevestigde alarmen / signalen', icon: 'AlertTriangle', type: 'table', title: 'Open alarmen',
|
|
273
|
+
config: { table: 'dashboard_alert_events', columns: ['severity', 'message', 'value', 'threshold', 'created_at'], orderBy: 'created_at', orderDir: 'desc', limit: 25, filterColumn: 'acknowledged', filterValue: 'false' } },
|
|
274
|
+
{ id: 'mgmt-forecast', category: 'management', label: 'Forecast-overzicht', description: 'Omzetforecast volgende periode', icon: 'LineChart', type: 'forecast', title: 'Management forecast',
|
|
275
|
+
config: { table: 'orders', xColumn: 'created_at', yColumn: 'total', agg: 'sum', horizon: 30, history: 365 } },
|
|
276
|
+
{ id: 'mgmt-summary-ai', category: 'management', label: 'Managementsamenvatting (AI)', description: 'AI-samenvatting van je belangrijkste cijfers', icon: 'Sparkles', type: 'ai_analysis', title: 'Managementsamenvatting',
|
|
277
|
+
config: { table: 'orders', columns: [], limit: 300, question: 'Geef een korte managementsamenvatting met de belangrijkste cijfers, trends en aanbevelingen.' } },
|
|
278
|
+
{ id: 'mgmt-recommendations-ai', category: 'management', label: 'Belangrijkste aanbevelingen', description: 'AI: wat moet je nu doen?', icon: 'Sparkles', type: 'ai_analysis', title: 'Aanbevelingen',
|
|
279
|
+
config: { table: 'orders', columns: [], limit: 300, question: 'Wat zijn op basis van deze data de drie belangrijkste aanbevelingen?' } },
|
|
280
|
+
];
|
|
281
|
+
export const QUICK_CATEGORIES = [
|
|
282
|
+
{ id: 'verkoop', label: 'Verkoop', icon: 'TrendingUp' },
|
|
283
|
+
{ id: 'voorraad', label: 'Voorraad', icon: 'Package' },
|
|
284
|
+
{ id: 'klanten', label: 'Klanten', icon: 'Users' },
|
|
285
|
+
{ id: 'orders', label: 'Orders', icon: 'ShoppingCart' },
|
|
286
|
+
{ id: 'inkoop', label: 'Inkoop', icon: 'Truck' },
|
|
287
|
+
{ id: 'financieel', label: 'Financieel', icon: 'Euro' },
|
|
288
|
+
{ id: 'producten', label: 'Producten', icon: 'Boxes' },
|
|
289
|
+
{ id: 'leveranciers', label: 'Leveranciers', icon: 'Truck' },
|
|
290
|
+
{ id: 'mailbox', label: 'E-mail', icon: 'Mail' },
|
|
291
|
+
{ id: 'logistiek', label: 'Logistiek', icon: 'MapPin' },
|
|
292
|
+
{ id: 'ai', label: 'AI Inzichten', icon: 'Sparkles' },
|
|
293
|
+
{ id: 'management', label: 'Management', icon: 'LineChart' },
|
|
294
|
+
];
|
|
295
|
+
export function getQuickBlock(id) {
|
|
296
|
+
return QUICK_BLOCKS.find((b) => b.id === id);
|
|
297
|
+
}
|