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