@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.
Files changed (150) hide show
  1. package/dist-lib/_core-safelist.d.ts +2 -0
  2. package/dist-lib/_core-safelist.d.ts.map +1 -0
  3. package/dist-lib/_core-safelist.js +15 -0
  4. package/dist-lib/components/DashboardErpLogo.d.ts +6 -0
  5. package/dist-lib/components/DashboardErpLogo.d.ts.map +1 -0
  6. package/dist-lib/components/DashboardErpLogo.js +4 -0
  7. package/dist-lib/components/dashboard/AiSettingsCard.d.ts +2 -0
  8. package/dist-lib/components/dashboard/AiSettingsCard.d.ts.map +1 -0
  9. package/dist-lib/components/dashboard/AiSettingsCard.js +37 -0
  10. package/dist-lib/components/dashboard/AlertHistoryPanel.d.ts +4 -0
  11. package/dist-lib/components/dashboard/AlertHistoryPanel.d.ts.map +1 -0
  12. package/dist-lib/components/dashboard/AlertHistoryPanel.js +18 -0
  13. package/dist-lib/components/dashboard/BlockEditorDialog.d.ts +15 -0
  14. package/dist-lib/components/dashboard/BlockEditorDialog.d.ts.map +1 -0
  15. package/dist-lib/components/dashboard/BlockEditorDialog.js +89 -0
  16. package/dist-lib/components/dashboard/BlockRenderer.d.ts +5 -0
  17. package/dist-lib/components/dashboard/BlockRenderer.d.ts.map +1 -0
  18. package/dist-lib/components/dashboard/BlockRenderer.js +25 -0
  19. package/dist-lib/components/dashboard/DashboardBuilderPage.d.ts +4 -0
  20. package/dist-lib/components/dashboard/DashboardBuilderPage.d.ts.map +1 -0
  21. package/dist-lib/components/dashboard/DashboardBuilderPage.js +49 -0
  22. package/dist-lib/components/dashboard/DashboardErpLayoutPage.d.ts +2 -0
  23. package/dist-lib/components/dashboard/DashboardErpLayoutPage.d.ts.map +1 -0
  24. package/dist-lib/components/dashboard/DashboardErpLayoutPage.js +30 -0
  25. package/dist-lib/components/dashboard/DashboardSummary.d.ts +9 -0
  26. package/dist-lib/components/dashboard/DashboardSummary.d.ts.map +1 -0
  27. package/dist-lib/components/dashboard/DashboardSummary.js +136 -0
  28. package/dist-lib/components/dashboard/DashboardViewPage.d.ts +3 -0
  29. package/dist-lib/components/dashboard/DashboardViewPage.d.ts.map +1 -0
  30. package/dist-lib/components/dashboard/DashboardViewPage.js +37 -0
  31. package/dist-lib/components/dashboard/FilterBar.d.ts +17 -0
  32. package/dist-lib/components/dashboard/FilterBar.d.ts.map +1 -0
  33. package/dist-lib/components/dashboard/FilterBar.js +66 -0
  34. package/dist-lib/components/dashboard/QuickAddDialog.d.ts +15 -0
  35. package/dist-lib/components/dashboard/QuickAddDialog.d.ts.map +1 -0
  36. package/dist-lib/components/dashboard/QuickAddDialog.js +168 -0
  37. package/dist-lib/components/dashboard/SuggestionBanner.d.ts +15 -0
  38. package/dist-lib/components/dashboard/SuggestionBanner.d.ts.map +1 -0
  39. package/dist-lib/components/dashboard/SuggestionBanner.js +13 -0
  40. package/dist-lib/components/dashboard/TileGallery.d.ts +17 -0
  41. package/dist-lib/components/dashboard/TileGallery.d.ts.map +1 -0
  42. package/dist-lib/components/dashboard/TileGallery.js +60 -0
  43. package/dist-lib/components/dashboard/ai/AiChatPanel.d.ts +6 -0
  44. package/dist-lib/components/dashboard/ai/AiChatPanel.d.ts.map +1 -0
  45. package/dist-lib/components/dashboard/ai/AiChatPanel.js +57 -0
  46. package/dist-lib/components/dashboard/ai/BlockGeneratorDialog.d.ts +14 -0
  47. package/dist-lib/components/dashboard/ai/BlockGeneratorDialog.d.ts.map +1 -0
  48. package/dist-lib/components/dashboard/ai/BlockGeneratorDialog.js +61 -0
  49. package/dist-lib/components/dashboard/blocks/AiAnalysisBlock.d.ts +5 -0
  50. package/dist-lib/components/dashboard/blocks/AiAnalysisBlock.d.ts.map +1 -0
  51. package/dist-lib/components/dashboard/blocks/AiAnalysisBlock.js +58 -0
  52. package/dist-lib/components/dashboard/blocks/AlertBlock.d.ts +5 -0
  53. package/dist-lib/components/dashboard/blocks/AlertBlock.d.ts.map +1 -0
  54. package/dist-lib/components/dashboard/blocks/AlertBlock.js +107 -0
  55. package/dist-lib/components/dashboard/blocks/BlockShell.d.ts +10 -0
  56. package/dist-lib/components/dashboard/blocks/BlockShell.d.ts.map +1 -0
  57. package/dist-lib/components/dashboard/blocks/BlockShell.js +39 -0
  58. package/dist-lib/components/dashboard/blocks/ChartBlock.d.ts +5 -0
  59. package/dist-lib/components/dashboard/blocks/ChartBlock.d.ts.map +1 -0
  60. package/dist-lib/components/dashboard/blocks/ChartBlock.js +31 -0
  61. package/dist-lib/components/dashboard/blocks/ForecastBlock.d.ts +5 -0
  62. package/dist-lib/components/dashboard/blocks/ForecastBlock.d.ts.map +1 -0
  63. package/dist-lib/components/dashboard/blocks/ForecastBlock.js +86 -0
  64. package/dist-lib/components/dashboard/blocks/KpiBlock.d.ts +5 -0
  65. package/dist-lib/components/dashboard/blocks/KpiBlock.d.ts.map +1 -0
  66. package/dist-lib/components/dashboard/blocks/KpiBlock.js +17 -0
  67. package/dist-lib/components/dashboard/blocks/TableBlock.d.ts +5 -0
  68. package/dist-lib/components/dashboard/blocks/TableBlock.d.ts.map +1 -0
  69. package/dist-lib/components/dashboard/blocks/TableBlock.js +12 -0
  70. package/dist-lib/components/dashboard/types.d.ts +129 -0
  71. package/dist-lib/components/dashboard/types.d.ts.map +1 -0
  72. package/dist-lib/components/dashboard/types.js +1 -0
  73. package/dist-lib/hooks/useAlertEvents.d.ts +9 -0
  74. package/dist-lib/hooks/useAlertEvents.d.ts.map +1 -0
  75. package/dist-lib/hooks/useAlertEvents.js +32 -0
  76. package/dist-lib/hooks/useBlockData.d.ts +10 -0
  77. package/dist-lib/hooks/useBlockData.d.ts.map +1 -0
  78. package/dist-lib/hooks/useBlockData.js +130 -0
  79. package/dist-lib/hooks/useDashboardBlocks.d.ts +25 -0
  80. package/dist-lib/hooks/useDashboardBlocks.d.ts.map +1 -0
  81. package/dist-lib/hooks/useDashboardBlocks.js +66 -0
  82. package/dist-lib/hooks/useDashboardPages.d.ts +10 -0
  83. package/dist-lib/hooks/useDashboardPages.d.ts.map +1 -0
  84. package/dist-lib/hooks/useDashboardPages.js +56 -0
  85. package/dist-lib/hooks/useSchema.d.ts +13 -0
  86. package/dist-lib/hooks/useSchema.d.ts.map +1 -0
  87. package/dist-lib/hooks/useSchema.js +23 -0
  88. package/dist-lib/hooks/useUserRoles.d.ts +5 -0
  89. package/dist-lib/hooks/useUserRoles.d.ts.map +1 -0
  90. package/dist-lib/hooks/useUserRoles.js +23 -0
  91. package/dist-lib/index.d.ts +17 -0
  92. package/dist-lib/index.d.ts.map +1 -0
  93. package/dist-lib/index.js +47 -0
  94. package/dist-lib/integrations/supabase/auth-attacher.d.ts +2 -0
  95. package/dist-lib/integrations/supabase/auth-attacher.d.ts.map +1 -0
  96. package/dist-lib/integrations/supabase/auth-attacher.js +12 -0
  97. package/dist-lib/integrations/supabase/auth-middleware.d.ts +2555 -0
  98. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -0
  99. package/dist-lib/integrations/supabase/auth-middleware.js +52 -0
  100. package/dist-lib/integrations/supabase/client.d.ts +2551 -0
  101. package/dist-lib/integrations/supabase/client.d.ts.map +1 -0
  102. package/dist-lib/integrations/supabase/client.js +13 -0
  103. package/dist-lib/integrations/supabase/client.server.d.ts +2551 -0
  104. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -0
  105. package/dist-lib/integrations/supabase/client.server.js +30 -0
  106. package/dist-lib/integrations/supabase/types.d.ts +2685 -0
  107. package/dist-lib/integrations/supabase/types.d.ts.map +1 -0
  108. package/dist-lib/integrations/supabase/types.js +8 -0
  109. package/dist-lib/lib/ai-gateway.server.d.ts +2 -0
  110. package/dist-lib/lib/ai-gateway.server.d.ts.map +1 -0
  111. package/dist-lib/lib/ai-gateway.server.js +11 -0
  112. package/dist-lib/lib/ai-insights.functions.d.ts +10271 -0
  113. package/dist-lib/lib/ai-insights.functions.d.ts.map +1 -0
  114. package/dist-lib/lib/ai-insights.functions.js +118 -0
  115. package/dist-lib/lib/aiSettings.d.ts +22 -0
  116. package/dist-lib/lib/aiSettings.d.ts.map +1 -0
  117. package/dist-lib/lib/aiSettings.js +107 -0
  118. package/dist-lib/lib/dashboard-eval.functions.d.ts +5130 -0
  119. package/dist-lib/lib/dashboard-eval.functions.d.ts.map +1 -0
  120. package/dist-lib/lib/dashboard-eval.functions.js +87 -0
  121. package/dist-lib/lib/dashboard.functions.d.ts +2562 -0
  122. package/dist-lib/lib/dashboard.functions.d.ts.map +1 -0
  123. package/dist-lib/lib/dashboard.functions.js +21 -0
  124. package/dist-lib/lib/dashboardTemplates.d.ts +11 -0
  125. package/dist-lib/lib/dashboardTemplates.d.ts.map +1 -0
  126. package/dist-lib/lib/dashboardTemplates.js +44 -0
  127. package/dist-lib/lib/format.d.ts +20 -0
  128. package/dist-lib/lib/format.d.ts.map +1 -0
  129. package/dist-lib/lib/format.js +121 -0
  130. package/dist-lib/lib/query.functions.d.ts +2583 -0
  131. package/dist-lib/lib/query.functions.d.ts.map +1 -0
  132. package/dist-lib/lib/query.functions.js +85 -0
  133. package/dist-lib/lib/quickBlocks.d.ts +28 -0
  134. package/dist-lib/lib/quickBlocks.d.ts.map +1 -0
  135. package/dist-lib/lib/quickBlocks.js +297 -0
  136. package/dist-lib/lib/roles.functions.d.ts +2556 -0
  137. package/dist-lib/lib/roles.functions.d.ts.map +1 -0
  138. package/dist-lib/lib/roles.functions.js +14 -0
  139. package/dist-lib/lib/suggestions.d.ts +8 -0
  140. package/dist-lib/lib/suggestions.d.ts.map +1 -0
  141. package/dist-lib/lib/suggestions.js +41 -0
  142. package/dist-lib/lib/utils.d.ts +3 -0
  143. package/dist-lib/lib/utils.d.ts.map +1 -0
  144. package/dist-lib/lib/utils.js +5 -0
  145. package/dist-lib/lib/validationSchemas.d.ts +15 -0
  146. package/dist-lib/lib/validationSchemas.d.ts.map +1 -0
  147. package/dist-lib/lib/validationSchemas.js +25 -0
  148. package/dist-lib/styles.css +1 -0
  149. package/package.json +95 -0
  150. package/public/flowselections-assets/template-module/README.md +15 -0
@@ -0,0 +1,2583 @@
1
+ export type RunMode = 'select' | 'count' | 'aggregate';
2
+ export type RunAgg = 'count' | 'sum' | 'avg' | 'min' | 'max';
3
+ export interface RunBlockQueryInput {
4
+ table: string;
5
+ mode: RunMode;
6
+ columns?: string[];
7
+ agg?: RunAgg;
8
+ aggColumn?: string | null;
9
+ filters?: Array<{
10
+ column: string;
11
+ op?: 'eq' | 'gte' | 'lte' | 'gt' | 'lt' | 'neq' | 'like';
12
+ value: string | number | null;
13
+ }>;
14
+ orderBy?: string | null;
15
+ orderDir?: 'asc' | 'desc';
16
+ limit?: number;
17
+ }
18
+ export declare const runBlockQuery: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
19
+ supabase: import("@supabase/supabase-js").SupabaseClient<import("../integrations/supabase/types").Database, "public", "public", {
20
+ Tables: {
21
+ bugs: {
22
+ Row: {
23
+ attachment_url: string | null;
24
+ created_at: string;
25
+ description: string;
26
+ id: string;
27
+ priority: string;
28
+ status: string;
29
+ title: string;
30
+ updated_at: string;
31
+ user_id: string;
32
+ };
33
+ Insert: {
34
+ attachment_url?: string | null;
35
+ created_at?: string;
36
+ description: string;
37
+ id?: string;
38
+ priority?: string;
39
+ status?: string;
40
+ title: string;
41
+ updated_at?: string;
42
+ user_id: string;
43
+ };
44
+ Update: {
45
+ attachment_url?: string | null;
46
+ created_at?: string;
47
+ description?: string;
48
+ id?: string;
49
+ priority?: string;
50
+ status?: string;
51
+ title?: string;
52
+ updated_at?: string;
53
+ user_id?: string;
54
+ };
55
+ Relationships: [];
56
+ };
57
+ collections: {
58
+ Row: {
59
+ created_at: string;
60
+ created_by: string | null;
61
+ id: string;
62
+ name: string;
63
+ updated_at: string;
64
+ };
65
+ Insert: {
66
+ created_at?: string;
67
+ created_by?: string | null;
68
+ id?: string;
69
+ name: string;
70
+ updated_at?: string;
71
+ };
72
+ Update: {
73
+ created_at?: string;
74
+ created_by?: string | null;
75
+ id?: string;
76
+ name?: string;
77
+ updated_at?: string;
78
+ };
79
+ Relationships: [];
80
+ };
81
+ customer_audit_log: {
82
+ Row: {
83
+ action: string;
84
+ changes: import("../integrations/supabase/types").Json;
85
+ created_at: string;
86
+ customer_id: string;
87
+ id: string;
88
+ user_id: string | null;
89
+ };
90
+ Insert: {
91
+ action: string;
92
+ changes?: import("../integrations/supabase/types").Json;
93
+ created_at?: string;
94
+ customer_id: string;
95
+ id?: string;
96
+ user_id?: string | null;
97
+ };
98
+ Update: {
99
+ action?: string;
100
+ changes?: import("../integrations/supabase/types").Json;
101
+ created_at?: string;
102
+ customer_id?: string;
103
+ id?: string;
104
+ user_id?: string | null;
105
+ };
106
+ Relationships: [{
107
+ foreignKeyName: "customer_audit_log_customer_id_fkey";
108
+ columns: ["customer_id"];
109
+ isOneToOne: false;
110
+ referencedRelation: "customers";
111
+ referencedColumns: ["id"];
112
+ }];
113
+ };
114
+ customer_contacts: {
115
+ Row: {
116
+ created_at: string;
117
+ customer_id: string;
118
+ email: string | null;
119
+ floriday_contact_id: string | null;
120
+ full_name: string;
121
+ id: string;
122
+ is_active: boolean;
123
+ job_title: string | null;
124
+ phone: string | null;
125
+ photo_url: string | null;
126
+ raw: import("../integrations/supabase/types").Json | null;
127
+ updated_at: string;
128
+ };
129
+ Insert: {
130
+ created_at?: string;
131
+ customer_id: string;
132
+ email?: string | null;
133
+ floriday_contact_id?: string | null;
134
+ full_name: string;
135
+ id?: string;
136
+ is_active?: boolean;
137
+ job_title?: string | null;
138
+ phone?: string | null;
139
+ photo_url?: string | null;
140
+ raw?: import("../integrations/supabase/types").Json | null;
141
+ updated_at?: string;
142
+ };
143
+ Update: {
144
+ created_at?: string;
145
+ customer_id?: string;
146
+ email?: string | null;
147
+ floriday_contact_id?: string | null;
148
+ full_name?: string;
149
+ id?: string;
150
+ is_active?: boolean;
151
+ job_title?: string | null;
152
+ phone?: string | null;
153
+ photo_url?: string | null;
154
+ raw?: import("../integrations/supabase/types").Json | null;
155
+ updated_at?: string;
156
+ };
157
+ Relationships: [{
158
+ foreignKeyName: "customer_contacts_customer_id_fkey";
159
+ columns: ["customer_id"];
160
+ isOneToOne: false;
161
+ referencedRelation: "customers";
162
+ referencedColumns: ["id"];
163
+ }];
164
+ };
165
+ customer_delivery_locations: {
166
+ Row: {
167
+ address_line: string | null;
168
+ city: string | null;
169
+ country: string | null;
170
+ created_at: string;
171
+ customer_id: string;
172
+ floriday_location_id: string | null;
173
+ gln: string | null;
174
+ id: string;
175
+ is_primary: boolean;
176
+ name: string | null;
177
+ postal_code: string | null;
178
+ raw: import("../integrations/supabase/types").Json | null;
179
+ updated_at: string;
180
+ };
181
+ Insert: {
182
+ address_line?: string | null;
183
+ city?: string | null;
184
+ country?: string | null;
185
+ created_at?: string;
186
+ customer_id: string;
187
+ floriday_location_id?: string | null;
188
+ gln?: string | null;
189
+ id?: string;
190
+ is_primary?: boolean;
191
+ name?: string | null;
192
+ postal_code?: string | null;
193
+ raw?: import("../integrations/supabase/types").Json | null;
194
+ updated_at?: string;
195
+ };
196
+ Update: {
197
+ address_line?: string | null;
198
+ city?: string | null;
199
+ country?: string | null;
200
+ created_at?: string;
201
+ customer_id?: string;
202
+ floriday_location_id?: string | null;
203
+ gln?: string | null;
204
+ id?: string;
205
+ is_primary?: boolean;
206
+ name?: string | null;
207
+ postal_code?: string | null;
208
+ raw?: import("../integrations/supabase/types").Json | null;
209
+ updated_at?: string;
210
+ };
211
+ Relationships: [{
212
+ foreignKeyName: "customer_delivery_locations_customer_id_fkey";
213
+ columns: ["customer_id"];
214
+ isOneToOne: false;
215
+ referencedRelation: "customers";
216
+ referencedColumns: ["id"];
217
+ }];
218
+ };
219
+ customer_field_options: {
220
+ Row: {
221
+ created_at: string;
222
+ field_setting_id: string;
223
+ id: string;
224
+ label: string;
225
+ sort_order: number;
226
+ };
227
+ Insert: {
228
+ created_at?: string;
229
+ field_setting_id: string;
230
+ id?: string;
231
+ label: string;
232
+ sort_order?: number;
233
+ };
234
+ Update: {
235
+ created_at?: string;
236
+ field_setting_id?: string;
237
+ id?: string;
238
+ label?: string;
239
+ sort_order?: number;
240
+ };
241
+ Relationships: [{
242
+ foreignKeyName: "customer_field_options_field_setting_id_fkey";
243
+ columns: ["field_setting_id"];
244
+ isOneToOne: false;
245
+ referencedRelation: "customer_field_settings";
246
+ referencedColumns: ["id"];
247
+ }];
248
+ };
249
+ customer_field_settings: {
250
+ Row: {
251
+ created_at: string;
252
+ field_key: string;
253
+ field_label: string;
254
+ field_type: string;
255
+ id: string;
256
+ is_custom: boolean;
257
+ sort_order: number;
258
+ updated_at: string;
259
+ };
260
+ Insert: {
261
+ created_at?: string;
262
+ field_key: string;
263
+ field_label: string;
264
+ field_type?: string;
265
+ id?: string;
266
+ is_custom?: boolean;
267
+ sort_order?: number;
268
+ updated_at?: string;
269
+ };
270
+ Update: {
271
+ created_at?: string;
272
+ field_key?: string;
273
+ field_label?: string;
274
+ field_type?: string;
275
+ id?: string;
276
+ is_custom?: boolean;
277
+ sort_order?: number;
278
+ updated_at?: string;
279
+ };
280
+ Relationships: [];
281
+ };
282
+ customer_selected_assortment: {
283
+ Row: {
284
+ article_number: string | null;
285
+ created_at: string;
286
+ customer_id: string;
287
+ floriday_item_id: string | null;
288
+ id: string;
289
+ price: number | null;
290
+ product_group: string | null;
291
+ product_name: string;
292
+ raw: import("../integrations/supabase/types").Json | null;
293
+ unit: string | null;
294
+ updated_at: string;
295
+ };
296
+ Insert: {
297
+ article_number?: string | null;
298
+ created_at?: string;
299
+ customer_id: string;
300
+ floriday_item_id?: string | null;
301
+ id?: string;
302
+ price?: number | null;
303
+ product_group?: string | null;
304
+ product_name: string;
305
+ raw?: import("../integrations/supabase/types").Json | null;
306
+ unit?: string | null;
307
+ updated_at?: string;
308
+ };
309
+ Update: {
310
+ article_number?: string | null;
311
+ created_at?: string;
312
+ customer_id?: string;
313
+ floriday_item_id?: string | null;
314
+ id?: string;
315
+ price?: number | null;
316
+ product_group?: string | null;
317
+ product_name?: string;
318
+ raw?: import("../integrations/supabase/types").Json | null;
319
+ unit?: string | null;
320
+ updated_at?: string;
321
+ };
322
+ Relationships: [{
323
+ foreignKeyName: "customer_selected_assortment_customer_id_fkey";
324
+ columns: ["customer_id"];
325
+ isOneToOne: false;
326
+ referencedRelation: "customers";
327
+ referencedColumns: ["id"];
328
+ }];
329
+ };
330
+ customer_trade_settings: {
331
+ Row: {
332
+ category: string;
333
+ created_at: string;
334
+ customer_id: string;
335
+ id: string;
336
+ is_active: boolean;
337
+ raw: import("../integrations/supabase/types").Json | null;
338
+ setting_key: string;
339
+ setting_label: string;
340
+ updated_at: string;
341
+ };
342
+ Insert: {
343
+ category?: string;
344
+ created_at?: string;
345
+ customer_id: string;
346
+ id?: string;
347
+ is_active?: boolean;
348
+ raw?: import("../integrations/supabase/types").Json | null;
349
+ setting_key: string;
350
+ setting_label: string;
351
+ updated_at?: string;
352
+ };
353
+ Update: {
354
+ category?: string;
355
+ created_at?: string;
356
+ customer_id?: string;
357
+ id?: string;
358
+ is_active?: boolean;
359
+ raw?: import("../integrations/supabase/types").Json | null;
360
+ setting_key?: string;
361
+ setting_label?: string;
362
+ updated_at?: string;
363
+ };
364
+ Relationships: [{
365
+ foreignKeyName: "customer_trade_settings_customer_id_fkey";
366
+ columns: ["customer_id"];
367
+ isOneToOne: false;
368
+ referencedRelation: "customers";
369
+ referencedColumns: ["id"];
370
+ }];
371
+ };
372
+ customers: {
373
+ Row: {
374
+ address: string | null;
375
+ bio: string | null;
376
+ city: string | null;
377
+ commercial_name: string | null;
378
+ company_name: string;
379
+ connection_status: string;
380
+ contact_person: string | null;
381
+ country: string | null;
382
+ created_at: string;
383
+ custom_fields: import("../integrations/supabase/types").Json;
384
+ customer_class: string | null;
385
+ email: string | null;
386
+ external_id: string | null;
387
+ floriday_connection_id: string | null;
388
+ floriday_organization_id: string | null;
389
+ floriday_raw: import("../integrations/supabase/types").Json | null;
390
+ gln: string | null;
391
+ house_number: string | null;
392
+ id: string;
393
+ is_active: boolean;
394
+ last_synced_at: string | null;
395
+ logo_url: string | null;
396
+ markets: string[];
397
+ notes: string | null;
398
+ organization_type: string | null;
399
+ payment_methods: string[];
400
+ phone: string | null;
401
+ postal_code: string | null;
402
+ product_groups: string[];
403
+ segments: string[];
404
+ source: string;
405
+ street: string | null;
406
+ sync_error: string | null;
407
+ sync_status: string;
408
+ trade_forms: string[];
409
+ updated_at: string;
410
+ vat_number: string | null;
411
+ website: string | null;
412
+ };
413
+ Insert: {
414
+ address?: string | null;
415
+ bio?: string | null;
416
+ city?: string | null;
417
+ commercial_name?: string | null;
418
+ company_name: string;
419
+ connection_status?: string;
420
+ contact_person?: string | null;
421
+ country?: string | null;
422
+ created_at?: string;
423
+ custom_fields?: import("../integrations/supabase/types").Json;
424
+ customer_class?: string | null;
425
+ email?: string | null;
426
+ external_id?: string | null;
427
+ floriday_connection_id?: string | null;
428
+ floriday_organization_id?: string | null;
429
+ floriday_raw?: import("../integrations/supabase/types").Json | null;
430
+ gln?: string | null;
431
+ house_number?: string | null;
432
+ id?: string;
433
+ is_active?: boolean;
434
+ last_synced_at?: string | null;
435
+ logo_url?: string | null;
436
+ markets?: string[];
437
+ notes?: string | null;
438
+ organization_type?: string | null;
439
+ payment_methods?: string[];
440
+ phone?: string | null;
441
+ postal_code?: string | null;
442
+ product_groups?: string[];
443
+ segments?: string[];
444
+ source?: string;
445
+ street?: string | null;
446
+ sync_error?: string | null;
447
+ sync_status?: string;
448
+ trade_forms?: string[];
449
+ updated_at?: string;
450
+ vat_number?: string | null;
451
+ website?: string | null;
452
+ };
453
+ Update: {
454
+ address?: string | null;
455
+ bio?: string | null;
456
+ city?: string | null;
457
+ commercial_name?: string | null;
458
+ company_name?: string;
459
+ connection_status?: string;
460
+ contact_person?: string | null;
461
+ country?: string | null;
462
+ created_at?: string;
463
+ custom_fields?: import("../integrations/supabase/types").Json;
464
+ customer_class?: string | null;
465
+ email?: string | null;
466
+ external_id?: string | null;
467
+ floriday_connection_id?: string | null;
468
+ floriday_organization_id?: string | null;
469
+ floriday_raw?: import("../integrations/supabase/types").Json | null;
470
+ gln?: string | null;
471
+ house_number?: string | null;
472
+ id?: string;
473
+ is_active?: boolean;
474
+ last_synced_at?: string | null;
475
+ logo_url?: string | null;
476
+ markets?: string[];
477
+ notes?: string | null;
478
+ organization_type?: string | null;
479
+ payment_methods?: string[];
480
+ phone?: string | null;
481
+ postal_code?: string | null;
482
+ product_groups?: string[];
483
+ segments?: string[];
484
+ source?: string;
485
+ street?: string | null;
486
+ sync_error?: string | null;
487
+ sync_status?: string;
488
+ trade_forms?: string[];
489
+ updated_at?: string;
490
+ vat_number?: string | null;
491
+ website?: string | null;
492
+ };
493
+ Relationships: [];
494
+ };
495
+ dashboard_ai_conversations: {
496
+ Row: {
497
+ created_at: string;
498
+ id: string;
499
+ messages: import("../integrations/supabase/types").Json;
500
+ page_id: string | null;
501
+ title: string | null;
502
+ updated_at: string;
503
+ user_id: string;
504
+ };
505
+ Insert: {
506
+ created_at?: string;
507
+ id?: string;
508
+ messages?: import("../integrations/supabase/types").Json;
509
+ page_id?: string | null;
510
+ title?: string | null;
511
+ updated_at?: string;
512
+ user_id: string;
513
+ };
514
+ Update: {
515
+ created_at?: string;
516
+ id?: string;
517
+ messages?: import("../integrations/supabase/types").Json;
518
+ page_id?: string | null;
519
+ title?: string | null;
520
+ updated_at?: string;
521
+ user_id?: string;
522
+ };
523
+ Relationships: [{
524
+ foreignKeyName: "dashboard_ai_conversations_page_id_fkey";
525
+ columns: ["page_id"];
526
+ isOneToOne: false;
527
+ referencedRelation: "dashboard_pages";
528
+ referencedColumns: ["id"];
529
+ }];
530
+ };
531
+ dashboard_alert_events: {
532
+ Row: {
533
+ acknowledged: boolean;
534
+ block_id: string;
535
+ created_at: string;
536
+ id: string;
537
+ message: string | null;
538
+ page_id: string;
539
+ severity: string;
540
+ threshold: number | null;
541
+ user_id: string;
542
+ value: number | null;
543
+ };
544
+ Insert: {
545
+ acknowledged?: boolean;
546
+ block_id: string;
547
+ created_at?: string;
548
+ id?: string;
549
+ message?: string | null;
550
+ page_id: string;
551
+ severity?: string;
552
+ threshold?: number | null;
553
+ user_id: string;
554
+ value?: number | null;
555
+ };
556
+ Update: {
557
+ acknowledged?: boolean;
558
+ block_id?: string;
559
+ created_at?: string;
560
+ id?: string;
561
+ message?: string | null;
562
+ page_id?: string;
563
+ severity?: string;
564
+ threshold?: number | null;
565
+ user_id?: string;
566
+ value?: number | null;
567
+ };
568
+ Relationships: [{
569
+ foreignKeyName: "dashboard_alert_events_block_id_fkey";
570
+ columns: ["block_id"];
571
+ isOneToOne: false;
572
+ referencedRelation: "dashboard_blocks";
573
+ referencedColumns: ["id"];
574
+ }, {
575
+ foreignKeyName: "dashboard_alert_events_page_id_fkey";
576
+ columns: ["page_id"];
577
+ isOneToOne: false;
578
+ referencedRelation: "dashboard_pages";
579
+ referencedColumns: ["id"];
580
+ }];
581
+ };
582
+ dashboard_block_templates: {
583
+ Row: {
584
+ config: import("../integrations/supabase/types").Json;
585
+ created_at: string;
586
+ description: string | null;
587
+ id: string;
588
+ is_public: boolean;
589
+ name: string;
590
+ type: string;
591
+ updated_at: string;
592
+ user_id: string;
593
+ };
594
+ Insert: {
595
+ config?: import("../integrations/supabase/types").Json;
596
+ created_at?: string;
597
+ description?: string | null;
598
+ id?: string;
599
+ is_public?: boolean;
600
+ name: string;
601
+ type: string;
602
+ updated_at?: string;
603
+ user_id: string;
604
+ };
605
+ Update: {
606
+ config?: import("../integrations/supabase/types").Json;
607
+ created_at?: string;
608
+ description?: string | null;
609
+ id?: string;
610
+ is_public?: boolean;
611
+ name?: string;
612
+ type?: string;
613
+ updated_at?: string;
614
+ user_id?: string;
615
+ };
616
+ Relationships: [];
617
+ };
618
+ dashboard_blocks: {
619
+ Row: {
620
+ config: import("../integrations/supabase/types").Json;
621
+ created_at: string;
622
+ filters: import("../integrations/supabase/types").Json;
623
+ id: string;
624
+ layout: import("../integrations/supabase/types").Json;
625
+ page_id: string;
626
+ permissions: import("../integrations/supabase/types").Json;
627
+ sort_order: number;
628
+ title: string;
629
+ type: string;
630
+ updated_at: string;
631
+ };
632
+ Insert: {
633
+ config?: import("../integrations/supabase/types").Json;
634
+ created_at?: string;
635
+ filters?: import("../integrations/supabase/types").Json;
636
+ id?: string;
637
+ layout?: import("../integrations/supabase/types").Json;
638
+ page_id: string;
639
+ permissions?: import("../integrations/supabase/types").Json;
640
+ sort_order?: number;
641
+ title: string;
642
+ type: string;
643
+ updated_at?: string;
644
+ };
645
+ Update: {
646
+ config?: import("../integrations/supabase/types").Json;
647
+ created_at?: string;
648
+ filters?: import("../integrations/supabase/types").Json;
649
+ id?: string;
650
+ layout?: import("../integrations/supabase/types").Json;
651
+ page_id?: string;
652
+ permissions?: import("../integrations/supabase/types").Json;
653
+ sort_order?: number;
654
+ title?: string;
655
+ type?: string;
656
+ updated_at?: string;
657
+ };
658
+ Relationships: [{
659
+ foreignKeyName: "dashboard_blocks_page_id_fkey";
660
+ columns: ["page_id"];
661
+ isOneToOne: false;
662
+ referencedRelation: "dashboard_pages";
663
+ referencedColumns: ["id"];
664
+ }];
665
+ };
666
+ dashboard_daily_reports: {
667
+ Row: {
668
+ created_at: string;
669
+ highlights: import("../integrations/supabase/types").Json | null;
670
+ id: string;
671
+ page_id: string;
672
+ summary: string;
673
+ user_id: string;
674
+ };
675
+ Insert: {
676
+ created_at?: string;
677
+ highlights?: import("../integrations/supabase/types").Json | null;
678
+ id?: string;
679
+ page_id: string;
680
+ summary: string;
681
+ user_id: string;
682
+ };
683
+ Update: {
684
+ created_at?: string;
685
+ highlights?: import("../integrations/supabase/types").Json | null;
686
+ id?: string;
687
+ page_id?: string;
688
+ summary?: string;
689
+ user_id?: string;
690
+ };
691
+ Relationships: [{
692
+ foreignKeyName: "dashboard_daily_reports_page_id_fkey";
693
+ columns: ["page_id"];
694
+ isOneToOne: false;
695
+ referencedRelation: "dashboard_pages";
696
+ referencedColumns: ["id"];
697
+ }];
698
+ };
699
+ dashboard_pages: {
700
+ Row: {
701
+ created_at: string;
702
+ icon: string | null;
703
+ id: string;
704
+ is_default: boolean;
705
+ name: string;
706
+ shared_with: string[];
707
+ sort_order: number;
708
+ updated_at: string;
709
+ user_id: string;
710
+ };
711
+ Insert: {
712
+ created_at?: string;
713
+ icon?: string | null;
714
+ id?: string;
715
+ is_default?: boolean;
716
+ name: string;
717
+ shared_with?: string[];
718
+ sort_order?: number;
719
+ updated_at?: string;
720
+ user_id: string;
721
+ };
722
+ Update: {
723
+ created_at?: string;
724
+ icon?: string | null;
725
+ id?: string;
726
+ is_default?: boolean;
727
+ name?: string;
728
+ shared_with?: string[];
729
+ sort_order?: number;
730
+ updated_at?: string;
731
+ user_id?: string;
732
+ };
733
+ Relationships: [];
734
+ };
735
+ dashboard_saved_queries: {
736
+ Row: {
737
+ created_at: string;
738
+ description: string | null;
739
+ id: string;
740
+ name: string;
741
+ query_spec: import("../integrations/supabase/types").Json;
742
+ updated_at: string;
743
+ user_id: string;
744
+ };
745
+ Insert: {
746
+ created_at?: string;
747
+ description?: string | null;
748
+ id?: string;
749
+ name: string;
750
+ query_spec: import("../integrations/supabase/types").Json;
751
+ updated_at?: string;
752
+ user_id: string;
753
+ };
754
+ Update: {
755
+ created_at?: string;
756
+ description?: string | null;
757
+ id?: string;
758
+ name?: string;
759
+ query_spec?: import("../integrations/supabase/types").Json;
760
+ updated_at?: string;
761
+ user_id?: string;
762
+ };
763
+ Relationships: [];
764
+ };
765
+ exact_connections: {
766
+ Row: {
767
+ access_token_encrypted: string;
768
+ company_name: string | null;
769
+ connected_at: string;
770
+ connected_by: string | null;
771
+ division_code: number | null;
772
+ environment: import("../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
773
+ expires_at: string;
774
+ id: string;
775
+ last_error: string | null;
776
+ last_refreshed_at: string | null;
777
+ last_tested_at: string | null;
778
+ refresh_token_encrypted: string;
779
+ status: string;
780
+ updated_at: string;
781
+ };
782
+ Insert: {
783
+ access_token_encrypted: string;
784
+ company_name?: string | null;
785
+ connected_at?: string;
786
+ connected_by?: string | null;
787
+ division_code?: number | null;
788
+ environment: import("../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
789
+ expires_at: string;
790
+ id?: string;
791
+ last_error?: string | null;
792
+ last_refreshed_at?: string | null;
793
+ last_tested_at?: string | null;
794
+ refresh_token_encrypted: string;
795
+ status?: string;
796
+ updated_at?: string;
797
+ };
798
+ Update: {
799
+ access_token_encrypted?: string;
800
+ company_name?: string | null;
801
+ connected_at?: string;
802
+ connected_by?: string | null;
803
+ division_code?: number | null;
804
+ environment?: import("../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
805
+ expires_at?: string;
806
+ id?: string;
807
+ last_error?: string | null;
808
+ last_refreshed_at?: string | null;
809
+ last_tested_at?: string | null;
810
+ refresh_token_encrypted?: string;
811
+ status?: string;
812
+ updated_at?: string;
813
+ };
814
+ Relationships: [];
815
+ };
816
+ exact_credentials: {
817
+ Row: {
818
+ client_id: string;
819
+ client_secret_encrypted: string;
820
+ created_at: string;
821
+ environment: import("../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
822
+ id: string;
823
+ redirect_uri: string;
824
+ updated_at: string;
825
+ };
826
+ Insert: {
827
+ client_id: string;
828
+ client_secret_encrypted: string;
829
+ created_at?: string;
830
+ environment: import("../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
831
+ id?: string;
832
+ redirect_uri?: string;
833
+ updated_at?: string;
834
+ };
835
+ Update: {
836
+ client_id?: string;
837
+ client_secret_encrypted?: string;
838
+ created_at?: string;
839
+ environment?: import("../integrations/supabase/types").Database["public"]["Enums"]["exact_env"];
840
+ id?: string;
841
+ redirect_uri?: string;
842
+ updated_at?: string;
843
+ };
844
+ Relationships: [];
845
+ };
846
+ exact_customers_cache: {
847
+ Row: {
848
+ connection_id: string;
849
+ data: import("../integrations/supabase/types").Json;
850
+ exact_id: string;
851
+ fetched_at: string;
852
+ };
853
+ Insert: {
854
+ connection_id: string;
855
+ data?: import("../integrations/supabase/types").Json;
856
+ exact_id: string;
857
+ fetched_at?: string;
858
+ };
859
+ Update: {
860
+ connection_id?: string;
861
+ data?: import("../integrations/supabase/types").Json;
862
+ exact_id?: string;
863
+ fetched_at?: string;
864
+ };
865
+ Relationships: [];
866
+ };
867
+ exact_sync_state: {
868
+ Row: {
869
+ connection_id: string;
870
+ last_error: string | null;
871
+ last_modified_cursor: string | null;
872
+ last_synced_at: string | null;
873
+ status: string;
874
+ updated_at: string;
875
+ };
876
+ Insert: {
877
+ connection_id: string;
878
+ last_error?: string | null;
879
+ last_modified_cursor?: string | null;
880
+ last_synced_at?: string | null;
881
+ status?: string;
882
+ updated_at?: string;
883
+ };
884
+ Update: {
885
+ connection_id?: string;
886
+ last_error?: string | null;
887
+ last_modified_cursor?: string | null;
888
+ last_synced_at?: string | null;
889
+ status?: string;
890
+ updated_at?: string;
891
+ };
892
+ Relationships: [];
893
+ };
894
+ floricode_connection_settings: {
895
+ Row: {
896
+ catalog_key: string | null;
897
+ catalog_url: string;
898
+ created_at: string;
899
+ id: number;
900
+ last_meta: import("../integrations/supabase/types").Json | null;
901
+ last_test_at: string | null;
902
+ last_test_error: string | null;
903
+ last_test_ok: boolean | null;
904
+ updated_at: string;
905
+ };
906
+ Insert: {
907
+ catalog_key?: string | null;
908
+ catalog_url?: string;
909
+ created_at?: string;
910
+ id?: number;
911
+ last_meta?: import("../integrations/supabase/types").Json | null;
912
+ last_test_at?: string | null;
913
+ last_test_error?: string | null;
914
+ last_test_ok?: boolean | null;
915
+ updated_at?: string;
916
+ };
917
+ Update: {
918
+ catalog_key?: string | null;
919
+ catalog_url?: string;
920
+ created_at?: string;
921
+ id?: number;
922
+ last_meta?: import("../integrations/supabase/types").Json | null;
923
+ last_test_at?: string | null;
924
+ last_test_error?: string | null;
925
+ last_test_ok?: boolean | null;
926
+ updated_at?: string;
927
+ };
928
+ Relationships: [];
929
+ };
930
+ floricode_records: {
931
+ Row: {
932
+ change_date_time: string | null;
933
+ data: import("../integrations/supabase/types").Json;
934
+ last_synced_at: string;
935
+ record_id: string;
936
+ resource: string;
937
+ };
938
+ Insert: {
939
+ change_date_time?: string | null;
940
+ data?: import("../integrations/supabase/types").Json;
941
+ last_synced_at?: string;
942
+ record_id: string;
943
+ resource: string;
944
+ };
945
+ Update: {
946
+ change_date_time?: string | null;
947
+ data?: import("../integrations/supabase/types").Json;
948
+ last_synced_at?: string;
949
+ record_id?: string;
950
+ resource?: string;
951
+ };
952
+ Relationships: [];
953
+ };
954
+ floricode_sync_state: {
955
+ Row: {
956
+ error_message: string | null;
957
+ last_change_date_time: string | null;
958
+ last_sequence_number: number;
959
+ last_sync_at: string | null;
960
+ resource: string;
961
+ status: string;
962
+ updated_at: string;
963
+ };
964
+ Insert: {
965
+ error_message?: string | null;
966
+ last_change_date_time?: string | null;
967
+ last_sequence_number?: number;
968
+ last_sync_at?: string | null;
969
+ resource: string;
970
+ status?: string;
971
+ updated_at?: string;
972
+ };
973
+ Update: {
974
+ error_message?: string | null;
975
+ last_change_date_time?: string | null;
976
+ last_sequence_number?: number;
977
+ last_sync_at?: string | null;
978
+ resource?: string;
979
+ status?: string;
980
+ updated_at?: string;
981
+ };
982
+ Relationships: [];
983
+ };
984
+ floriday_connections: {
985
+ Row: {
986
+ access_token: string | null;
987
+ api_key: string;
988
+ client_id: string;
989
+ client_secret: string;
990
+ created_at: string;
991
+ customers_endpoint: string | null;
992
+ environment: string;
993
+ gln_code: string | null;
994
+ id: string;
995
+ is_active: boolean;
996
+ label: string;
997
+ organization_name: string | null;
998
+ preferred_warehouse_id: string | null;
999
+ preferred_warehouse_name: string | null;
1000
+ token_expires_at: string | null;
1001
+ updated_at: string;
1002
+ };
1003
+ Insert: {
1004
+ access_token?: string | null;
1005
+ api_key: string;
1006
+ client_id: string;
1007
+ client_secret: string;
1008
+ created_at?: string;
1009
+ customers_endpoint?: string | null;
1010
+ environment: string;
1011
+ gln_code?: string | null;
1012
+ id?: string;
1013
+ is_active?: boolean;
1014
+ label?: string;
1015
+ organization_name?: string | null;
1016
+ preferred_warehouse_id?: string | null;
1017
+ preferred_warehouse_name?: string | null;
1018
+ token_expires_at?: string | null;
1019
+ updated_at?: string;
1020
+ };
1021
+ Update: {
1022
+ access_token?: string | null;
1023
+ api_key?: string;
1024
+ client_id?: string;
1025
+ client_secret?: string;
1026
+ created_at?: string;
1027
+ customers_endpoint?: string | null;
1028
+ environment?: string;
1029
+ gln_code?: string | null;
1030
+ id?: string;
1031
+ is_active?: boolean;
1032
+ label?: string;
1033
+ organization_name?: string | null;
1034
+ preferred_warehouse_id?: string | null;
1035
+ preferred_warehouse_name?: string | null;
1036
+ token_expires_at?: string | null;
1037
+ updated_at?: string;
1038
+ };
1039
+ Relationships: [];
1040
+ };
1041
+ floriday_customers_cache: {
1042
+ Row: {
1043
+ connection_id: string | null;
1044
+ data: import("../integrations/supabase/types").Json;
1045
+ fetched_at: string;
1046
+ organization_id: string;
1047
+ };
1048
+ Insert: {
1049
+ connection_id?: string | null;
1050
+ data?: import("../integrations/supabase/types").Json;
1051
+ fetched_at?: string;
1052
+ organization_id: string;
1053
+ };
1054
+ Update: {
1055
+ connection_id?: string | null;
1056
+ data?: import("../integrations/supabase/types").Json;
1057
+ fetched_at?: string;
1058
+ organization_id?: string;
1059
+ };
1060
+ Relationships: [{
1061
+ foreignKeyName: "floriday_customers_cache_connection_id_fkey";
1062
+ columns: ["connection_id"];
1063
+ isOneToOne: false;
1064
+ referencedRelation: "floriday_connections";
1065
+ referencedColumns: ["id"];
1066
+ }];
1067
+ };
1068
+ floriday_network_cache: {
1069
+ Row: {
1070
+ city: string | null;
1071
+ connection_id: string;
1072
+ country: string | null;
1073
+ data: import("../integrations/supabase/types").Json;
1074
+ fetched_at: string;
1075
+ gln: string | null;
1076
+ organization_id: string;
1077
+ organization_name: string | null;
1078
+ };
1079
+ Insert: {
1080
+ city?: string | null;
1081
+ connection_id: string;
1082
+ country?: string | null;
1083
+ data?: import("../integrations/supabase/types").Json;
1084
+ fetched_at?: string;
1085
+ gln?: string | null;
1086
+ organization_id: string;
1087
+ organization_name?: string | null;
1088
+ };
1089
+ Update: {
1090
+ city?: string | null;
1091
+ connection_id?: string;
1092
+ country?: string | null;
1093
+ data?: import("../integrations/supabase/types").Json;
1094
+ fetched_at?: string;
1095
+ gln?: string | null;
1096
+ organization_id?: string;
1097
+ organization_name?: string | null;
1098
+ };
1099
+ Relationships: [];
1100
+ };
1101
+ floriday_network_sync_state: {
1102
+ Row: {
1103
+ connection_id: string;
1104
+ last_error: string | null;
1105
+ last_sequence_number: number;
1106
+ last_synced_at: string | null;
1107
+ updated_at: string;
1108
+ };
1109
+ Insert: {
1110
+ connection_id: string;
1111
+ last_error?: string | null;
1112
+ last_sequence_number?: number;
1113
+ last_synced_at?: string | null;
1114
+ updated_at?: string;
1115
+ };
1116
+ Update: {
1117
+ connection_id?: string;
1118
+ last_error?: string | null;
1119
+ last_sequence_number?: number;
1120
+ last_synced_at?: string | null;
1121
+ updated_at?: string;
1122
+ };
1123
+ Relationships: [];
1124
+ };
1125
+ floriday_settings: {
1126
+ Row: {
1127
+ active_environment: string;
1128
+ id: number;
1129
+ updated_at: string;
1130
+ };
1131
+ Insert: {
1132
+ active_environment?: string;
1133
+ id?: number;
1134
+ updated_at?: string;
1135
+ };
1136
+ Update: {
1137
+ active_environment?: string;
1138
+ id?: number;
1139
+ updated_at?: string;
1140
+ };
1141
+ Relationships: [];
1142
+ };
1143
+ inventory_settings: {
1144
+ Row: {
1145
+ created_at: string;
1146
+ hierarchy_levels: string[];
1147
+ id: string;
1148
+ updated_at: string;
1149
+ visible_columns: string[];
1150
+ };
1151
+ Insert: {
1152
+ created_at?: string;
1153
+ hierarchy_levels?: string[];
1154
+ id?: string;
1155
+ updated_at?: string;
1156
+ visible_columns?: string[];
1157
+ };
1158
+ Update: {
1159
+ created_at?: string;
1160
+ hierarchy_levels?: string[];
1161
+ id?: string;
1162
+ updated_at?: string;
1163
+ visible_columns?: string[];
1164
+ };
1165
+ Relationships: [];
1166
+ };
1167
+ locations: {
1168
+ Row: {
1169
+ created_at: string;
1170
+ id: string;
1171
+ name: string;
1172
+ sort_order: number;
1173
+ updated_at: string;
1174
+ };
1175
+ Insert: {
1176
+ created_at?: string;
1177
+ id?: string;
1178
+ name: string;
1179
+ sort_order?: number;
1180
+ updated_at?: string;
1181
+ };
1182
+ Update: {
1183
+ created_at?: string;
1184
+ id?: string;
1185
+ name?: string;
1186
+ sort_order?: number;
1187
+ updated_at?: string;
1188
+ };
1189
+ Relationships: [];
1190
+ };
1191
+ mailbox_messages: {
1192
+ Row: {
1193
+ body_html: string | null;
1194
+ body_text: string | null;
1195
+ created_at: string;
1196
+ error_message: string | null;
1197
+ from_email: string | null;
1198
+ from_name: string | null;
1199
+ id: string;
1200
+ message_id: string | null;
1201
+ raw_size: number | null;
1202
+ received_at: string | null;
1203
+ status: string;
1204
+ subject: string | null;
1205
+ uid: number;
1206
+ updated_at: string;
1207
+ };
1208
+ Insert: {
1209
+ body_html?: string | null;
1210
+ body_text?: string | null;
1211
+ created_at?: string;
1212
+ error_message?: string | null;
1213
+ from_email?: string | null;
1214
+ from_name?: string | null;
1215
+ id?: string;
1216
+ message_id?: string | null;
1217
+ raw_size?: number | null;
1218
+ received_at?: string | null;
1219
+ status?: string;
1220
+ subject?: string | null;
1221
+ uid: number;
1222
+ updated_at?: string;
1223
+ };
1224
+ Update: {
1225
+ body_html?: string | null;
1226
+ body_text?: string | null;
1227
+ created_at?: string;
1228
+ error_message?: string | null;
1229
+ from_email?: string | null;
1230
+ from_name?: string | null;
1231
+ id?: string;
1232
+ message_id?: string | null;
1233
+ raw_size?: number | null;
1234
+ received_at?: string | null;
1235
+ status?: string;
1236
+ subject?: string | null;
1237
+ uid?: number;
1238
+ updated_at?: string;
1239
+ };
1240
+ Relationships: [];
1241
+ };
1242
+ mailbox_order_proposals: {
1243
+ Row: {
1244
+ confidence: number | null;
1245
+ created_at: string;
1246
+ created_order_id: string | null;
1247
+ delivery_date: string | null;
1248
+ id: string;
1249
+ matched_customer_id: string | null;
1250
+ message_id: string;
1251
+ notes: string | null;
1252
+ parsed_payload: import("../integrations/supabase/types").Json | null;
1253
+ reviewed_at: string | null;
1254
+ reviewed_by: string | null;
1255
+ status: string;
1256
+ updated_at: string;
1257
+ };
1258
+ Insert: {
1259
+ confidence?: number | null;
1260
+ created_at?: string;
1261
+ created_order_id?: string | null;
1262
+ delivery_date?: string | null;
1263
+ id?: string;
1264
+ matched_customer_id?: string | null;
1265
+ message_id: string;
1266
+ notes?: string | null;
1267
+ parsed_payload?: import("../integrations/supabase/types").Json | null;
1268
+ reviewed_at?: string | null;
1269
+ reviewed_by?: string | null;
1270
+ status?: string;
1271
+ updated_at?: string;
1272
+ };
1273
+ Update: {
1274
+ confidence?: number | null;
1275
+ created_at?: string;
1276
+ created_order_id?: string | null;
1277
+ delivery_date?: string | null;
1278
+ id?: string;
1279
+ matched_customer_id?: string | null;
1280
+ message_id?: string;
1281
+ notes?: string | null;
1282
+ parsed_payload?: import("../integrations/supabase/types").Json | null;
1283
+ reviewed_at?: string | null;
1284
+ reviewed_by?: string | null;
1285
+ status?: string;
1286
+ updated_at?: string;
1287
+ };
1288
+ Relationships: [{
1289
+ foreignKeyName: "mailbox_order_proposals_created_order_id_fkey";
1290
+ columns: ["created_order_id"];
1291
+ isOneToOne: false;
1292
+ referencedRelation: "orders";
1293
+ referencedColumns: ["id"];
1294
+ }, {
1295
+ foreignKeyName: "mailbox_order_proposals_matched_customer_id_fkey";
1296
+ columns: ["matched_customer_id"];
1297
+ isOneToOne: false;
1298
+ referencedRelation: "customers";
1299
+ referencedColumns: ["id"];
1300
+ }, {
1301
+ foreignKeyName: "mailbox_order_proposals_message_id_fkey";
1302
+ columns: ["message_id"];
1303
+ isOneToOne: false;
1304
+ referencedRelation: "mailbox_messages";
1305
+ referencedColumns: ["id"];
1306
+ }];
1307
+ };
1308
+ mailbox_order_template_fields: {
1309
+ Row: {
1310
+ ai_enabled: boolean;
1311
+ ai_hint: string | null;
1312
+ created_at: string;
1313
+ default_value: import("../integrations/supabase/types").Json | null;
1314
+ field_type: string;
1315
+ id: string;
1316
+ key: string;
1317
+ label: string;
1318
+ options: import("../integrations/supabase/types").Json | null;
1319
+ required: boolean;
1320
+ sort_order: number;
1321
+ source: string;
1322
+ source_table: string | null;
1323
+ updated_at: string;
1324
+ visible: boolean;
1325
+ };
1326
+ Insert: {
1327
+ ai_enabled?: boolean;
1328
+ ai_hint?: string | null;
1329
+ created_at?: string;
1330
+ default_value?: import("../integrations/supabase/types").Json | null;
1331
+ field_type: string;
1332
+ id?: string;
1333
+ key: string;
1334
+ label: string;
1335
+ options?: import("../integrations/supabase/types").Json | null;
1336
+ required?: boolean;
1337
+ sort_order?: number;
1338
+ source?: string;
1339
+ source_table?: string | null;
1340
+ updated_at?: string;
1341
+ visible?: boolean;
1342
+ };
1343
+ Update: {
1344
+ ai_enabled?: boolean;
1345
+ ai_hint?: string | null;
1346
+ created_at?: string;
1347
+ default_value?: import("../integrations/supabase/types").Json | null;
1348
+ field_type?: string;
1349
+ id?: string;
1350
+ key?: string;
1351
+ label?: string;
1352
+ options?: import("../integrations/supabase/types").Json | null;
1353
+ required?: boolean;
1354
+ sort_order?: number;
1355
+ source?: string;
1356
+ source_table?: string | null;
1357
+ updated_at?: string;
1358
+ visible?: boolean;
1359
+ };
1360
+ Relationships: [];
1361
+ };
1362
+ mailbox_proposal_field_values: {
1363
+ Row: {
1364
+ ai_confidence: number | null;
1365
+ ai_filled: boolean;
1366
+ created_at: string;
1367
+ field_key: string;
1368
+ id: string;
1369
+ needs_review: boolean;
1370
+ proposal_id: string;
1371
+ updated_at: string;
1372
+ value: import("../integrations/supabase/types").Json | null;
1373
+ };
1374
+ Insert: {
1375
+ ai_confidence?: number | null;
1376
+ ai_filled?: boolean;
1377
+ created_at?: string;
1378
+ field_key: string;
1379
+ id?: string;
1380
+ needs_review?: boolean;
1381
+ proposal_id: string;
1382
+ updated_at?: string;
1383
+ value?: import("../integrations/supabase/types").Json | null;
1384
+ };
1385
+ Update: {
1386
+ ai_confidence?: number | null;
1387
+ ai_filled?: boolean;
1388
+ created_at?: string;
1389
+ field_key?: string;
1390
+ id?: string;
1391
+ needs_review?: boolean;
1392
+ proposal_id?: string;
1393
+ updated_at?: string;
1394
+ value?: import("../integrations/supabase/types").Json | null;
1395
+ };
1396
+ Relationships: [{
1397
+ foreignKeyName: "mailbox_proposal_field_values_proposal_id_fkey";
1398
+ columns: ["proposal_id"];
1399
+ isOneToOne: false;
1400
+ referencedRelation: "mailbox_order_proposals";
1401
+ referencedColumns: ["id"];
1402
+ }];
1403
+ };
1404
+ mailbox_proposal_lines: {
1405
+ Row: {
1406
+ created_at: string;
1407
+ id: string;
1408
+ match_confidence: number | null;
1409
+ product_id: string | null;
1410
+ proposal_id: string;
1411
+ quantity: number | null;
1412
+ raw_product_text: string | null;
1413
+ sort_order: number;
1414
+ unit: string | null;
1415
+ updated_at: string;
1416
+ };
1417
+ Insert: {
1418
+ created_at?: string;
1419
+ id?: string;
1420
+ match_confidence?: number | null;
1421
+ product_id?: string | null;
1422
+ proposal_id: string;
1423
+ quantity?: number | null;
1424
+ raw_product_text?: string | null;
1425
+ sort_order?: number;
1426
+ unit?: string | null;
1427
+ updated_at?: string;
1428
+ };
1429
+ Update: {
1430
+ created_at?: string;
1431
+ id?: string;
1432
+ match_confidence?: number | null;
1433
+ product_id?: string | null;
1434
+ proposal_id?: string;
1435
+ quantity?: number | null;
1436
+ raw_product_text?: string | null;
1437
+ sort_order?: number;
1438
+ unit?: string | null;
1439
+ updated_at?: string;
1440
+ };
1441
+ Relationships: [{
1442
+ foreignKeyName: "mailbox_proposal_lines_product_id_fkey";
1443
+ columns: ["product_id"];
1444
+ isOneToOne: false;
1445
+ referencedRelation: "products";
1446
+ referencedColumns: ["id"];
1447
+ }, {
1448
+ foreignKeyName: "mailbox_proposal_lines_proposal_id_fkey";
1449
+ columns: ["proposal_id"];
1450
+ isOneToOne: false;
1451
+ referencedRelation: "mailbox_order_proposals";
1452
+ referencedColumns: ["id"];
1453
+ }];
1454
+ };
1455
+ mailbox_settings: {
1456
+ Row: {
1457
+ created_at: string;
1458
+ folder: string;
1459
+ id: string;
1460
+ imap_host: string;
1461
+ imap_port: number;
1462
+ imap_use_tls: boolean;
1463
+ imap_username: string;
1464
+ last_error: string | null;
1465
+ last_polled_at: string | null;
1466
+ last_uid_seen: number;
1467
+ polling_enabled: boolean;
1468
+ singleton: boolean;
1469
+ updated_at: string;
1470
+ };
1471
+ Insert: {
1472
+ created_at?: string;
1473
+ folder?: string;
1474
+ id?: string;
1475
+ imap_host?: string;
1476
+ imap_port?: number;
1477
+ imap_use_tls?: boolean;
1478
+ imap_username?: string;
1479
+ last_error?: string | null;
1480
+ last_polled_at?: string | null;
1481
+ last_uid_seen?: number;
1482
+ polling_enabled?: boolean;
1483
+ singleton?: boolean;
1484
+ updated_at?: string;
1485
+ };
1486
+ Update: {
1487
+ created_at?: string;
1488
+ folder?: string;
1489
+ id?: string;
1490
+ imap_host?: string;
1491
+ imap_port?: number;
1492
+ imap_use_tls?: boolean;
1493
+ imap_username?: string;
1494
+ last_error?: string | null;
1495
+ last_polled_at?: string | null;
1496
+ last_uid_seen?: number;
1497
+ polling_enabled?: boolean;
1498
+ singleton?: boolean;
1499
+ updated_at?: string;
1500
+ };
1501
+ Relationships: [];
1502
+ };
1503
+ notifications: {
1504
+ Row: {
1505
+ created_at: string;
1506
+ id: string;
1507
+ message: string | null;
1508
+ read: boolean;
1509
+ title: string;
1510
+ updated_at: string;
1511
+ user_id: string;
1512
+ };
1513
+ Insert: {
1514
+ created_at?: string;
1515
+ id?: string;
1516
+ message?: string | null;
1517
+ read?: boolean;
1518
+ title: string;
1519
+ updated_at?: string;
1520
+ user_id: string;
1521
+ };
1522
+ Update: {
1523
+ created_at?: string;
1524
+ id?: string;
1525
+ message?: string | null;
1526
+ read?: boolean;
1527
+ title?: string;
1528
+ updated_at?: string;
1529
+ user_id?: string;
1530
+ };
1531
+ Relationships: [];
1532
+ };
1533
+ offer_campaign_product_tiers: {
1534
+ Row: {
1535
+ campaign_product_id: string;
1536
+ created_at: string;
1537
+ id: string;
1538
+ min_crates: number;
1539
+ price_per_crate: number;
1540
+ sort_order: number;
1541
+ };
1542
+ Insert: {
1543
+ campaign_product_id: string;
1544
+ created_at?: string;
1545
+ id?: string;
1546
+ min_crates?: number;
1547
+ price_per_crate?: number;
1548
+ sort_order?: number;
1549
+ };
1550
+ Update: {
1551
+ campaign_product_id?: string;
1552
+ created_at?: string;
1553
+ id?: string;
1554
+ min_crates?: number;
1555
+ price_per_crate?: number;
1556
+ sort_order?: number;
1557
+ };
1558
+ Relationships: [{
1559
+ foreignKeyName: "offer_campaign_product_tiers_campaign_product_id_fkey";
1560
+ columns: ["campaign_product_id"];
1561
+ isOneToOne: false;
1562
+ referencedRelation: "offer_campaign_products";
1563
+ referencedColumns: ["id"];
1564
+ }];
1565
+ };
1566
+ offer_campaign_products: {
1567
+ Row: {
1568
+ available_stock: number;
1569
+ barcode: string | null;
1570
+ belading: string | null;
1571
+ campaign_id: string;
1572
+ crate_price: number | null;
1573
+ created_at: string;
1574
+ description: string | null;
1575
+ discount_price: number;
1576
+ id: string;
1577
+ image_url: string | null;
1578
+ normal_price: number;
1579
+ plants_per_crate: number | null;
1580
+ product_id: string | null;
1581
+ product_name: string;
1582
+ sort_order: number;
1583
+ sticker_available: boolean;
1584
+ sticker_cost: number | null;
1585
+ };
1586
+ Insert: {
1587
+ available_stock?: number;
1588
+ barcode?: string | null;
1589
+ belading?: string | null;
1590
+ campaign_id: string;
1591
+ crate_price?: number | null;
1592
+ created_at?: string;
1593
+ description?: string | null;
1594
+ discount_price?: number;
1595
+ id?: string;
1596
+ image_url?: string | null;
1597
+ normal_price?: number;
1598
+ plants_per_crate?: number | null;
1599
+ product_id?: string | null;
1600
+ product_name: string;
1601
+ sort_order?: number;
1602
+ sticker_available?: boolean;
1603
+ sticker_cost?: number | null;
1604
+ };
1605
+ Update: {
1606
+ available_stock?: number;
1607
+ barcode?: string | null;
1608
+ belading?: string | null;
1609
+ campaign_id?: string;
1610
+ crate_price?: number | null;
1611
+ created_at?: string;
1612
+ description?: string | null;
1613
+ discount_price?: number;
1614
+ id?: string;
1615
+ image_url?: string | null;
1616
+ normal_price?: number;
1617
+ plants_per_crate?: number | null;
1618
+ product_id?: string | null;
1619
+ product_name?: string;
1620
+ sort_order?: number;
1621
+ sticker_available?: boolean;
1622
+ sticker_cost?: number | null;
1623
+ };
1624
+ Relationships: [{
1625
+ foreignKeyName: "offer_campaign_products_campaign_id_fkey";
1626
+ columns: ["campaign_id"];
1627
+ isOneToOne: false;
1628
+ referencedRelation: "offer_campaigns";
1629
+ referencedColumns: ["id"];
1630
+ }, {
1631
+ foreignKeyName: "offer_campaign_products_product_id_fkey";
1632
+ columns: ["product_id"];
1633
+ isOneToOne: false;
1634
+ referencedRelation: "products";
1635
+ referencedColumns: ["id"];
1636
+ }];
1637
+ };
1638
+ offer_campaigns: {
1639
+ Row: {
1640
+ created_at: string;
1641
+ created_by: string | null;
1642
+ from_email: string;
1643
+ from_name: string;
1644
+ id: string;
1645
+ intro_message: string | null;
1646
+ name: string;
1647
+ scheduled_at: string | null;
1648
+ sent_at: string | null;
1649
+ status: string;
1650
+ subject: string;
1651
+ updated_at: string;
1652
+ };
1653
+ Insert: {
1654
+ created_at?: string;
1655
+ created_by?: string | null;
1656
+ from_email: string;
1657
+ from_name: string;
1658
+ id?: string;
1659
+ intro_message?: string | null;
1660
+ name: string;
1661
+ scheduled_at?: string | null;
1662
+ sent_at?: string | null;
1663
+ status?: string;
1664
+ subject: string;
1665
+ updated_at?: string;
1666
+ };
1667
+ Update: {
1668
+ created_at?: string;
1669
+ created_by?: string | null;
1670
+ from_email?: string;
1671
+ from_name?: string;
1672
+ id?: string;
1673
+ intro_message?: string | null;
1674
+ name?: string;
1675
+ scheduled_at?: string | null;
1676
+ sent_at?: string | null;
1677
+ status?: string;
1678
+ subject?: string;
1679
+ updated_at?: string;
1680
+ };
1681
+ Relationships: [];
1682
+ };
1683
+ offer_events: {
1684
+ Row: {
1685
+ campaign_id: string;
1686
+ created_at: string;
1687
+ event_type: string;
1688
+ id: string;
1689
+ metadata: import("../integrations/supabase/types").Json;
1690
+ recipient_id: string;
1691
+ };
1692
+ Insert: {
1693
+ campaign_id: string;
1694
+ created_at?: string;
1695
+ event_type: string;
1696
+ id?: string;
1697
+ metadata?: import("../integrations/supabase/types").Json;
1698
+ recipient_id: string;
1699
+ };
1700
+ Update: {
1701
+ campaign_id?: string;
1702
+ created_at?: string;
1703
+ event_type?: string;
1704
+ id?: string;
1705
+ metadata?: import("../integrations/supabase/types").Json;
1706
+ recipient_id?: string;
1707
+ };
1708
+ Relationships: [{
1709
+ foreignKeyName: "offer_events_campaign_id_fkey";
1710
+ columns: ["campaign_id"];
1711
+ isOneToOne: false;
1712
+ referencedRelation: "offer_campaigns";
1713
+ referencedColumns: ["id"];
1714
+ }, {
1715
+ foreignKeyName: "offer_events_recipient_id_fkey";
1716
+ columns: ["recipient_id"];
1717
+ isOneToOne: false;
1718
+ referencedRelation: "offer_recipients";
1719
+ referencedColumns: ["id"];
1720
+ }];
1721
+ };
1722
+ offer_orders: {
1723
+ Row: {
1724
+ campaign_id: string;
1725
+ created_at: string;
1726
+ customer_email: string;
1727
+ customer_id: string | null;
1728
+ customer_name: string;
1729
+ customer_phone: string | null;
1730
+ id: string;
1731
+ items: import("../integrations/supabase/types").Json;
1732
+ notes: string | null;
1733
+ recipient_id: string;
1734
+ total_amount: number;
1735
+ };
1736
+ Insert: {
1737
+ campaign_id: string;
1738
+ created_at?: string;
1739
+ customer_email: string;
1740
+ customer_id?: string | null;
1741
+ customer_name: string;
1742
+ customer_phone?: string | null;
1743
+ id?: string;
1744
+ items?: import("../integrations/supabase/types").Json;
1745
+ notes?: string | null;
1746
+ recipient_id: string;
1747
+ total_amount?: number;
1748
+ };
1749
+ Update: {
1750
+ campaign_id?: string;
1751
+ created_at?: string;
1752
+ customer_email?: string;
1753
+ customer_id?: string | null;
1754
+ customer_name?: string;
1755
+ customer_phone?: string | null;
1756
+ id?: string;
1757
+ items?: import("../integrations/supabase/types").Json;
1758
+ notes?: string | null;
1759
+ recipient_id?: string;
1760
+ total_amount?: number;
1761
+ };
1762
+ Relationships: [{
1763
+ foreignKeyName: "offer_orders_campaign_id_fkey";
1764
+ columns: ["campaign_id"];
1765
+ isOneToOne: false;
1766
+ referencedRelation: "offer_campaigns";
1767
+ referencedColumns: ["id"];
1768
+ }, {
1769
+ foreignKeyName: "offer_orders_customer_id_fkey";
1770
+ columns: ["customer_id"];
1771
+ isOneToOne: false;
1772
+ referencedRelation: "customers";
1773
+ referencedColumns: ["id"];
1774
+ }, {
1775
+ foreignKeyName: "offer_orders_recipient_id_fkey";
1776
+ columns: ["recipient_id"];
1777
+ isOneToOne: false;
1778
+ referencedRelation: "offer_recipients";
1779
+ referencedColumns: ["id"];
1780
+ }];
1781
+ };
1782
+ offer_recipients: {
1783
+ Row: {
1784
+ campaign_id: string;
1785
+ clicked_at: string | null;
1786
+ contact_id: string | null;
1787
+ created_at: string;
1788
+ customer_id: string | null;
1789
+ id: string;
1790
+ link_code: string;
1791
+ opened_at: string | null;
1792
+ ordered_at: string | null;
1793
+ recipient_email: string;
1794
+ recipient_name: string;
1795
+ sent_at: string | null;
1796
+ };
1797
+ Insert: {
1798
+ campaign_id: string;
1799
+ clicked_at?: string | null;
1800
+ contact_id?: string | null;
1801
+ created_at?: string;
1802
+ customer_id?: string | null;
1803
+ id?: string;
1804
+ link_code?: string;
1805
+ opened_at?: string | null;
1806
+ ordered_at?: string | null;
1807
+ recipient_email: string;
1808
+ recipient_name: string;
1809
+ sent_at?: string | null;
1810
+ };
1811
+ Update: {
1812
+ campaign_id?: string;
1813
+ clicked_at?: string | null;
1814
+ contact_id?: string | null;
1815
+ created_at?: string;
1816
+ customer_id?: string | null;
1817
+ id?: string;
1818
+ link_code?: string;
1819
+ opened_at?: string | null;
1820
+ ordered_at?: string | null;
1821
+ recipient_email?: string;
1822
+ recipient_name?: string;
1823
+ sent_at?: string | null;
1824
+ };
1825
+ Relationships: [{
1826
+ foreignKeyName: "offer_recipients_campaign_id_fkey";
1827
+ columns: ["campaign_id"];
1828
+ isOneToOne: false;
1829
+ referencedRelation: "offer_campaigns";
1830
+ referencedColumns: ["id"];
1831
+ }, {
1832
+ foreignKeyName: "offer_recipients_contact_id_fkey";
1833
+ columns: ["contact_id"];
1834
+ isOneToOne: false;
1835
+ referencedRelation: "customer_contacts";
1836
+ referencedColumns: ["id"];
1837
+ }, {
1838
+ foreignKeyName: "offer_recipients_customer_id_fkey";
1839
+ columns: ["customer_id"];
1840
+ isOneToOne: false;
1841
+ referencedRelation: "customers";
1842
+ referencedColumns: ["id"];
1843
+ }];
1844
+ };
1845
+ offer_settings: {
1846
+ Row: {
1847
+ button_color: string;
1848
+ created_at: string;
1849
+ default_countries: string[];
1850
+ default_customer_classes: string[];
1851
+ default_intro: string;
1852
+ default_sticker_cost: number;
1853
+ default_subject: string;
1854
+ discount_display: string;
1855
+ excluded_contact_ids: string[];
1856
+ excluded_customer_ids: string[];
1857
+ from_email: string;
1858
+ from_name: string;
1859
+ id: string;
1860
+ logo_url: string | null;
1861
+ primary_color: string;
1862
+ show_customer_classes: boolean;
1863
+ singleton: boolean;
1864
+ tracking_enabled: boolean;
1865
+ updated_at: string;
1866
+ };
1867
+ Insert: {
1868
+ button_color?: string;
1869
+ created_at?: string;
1870
+ default_countries?: string[];
1871
+ default_customer_classes?: string[];
1872
+ default_intro?: string;
1873
+ default_sticker_cost?: number;
1874
+ default_subject?: string;
1875
+ discount_display?: string;
1876
+ excluded_contact_ids?: string[];
1877
+ excluded_customer_ids?: string[];
1878
+ from_email?: string;
1879
+ from_name?: string;
1880
+ id?: string;
1881
+ logo_url?: string | null;
1882
+ primary_color?: string;
1883
+ show_customer_classes?: boolean;
1884
+ singleton?: boolean;
1885
+ tracking_enabled?: boolean;
1886
+ updated_at?: string;
1887
+ };
1888
+ Update: {
1889
+ button_color?: string;
1890
+ created_at?: string;
1891
+ default_countries?: string[];
1892
+ default_customer_classes?: string[];
1893
+ default_intro?: string;
1894
+ default_sticker_cost?: number;
1895
+ default_subject?: string;
1896
+ discount_display?: string;
1897
+ excluded_contact_ids?: string[];
1898
+ excluded_customer_ids?: string[];
1899
+ from_email?: string;
1900
+ from_name?: string;
1901
+ id?: string;
1902
+ logo_url?: string | null;
1903
+ primary_color?: string;
1904
+ show_customer_classes?: boolean;
1905
+ singleton?: boolean;
1906
+ tracking_enabled?: boolean;
1907
+ updated_at?: string;
1908
+ };
1909
+ Relationships: [];
1910
+ };
1911
+ order_field_options: {
1912
+ Row: {
1913
+ created_at: string;
1914
+ field_setting_id: string;
1915
+ id: string;
1916
+ label: string;
1917
+ sort_order: number;
1918
+ };
1919
+ Insert: {
1920
+ created_at?: string;
1921
+ field_setting_id: string;
1922
+ id?: string;
1923
+ label: string;
1924
+ sort_order?: number;
1925
+ };
1926
+ Update: {
1927
+ created_at?: string;
1928
+ field_setting_id?: string;
1929
+ id?: string;
1930
+ label?: string;
1931
+ sort_order?: number;
1932
+ };
1933
+ Relationships: [{
1934
+ foreignKeyName: "order_field_options_field_setting_id_fkey";
1935
+ columns: ["field_setting_id"];
1936
+ isOneToOne: false;
1937
+ referencedRelation: "order_field_settings";
1938
+ referencedColumns: ["id"];
1939
+ }];
1940
+ };
1941
+ order_field_settings: {
1942
+ Row: {
1943
+ active: boolean;
1944
+ created_at: string;
1945
+ field_key: string;
1946
+ field_label: string;
1947
+ field_type: string;
1948
+ id: string;
1949
+ is_custom: boolean;
1950
+ sort_order: number;
1951
+ updated_at: string;
1952
+ };
1953
+ Insert: {
1954
+ active?: boolean;
1955
+ created_at?: string;
1956
+ field_key: string;
1957
+ field_label: string;
1958
+ field_type?: string;
1959
+ id?: string;
1960
+ is_custom?: boolean;
1961
+ sort_order?: number;
1962
+ updated_at?: string;
1963
+ };
1964
+ Update: {
1965
+ active?: boolean;
1966
+ created_at?: string;
1967
+ field_key?: string;
1968
+ field_label?: string;
1969
+ field_type?: string;
1970
+ id?: string;
1971
+ is_custom?: boolean;
1972
+ sort_order?: number;
1973
+ updated_at?: string;
1974
+ };
1975
+ Relationships: [];
1976
+ };
1977
+ order_items: {
1978
+ Row: {
1979
+ created_at: string;
1980
+ id: string;
1981
+ order_id: string;
1982
+ product_id: string | null;
1983
+ product_name: string;
1984
+ quantity: number;
1985
+ unit: string;
1986
+ unit_price: number | null;
1987
+ };
1988
+ Insert: {
1989
+ created_at?: string;
1990
+ id?: string;
1991
+ order_id: string;
1992
+ product_id?: string | null;
1993
+ product_name: string;
1994
+ quantity?: number;
1995
+ unit?: string;
1996
+ unit_price?: number | null;
1997
+ };
1998
+ Update: {
1999
+ created_at?: string;
2000
+ id?: string;
2001
+ order_id?: string;
2002
+ product_id?: string | null;
2003
+ product_name?: string;
2004
+ quantity?: number;
2005
+ unit?: string;
2006
+ unit_price?: number | null;
2007
+ };
2008
+ Relationships: [{
2009
+ foreignKeyName: "order_items_order_id_fkey";
2010
+ columns: ["order_id"];
2011
+ isOneToOne: false;
2012
+ referencedRelation: "orders";
2013
+ referencedColumns: ["id"];
2014
+ }, {
2015
+ foreignKeyName: "order_items_product_id_fkey";
2016
+ columns: ["product_id"];
2017
+ isOneToOne: false;
2018
+ referencedRelation: "products";
2019
+ referencedColumns: ["id"];
2020
+ }];
2021
+ };
2022
+ orders: {
2023
+ Row: {
2024
+ created_at: string;
2025
+ custom_fields: import("../integrations/supabase/types").Json;
2026
+ customer_id: string | null;
2027
+ customer_name: string;
2028
+ deleted_at: string | null;
2029
+ delivery_date: string;
2030
+ id: string;
2031
+ notes: string | null;
2032
+ order_date: string;
2033
+ order_number: string;
2034
+ status: string;
2035
+ total: string;
2036
+ updated_at: string;
2037
+ };
2038
+ Insert: {
2039
+ created_at?: string;
2040
+ custom_fields?: import("../integrations/supabase/types").Json;
2041
+ customer_id?: string | null;
2042
+ customer_name?: string;
2043
+ deleted_at?: string | null;
2044
+ delivery_date: string;
2045
+ id?: string;
2046
+ notes?: string | null;
2047
+ order_date?: string;
2048
+ order_number: string;
2049
+ status?: string;
2050
+ total?: string;
2051
+ updated_at?: string;
2052
+ };
2053
+ Update: {
2054
+ created_at?: string;
2055
+ custom_fields?: import("../integrations/supabase/types").Json;
2056
+ customer_id?: string | null;
2057
+ customer_name?: string;
2058
+ deleted_at?: string | null;
2059
+ delivery_date?: string;
2060
+ id?: string;
2061
+ notes?: string | null;
2062
+ order_date?: string;
2063
+ order_number?: string;
2064
+ status?: string;
2065
+ total?: string;
2066
+ updated_at?: string;
2067
+ };
2068
+ Relationships: [{
2069
+ foreignKeyName: "orders_customer_id_fkey";
2070
+ columns: ["customer_id"];
2071
+ isOneToOne: false;
2072
+ referencedRelation: "customers";
2073
+ referencedColumns: ["id"];
2074
+ }];
2075
+ };
2076
+ product_categories: {
2077
+ Row: {
2078
+ color: string;
2079
+ created_at: string;
2080
+ icon: string | null;
2081
+ id: string;
2082
+ name: string;
2083
+ slug: string;
2084
+ sort_order: number;
2085
+ updated_at: string;
2086
+ };
2087
+ Insert: {
2088
+ color?: string;
2089
+ created_at?: string;
2090
+ icon?: string | null;
2091
+ id?: string;
2092
+ name: string;
2093
+ slug: string;
2094
+ sort_order?: number;
2095
+ updated_at?: string;
2096
+ };
2097
+ Update: {
2098
+ color?: string;
2099
+ created_at?: string;
2100
+ icon?: string | null;
2101
+ id?: string;
2102
+ name?: string;
2103
+ slug?: string;
2104
+ sort_order?: number;
2105
+ updated_at?: string;
2106
+ };
2107
+ Relationships: [];
2108
+ };
2109
+ product_field_options: {
2110
+ Row: {
2111
+ created_at: string;
2112
+ field_setting_id: string;
2113
+ id: string;
2114
+ label: string;
2115
+ sort_order: number;
2116
+ };
2117
+ Insert: {
2118
+ created_at?: string;
2119
+ field_setting_id: string;
2120
+ id?: string;
2121
+ label: string;
2122
+ sort_order?: number;
2123
+ };
2124
+ Update: {
2125
+ created_at?: string;
2126
+ field_setting_id?: string;
2127
+ id?: string;
2128
+ label?: string;
2129
+ sort_order?: number;
2130
+ };
2131
+ Relationships: [{
2132
+ foreignKeyName: "product_field_options_field_setting_id_fkey";
2133
+ columns: ["field_setting_id"];
2134
+ isOneToOne: false;
2135
+ referencedRelation: "product_field_settings";
2136
+ referencedColumns: ["id"];
2137
+ }];
2138
+ };
2139
+ product_field_settings: {
2140
+ Row: {
2141
+ active_per_category: import("../integrations/supabase/types").Json;
2142
+ created_at: string;
2143
+ field_key: string;
2144
+ field_label: string;
2145
+ field_type: string;
2146
+ id: string;
2147
+ is_custom: boolean;
2148
+ sort_order: number;
2149
+ updated_at: string;
2150
+ };
2151
+ Insert: {
2152
+ active_per_category?: import("../integrations/supabase/types").Json;
2153
+ created_at?: string;
2154
+ field_key: string;
2155
+ field_label: string;
2156
+ field_type?: string;
2157
+ id?: string;
2158
+ is_custom?: boolean;
2159
+ sort_order?: number;
2160
+ updated_at?: string;
2161
+ };
2162
+ Update: {
2163
+ active_per_category?: import("../integrations/supabase/types").Json;
2164
+ created_at?: string;
2165
+ field_key?: string;
2166
+ field_label?: string;
2167
+ field_type?: string;
2168
+ id?: string;
2169
+ is_custom?: boolean;
2170
+ sort_order?: number;
2171
+ updated_at?: string;
2172
+ };
2173
+ Relationships: [];
2174
+ };
2175
+ products: {
2176
+ Row: {
2177
+ barcode: string | null;
2178
+ batch: string;
2179
+ created_at: string;
2180
+ custom_fields: import("../integrations/supabase/types").Json;
2181
+ id: string;
2182
+ image_url: string | null;
2183
+ incoming_quantity: number;
2184
+ location: string;
2185
+ min_quantity: number;
2186
+ product: string;
2187
+ product_type: string;
2188
+ purchase_price: number | null;
2189
+ quantity: number;
2190
+ sale_price: number | null;
2191
+ unit: string;
2192
+ updated_at: string;
2193
+ weight: string | null;
2194
+ };
2195
+ Insert: {
2196
+ barcode?: string | null;
2197
+ batch: string;
2198
+ created_at?: string;
2199
+ custom_fields?: import("../integrations/supabase/types").Json;
2200
+ id?: string;
2201
+ image_url?: string | null;
2202
+ incoming_quantity?: number;
2203
+ location: string;
2204
+ min_quantity?: number;
2205
+ product: string;
2206
+ product_type?: string;
2207
+ purchase_price?: number | null;
2208
+ quantity?: number;
2209
+ sale_price?: number | null;
2210
+ unit?: string;
2211
+ updated_at?: string;
2212
+ weight?: string | null;
2213
+ };
2214
+ Update: {
2215
+ barcode?: string | null;
2216
+ batch?: string;
2217
+ created_at?: string;
2218
+ custom_fields?: import("../integrations/supabase/types").Json;
2219
+ id?: string;
2220
+ image_url?: string | null;
2221
+ incoming_quantity?: number;
2222
+ location?: string;
2223
+ min_quantity?: number;
2224
+ product?: string;
2225
+ product_type?: string;
2226
+ purchase_price?: number | null;
2227
+ quantity?: number;
2228
+ sale_price?: number | null;
2229
+ unit?: string;
2230
+ updated_at?: string;
2231
+ weight?: string | null;
2232
+ };
2233
+ Relationships: [];
2234
+ };
2235
+ profiles: {
2236
+ Row: {
2237
+ created_at: string;
2238
+ display_name: string | null;
2239
+ email: string | null;
2240
+ id: string;
2241
+ notification_preferences: import("../integrations/supabase/types").Json;
2242
+ updated_at: string;
2243
+ };
2244
+ Insert: {
2245
+ created_at?: string;
2246
+ display_name?: string | null;
2247
+ email?: string | null;
2248
+ id: string;
2249
+ notification_preferences?: import("../integrations/supabase/types").Json;
2250
+ updated_at?: string;
2251
+ };
2252
+ Update: {
2253
+ created_at?: string;
2254
+ display_name?: string | null;
2255
+ email?: string | null;
2256
+ id?: string;
2257
+ notification_preferences?: import("../integrations/supabase/types").Json;
2258
+ updated_at?: string;
2259
+ };
2260
+ Relationships: [];
2261
+ };
2262
+ purchase_order_items: {
2263
+ Row: {
2264
+ created_at: string;
2265
+ id: string;
2266
+ product_id: string | null;
2267
+ product_type: string;
2268
+ purchase_order_id: string;
2269
+ quantity: number;
2270
+ };
2271
+ Insert: {
2272
+ created_at?: string;
2273
+ id?: string;
2274
+ product_id?: string | null;
2275
+ product_type?: string;
2276
+ purchase_order_id: string;
2277
+ quantity?: number;
2278
+ };
2279
+ Update: {
2280
+ created_at?: string;
2281
+ id?: string;
2282
+ product_id?: string | null;
2283
+ product_type?: string;
2284
+ purchase_order_id?: string;
2285
+ quantity?: number;
2286
+ };
2287
+ Relationships: [{
2288
+ foreignKeyName: "purchase_order_items_product_id_fkey";
2289
+ columns: ["product_id"];
2290
+ isOneToOne: false;
2291
+ referencedRelation: "products";
2292
+ referencedColumns: ["id"];
2293
+ }, {
2294
+ foreignKeyName: "purchase_order_items_purchase_order_id_fkey";
2295
+ columns: ["purchase_order_id"];
2296
+ isOneToOne: false;
2297
+ referencedRelation: "purchase_orders";
2298
+ referencedColumns: ["id"];
2299
+ }];
2300
+ };
2301
+ purchase_orders: {
2302
+ Row: {
2303
+ created_at: string;
2304
+ expected_delivery_date: string;
2305
+ id: string;
2306
+ location_id: string | null;
2307
+ notes: string | null;
2308
+ order_number: string;
2309
+ status: string;
2310
+ supplier_id: string | null;
2311
+ supplier_name: string;
2312
+ updated_at: string;
2313
+ };
2314
+ Insert: {
2315
+ created_at?: string;
2316
+ expected_delivery_date: string;
2317
+ id?: string;
2318
+ location_id?: string | null;
2319
+ notes?: string | null;
2320
+ order_number: string;
2321
+ status?: string;
2322
+ supplier_id?: string | null;
2323
+ supplier_name?: string;
2324
+ updated_at?: string;
2325
+ };
2326
+ Update: {
2327
+ created_at?: string;
2328
+ expected_delivery_date?: string;
2329
+ id?: string;
2330
+ location_id?: string | null;
2331
+ notes?: string | null;
2332
+ order_number?: string;
2333
+ status?: string;
2334
+ supplier_id?: string | null;
2335
+ supplier_name?: string;
2336
+ updated_at?: string;
2337
+ };
2338
+ Relationships: [{
2339
+ foreignKeyName: "purchase_orders_location_id_fkey";
2340
+ columns: ["location_id"];
2341
+ isOneToOne: false;
2342
+ referencedRelation: "locations";
2343
+ referencedColumns: ["id"];
2344
+ }, {
2345
+ foreignKeyName: "purchase_orders_supplier_id_fkey";
2346
+ columns: ["supplier_id"];
2347
+ isOneToOne: false;
2348
+ referencedRelation: "suppliers";
2349
+ referencedColumns: ["id"];
2350
+ }];
2351
+ };
2352
+ supplier_products: {
2353
+ Row: {
2354
+ article_number: string | null;
2355
+ created_at: string;
2356
+ id: string;
2357
+ name: string;
2358
+ notes: string | null;
2359
+ pot_size: string | null;
2360
+ price: number | null;
2361
+ quantity: number | null;
2362
+ supplier_id: string;
2363
+ unit: string;
2364
+ updated_at: string;
2365
+ };
2366
+ Insert: {
2367
+ article_number?: string | null;
2368
+ created_at?: string;
2369
+ id?: string;
2370
+ name: string;
2371
+ notes?: string | null;
2372
+ pot_size?: string | null;
2373
+ price?: number | null;
2374
+ quantity?: number | null;
2375
+ supplier_id: string;
2376
+ unit?: string;
2377
+ updated_at?: string;
2378
+ };
2379
+ Update: {
2380
+ article_number?: string | null;
2381
+ created_at?: string;
2382
+ id?: string;
2383
+ name?: string;
2384
+ notes?: string | null;
2385
+ pot_size?: string | null;
2386
+ price?: number | null;
2387
+ quantity?: number | null;
2388
+ supplier_id?: string;
2389
+ unit?: string;
2390
+ updated_at?: string;
2391
+ };
2392
+ Relationships: [{
2393
+ foreignKeyName: "supplier_products_supplier_id_fkey";
2394
+ columns: ["supplier_id"];
2395
+ isOneToOne: false;
2396
+ referencedRelation: "suppliers";
2397
+ referencedColumns: ["id"];
2398
+ }];
2399
+ };
2400
+ suppliers: {
2401
+ Row: {
2402
+ address: string | null;
2403
+ column_mappings: import("../integrations/supabase/types").Json | null;
2404
+ contact_person: string | null;
2405
+ created_at: string;
2406
+ default_product_type: string;
2407
+ email: string | null;
2408
+ id: string;
2409
+ imported_file_name: string | null;
2410
+ name: string;
2411
+ notes: string | null;
2412
+ phone: string | null;
2413
+ updated_at: string;
2414
+ };
2415
+ Insert: {
2416
+ address?: string | null;
2417
+ column_mappings?: import("../integrations/supabase/types").Json | null;
2418
+ contact_person?: string | null;
2419
+ created_at?: string;
2420
+ default_product_type?: string;
2421
+ email?: string | null;
2422
+ id?: string;
2423
+ imported_file_name?: string | null;
2424
+ name: string;
2425
+ notes?: string | null;
2426
+ phone?: string | null;
2427
+ updated_at?: string;
2428
+ };
2429
+ Update: {
2430
+ address?: string | null;
2431
+ column_mappings?: import("../integrations/supabase/types").Json | null;
2432
+ contact_person?: string | null;
2433
+ created_at?: string;
2434
+ default_product_type?: string;
2435
+ email?: string | null;
2436
+ id?: string;
2437
+ imported_file_name?: string | null;
2438
+ name?: string;
2439
+ notes?: string | null;
2440
+ phone?: string | null;
2441
+ updated_at?: string;
2442
+ };
2443
+ Relationships: [];
2444
+ };
2445
+ trade_item_drafts: {
2446
+ Row: {
2447
+ connection_id: string | null;
2448
+ created_at: string;
2449
+ data: import("../integrations/supabase/types").Json;
2450
+ id: string;
2451
+ updated_at: string;
2452
+ user_id: string;
2453
+ };
2454
+ Insert: {
2455
+ connection_id?: string | null;
2456
+ created_at?: string;
2457
+ data?: import("../integrations/supabase/types").Json;
2458
+ id?: string;
2459
+ updated_at?: string;
2460
+ user_id: string;
2461
+ };
2462
+ Update: {
2463
+ connection_id?: string | null;
2464
+ created_at?: string;
2465
+ data?: import("../integrations/supabase/types").Json;
2466
+ id?: string;
2467
+ updated_at?: string;
2468
+ user_id?: string;
2469
+ };
2470
+ Relationships: [];
2471
+ };
2472
+ user_roles: {
2473
+ Row: {
2474
+ created_at: string;
2475
+ id: string;
2476
+ role: import("../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
2477
+ user_id: string;
2478
+ };
2479
+ Insert: {
2480
+ created_at?: string;
2481
+ id?: string;
2482
+ role: import("../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
2483
+ user_id: string;
2484
+ };
2485
+ Update: {
2486
+ created_at?: string;
2487
+ id?: string;
2488
+ role?: import("../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
2489
+ user_id?: string;
2490
+ };
2491
+ Relationships: [{
2492
+ foreignKeyName: "user_roles_user_id_fkey";
2493
+ columns: ["user_id"];
2494
+ isOneToOne: false;
2495
+ referencedRelation: "profiles";
2496
+ referencedColumns: ["id"];
2497
+ }];
2498
+ };
2499
+ };
2500
+ Views: { [_ in never]: never; };
2501
+ Functions: {
2502
+ dashboard_list_public_schema: {
2503
+ Args: never;
2504
+ Returns: {
2505
+ column_name: string;
2506
+ data_type: string;
2507
+ table_name: string;
2508
+ }[];
2509
+ };
2510
+ exact_decrypt: {
2511
+ Args: {
2512
+ cipher: string;
2513
+ };
2514
+ Returns: string;
2515
+ };
2516
+ exact_encrypt: {
2517
+ Args: {
2518
+ plain: string;
2519
+ };
2520
+ Returns: string;
2521
+ };
2522
+ get_offer_by_link_code: {
2523
+ Args: {
2524
+ p_code: string;
2525
+ };
2526
+ Returns: import("../integrations/supabase/types").Json;
2527
+ };
2528
+ has_role: {
2529
+ Args: {
2530
+ _role: import("../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
2531
+ _user_id: string;
2532
+ };
2533
+ Returns: boolean;
2534
+ };
2535
+ schedule_floriday_network_sync: {
2536
+ Args: {
2537
+ p_apikey: string;
2538
+ p_url: string;
2539
+ };
2540
+ Returns: number;
2541
+ };
2542
+ schedule_floriday_token_refresh: {
2543
+ Args: {
2544
+ p_apikey: string;
2545
+ p_url: string;
2546
+ };
2547
+ Returns: number;
2548
+ };
2549
+ show_limit: {
2550
+ Args: never;
2551
+ Returns: number;
2552
+ };
2553
+ show_trgm: {
2554
+ Args: {
2555
+ "": string;
2556
+ };
2557
+ Returns: string[];
2558
+ };
2559
+ };
2560
+ Enums: {
2561
+ app_role: "admin" | "manager" | "warehouse" | "sales" | "developer";
2562
+ exact_env: "staging" | "live";
2563
+ };
2564
+ CompositeTypes: { [_ in never]: never; };
2565
+ }, {
2566
+ PostgrestVersion: "14.5";
2567
+ }>;
2568
+ userId: string;
2569
+ claims: import("@supabase/auth-js").JwtPayload;
2570
+ }, undefined, undefined, undefined>], (input: RunBlockQueryInput) => RunBlockQueryInput, Promise<{
2571
+ count: any;
2572
+ rows: [];
2573
+ value?: undefined;
2574
+ } | {
2575
+ count: 0;
2576
+ value: number;
2577
+ rows: [];
2578
+ } | {
2579
+ count: 0;
2580
+ rows: any[];
2581
+ value?: undefined;
2582
+ }>>;
2583
+ //# sourceMappingURL=query.functions.d.ts.map