@flowselections/floriday-verkoop-module 1.0.21 → 1.0.25

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 (95) hide show
  1. package/dist-lib/components/karindeling/AfmetingenTab.d.ts +6 -0
  2. package/dist-lib/components/karindeling/AfmetingenTab.d.ts.map +1 -0
  3. package/dist-lib/components/karindeling/AfmetingenTab.js +128 -0
  4. package/dist-lib/components/karindeling/KarindelingPage.d.ts +2 -0
  5. package/dist-lib/components/karindeling/KarindelingPage.d.ts.map +1 -0
  6. package/dist-lib/components/karindeling/KarindelingPage.js +102 -0
  7. package/dist-lib/components/verkoop/OrderKarindelingCard.d.ts.map +1 -1
  8. package/dist-lib/components/verkoop/OrderKarindelingCard.js +83 -37
  9. package/dist-lib/components/verkoop/SalesOrderDetailPage.d.ts.map +1 -1
  10. package/dist-lib/components/verkoop/SalesOrderDetailPage.js +59 -8
  11. package/dist-lib/components/verkoop/SalesOrderDetailView.d.ts +2 -1
  12. package/dist-lib/components/verkoop/SalesOrderDetailView.d.ts.map +1 -1
  13. package/dist-lib/components/verkoop/SalesOrderDetailView.js +2 -2
  14. package/dist-lib/components/verkoop/SalesOrdersTable.d.ts.map +1 -1
  15. package/dist-lib/components/verkoop/SalesOrdersTable.js +36 -4
  16. package/dist-lib/components/verkoop/VerkoopOrdersPage.d.ts.map +1 -1
  17. package/dist-lib/components/verkoop/VerkoopOrdersPage.js +18 -2
  18. package/dist-lib/index.d.ts +1 -0
  19. package/dist-lib/index.d.ts.map +1 -1
  20. package/dist-lib/index.js +12 -1
  21. package/dist-lib/integrations/supabase/auth-middleware.d.ts +2353 -374
  22. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  23. package/dist-lib/integrations/supabase/client.d.ts +2353 -374
  24. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  25. package/dist-lib/integrations/supabase/client.js +24 -9
  26. package/dist-lib/integrations/supabase/client.server.d.ts +2353 -374
  27. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  28. package/dist-lib/integrations/supabase/types.d.ts +2406 -376
  29. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  30. package/dist-lib/integrations/supabase/types.js +11 -9
  31. package/dist-lib/lib/cart-lock.functions.d.ts +2353 -374
  32. package/dist-lib/lib/cart-lock.functions.d.ts.map +1 -1
  33. package/dist-lib/lib/cart-planner.d.ts +9 -1
  34. package/dist-lib/lib/cart-planner.d.ts.map +1 -1
  35. package/dist-lib/lib/cart-planner.js +21 -4
  36. package/dist-lib/lib/cart-planning-settings.functions.d.ts +152282 -0
  37. package/dist-lib/lib/cart-planning-settings.functions.d.ts.map +1 -0
  38. package/dist-lib/lib/cart-planning-settings.functions.js +375 -0
  39. package/dist-lib/lib/cart-replan.functions.d.ts +18468 -651
  40. package/dist-lib/lib/cart-replan.functions.d.ts.map +1 -1
  41. package/dist-lib/lib/cart-replan.functions.js +85 -27
  42. package/dist-lib/lib/create-order.functions.d.ts +25367 -1619
  43. package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
  44. package/dist-lib/lib/cron/index.d.ts +5 -0
  45. package/dist-lib/lib/cron/index.d.ts.map +1 -0
  46. package/dist-lib/lib/cron/index.js +4 -0
  47. package/dist-lib/lib/cron/mirror-floriday-orders.d.ts +4 -0
  48. package/dist-lib/lib/cron/mirror-floriday-orders.d.ts.map +1 -0
  49. package/dist-lib/lib/cron/mirror-floriday-orders.js +23 -0
  50. package/dist-lib/lib/cron/replan-carts.d.ts +4 -0
  51. package/dist-lib/lib/cron/replan-carts.d.ts.map +1 -0
  52. package/dist-lib/lib/cron/replan-carts.js +18 -0
  53. package/dist-lib/lib/cron/sync-salesorders.d.ts +4 -0
  54. package/dist-lib/lib/cron/sync-salesorders.d.ts.map +1 -0
  55. package/dist-lib/lib/cron/sync-salesorders.js +18 -0
  56. package/dist-lib/lib/cron/sync-tradeitems.d.ts +4 -0
  57. package/dist-lib/lib/cron/sync-tradeitems.d.ts.map +1 -0
  58. package/dist-lib/lib/cron/sync-tradeitems.js +18 -0
  59. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts +6539 -602
  60. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts.map +1 -1
  61. package/dist-lib/lib/floriday-auto-fulfillment.server.js +1 -1
  62. package/dist-lib/lib/floriday-central-token.server.d.ts +12 -0
  63. package/dist-lib/lib/floriday-central-token.server.d.ts.map +1 -0
  64. package/dist-lib/lib/floriday-central-token.server.js +58 -0
  65. package/dist-lib/lib/floriday-gateway.server.d.ts +2 -2
  66. package/dist-lib/lib/floriday-gateway.server.d.ts.map +1 -1
  67. package/dist-lib/lib/floriday-gateway.server.js +10 -37
  68. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts +2353 -374
  69. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts.map +1 -1
  70. package/dist-lib/lib/floriday-logistic-labels.functions.js +14 -4
  71. package/dist-lib/lib/floriday-mirror.functions.d.ts +13846 -0
  72. package/dist-lib/lib/floriday-mirror.functions.d.ts.map +1 -0
  73. package/dist-lib/lib/floriday-mirror.functions.js +278 -0
  74. package/dist-lib/lib/floriday-public.functions.d.ts +14907 -1054
  75. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  76. package/dist-lib/lib/floriday-sync.d.ts +0 -1
  77. package/dist-lib/lib/floriday-sync.d.ts.map +1 -1
  78. package/dist-lib/lib/floriday-sync.js +1 -1
  79. package/dist-lib/lib/floriday-writes.functions.d.ts +10723 -828
  80. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  81. package/dist-lib/lib/order-buffers.functions.d.ts +41540 -0
  82. package/dist-lib/lib/order-buffers.functions.d.ts.map +1 -0
  83. package/dist-lib/lib/order-buffers.functions.js +244 -0
  84. package/dist-lib/lib/order-shipments.functions.d.ts +8631 -715
  85. package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -1
  86. package/dist-lib/lib/salesorders-mapping.d.ts +3 -0
  87. package/dist-lib/lib/salesorders-mapping.d.ts.map +1 -1
  88. package/dist-lib/lib/salesorders.functions.d.ts +10725 -828
  89. package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
  90. package/dist-lib/lib/salesorders.functions.js +129 -3
  91. package/dist-lib/lib/tradeitems.functions.d.ts +2353 -374
  92. package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
  93. package/dist-lib/lib/useSalesOrdersQuery.d.ts.map +1 -1
  94. package/dist-lib/lib/useSalesOrdersQuery.js +37 -2
  95. package/package.json +27 -5
@@ -247,12 +247,100 @@ export type Database = {
247
247
  };
248
248
  Relationships: [];
249
249
  };
250
+ ai_admin_credentials: {
251
+ Row: {
252
+ active: boolean;
253
+ admin_key: string;
254
+ created_at: string;
255
+ id: string;
256
+ label: string;
257
+ provider_id: string;
258
+ updated_at: string;
259
+ };
260
+ Insert: {
261
+ active?: boolean;
262
+ admin_key: string;
263
+ created_at?: string;
264
+ id?: string;
265
+ label: string;
266
+ provider_id: string;
267
+ updated_at?: string;
268
+ };
269
+ Update: {
270
+ active?: boolean;
271
+ admin_key?: string;
272
+ created_at?: string;
273
+ id?: string;
274
+ label?: string;
275
+ provider_id?: string;
276
+ updated_at?: string;
277
+ };
278
+ Relationships: [
279
+ {
280
+ foreignKeyName: "ai_admin_credentials_provider_id_fkey";
281
+ columns: ["provider_id"];
282
+ isOneToOne: true;
283
+ referencedRelation: "ai_providers";
284
+ referencedColumns: ["id"];
285
+ }
286
+ ];
287
+ };
288
+ ai_call_log: {
289
+ Row: {
290
+ consumer_module_id: string;
291
+ cost_usd: number | null;
292
+ created_at: string;
293
+ created_by: string | null;
294
+ duration_ms: number | null;
295
+ error_code: string | null;
296
+ error_message: string | null;
297
+ id: string;
298
+ input_tokens: number;
299
+ model_slug: string | null;
300
+ output_tokens: number;
301
+ provider_slug: string | null;
302
+ status: string;
303
+ total_tokens: number;
304
+ };
305
+ Insert: {
306
+ consumer_module_id: string;
307
+ cost_usd?: number | null;
308
+ created_at?: string;
309
+ created_by?: string | null;
310
+ duration_ms?: number | null;
311
+ error_code?: string | null;
312
+ error_message?: string | null;
313
+ id?: string;
314
+ input_tokens?: number;
315
+ model_slug?: string | null;
316
+ output_tokens?: number;
317
+ provider_slug?: string | null;
318
+ status: string;
319
+ total_tokens?: number;
320
+ };
321
+ Update: {
322
+ consumer_module_id?: string;
323
+ cost_usd?: number | null;
324
+ created_at?: string;
325
+ created_by?: string | null;
326
+ duration_ms?: number | null;
327
+ error_code?: string | null;
328
+ error_message?: string | null;
329
+ id?: string;
330
+ input_tokens?: number;
331
+ model_slug?: string | null;
332
+ output_tokens?: number;
333
+ provider_slug?: string | null;
334
+ status?: string;
335
+ total_tokens?: number;
336
+ };
337
+ Relationships: [];
338
+ };
250
339
  ai_credentials: {
251
340
  Row: {
252
341
  active: boolean;
253
342
  api_key: string;
254
343
  created_at: string;
255
- created_by: string | null;
256
344
  id: string;
257
345
  label: string;
258
346
  provider_id: string;
@@ -262,7 +350,6 @@ export type Database = {
262
350
  active?: boolean;
263
351
  api_key: string;
264
352
  created_at?: string;
265
- created_by?: string | null;
266
353
  id?: string;
267
354
  label: string;
268
355
  provider_id: string;
@@ -272,7 +359,6 @@ export type Database = {
272
359
  active?: boolean;
273
360
  api_key?: string;
274
361
  created_at?: string;
275
- created_by?: string | null;
276
362
  id?: string;
277
363
  label?: string;
278
364
  provider_id?: string;
@@ -288,6 +374,75 @@ export type Database = {
288
374
  }
289
375
  ];
290
376
  };
377
+ ai_goals: {
378
+ Row: {
379
+ active: boolean;
380
+ created_at: string;
381
+ description: string | null;
382
+ key: string;
383
+ label: string;
384
+ sort_order: number;
385
+ updated_at: string;
386
+ };
387
+ Insert: {
388
+ active?: boolean;
389
+ created_at?: string;
390
+ description?: string | null;
391
+ key: string;
392
+ label: string;
393
+ sort_order?: number;
394
+ updated_at?: string;
395
+ };
396
+ Update: {
397
+ active?: boolean;
398
+ created_at?: string;
399
+ description?: string | null;
400
+ key?: string;
401
+ label?: string;
402
+ sort_order?: number;
403
+ updated_at?: string;
404
+ };
405
+ Relationships: [];
406
+ };
407
+ ai_model_pricing: {
408
+ Row: {
409
+ created_at: string;
410
+ currency: string;
411
+ fetched_at: string;
412
+ id: string;
413
+ input_per_mtok: number | null;
414
+ model_slug: string;
415
+ output_per_mtok: number | null;
416
+ provider_slug: string;
417
+ source: string;
418
+ updated_at: string;
419
+ };
420
+ Insert: {
421
+ created_at?: string;
422
+ currency?: string;
423
+ fetched_at?: string;
424
+ id?: string;
425
+ input_per_mtok?: number | null;
426
+ model_slug: string;
427
+ output_per_mtok?: number | null;
428
+ provider_slug: string;
429
+ source?: string;
430
+ updated_at?: string;
431
+ };
432
+ Update: {
433
+ created_at?: string;
434
+ currency?: string;
435
+ fetched_at?: string;
436
+ id?: string;
437
+ input_per_mtok?: number | null;
438
+ model_slug?: string;
439
+ output_per_mtok?: number | null;
440
+ provider_slug?: string;
441
+ source?: string;
442
+ updated_at?: string;
443
+ };
444
+ Relationships: [];
445
+ };
291
446
  ai_models: {
292
447
  Row: {
293
448
  active: boolean;
@@ -1051,6 +1206,143 @@ export type Database = {
1051
1206
  };
1052
1207
  Relationships: [];
1053
1208
  };
1209
+ cart_planning_pick_times: {
1210
+ Row: {
1211
+ created_at: string;
1212
+ id: string;
1213
+ pot_size: string;
1214
+ seconds_per_cart: number;
1215
+ updated_at: string;
1216
+ };
1217
+ Insert: {
1218
+ created_at?: string;
1219
+ id?: string;
1220
+ pot_size: string;
1221
+ seconds_per_cart: number;
1222
+ updated_at?: string;
1223
+ };
1224
+ Update: {
1225
+ created_at?: string;
1226
+ id?: string;
1227
+ pot_size?: string;
1228
+ seconds_per_cart?: number;
1229
+ updated_at?: string;
1230
+ };
1231
+ Relationships: [];
1232
+ };
1233
+ cart_planning_product_overrides: {
1234
+ Row: {
1235
+ created_at: string;
1236
+ id: string;
1237
+ max_party_share_per_layer_pct_override: number | null;
1238
+ never_mix: boolean;
1239
+ notes: string | null;
1240
+ product_id: string;
1241
+ updated_at: string;
1242
+ };
1243
+ Insert: {
1244
+ created_at?: string;
1245
+ id?: string;
1246
+ max_party_share_per_layer_pct_override?: number | null;
1247
+ never_mix?: boolean;
1248
+ notes?: string | null;
1249
+ product_id: string;
1250
+ updated_at?: string;
1251
+ };
1252
+ Update: {
1253
+ created_at?: string;
1254
+ id?: string;
1255
+ max_party_share_per_layer_pct_override?: number | null;
1256
+ never_mix?: boolean;
1257
+ notes?: string | null;
1258
+ product_id?: string;
1259
+ updated_at?: string;
1260
+ };
1261
+ Relationships: [
1262
+ {
1263
+ foreignKeyName: "cart_planning_product_overrides_product_id_fkey";
1264
+ columns: ["product_id"];
1265
+ isOneToOne: true;
1266
+ referencedRelation: "products";
1267
+ referencedColumns: ["id"];
1268
+ }
1269
+ ];
1270
+ };
1271
+ cart_planning_settings: {
1272
+ Row: {
1273
+ allow_editing_after_pickstation_send: boolean;
1274
+ buffer_grouping_mode: string;
1275
+ combine_floriday_orders: boolean;
1276
+ combine_floriday_orders_window: string;
1277
+ combine_orders_scope: string;
1278
+ default_workers: number;
1279
+ id: number;
1280
+ max_beladingen_per_layer: number;
1281
+ max_customers_per_cart: number;
1282
+ max_one_customer_per_layer: boolean;
1283
+ max_party_share_per_layer_pct: number;
1284
+ optimization_strategy: string;
1285
+ own_cart_from_layers: number;
1286
+ pick_time_mode: string;
1287
+ plants_per_day: number;
1288
+ plants_per_hour: number;
1289
+ require_same_carrier: boolean;
1290
+ require_same_crate_type: boolean;
1291
+ require_same_delivery_date: boolean;
1292
+ require_same_delivery_location: boolean;
1293
+ updated_at: string;
1294
+ updated_by: string | null;
1295
+ };
1296
+ Insert: {
1297
+ allow_editing_after_pickstation_send?: boolean;
1298
+ buffer_grouping_mode?: string;
1299
+ combine_floriday_orders?: boolean;
1300
+ combine_floriday_orders_window?: string;
1301
+ combine_orders_scope?: string;
1302
+ default_workers?: number;
1303
+ id?: number;
1304
+ max_beladingen_per_layer?: number;
1305
+ max_customers_per_cart?: number;
1306
+ max_one_customer_per_layer?: boolean;
1307
+ max_party_share_per_layer_pct?: number;
1308
+ optimization_strategy?: string;
1309
+ own_cart_from_layers?: number;
1310
+ pick_time_mode?: string;
1311
+ plants_per_day?: number;
1312
+ plants_per_hour?: number;
1313
+ require_same_carrier?: boolean;
1314
+ require_same_crate_type?: boolean;
1315
+ require_same_delivery_date?: boolean;
1316
+ require_same_delivery_location?: boolean;
1317
+ updated_at?: string;
1318
+ updated_by?: string | null;
1319
+ };
1320
+ Update: {
1321
+ allow_editing_after_pickstation_send?: boolean;
1322
+ buffer_grouping_mode?: string;
1323
+ combine_floriday_orders?: boolean;
1324
+ combine_floriday_orders_window?: string;
1325
+ combine_orders_scope?: string;
1326
+ default_workers?: number;
1327
+ id?: number;
1328
+ max_beladingen_per_layer?: number;
1329
+ max_customers_per_cart?: number;
1330
+ max_one_customer_per_layer?: boolean;
1331
+ max_party_share_per_layer_pct?: number;
1332
+ optimization_strategy?: string;
1333
+ own_cart_from_layers?: number;
1334
+ pick_time_mode?: string;
1335
+ plants_per_day?: number;
1336
+ plants_per_hour?: number;
1337
+ require_same_carrier?: boolean;
1338
+ require_same_crate_type?: boolean;
1339
+ require_same_delivery_date?: boolean;
1340
+ require_same_delivery_location?: boolean;
1341
+ updated_at?: string;
1342
+ updated_by?: string | null;
1343
+ };
1344
+ Relationships: [];
1345
+ };
1054
1346
  cart_replan_queue: {
1055
1347
  Row: {
1056
1348
  attempts: number;
@@ -1083,106 +1375,232 @@ export type Database = {
1083
1375
  }
1084
1376
  ];
1085
1377
  };
1086
- collections: {
1378
+ cart_types: {
1087
1379
  Row: {
1088
1380
  created_at: string;
1089
- created_by: string | null;
1090
1381
  id: string;
1382
+ is_default: boolean;
1383
+ layer_length_cm: number;
1384
+ layer_width_cm: number;
1385
+ layers_per_cart: number;
1091
1386
  name: string;
1092
1387
  updated_at: string;
1093
1388
  };
1094
1389
  Insert: {
1095
1390
  created_at?: string;
1096
- created_by?: string | null;
1097
1391
  id?: string;
1392
+ is_default?: boolean;
1393
+ layer_length_cm: number;
1394
+ layer_width_cm: number;
1395
+ layers_per_cart?: number;
1098
1396
  name: string;
1099
1397
  updated_at?: string;
1100
1398
  };
1101
1399
  Update: {
1102
1400
  created_at?: string;
1103
- created_by?: string | null;
1104
1401
  id?: string;
1402
+ is_default?: boolean;
1403
+ layer_length_cm?: number;
1404
+ layer_width_cm?: number;
1405
+ layers_per_cart?: number;
1105
1406
  name?: string;
1106
1407
  updated_at?: string;
1107
1408
  };
1108
1409
  Relationships: [];
1109
1410
  };
1110
- customer_audit_log: {
1411
+ catalog_articles_cache: {
1111
1412
  Row: {
1112
- action: string;
1113
- changes: Json;
1114
1413
  created_at: string;
1115
- customer_id: string;
1414
+ default_price: number;
1415
+ default_vat_rate_ref: string | null;
1416
+ external_ref: string;
1116
1417
  id: string;
1117
- user_id: string | null;
1418
+ name: string;
1419
+ updated_at: string;
1420
+ user_id: string;
1118
1421
  };
1119
1422
  Insert: {
1120
- action: string;
1121
- changes?: Json;
1122
1423
  created_at?: string;
1123
- customer_id: string;
1424
+ default_price?: number;
1425
+ default_vat_rate_ref?: string | null;
1426
+ external_ref: string;
1124
1427
  id?: string;
1125
- user_id?: string | null;
1428
+ name: string;
1429
+ updated_at?: string;
1430
+ user_id: string;
1126
1431
  };
1127
1432
  Update: {
1128
- action?: string;
1129
- changes?: Json;
1130
1433
  created_at?: string;
1131
- customer_id?: string;
1434
+ default_price?: number;
1435
+ default_vat_rate_ref?: string | null;
1436
+ external_ref?: string;
1132
1437
  id?: string;
1133
- user_id?: string | null;
1438
+ name?: string;
1439
+ updated_at?: string;
1440
+ user_id?: string;
1134
1441
  };
1135
- Relationships: [
1136
- {
1137
- foreignKeyName: "customer_audit_log_customer_id_fkey";
1138
- columns: ["customer_id"];
1139
- isOneToOne: false;
1140
- referencedRelation: "customers";
1141
- referencedColumns: ["id"];
1142
- }
1143
- ];
1442
+ Relationships: [];
1144
1443
  };
1145
- customer_contacts: {
1444
+ catalog_vat_rates_cache: {
1146
1445
  Row: {
1147
1446
  created_at: string;
1148
- customer_id: string;
1149
- email: string | null;
1150
- floriday_contact_id: string | null;
1151
- full_name: string;
1447
+ external_ref: string;
1152
1448
  id: string;
1153
- is_active: boolean;
1154
- job_title: string | null;
1155
- phone: string | null;
1156
- photo_url: string | null;
1157
- raw: Json | null;
1449
+ label: string;
1450
+ percentage: number;
1158
1451
  updated_at: string;
1452
+ user_id: string;
1159
1453
  };
1160
1454
  Insert: {
1161
1455
  created_at?: string;
1162
- customer_id: string;
1163
- email?: string | null;
1164
- floriday_contact_id?: string | null;
1165
- full_name: string;
1456
+ external_ref: string;
1166
1457
  id?: string;
1167
- is_active?: boolean;
1168
- job_title?: string | null;
1169
- phone?: string | null;
1170
- photo_url?: string | null;
1171
- raw?: Json | null;
1458
+ label: string;
1459
+ percentage?: number;
1172
1460
  updated_at?: string;
1461
+ user_id: string;
1173
1462
  };
1174
1463
  Update: {
1175
1464
  created_at?: string;
1176
- customer_id?: string;
1177
- email?: string | null;
1178
- floriday_contact_id?: string | null;
1179
- full_name?: string;
1465
+ external_ref?: string;
1180
1466
  id?: string;
1181
- is_active?: boolean;
1182
- job_title?: string | null;
1183
- phone?: string | null;
1184
- photo_url?: string | null;
1185
- raw?: Json | null;
1467
+ label?: string;
1468
+ percentage?: number;
1469
+ updated_at?: string;
1470
+ user_id?: string;
1471
+ };
1472
+ Relationships: [];
1473
+ };
1474
+ collections: {
1475
+ Row: {
1476
+ created_at: string;
1477
+ created_by: string | null;
1478
+ id: string;
1479
+ name: string;
1480
+ updated_at: string;
1481
+ };
1482
+ Insert: {
1483
+ created_at?: string;
1484
+ created_by?: string | null;
1485
+ id?: string;
1486
+ name: string;
1487
+ updated_at?: string;
1488
+ };
1489
+ Update: {
1490
+ created_at?: string;
1491
+ created_by?: string | null;
1492
+ id?: string;
1493
+ name?: string;
1494
+ updated_at?: string;
1495
+ };
1496
+ Relationships: [];
1497
+ };
1498
+ crate_types: {
1499
+ Row: {
1500
+ created_at: string;
1501
+ id: string;
1502
+ length_cm: number;
1503
+ name: string;
1504
+ plants_per_crate: number;
1505
+ updated_at: string;
1506
+ width_cm: number;
1507
+ };
1508
+ Insert: {
1509
+ created_at?: string;
1510
+ id?: string;
1511
+ length_cm: number;
1512
+ name: string;
1513
+ plants_per_crate?: number;
1514
+ updated_at?: string;
1515
+ width_cm: number;
1516
+ };
1517
+ Update: {
1518
+ created_at?: string;
1519
+ id?: string;
1520
+ length_cm?: number;
1521
+ name?: string;
1522
+ plants_per_crate?: number;
1523
+ updated_at?: string;
1524
+ width_cm?: number;
1525
+ };
1526
+ Relationships: [];
1527
+ };
1528
+ customer_audit_log: {
1529
+ Row: {
1530
+ action: string;
1531
+ changes: Json;
1532
+ created_at: string;
1533
+ customer_id: string;
1534
+ id: string;
1535
+ user_id: string | null;
1536
+ };
1537
+ Insert: {
1538
+ action: string;
1539
+ changes?: Json;
1540
+ created_at?: string;
1541
+ customer_id: string;
1542
+ id?: string;
1543
+ user_id?: string | null;
1544
+ };
1545
+ Update: {
1546
+ action?: string;
1547
+ changes?: Json;
1548
+ created_at?: string;
1549
+ customer_id?: string;
1550
+ id?: string;
1551
+ user_id?: string | null;
1552
+ };
1553
+ Relationships: [
1554
+ {
1555
+ foreignKeyName: "customer_audit_log_customer_id_fkey";
1556
+ columns: ["customer_id"];
1557
+ isOneToOne: false;
1558
+ referencedRelation: "customers";
1559
+ referencedColumns: ["id"];
1560
+ }
1561
+ ];
1562
+ };
1563
+ customer_contacts: {
1564
+ Row: {
1565
+ created_at: string;
1566
+ customer_id: string;
1567
+ email: string | null;
1568
+ floriday_contact_id: string | null;
1569
+ full_name: string;
1570
+ id: string;
1571
+ is_active: boolean;
1572
+ job_title: string | null;
1573
+ phone: string | null;
1574
+ photo_url: string | null;
1575
+ raw: Json | null;
1576
+ updated_at: string;
1577
+ };
1578
+ Insert: {
1579
+ created_at?: string;
1580
+ customer_id: string;
1581
+ email?: string | null;
1582
+ floriday_contact_id?: string | null;
1583
+ full_name: string;
1584
+ id?: string;
1585
+ is_active?: boolean;
1586
+ job_title?: string | null;
1587
+ phone?: string | null;
1588
+ photo_url?: string | null;
1589
+ raw?: Json | null;
1590
+ updated_at?: string;
1591
+ };
1592
+ Update: {
1593
+ created_at?: string;
1594
+ customer_id?: string;
1595
+ email?: string | null;
1596
+ floriday_contact_id?: string | null;
1597
+ full_name?: string;
1598
+ id?: string;
1599
+ is_active?: boolean;
1600
+ job_title?: string | null;
1601
+ phone?: string | null;
1602
+ photo_url?: string | null;
1603
+ raw?: Json | null;
1186
1604
  updated_at?: string;
1187
1605
  };
1188
1606
  Relationships: [
@@ -1341,6 +1759,107 @@ export type Database = {
1341
1759
  };
1342
1760
  Relationships: [];
1343
1761
  };
1762
+ customer_price_group_members: {
1763
+ Row: {
1764
+ created_at: string;
1765
+ customer_key: string;
1766
+ id: string;
1767
+ owner_id: string;
1768
+ price_group_id: string;
1769
+ };
1770
+ Insert: {
1771
+ created_at?: string;
1772
+ customer_key: string;
1773
+ id?: string;
1774
+ owner_id?: string;
1775
+ price_group_id: string;
1776
+ };
1777
+ Update: {
1778
+ created_at?: string;
1779
+ customer_key?: string;
1780
+ id?: string;
1781
+ owner_id?: string;
1782
+ price_group_id?: string;
1783
+ };
1784
+ Relationships: [
1785
+ {
1786
+ foreignKeyName: "customer_price_group_members_price_group_id_fkey";
1787
+ columns: ["price_group_id"];
1788
+ isOneToOne: false;
1789
+ referencedRelation: "customer_price_groups";
1790
+ referencedColumns: ["id"];
1791
+ }
1792
+ ];
1793
+ };
1794
+ customer_price_groups: {
1795
+ Row: {
1796
+ calc_type: string | null;
1797
+ calc_value: number | null;
1798
+ calc_value_type: string | null;
1799
+ created_at: string;
1800
+ currency: string;
1801
+ distribute_over: string | null;
1802
+ group_type: string;
1803
+ handling_fee: number | null;
1804
+ id: string;
1805
+ include_stickers: boolean;
1806
+ is_active: boolean;
1807
+ name: string;
1808
+ owner_id: string;
1809
+ price_scope: string;
1810
+ pricing_mode: string;
1811
+ rounding: string;
1812
+ rounding_step: number;
1813
+ sort_order: number;
1814
+ unit: string;
1815
+ updated_at: string;
1816
+ };
1817
+ Insert: {
1818
+ calc_type?: string | null;
1819
+ calc_value?: number | null;
1820
+ calc_value_type?: string | null;
1821
+ created_at?: string;
1822
+ currency?: string;
1823
+ distribute_over?: string | null;
1824
+ group_type?: string;
1825
+ handling_fee?: number | null;
1826
+ id?: string;
1827
+ include_stickers?: boolean;
1828
+ is_active?: boolean;
1829
+ name: string;
1830
+ owner_id?: string;
1831
+ price_scope?: string;
1832
+ pricing_mode?: string;
1833
+ rounding?: string;
1834
+ rounding_step?: number;
1835
+ sort_order?: number;
1836
+ unit?: string;
1837
+ updated_at?: string;
1838
+ };
1839
+ Update: {
1840
+ calc_type?: string | null;
1841
+ calc_value?: number | null;
1842
+ calc_value_type?: string | null;
1843
+ created_at?: string;
1844
+ currency?: string;
1845
+ distribute_over?: string | null;
1846
+ group_type?: string;
1847
+ handling_fee?: number | null;
1848
+ id?: string;
1849
+ include_stickers?: boolean;
1850
+ is_active?: boolean;
1851
+ name?: string;
1852
+ owner_id?: string;
1853
+ price_scope?: string;
1854
+ pricing_mode?: string;
1855
+ rounding?: string;
1856
+ rounding_step?: number;
1857
+ sort_order?: number;
1858
+ unit?: string;
1859
+ updated_at?: string;
1860
+ };
1861
+ Relationships: [];
1862
+ };
1344
1863
  customer_selected_assortment: {
1345
1864
  Row: {
1346
1865
  article_number: string | null;
@@ -1498,6 +2017,10 @@ export type Database = {
1498
2017
  sync_error: string | null;
1499
2018
  sync_status: string;
1500
2019
  trade_forms: string[];
2020
+ twinfield_code: string | null;
2021
+ twinfield_last_hash: string | null;
2022
+ twinfield_sync_error: string | null;
2023
+ twinfield_synced_at: string | null;
1501
2024
  updated_at: string;
1502
2025
  vat_display: string | null;
1503
2026
  vat_number: string | null;
@@ -1565,6 +2088,10 @@ export type Database = {
1565
2088
  sync_error?: string | null;
1566
2089
  sync_status?: string;
1567
2090
  trade_forms?: string[];
2091
+ twinfield_code?: string | null;
2092
+ twinfield_last_hash?: string | null;
2093
+ twinfield_sync_error?: string | null;
2094
+ twinfield_synced_at?: string | null;
1568
2095
  updated_at?: string;
1569
2096
  vat_display?: string | null;
1570
2097
  vat_number?: string | null;
@@ -1632,6 +2159,10 @@ export type Database = {
1632
2159
  sync_error?: string | null;
1633
2160
  sync_status?: string;
1634
2161
  trade_forms?: string[];
2162
+ twinfield_code?: string | null;
2163
+ twinfield_last_hash?: string | null;
2164
+ twinfield_sync_error?: string | null;
2165
+ twinfield_synced_at?: string | null;
1635
2166
  updated_at?: string;
1636
2167
  vat_display?: string | null;
1637
2168
  vat_number?: string | null;
@@ -3490,37 +4021,49 @@ export type Database = {
3490
4021
  }
3491
4022
  ];
3492
4023
  };
3493
- floriday_auction_letters_cache: {
4024
+ floriday_agreement_calloffs_cache: {
3494
4025
  Row: {
3495
- auction_letter_code: string;
3496
- clock_supply_id: string;
4026
+ agreement_id: string | null;
3497
4027
  connection_id: string;
3498
- content_type: string;
4028
+ data: Json;
4029
+ delivery_date: string | null;
3499
4030
  fetched_at: string;
4031
+ floriday_id: string;
3500
4032
  id: string;
3501
- storage_path: string;
4033
+ is_deleted: boolean;
4034
+ sequence_number: number;
4035
+ status: string | null;
4036
+ updated_at: string;
3502
4037
  };
3503
4038
  Insert: {
3504
- auction_letter_code: string;
3505
- clock_supply_id: string;
4039
+ agreement_id?: string | null;
3506
4040
  connection_id: string;
3507
- content_type?: string;
4041
+ data?: Json;
4042
+ delivery_date?: string | null;
3508
4043
  fetched_at?: string;
4044
+ floriday_id: string;
3509
4045
  id?: string;
3510
- storage_path: string;
4046
+ is_deleted?: boolean;
4047
+ sequence_number?: number;
4048
+ status?: string | null;
4049
+ updated_at?: string;
3511
4050
  };
3512
4051
  Update: {
3513
- auction_letter_code?: string;
3514
- clock_supply_id?: string;
4052
+ agreement_id?: string | null;
3515
4053
  connection_id?: string;
3516
- content_type?: string;
4054
+ data?: Json;
4055
+ delivery_date?: string | null;
3517
4056
  fetched_at?: string;
4057
+ floriday_id?: string;
3518
4058
  id?: string;
3519
- storage_path?: string;
4059
+ is_deleted?: boolean;
4060
+ sequence_number?: number;
4061
+ status?: string | null;
4062
+ updated_at?: string;
3520
4063
  };
3521
4064
  Relationships: [
3522
4065
  {
3523
- foreignKeyName: "floriday_auction_letters_cache_connection_id_fkey";
4066
+ foreignKeyName: "floriday_agreement_calloffs_cache_connection_id_fkey";
3524
4067
  columns: ["connection_id"];
3525
4068
  isOneToOne: false;
3526
4069
  referencedRelation: "floriday_connections";
@@ -3528,38 +4071,129 @@ export type Database = {
3528
4071
  }
3529
4072
  ];
3530
4073
  };
3531
- floriday_auto_fulfillment_log: {
4074
+ floriday_agreements_cache: {
3532
4075
  Row: {
3533
- attempts: number;
4076
+ buyer_organization_id: string | null;
3534
4077
  connection_id: string;
3535
- created_at: string;
3536
- error: string | null;
3537
- fulfillment_order_id: string | null;
4078
+ data: Json;
4079
+ fetched_at: string;
4080
+ floriday_id: string;
3538
4081
  id: string;
3539
- last_attempt_at: string | null;
3540
- reason: string | null;
3541
- sales_order_id: string;
3542
- status: string;
4082
+ is_deleted: boolean;
4083
+ sequence_number: number;
4084
+ status: string | null;
3543
4085
  updated_at: string;
4086
+ valid_from: string | null;
4087
+ valid_until: string | null;
3544
4088
  };
3545
4089
  Insert: {
3546
- attempts?: number;
4090
+ buyer_organization_id?: string | null;
3547
4091
  connection_id: string;
3548
- created_at?: string;
3549
- error?: string | null;
3550
- fulfillment_order_id?: string | null;
4092
+ data?: Json;
4093
+ fetched_at?: string;
4094
+ floriday_id: string;
3551
4095
  id?: string;
3552
- last_attempt_at?: string | null;
3553
- reason?: string | null;
3554
- sales_order_id: string;
3555
- status?: string;
4096
+ is_deleted?: boolean;
4097
+ sequence_number?: number;
4098
+ status?: string | null;
3556
4099
  updated_at?: string;
4100
+ valid_from?: string | null;
4101
+ valid_until?: string | null;
3557
4102
  };
3558
4103
  Update: {
3559
- attempts?: number;
4104
+ buyer_organization_id?: string | null;
3560
4105
  connection_id?: string;
3561
- created_at?: string;
3562
- error?: string | null;
4106
+ data?: Json;
4107
+ fetched_at?: string;
4108
+ floriday_id?: string;
4109
+ id?: string;
4110
+ is_deleted?: boolean;
4111
+ sequence_number?: number;
4112
+ status?: string | null;
4113
+ updated_at?: string;
4114
+ valid_from?: string | null;
4115
+ valid_until?: string | null;
4116
+ };
4117
+ Relationships: [
4118
+ {
4119
+ foreignKeyName: "floriday_agreements_cache_connection_id_fkey";
4120
+ columns: ["connection_id"];
4121
+ isOneToOne: false;
4122
+ referencedRelation: "floriday_connections";
4123
+ referencedColumns: ["id"];
4124
+ }
4125
+ ];
4126
+ };
4127
+ floriday_auction_letters_cache: {
4128
+ Row: {
4129
+ auction_letter_code: string;
4130
+ clock_supply_id: string;
4131
+ connection_id: string;
4132
+ content_type: string;
4133
+ fetched_at: string;
4134
+ id: string;
4135
+ storage_path: string;
4136
+ };
4137
+ Insert: {
4138
+ auction_letter_code: string;
4139
+ clock_supply_id: string;
4140
+ connection_id: string;
4141
+ content_type?: string;
4142
+ fetched_at?: string;
4143
+ id?: string;
4144
+ storage_path: string;
4145
+ };
4146
+ Update: {
4147
+ auction_letter_code?: string;
4148
+ clock_supply_id?: string;
4149
+ connection_id?: string;
4150
+ content_type?: string;
4151
+ fetched_at?: string;
4152
+ id?: string;
4153
+ storage_path?: string;
4154
+ };
4155
+ Relationships: [
4156
+ {
4157
+ foreignKeyName: "floriday_auction_letters_cache_connection_id_fkey";
4158
+ columns: ["connection_id"];
4159
+ isOneToOne: false;
4160
+ referencedRelation: "floriday_connections";
4161
+ referencedColumns: ["id"];
4162
+ }
4163
+ ];
4164
+ };
4165
+ floriday_auto_fulfillment_log: {
4166
+ Row: {
4167
+ attempts: number;
4168
+ connection_id: string;
4169
+ created_at: string;
4170
+ error: string | null;
4171
+ fulfillment_order_id: string | null;
4172
+ id: string;
4173
+ last_attempt_at: string | null;
4174
+ reason: string | null;
4175
+ sales_order_id: string;
4176
+ status: string;
4177
+ updated_at: string;
4178
+ };
4179
+ Insert: {
4180
+ attempts?: number;
4181
+ connection_id: string;
4182
+ created_at?: string;
4183
+ error?: string | null;
4184
+ fulfillment_order_id?: string | null;
4185
+ id?: string;
4186
+ last_attempt_at?: string | null;
4187
+ reason?: string | null;
4188
+ sales_order_id: string;
4189
+ status?: string;
4190
+ updated_at?: string;
4191
+ };
4192
+ Update: {
4193
+ attempts?: number;
4194
+ connection_id?: string;
4195
+ created_at?: string;
4196
+ error?: string | null;
3563
4197
  fulfillment_order_id?: string | null;
3564
4198
  id?: string;
3565
4199
  last_attempt_at?: string | null;
@@ -4008,27 +4642,6 @@ export type Database = {
4008
4642
  }
4009
4643
  ];
4010
4644
  };
4011
- floriday_continuous_stock_cache: {
4012
- Row: {
4013
- connection_id: string;
4014
- fetched_at: string;
4015
- number_of_pieces: number;
4016
- trade_item_id: string;
4017
- };
4018
- Insert: {
4019
- connection_id: string;
4020
- fetched_at?: string;
4021
- number_of_pieces?: number;
4022
- trade_item_id: string;
4023
- };
4024
- Update: {
4025
- connection_id?: string;
4026
- fetched_at?: string;
4027
- number_of_pieces?: number;
4028
- trade_item_id?: string;
4029
- };
4030
- Relationships: [];
4031
- };
4032
4645
  floriday_continuous_stock_queue: {
4033
4646
  Row: {
4034
4647
  attempts: number;
@@ -4832,8 +5445,6 @@ export type Database = {
4832
5445
  Row: {
4833
5446
  buyer_organization_id: string | null;
4834
5447
  connection_id: string;
4835
- controlled_at: string | null;
4836
- controlled_by: string | null;
4837
5448
  created_at: string;
4838
5449
  data: Json;
4839
5450
  floriday_id: string;
@@ -4845,8 +5456,6 @@ export type Database = {
4845
5456
  Insert: {
4846
5457
  buyer_organization_id?: string | null;
4847
5458
  connection_id: string;
4848
- controlled_at?: string | null;
4849
- controlled_by?: string | null;
4850
5459
  created_at?: string;
4851
5460
  data: Json;
4852
5461
  floriday_id: string;
@@ -4858,8 +5467,6 @@ export type Database = {
4858
5467
  Update: {
4859
5468
  buyer_organization_id?: string | null;
4860
5469
  connection_id?: string;
4861
- controlled_at?: string | null;
4862
- controlled_by?: string | null;
4863
5470
  created_at?: string;
4864
5471
  data?: Json;
4865
5472
  floriday_id?: string;
@@ -5051,47 +5658,6 @@ export type Database = {
5051
5658
  }
5052
5659
  ];
5053
5660
  };
5054
- floriday_trade_settings_customers_cache: {
5055
- Row: {
5056
- connection_id: string;
5057
- data: Json;
5058
- fetched_at: string;
5059
- floriday_id: string;
5060
- id: string;
5061
- is_deleted: boolean;
5062
- sequence_number: number;
5063
- updated_at: string;
5064
- };
5065
- Insert: {
5066
- connection_id: string;
5067
- data: Json;
5068
- fetched_at?: string;
5069
- floriday_id: string;
5070
- id?: string;
5071
- is_deleted?: boolean;
5072
- sequence_number?: number;
5073
- updated_at?: string;
5074
- };
5075
- Update: {
5076
- connection_id?: string;
5077
- data?: Json;
5078
- fetched_at?: string;
5079
- floriday_id?: string;
5080
- id?: string;
5081
- is_deleted?: boolean;
5082
- sequence_number?: number;
5083
- updated_at?: string;
5084
- };
5085
- Relationships: [
5086
- {
5087
- foreignKeyName: "floriday_trade_settings_customers_cache_connection_id_fkey";
5088
- columns: ["connection_id"];
5089
- isOneToOne: false;
5090
- referencedRelation: "floriday_connections";
5091
- referencedColumns: ["id"];
5092
- }
5093
- ];
5094
- };
5095
5661
  floriday_trips_cache: {
5096
5662
  Row: {
5097
5663
  carrier_organization_id: string | null;
@@ -5638,237 +6204,817 @@ export type Database = {
5638
6204
  };
5639
6205
  Relationships: [];
5640
6206
  };
5641
- local_customer_agreements: {
6207
+ itk_contact_persons: {
5642
6208
  Row: {
5643
- base_price: number | null;
5644
6209
  created_at: string;
5645
- currency: string;
5646
6210
  customer_id: string;
6211
+ email: string | null;
5647
6212
  id: string;
5648
- min_quantity: number;
5649
- net_price: number;
5650
- notes: string | null;
5651
- product_category_id: string | null;
5652
- product_id: string | null;
6213
+ name: string;
6214
+ phone: string | null;
6215
+ role: string | null;
5653
6216
  updated_at: string;
5654
- valid_from: string | null;
5655
- valid_until: string | null;
5656
6217
  };
5657
6218
  Insert: {
5658
- base_price?: number | null;
5659
6219
  created_at?: string;
5660
- currency?: string;
5661
6220
  customer_id: string;
6221
+ email?: string | null;
5662
6222
  id?: string;
5663
- min_quantity?: number;
5664
- net_price: number;
5665
- notes?: string | null;
5666
- product_category_id?: string | null;
5667
- product_id?: string | null;
6223
+ name: string;
6224
+ phone?: string | null;
6225
+ role?: string | null;
5668
6226
  updated_at?: string;
5669
- valid_from?: string | null;
5670
- valid_until?: string | null;
5671
6227
  };
5672
6228
  Update: {
5673
- base_price?: number | null;
5674
6229
  created_at?: string;
5675
- currency?: string;
5676
6230
  customer_id?: string;
6231
+ email?: string | null;
5677
6232
  id?: string;
5678
- min_quantity?: number;
5679
- net_price?: number;
5680
- notes?: string | null;
5681
- product_category_id?: string | null;
5682
- product_id?: string | null;
6233
+ name?: string;
6234
+ phone?: string | null;
6235
+ role?: string | null;
5683
6236
  updated_at?: string;
5684
- valid_from?: string | null;
5685
- valid_until?: string | null;
5686
6237
  };
5687
6238
  Relationships: [
5688
6239
  {
5689
- foreignKeyName: "local_customer_agreements_customer_id_fkey";
6240
+ foreignKeyName: "itk_contact_persons_customer_id_fkey";
5690
6241
  columns: ["customer_id"];
5691
6242
  isOneToOne: false;
5692
- referencedRelation: "customers";
5693
- referencedColumns: ["id"];
5694
- },
5695
- {
5696
- foreignKeyName: "local_customer_agreements_product_category_id_fkey";
5697
- columns: ["product_category_id"];
5698
- isOneToOne: false;
5699
- referencedRelation: "product_categories";
5700
- referencedColumns: ["id"];
5701
- },
5702
- {
5703
- foreignKeyName: "local_customer_agreements_product_id_fkey";
5704
- columns: ["product_id"];
5705
- isOneToOne: false;
5706
- referencedRelation: "products";
6243
+ referencedRelation: "itk_customers";
5707
6244
  referencedColumns: ["id"];
5708
6245
  }
5709
6246
  ];
5710
6247
  };
5711
- local_customer_price_groups: {
6248
+ itk_customer_dynamic_values: {
5712
6249
  Row: {
5713
6250
  created_at: string;
5714
- currency: string;
5715
6251
  customer_id: string;
5716
- discount_type: string;
5717
- discount_value: number;
6252
+ field_id: string;
5718
6253
  id: string;
5719
- min_quantity: number;
5720
- notes: string | null;
5721
- product_category_id: string | null;
5722
- product_id: string | null;
5723
6254
  updated_at: string;
5724
- valid_from: string | null;
5725
- valid_until: string | null;
6255
+ value: string | null;
5726
6256
  };
5727
6257
  Insert: {
5728
6258
  created_at?: string;
5729
- currency?: string;
5730
6259
  customer_id: string;
5731
- discount_type: string;
5732
- discount_value: number;
6260
+ field_id: string;
5733
6261
  id?: string;
5734
- min_quantity?: number;
5735
- notes?: string | null;
5736
- product_category_id?: string | null;
5737
- product_id?: string | null;
5738
6262
  updated_at?: string;
5739
- valid_from?: string | null;
5740
- valid_until?: string | null;
6263
+ value?: string | null;
5741
6264
  };
5742
6265
  Update: {
5743
6266
  created_at?: string;
5744
- currency?: string;
5745
6267
  customer_id?: string;
5746
- discount_type?: string;
5747
- discount_value?: number;
6268
+ field_id?: string;
5748
6269
  id?: string;
5749
- min_quantity?: number;
5750
- notes?: string | null;
5751
- product_category_id?: string | null;
5752
- product_id?: string | null;
5753
6270
  updated_at?: string;
5754
- valid_from?: string | null;
5755
- valid_until?: string | null;
6271
+ value?: string | null;
5756
6272
  };
5757
6273
  Relationships: [
5758
6274
  {
5759
- foreignKeyName: "local_customer_price_groups_customer_id_fkey";
6275
+ foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey";
5760
6276
  columns: ["customer_id"];
5761
6277
  isOneToOne: false;
5762
- referencedRelation: "customers";
5763
- referencedColumns: ["id"];
5764
- },
5765
- {
5766
- foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
5767
- columns: ["product_category_id"];
5768
- isOneToOne: false;
5769
- referencedRelation: "product_categories";
6278
+ referencedRelation: "itk_customers";
5770
6279
  referencedColumns: ["id"];
5771
6280
  },
5772
6281
  {
5773
- foreignKeyName: "local_customer_price_groups_product_id_fkey";
5774
- columns: ["product_id"];
6282
+ foreignKeyName: "itk_customer_dynamic_values_field_id_fkey";
6283
+ columns: ["field_id"];
5775
6284
  isOneToOne: false;
5776
- referencedRelation: "products";
6285
+ referencedRelation: "itk_dynamic_fields";
5777
6286
  referencedColumns: ["id"];
5778
6287
  }
5779
6288
  ];
5780
6289
  };
5781
- local_customer_sales_strategies: {
6290
+ itk_customer_notes: {
5782
6291
  Row: {
6292
+ body: string;
5783
6293
  created_at: string;
5784
- currency: string;
6294
+ created_by: string | null;
5785
6295
  customer_id: string;
5786
- discount_type: string;
5787
- discount_value: number;
5788
6296
  id: string;
5789
- min_quantity: number;
5790
- notes: string | null;
5791
- product_category_id: string | null;
5792
- product_id: string | null;
6297
+ note_type: string;
6298
+ updated_at: string;
6299
+ };
6300
+ Insert: {
6301
+ body: string;
6302
+ created_at?: string;
6303
+ created_by?: string | null;
6304
+ customer_id: string;
6305
+ id?: string;
6306
+ note_type?: string;
6307
+ updated_at?: string;
6308
+ };
6309
+ Update: {
6310
+ body?: string;
6311
+ created_at?: string;
6312
+ created_by?: string | null;
6313
+ customer_id?: string;
6314
+ id?: string;
6315
+ note_type?: string;
6316
+ updated_at?: string;
6317
+ };
6318
+ Relationships: [
6319
+ {
6320
+ foreignKeyName: "itk_customer_notes_customer_id_fkey";
6321
+ columns: ["customer_id"];
6322
+ isOneToOne: false;
6323
+ referencedRelation: "itk_customers";
6324
+ referencedColumns: ["id"];
6325
+ }
6326
+ ];
6327
+ };
6328
+ itk_customers: {
6329
+ Row: {
6330
+ billing_city: string | null;
6331
+ billing_postcode: string | null;
6332
+ billing_street: string | null;
6333
+ created_at: string;
6334
+ general_email: string | null;
6335
+ general_phone: string | null;
6336
+ id: string;
6337
+ legacy_customer_id: string | null;
6338
+ name: string;
6339
+ segment: Database["public"]["Enums"]["itk_customer_segment"];
6340
+ updated_at: string;
6341
+ };
6342
+ Insert: {
6343
+ billing_city?: string | null;
6344
+ billing_postcode?: string | null;
6345
+ billing_street?: string | null;
6346
+ created_at?: string;
6347
+ general_email?: string | null;
6348
+ general_phone?: string | null;
6349
+ id?: string;
6350
+ legacy_customer_id?: string | null;
6351
+ name: string;
6352
+ segment?: Database["public"]["Enums"]["itk_customer_segment"];
6353
+ updated_at?: string;
6354
+ };
6355
+ Update: {
6356
+ billing_city?: string | null;
6357
+ billing_postcode?: string | null;
6358
+ billing_street?: string | null;
6359
+ created_at?: string;
6360
+ general_email?: string | null;
6361
+ general_phone?: string | null;
6362
+ id?: string;
6363
+ legacy_customer_id?: string | null;
6364
+ name?: string;
6365
+ segment?: Database["public"]["Enums"]["itk_customer_segment"];
6366
+ updated_at?: string;
6367
+ };
6368
+ Relationships: [
6369
+ {
6370
+ foreignKeyName: "itk_customers_legacy_customer_id_fkey";
6371
+ columns: ["legacy_customer_id"];
6372
+ isOneToOne: false;
6373
+ referencedRelation: "customers";
6374
+ referencedColumns: ["id"];
6375
+ }
6376
+ ];
6377
+ };
6378
+ itk_dynamic_fields: {
6379
+ Row: {
6380
+ created_at: string;
6381
+ field_name: string;
6382
+ field_type: Database["public"]["Enums"]["itk_dynamic_field_type"];
6383
+ id: string;
6384
+ options: Json;
6385
+ sort_order: number;
6386
+ updated_at: string;
6387
+ };
6388
+ Insert: {
6389
+ created_at?: string;
6390
+ field_name: string;
6391
+ field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"];
6392
+ id?: string;
6393
+ options?: Json;
6394
+ sort_order?: number;
6395
+ updated_at?: string;
6396
+ };
6397
+ Update: {
6398
+ created_at?: string;
6399
+ field_name?: string;
6400
+ field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"];
6401
+ id?: string;
6402
+ options?: Json;
6403
+ sort_order?: number;
6404
+ updated_at?: string;
6405
+ };
6406
+ Relationships: [];
6407
+ };
6408
+ itk_work_locations: {
6409
+ Row: {
6410
+ city: string | null;
6411
+ created_at: string;
6412
+ customer_id: string;
6413
+ id: string;
6414
+ instructions: string | null;
6415
+ label: string;
6416
+ latitude: number | null;
6417
+ longitude: number | null;
6418
+ postcode: string | null;
6419
+ street: string | null;
6420
+ updated_at: string;
6421
+ };
6422
+ Insert: {
6423
+ city?: string | null;
6424
+ created_at?: string;
6425
+ customer_id: string;
6426
+ id?: string;
6427
+ instructions?: string | null;
6428
+ label: string;
6429
+ latitude?: number | null;
6430
+ longitude?: number | null;
6431
+ postcode?: string | null;
6432
+ street?: string | null;
6433
+ updated_at?: string;
6434
+ };
6435
+ Update: {
6436
+ city?: string | null;
6437
+ created_at?: string;
6438
+ customer_id?: string;
6439
+ id?: string;
6440
+ instructions?: string | null;
6441
+ label?: string;
6442
+ latitude?: number | null;
6443
+ longitude?: number | null;
6444
+ postcode?: string | null;
6445
+ street?: string | null;
6446
+ updated_at?: string;
6447
+ };
6448
+ Relationships: [
6449
+ {
6450
+ foreignKeyName: "itk_work_locations_customer_id_fkey";
6451
+ columns: ["customer_id"];
6452
+ isOneToOne: false;
6453
+ referencedRelation: "itk_customers";
6454
+ referencedColumns: ["id"];
6455
+ }
6456
+ ];
6457
+ };
6458
+ leave_requests: {
6459
+ Row: {
6460
+ created_at: string;
6461
+ end_date: string;
6462
+ id: string;
6463
+ reason: string | null;
6464
+ start_date: string;
6465
+ status: string;
6466
+ tenant_id: string;
6467
+ updated_at: string;
6468
+ user_id: string;
6469
+ };
6470
+ Insert: {
6471
+ created_at?: string;
6472
+ end_date: string;
6473
+ id?: string;
6474
+ reason?: string | null;
6475
+ start_date: string;
6476
+ status?: string;
6477
+ tenant_id?: string;
6478
+ updated_at?: string;
6479
+ user_id: string;
6480
+ };
6481
+ Update: {
6482
+ created_at?: string;
6483
+ end_date?: string;
6484
+ id?: string;
6485
+ reason?: string | null;
6486
+ start_date?: string;
6487
+ status?: string;
6488
+ tenant_id?: string;
6489
+ updated_at?: string;
6490
+ user_id?: string;
6491
+ };
6492
+ Relationships: [
6493
+ {
6494
+ foreignKeyName: "leave_requests_user_id_fkey";
6495
+ columns: ["user_id"];
6496
+ isOneToOne: false;
6497
+ referencedRelation: "monteurs";
6498
+ referencedColumns: ["id"];
6499
+ }
6500
+ ];
6501
+ };
6502
+ local_customer_agreements: {
6503
+ Row: {
6504
+ base_price: number | null;
6505
+ created_at: string;
6506
+ currency: string;
6507
+ customer_id: string;
6508
+ id: string;
6509
+ min_quantity: number;
6510
+ net_price: number;
6511
+ notes: string | null;
6512
+ product_category_id: string | null;
6513
+ product_id: string | null;
6514
+ updated_at: string;
6515
+ valid_from: string | null;
6516
+ valid_until: string | null;
6517
+ };
6518
+ Insert: {
6519
+ base_price?: number | null;
6520
+ created_at?: string;
6521
+ currency?: string;
6522
+ customer_id: string;
6523
+ id?: string;
6524
+ min_quantity?: number;
6525
+ net_price: number;
6526
+ notes?: string | null;
6527
+ product_category_id?: string | null;
6528
+ product_id?: string | null;
6529
+ updated_at?: string;
6530
+ valid_from?: string | null;
6531
+ valid_until?: string | null;
6532
+ };
6533
+ Update: {
6534
+ base_price?: number | null;
6535
+ created_at?: string;
6536
+ currency?: string;
6537
+ customer_id?: string;
6538
+ id?: string;
6539
+ min_quantity?: number;
6540
+ net_price?: number;
6541
+ notes?: string | null;
6542
+ product_category_id?: string | null;
6543
+ product_id?: string | null;
6544
+ updated_at?: string;
6545
+ valid_from?: string | null;
6546
+ valid_until?: string | null;
6547
+ };
6548
+ Relationships: [
6549
+ {
6550
+ foreignKeyName: "local_customer_agreements_customer_id_fkey";
6551
+ columns: ["customer_id"];
6552
+ isOneToOne: false;
6553
+ referencedRelation: "customers";
6554
+ referencedColumns: ["id"];
6555
+ },
6556
+ {
6557
+ foreignKeyName: "local_customer_agreements_product_category_id_fkey";
6558
+ columns: ["product_category_id"];
6559
+ isOneToOne: false;
6560
+ referencedRelation: "product_categories";
6561
+ referencedColumns: ["id"];
6562
+ },
6563
+ {
6564
+ foreignKeyName: "local_customer_agreements_product_id_fkey";
6565
+ columns: ["product_id"];
6566
+ isOneToOne: false;
6567
+ referencedRelation: "products";
6568
+ referencedColumns: ["id"];
6569
+ }
6570
+ ];
6571
+ };
6572
+ local_customer_price_groups: {
6573
+ Row: {
6574
+ created_at: string;
6575
+ currency: string;
6576
+ customer_id: string;
6577
+ discount_type: string;
6578
+ discount_value: number;
6579
+ id: string;
6580
+ min_quantity: number;
6581
+ notes: string | null;
6582
+ product_category_id: string | null;
6583
+ product_id: string | null;
6584
+ updated_at: string;
6585
+ valid_from: string | null;
6586
+ valid_until: string | null;
6587
+ };
6588
+ Insert: {
6589
+ created_at?: string;
6590
+ currency?: string;
6591
+ customer_id: string;
6592
+ discount_type: string;
6593
+ discount_value: number;
6594
+ id?: string;
6595
+ min_quantity?: number;
6596
+ notes?: string | null;
6597
+ product_category_id?: string | null;
6598
+ product_id?: string | null;
6599
+ updated_at?: string;
6600
+ valid_from?: string | null;
6601
+ valid_until?: string | null;
6602
+ };
6603
+ Update: {
6604
+ created_at?: string;
6605
+ currency?: string;
6606
+ customer_id?: string;
6607
+ discount_type?: string;
6608
+ discount_value?: number;
6609
+ id?: string;
6610
+ min_quantity?: number;
6611
+ notes?: string | null;
6612
+ product_category_id?: string | null;
6613
+ product_id?: string | null;
6614
+ updated_at?: string;
6615
+ valid_from?: string | null;
6616
+ valid_until?: string | null;
6617
+ };
6618
+ Relationships: [
6619
+ {
6620
+ foreignKeyName: "local_customer_price_groups_customer_id_fkey";
6621
+ columns: ["customer_id"];
6622
+ isOneToOne: false;
6623
+ referencedRelation: "customers";
6624
+ referencedColumns: ["id"];
6625
+ },
6626
+ {
6627
+ foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
6628
+ columns: ["product_category_id"];
6629
+ isOneToOne: false;
6630
+ referencedRelation: "product_categories";
6631
+ referencedColumns: ["id"];
6632
+ },
6633
+ {
6634
+ foreignKeyName: "local_customer_price_groups_product_id_fkey";
6635
+ columns: ["product_id"];
6636
+ isOneToOne: false;
6637
+ referencedRelation: "products";
6638
+ referencedColumns: ["id"];
6639
+ }
6640
+ ];
6641
+ };
6642
+ local_customer_sales_strategies: {
6643
+ Row: {
6644
+ created_at: string;
6645
+ currency: string;
6646
+ customer_id: string;
6647
+ discount_type: string;
6648
+ discount_value: number;
6649
+ id: string;
6650
+ min_quantity: number;
6651
+ notes: string | null;
6652
+ product_category_id: string | null;
6653
+ product_id: string | null;
6654
+ updated_at: string;
6655
+ valid_from: string | null;
6656
+ valid_until: string | null;
6657
+ };
6658
+ Insert: {
6659
+ created_at?: string;
6660
+ currency?: string;
6661
+ customer_id: string;
6662
+ discount_type: string;
6663
+ discount_value: number;
6664
+ id?: string;
6665
+ min_quantity?: number;
6666
+ notes?: string | null;
6667
+ product_category_id?: string | null;
6668
+ product_id?: string | null;
6669
+ updated_at?: string;
6670
+ valid_from?: string | null;
6671
+ valid_until?: string | null;
6672
+ };
6673
+ Update: {
6674
+ created_at?: string;
6675
+ currency?: string;
6676
+ customer_id?: string;
6677
+ discount_type?: string;
6678
+ discount_value?: number;
6679
+ id?: string;
6680
+ min_quantity?: number;
6681
+ notes?: string | null;
6682
+ product_category_id?: string | null;
6683
+ product_id?: string | null;
6684
+ updated_at?: string;
6685
+ valid_from?: string | null;
6686
+ valid_until?: string | null;
6687
+ };
6688
+ Relationships: [
6689
+ {
6690
+ foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
6691
+ columns: ["customer_id"];
6692
+ isOneToOne: false;
6693
+ referencedRelation: "customers";
6694
+ referencedColumns: ["id"];
6695
+ },
6696
+ {
6697
+ foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
6698
+ columns: ["product_category_id"];
6699
+ isOneToOne: false;
6700
+ referencedRelation: "product_categories";
6701
+ referencedColumns: ["id"];
6702
+ },
6703
+ {
6704
+ foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
6705
+ columns: ["product_id"];
6706
+ isOneToOne: false;
6707
+ referencedRelation: "products";
6708
+ referencedColumns: ["id"];
6709
+ }
6710
+ ];
6711
+ };
6712
+ locations: {
6713
+ Row: {
6714
+ created_at: string;
6715
+ id: string;
6716
+ name: string;
6717
+ sort_order: number;
6718
+ updated_at: string;
6719
+ };
6720
+ Insert: {
6721
+ created_at?: string;
6722
+ id?: string;
6723
+ name: string;
6724
+ sort_order?: number;
6725
+ updated_at?: string;
6726
+ };
6727
+ Update: {
6728
+ created_at?: string;
6729
+ id?: string;
6730
+ name?: string;
6731
+ sort_order?: number;
6732
+ updated_at?: string;
6733
+ };
6734
+ Relationships: [];
6735
+ };
6736
+ logistics_capacity_events: {
6737
+ Row: {
6738
+ available_carts: number;
6739
+ created_at: string;
6740
+ id: string;
6741
+ measures: Json;
6742
+ note: string | null;
6743
+ outcome: string;
6744
+ required_carts: number;
6745
+ reserve_minutes: number;
6746
+ shortage_carts: number;
6747
+ status: string;
6748
+ user_id: string;
6749
+ };
6750
+ Insert: {
6751
+ available_carts?: number;
6752
+ created_at?: string;
6753
+ id?: string;
6754
+ measures?: Json;
6755
+ note?: string | null;
6756
+ outcome?: string;
6757
+ required_carts?: number;
6758
+ reserve_minutes?: number;
6759
+ shortage_carts?: number;
6760
+ status: string;
6761
+ user_id: string;
6762
+ };
6763
+ Update: {
6764
+ available_carts?: number;
6765
+ created_at?: string;
6766
+ id?: string;
6767
+ measures?: Json;
6768
+ note?: string | null;
6769
+ outcome?: string;
6770
+ required_carts?: number;
6771
+ reserve_minutes?: number;
6772
+ shortage_carts?: number;
6773
+ status?: string;
6774
+ user_id?: string;
6775
+ };
6776
+ Relationships: [];
6777
+ };
6778
+ logistics_capacity_settings: {
6779
+ Row: {
6780
+ created_at: string;
6781
+ settings: Json;
6782
+ updated_at: string;
6783
+ user_id: string;
6784
+ };
6785
+ Insert: {
6786
+ created_at?: string;
6787
+ settings?: Json;
6788
+ updated_at?: string;
6789
+ user_id: string;
6790
+ };
6791
+ Update: {
6792
+ created_at?: string;
6793
+ settings?: Json;
6794
+ updated_at?: string;
6795
+ user_id?: string;
6796
+ };
6797
+ Relationships: [];
6798
+ };
6799
+ logistics_decisions: {
6800
+ Row: {
6801
+ created_at: string;
6802
+ explanation: string | null;
6803
+ id: string;
6804
+ input_snapshot: Json;
6805
+ result: Json;
6806
+ slot: string;
6807
+ strategy_id: string | null;
6808
+ subject_id: string;
6809
+ subject_type: string;
6810
+ user_id: string;
6811
+ };
6812
+ Insert: {
6813
+ created_at?: string;
6814
+ explanation?: string | null;
6815
+ id?: string;
6816
+ input_snapshot?: Json;
6817
+ result?: Json;
6818
+ slot: string;
6819
+ strategy_id?: string | null;
6820
+ subject_id: string;
6821
+ subject_type: string;
6822
+ user_id: string;
6823
+ };
6824
+ Update: {
6825
+ created_at?: string;
6826
+ explanation?: string | null;
6827
+ id?: string;
6828
+ input_snapshot?: Json;
6829
+ result?: Json;
6830
+ slot?: string;
6831
+ strategy_id?: string | null;
6832
+ subject_id?: string;
6833
+ subject_type?: string;
6834
+ user_id?: string;
6835
+ };
6836
+ Relationships: [
6837
+ {
6838
+ foreignKeyName: "logistics_decisions_strategy_id_fkey";
6839
+ columns: ["strategy_id"];
6840
+ isOneToOne: false;
6841
+ referencedRelation: "logistics_strategies";
6842
+ referencedColumns: ["id"];
6843
+ }
6844
+ ];
6845
+ };
6846
+ logistics_formulas: {
6847
+ Row: {
6848
+ created_at: string;
6849
+ expression: string;
6850
+ id: string;
6851
+ notes: string | null;
6852
+ slot: string;
6853
+ strategy_id: string;
6854
+ updated_at: string;
6855
+ user_id: string;
6856
+ version: number;
6857
+ };
6858
+ Insert: {
6859
+ created_at?: string;
6860
+ expression?: string;
6861
+ id?: string;
6862
+ notes?: string | null;
6863
+ slot: string;
6864
+ strategy_id: string;
6865
+ updated_at?: string;
6866
+ user_id: string;
6867
+ version?: number;
6868
+ };
6869
+ Update: {
6870
+ created_at?: string;
6871
+ expression?: string;
6872
+ id?: string;
6873
+ notes?: string | null;
6874
+ slot?: string;
6875
+ strategy_id?: string;
6876
+ updated_at?: string;
6877
+ user_id?: string;
6878
+ version?: number;
6879
+ };
6880
+ Relationships: [
6881
+ {
6882
+ foreignKeyName: "logistics_formulas_strategy_id_fkey";
6883
+ columns: ["strategy_id"];
6884
+ isOneToOne: false;
6885
+ referencedRelation: "logistics_strategies";
6886
+ referencedColumns: ["id"];
6887
+ }
6888
+ ];
6889
+ };
6890
+ logistics_strategies: {
6891
+ Row: {
6892
+ color: string;
6893
+ created_at: string;
6894
+ description: string | null;
6895
+ id: string;
6896
+ is_active: boolean;
6897
+ name: string;
6898
+ priority: number;
6899
+ updated_at: string;
6900
+ updated_by: string | null;
6901
+ user_id: string;
6902
+ version: number;
6903
+ };
6904
+ Insert: {
6905
+ color?: string;
6906
+ created_at?: string;
6907
+ description?: string | null;
6908
+ id?: string;
6909
+ is_active?: boolean;
6910
+ name: string;
6911
+ priority?: number;
6912
+ updated_at?: string;
6913
+ updated_by?: string | null;
6914
+ user_id: string;
6915
+ version?: number;
6916
+ };
6917
+ Update: {
6918
+ color?: string;
6919
+ created_at?: string;
6920
+ description?: string | null;
6921
+ id?: string;
6922
+ is_active?: boolean;
6923
+ name?: string;
6924
+ priority?: number;
6925
+ updated_at?: string;
6926
+ updated_by?: string | null;
6927
+ user_id?: string;
6928
+ version?: number;
6929
+ };
6930
+ Relationships: [];
6931
+ };
6932
+ logistics_strategy_schedules: {
6933
+ Row: {
6934
+ condition_expression: string | null;
6935
+ created_at: string;
6936
+ end_date: string | null;
6937
+ id: string;
6938
+ is_enabled: boolean;
6939
+ priority: number;
6940
+ rule_type: string;
6941
+ start_date: string | null;
6942
+ strategy_id: string;
5793
6943
  updated_at: string;
5794
- valid_from: string | null;
5795
- valid_until: string | null;
6944
+ user_id: string;
5796
6945
  };
5797
6946
  Insert: {
6947
+ condition_expression?: string | null;
5798
6948
  created_at?: string;
5799
- currency?: string;
5800
- customer_id: string;
5801
- discount_type: string;
5802
- discount_value: number;
6949
+ end_date?: string | null;
5803
6950
  id?: string;
5804
- min_quantity?: number;
5805
- notes?: string | null;
5806
- product_category_id?: string | null;
5807
- product_id?: string | null;
6951
+ is_enabled?: boolean;
6952
+ priority?: number;
6953
+ rule_type: string;
6954
+ start_date?: string | null;
6955
+ strategy_id: string;
5808
6956
  updated_at?: string;
5809
- valid_from?: string | null;
5810
- valid_until?: string | null;
6957
+ user_id: string;
5811
6958
  };
5812
6959
  Update: {
6960
+ condition_expression?: string | null;
5813
6961
  created_at?: string;
5814
- currency?: string;
5815
- customer_id?: string;
5816
- discount_type?: string;
5817
- discount_value?: number;
6962
+ end_date?: string | null;
5818
6963
  id?: string;
5819
- min_quantity?: number;
5820
- notes?: string | null;
5821
- product_category_id?: string | null;
5822
- product_id?: string | null;
6964
+ is_enabled?: boolean;
6965
+ priority?: number;
6966
+ rule_type?: string;
6967
+ start_date?: string | null;
6968
+ strategy_id?: string;
5823
6969
  updated_at?: string;
5824
- valid_from?: string | null;
5825
- valid_until?: string | null;
6970
+ user_id?: string;
5826
6971
  };
5827
6972
  Relationships: [
5828
6973
  {
5829
- foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
5830
- columns: ["customer_id"];
5831
- isOneToOne: false;
5832
- referencedRelation: "customers";
5833
- referencedColumns: ["id"];
5834
- },
5835
- {
5836
- foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
5837
- columns: ["product_category_id"];
5838
- isOneToOne: false;
5839
- referencedRelation: "product_categories";
5840
- referencedColumns: ["id"];
5841
- },
5842
- {
5843
- foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
5844
- columns: ["product_id"];
6974
+ foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey";
6975
+ columns: ["strategy_id"];
5845
6976
  isOneToOne: false;
5846
- referencedRelation: "products";
6977
+ referencedRelation: "logistics_strategies";
5847
6978
  referencedColumns: ["id"];
5848
6979
  }
5849
6980
  ];
5850
6981
  };
5851
- locations: {
6982
+ logistics_variables: {
5852
6983
  Row: {
5853
6984
  created_at: string;
6985
+ default_value: string | null;
6986
+ description: string | null;
5854
6987
  id: string;
5855
- name: string;
5856
- sort_order: number;
6988
+ is_builtin: boolean;
6989
+ key: string;
6990
+ label: string;
5857
6991
  updated_at: string;
6992
+ user_id: string;
6993
+ value_type: string;
5858
6994
  };
5859
6995
  Insert: {
5860
6996
  created_at?: string;
6997
+ default_value?: string | null;
6998
+ description?: string | null;
5861
6999
  id?: string;
5862
- name: string;
5863
- sort_order?: number;
7000
+ is_builtin?: boolean;
7001
+ key: string;
7002
+ label: string;
5864
7003
  updated_at?: string;
7004
+ user_id: string;
7005
+ value_type: string;
5865
7006
  };
5866
7007
  Update: {
5867
7008
  created_at?: string;
7009
+ default_value?: string | null;
7010
+ description?: string | null;
5868
7011
  id?: string;
5869
- name?: string;
5870
- sort_order?: number;
7012
+ is_builtin?: boolean;
7013
+ key?: string;
7014
+ label?: string;
5871
7015
  updated_at?: string;
7016
+ user_id?: string;
7017
+ value_type?: string;
5872
7018
  };
5873
7019
  Relationships: [];
5874
7020
  };
@@ -6284,62 +7430,66 @@ export type Database = {
6284
7430
  };
6285
7431
  manufacture_products: {
6286
7432
  Row: {
6287
- aantal_te_produceren: number;
6288
7433
  created_at: string;
6289
7434
  description: string | null;
6290
7435
  id: string;
6291
7436
  is_active: boolean;
6292
- location_id: string | null;
6293
7437
  name: string;
6294
- partij_nummer: string | null;
6295
- photos: Json;
6296
7438
  produced_stock: number;
6297
7439
  product_code: string;
6298
7440
  tenant_id: string;
6299
- unit: string;
6300
7441
  updated_at: string;
6301
7442
  };
6302
7443
  Insert: {
6303
- aantal_te_produceren?: number;
6304
7444
  created_at?: string;
6305
7445
  description?: string | null;
6306
7446
  id?: string;
6307
7447
  is_active?: boolean;
6308
- location_id?: string | null;
6309
7448
  name: string;
6310
- partij_nummer?: string | null;
6311
- photos?: Json;
6312
7449
  produced_stock?: number;
6313
7450
  product_code: string;
6314
7451
  tenant_id: string;
6315
- unit?: string;
6316
7452
  updated_at?: string;
6317
7453
  };
6318
7454
  Update: {
6319
- aantal_te_produceren?: number;
6320
7455
  created_at?: string;
6321
7456
  description?: string | null;
6322
7457
  id?: string;
6323
7458
  is_active?: boolean;
6324
- location_id?: string | null;
6325
7459
  name?: string;
6326
- partij_nummer?: string | null;
6327
- photos?: Json;
6328
7460
  produced_stock?: number;
6329
7461
  product_code?: string;
6330
7462
  tenant_id?: string;
6331
- unit?: string;
6332
7463
  updated_at?: string;
6333
7464
  };
6334
- Relationships: [
6335
- {
6336
- foreignKeyName: "manufacture_products_location_id_fkey";
6337
- columns: ["location_id"];
6338
- isOneToOne: false;
6339
- referencedRelation: "locations";
6340
- referencedColumns: ["id"];
6341
- }
6342
- ];
7465
+ Relationships: [];
7466
+ };
7467
+ module_permissions: {
7468
+ Row: {
7469
+ created_at: string;
7470
+ id: string;
7471
+ module_id: string;
7472
+ permission: string;
7473
+ role: Database["public"]["Enums"]["app_role"];
7474
+ updated_at: string;
7475
+ };
7476
+ Insert: {
7477
+ created_at?: string;
7478
+ id?: string;
7479
+ module_id: string;
7480
+ permission: string;
7481
+ role: Database["public"]["Enums"]["app_role"];
7482
+ updated_at?: string;
7483
+ };
7484
+ Update: {
7485
+ created_at?: string;
7486
+ id?: string;
7487
+ module_id?: string;
7488
+ permission?: string;
7489
+ role?: Database["public"]["Enums"]["app_role"];
7490
+ updated_at?: string;
7491
+ };
7492
+ Relationships: [];
6343
7493
  };
6344
7494
  monteurs: {
6345
7495
  Row: {
@@ -7095,6 +8245,42 @@ export type Database = {
7095
8245
  };
7096
8246
  Relationships: [];
7097
8247
  };
8248
+ order_buffers: {
8249
+ Row: {
8250
+ buffer_key: string;
8251
+ created_at: string;
8252
+ customer_id: string | null;
8253
+ grouping_mode: string;
8254
+ id: string;
8255
+ pickup_date: string | null;
8256
+ pickup_location: string | null;
8257
+ plan_locked_at: string | null;
8258
+ updated_at: string;
8259
+ };
8260
+ Insert: {
8261
+ buffer_key: string;
8262
+ created_at?: string;
8263
+ customer_id?: string | null;
8264
+ grouping_mode: string;
8265
+ id?: string;
8266
+ pickup_date?: string | null;
8267
+ pickup_location?: string | null;
8268
+ plan_locked_at?: string | null;
8269
+ updated_at?: string;
8270
+ };
8271
+ Update: {
8272
+ buffer_key?: string;
8273
+ created_at?: string;
8274
+ customer_id?: string | null;
8275
+ grouping_mode?: string;
8276
+ id?: string;
8277
+ pickup_date?: string | null;
8278
+ pickup_location?: string | null;
8279
+ plan_locked_at?: string | null;
8280
+ updated_at?: string;
8281
+ };
8282
+ Relationships: [];
8283
+ };
7098
8284
  order_cart_items: {
7099
8285
  Row: {
7100
8286
  cart_id: string;
@@ -7165,6 +8351,7 @@ export type Database = {
7165
8351
  order_carts: {
7166
8352
  Row: {
7167
8353
  algorithm_version: number;
8354
+ buffer_id: string | null;
7168
8355
  cart_number: number;
7169
8356
  created_at: string;
7170
8357
  id: string;
@@ -7172,13 +8359,14 @@ export type Database = {
7172
8359
  is_complete: boolean;
7173
8360
  notes: string | null;
7174
8361
  occupancy_pct: number;
7175
- order_id: string;
8362
+ order_id: string | null;
7176
8363
  source: string;
7177
8364
  total_layers_used: number;
7178
8365
  updated_at: string;
7179
8366
  };
7180
8367
  Insert: {
7181
8368
  algorithm_version?: number;
8369
+ buffer_id?: string | null;
7182
8370
  cart_number: number;
7183
8371
  created_at?: string;
7184
8372
  id?: string;
@@ -7186,13 +8374,14 @@ export type Database = {
7186
8374
  is_complete?: boolean;
7187
8375
  notes?: string | null;
7188
8376
  occupancy_pct?: number;
7189
- order_id: string;
8377
+ order_id?: string | null;
7190
8378
  source?: string;
7191
8379
  total_layers_used?: number;
7192
8380
  updated_at?: string;
7193
8381
  };
7194
8382
  Update: {
7195
8383
  algorithm_version?: number;
8384
+ buffer_id?: string | null;
7196
8385
  cart_number?: number;
7197
8386
  created_at?: string;
7198
8387
  id?: string;
@@ -7200,12 +8389,19 @@ export type Database = {
7200
8389
  is_complete?: boolean;
7201
8390
  notes?: string | null;
7202
8391
  occupancy_pct?: number;
7203
- order_id?: string;
8392
+ order_id?: string | null;
7204
8393
  source?: string;
7205
8394
  total_layers_used?: number;
7206
8395
  updated_at?: string;
7207
8396
  };
7208
8397
  Relationships: [
8398
+ {
8399
+ foreignKeyName: "order_carts_buffer_id_fkey";
8400
+ columns: ["buffer_id"];
8401
+ isOneToOne: false;
8402
+ referencedRelation: "order_buffers";
8403
+ referencedColumns: ["id"];
8404
+ },
7209
8405
  {
7210
8406
  foreignKeyName: "order_carts_order_id_fkey";
7211
8407
  columns: ["order_id"];
@@ -7456,12 +8652,14 @@ export type Database = {
7456
8652
  };
7457
8653
  orders: {
7458
8654
  Row: {
8655
+ buffer_id: string | null;
7459
8656
  created_at: string;
7460
8657
  custom_fields: Json;
7461
8658
  customer_id: string | null;
7462
8659
  customer_name: string;
7463
8660
  deleted_at: string | null;
7464
8661
  delivery_date: string | null;
8662
+ floriday_sales_order_id: string | null;
7465
8663
  id: string;
7466
8664
  is_reservation: boolean;
7467
8665
  notes: string | null;
@@ -7475,12 +8673,14 @@ export type Database = {
7475
8673
  updated_at: string;
7476
8674
  };
7477
8675
  Insert: {
8676
+ buffer_id?: string | null;
7478
8677
  created_at?: string;
7479
8678
  custom_fields?: Json;
7480
8679
  customer_id?: string | null;
7481
8680
  customer_name?: string;
7482
8681
  deleted_at?: string | null;
7483
8682
  delivery_date?: string | null;
8683
+ floriday_sales_order_id?: string | null;
7484
8684
  id?: string;
7485
8685
  is_reservation?: boolean;
7486
8686
  notes?: string | null;
@@ -7494,12 +8694,14 @@ export type Database = {
7494
8694
  updated_at?: string;
7495
8695
  };
7496
8696
  Update: {
8697
+ buffer_id?: string | null;
7497
8698
  created_at?: string;
7498
8699
  custom_fields?: Json;
7499
8700
  customer_id?: string | null;
7500
8701
  customer_name?: string;
7501
8702
  deleted_at?: string | null;
7502
8703
  delivery_date?: string | null;
8704
+ floriday_sales_order_id?: string | null;
7503
8705
  id?: string;
7504
8706
  is_reservation?: boolean;
7505
8707
  notes?: string | null;
@@ -7513,6 +8715,13 @@ export type Database = {
7513
8715
  updated_at?: string;
7514
8716
  };
7515
8717
  Relationships: [
8718
+ {
8719
+ foreignKeyName: "orders_buffer_id_fkey";
8720
+ columns: ["buffer_id"];
8721
+ isOneToOne: false;
8722
+ referencedRelation: "order_buffers";
8723
+ referencedColumns: ["id"];
8724
+ },
7516
8725
  {
7517
8726
  foreignKeyName: "orders_customer_id_fkey";
7518
8727
  columns: ["customer_id"];
@@ -7645,6 +8854,82 @@ export type Database = {
7645
8854
  };
7646
8855
  Relationships: [];
7647
8856
  };
8857
+ planning_item_assistants: {
8858
+ Row: {
8859
+ created_at: string;
8860
+ created_by: string | null;
8861
+ monteur_id: string;
8862
+ planning_item_id: string;
8863
+ };
8864
+ Insert: {
8865
+ created_at?: string;
8866
+ created_by?: string | null;
8867
+ monteur_id: string;
8868
+ planning_item_id: string;
8869
+ };
8870
+ Update: {
8871
+ created_at?: string;
8872
+ created_by?: string | null;
8873
+ monteur_id?: string;
8874
+ planning_item_id?: string;
8875
+ };
8876
+ Relationships: [
8877
+ {
8878
+ foreignKeyName: "planning_item_assistants_planning_item_id_fkey";
8879
+ columns: ["planning_item_id"];
8880
+ isOneToOne: false;
8881
+ referencedRelation: "planning_items";
8882
+ referencedColumns: ["id"];
8883
+ }
8884
+ ];
8885
+ };
8886
+ planning_items: {
8887
+ Row: {
8888
+ assigned_monteur_id: string;
8889
+ created_at: string;
8890
+ created_by: string | null;
8891
+ end_at: string;
8892
+ id: string;
8893
+ notes: string | null;
8894
+ start_at: string;
8895
+ status: Database["public"]["Enums"]["planning_item_status"];
8896
+ updated_at: string;
8897
+ werkbon_id: string;
8898
+ };
8899
+ Insert: {
8900
+ assigned_monteur_id: string;
8901
+ created_at?: string;
8902
+ created_by?: string | null;
8903
+ end_at: string;
8904
+ id?: string;
8905
+ notes?: string | null;
8906
+ start_at: string;
8907
+ status?: Database["public"]["Enums"]["planning_item_status"];
8908
+ updated_at?: string;
8909
+ werkbon_id: string;
8910
+ };
8911
+ Update: {
8912
+ assigned_monteur_id?: string;
8913
+ created_at?: string;
8914
+ created_by?: string | null;
8915
+ end_at?: string;
8916
+ id?: string;
8917
+ notes?: string | null;
8918
+ start_at?: string;
8919
+ status?: Database["public"]["Enums"]["planning_item_status"];
8920
+ updated_at?: string;
8921
+ werkbon_id?: string;
8922
+ };
8923
+ Relationships: [
8924
+ {
8925
+ foreignKeyName: "planning_items_werkbon_id_fkey";
8926
+ columns: ["werkbon_id"];
8927
+ isOneToOne: false;
8928
+ referencedRelation: "werkbonnen";
8929
+ referencedColumns: ["id"];
8930
+ }
8931
+ ];
8932
+ };
7648
8933
  product_bom_items: {
7649
8934
  Row: {
7650
8935
  component_product_id: string | null;
@@ -7652,6 +8937,7 @@ export type Database = {
7652
8937
  created_at: string;
7653
8938
  id: string;
7654
8939
  notes: string | null;
8940
+ packing_configuration_id: string | null;
7655
8941
  parent_product_id: string | null;
7656
8942
  parent_trade_item_floriday_id: string | null;
7657
8943
  quantity: number;
@@ -7666,6 +8952,7 @@ export type Database = {
7666
8952
  created_at?: string;
7667
8953
  id?: string;
7668
8954
  notes?: string | null;
8955
+ packing_configuration_id?: string | null;
7669
8956
  parent_product_id?: string | null;
7670
8957
  parent_trade_item_floriday_id?: string | null;
7671
8958
  quantity?: number;
@@ -7680,6 +8967,7 @@ export type Database = {
7680
8967
  created_at?: string;
7681
8968
  id?: string;
7682
8969
  notes?: string | null;
8970
+ packing_configuration_id?: string | null;
7683
8971
  parent_product_id?: string | null;
7684
8972
  parent_trade_item_floriday_id?: string | null;
7685
8973
  quantity?: number;
@@ -7890,11 +9178,13 @@ export type Database = {
7890
9178
  created_at: string;
7891
9179
  id: string;
7892
9180
  is_package: boolean;
9181
+ label: string | null;
7893
9182
  layers_per_load_carrier: number | null;
7894
9183
  load_carrier: string | null;
7895
9184
  package_id: string | null;
7896
9185
  package_label: string | null;
7897
9186
  packages_per_layer: number | null;
9187
+ packing_configuration_id: string;
7898
9188
  product_id: string | null;
7899
9189
  tenant_id: string;
7900
9190
  trade_item_floriday_id: string | null;
@@ -7905,11 +9195,13 @@ export type Database = {
7905
9195
  created_at?: string;
7906
9196
  id?: string;
7907
9197
  is_package?: boolean;
9198
+ label?: string | null;
7908
9199
  layers_per_load_carrier?: number | null;
7909
9200
  load_carrier?: string | null;
7910
9201
  package_id?: string | null;
7911
9202
  package_label?: string | null;
7912
9203
  packages_per_layer?: number | null;
9204
+ packing_configuration_id?: string;
7913
9205
  product_id?: string | null;
7914
9206
  tenant_id: string;
7915
9207
  trade_item_floriday_id?: string | null;
@@ -7920,11 +9212,13 @@ export type Database = {
7920
9212
  created_at?: string;
7921
9213
  id?: string;
7922
9214
  is_package?: boolean;
9215
+ label?: string | null;
7923
9216
  layers_per_load_carrier?: number | null;
7924
9217
  load_carrier?: string | null;
7925
9218
  package_id?: string | null;
7926
9219
  package_label?: string | null;
7927
9220
  packages_per_layer?: number | null;
9221
+ packing_configuration_id?: string;
7928
9222
  product_id?: string | null;
7929
9223
  tenant_id?: string;
7930
9224
  trade_item_floriday_id?: string | null;
@@ -7989,8 +9283,6 @@ export type Database = {
7989
9283
  crates_per_layer: number;
7990
9284
  created_at: string;
7991
9285
  custom_fields: Json;
7992
- floriday_active: boolean;
7993
- floriday_payload: Json;
7994
9286
  floriday_trade_item_id: string | null;
7995
9287
  id: string;
7996
9288
  image_url: string | null;
@@ -8017,8 +9309,6 @@ export type Database = {
8017
9309
  crates_per_layer?: number;
8018
9310
  created_at?: string;
8019
9311
  custom_fields?: Json;
8020
- floriday_active?: boolean;
8021
- floriday_payload?: Json;
8022
9312
  floriday_trade_item_id?: string | null;
8023
9313
  id?: string;
8024
9314
  image_url?: string | null;
@@ -8045,8 +9335,6 @@ export type Database = {
8045
9335
  crates_per_layer?: number;
8046
9336
  created_at?: string;
8047
9337
  custom_fields?: Json;
8048
- floriday_active?: boolean;
8049
- floriday_payload?: Json;
8050
9338
  floriday_trade_item_id?: string | null;
8051
9339
  id?: string;
8052
9340
  image_url?: string | null;
@@ -8071,6 +9359,7 @@ export type Database = {
8071
9359
  profiles: {
8072
9360
  Row: {
8073
9361
  address: string | null;
9362
+ avatar_url: string | null;
8074
9363
  created_at: string;
8075
9364
  display_name: string | null;
8076
9365
  email: string | null;
@@ -8082,6 +9371,7 @@ export type Database = {
8082
9371
  };
8083
9372
  Insert: {
8084
9373
  address?: string | null;
9374
+ avatar_url?: string | null;
8085
9375
  created_at?: string;
8086
9376
  display_name?: string | null;
8087
9377
  email?: string | null;
@@ -8093,6 +9383,7 @@ export type Database = {
8093
9383
  };
8094
9384
  Update: {
8095
9385
  address?: string | null;
9386
+ avatar_url?: string | null;
8096
9387
  created_at?: string;
8097
9388
  display_name?: string | null;
8098
9389
  email?: string | null;
@@ -8989,7 +10280,6 @@ export type Database = {
8989
10280
  order_id: string | null;
8990
10281
  order_item_id: string | null;
8991
10282
  order_source: string | null;
8992
- parent_trade_item_key: string | null;
8993
10283
  physical_after: number | null;
8994
10284
  physical_before: number | null;
8995
10285
  production_batch_id: string | null;
@@ -9008,7 +10298,6 @@ export type Database = {
9008
10298
  order_id?: string | null;
9009
10299
  order_item_id?: string | null;
9010
10300
  order_source?: string | null;
9011
- parent_trade_item_key?: string | null;
9012
10301
  physical_after?: number | null;
9013
10302
  physical_before?: number | null;
9014
10303
  production_batch_id?: string | null;
@@ -9027,7 +10316,6 @@ export type Database = {
9027
10316
  order_id?: string | null;
9028
10317
  order_item_id?: string | null;
9029
10318
  order_source?: string | null;
9030
- parent_trade_item_key?: string | null;
9031
10319
  physical_after?: number | null;
9032
10320
  physical_before?: number | null;
9033
10321
  production_batch_id?: string | null;
@@ -9134,6 +10422,27 @@ export type Database = {
9134
10422
  };
9135
10423
  Relationships: [];
9136
10424
  };
10425
+ technician_rates: {
10426
+ Row: {
10427
+ created_at: string;
10428
+ hourly_rate_cents: number;
10429
+ updated_at: string;
10430
+ user_id: string;
10431
+ };
10432
+ Insert: {
10433
+ created_at?: string;
10434
+ hourly_rate_cents?: number;
10435
+ updated_at?: string;
10436
+ user_id: string;
10437
+ };
10438
+ Update: {
10439
+ created_at?: string;
10440
+ hourly_rate_cents?: number;
10441
+ updated_at?: string;
10442
+ user_id?: string;
10443
+ };
10444
+ Relationships: [];
10445
+ };
9137
10446
  tenants: {
9138
10447
  Row: {
9139
10448
  created_at: string;
@@ -9336,9 +10645,51 @@ export type Database = {
9336
10645
  floriday_link_error?: string | null;
9337
10646
  floriday_link_status?: string;
9338
10647
  id?: string;
9339
- last_floriday_sync_at?: string | null;
9340
- missing_required_fields?: string[];
9341
- source?: string;
10648
+ last_floriday_sync_at?: string | null;
10649
+ missing_required_fields?: string[];
10650
+ source?: string;
10651
+ updated_at?: string;
10652
+ user_id?: string;
10653
+ };
10654
+ Relationships: [];
10655
+ };
10656
+ trade_item_prices: {
10657
+ Row: {
10658
+ created_at: string;
10659
+ currency: string;
10660
+ id: string;
10661
+ last_push_error: string | null;
10662
+ last_pushed_at: string | null;
10663
+ price_group_id: string | null;
10664
+ price_per_piece: number;
10665
+ supply_line_id: string | null;
10666
+ trade_item_key: string;
10667
+ updated_at: string;
10668
+ user_id: string;
10669
+ };
10670
+ Insert: {
10671
+ created_at?: string;
10672
+ currency?: string;
10673
+ id?: string;
10674
+ last_push_error?: string | null;
10675
+ last_pushed_at?: string | null;
10676
+ price_group_id?: string | null;
10677
+ price_per_piece: number;
10678
+ supply_line_id?: string | null;
10679
+ trade_item_key: string;
10680
+ updated_at?: string;
10681
+ user_id: string;
10682
+ };
10683
+ Update: {
10684
+ created_at?: string;
10685
+ currency?: string;
10686
+ id?: string;
10687
+ last_push_error?: string | null;
10688
+ last_pushed_at?: string | null;
10689
+ price_group_id?: string | null;
10690
+ price_per_piece?: number;
10691
+ supply_line_id?: string | null;
10692
+ trade_item_key?: string;
9342
10693
  updated_at?: string;
9343
10694
  user_id?: string;
9344
10695
  };
@@ -9499,7 +10850,7 @@ export type Database = {
9499
10850
  twinfield_connections: {
9500
10851
  Row: {
9501
10852
  access_token: string | null;
9502
- client_id: string | null;
10853
+ client_id: string;
9503
10854
  client_secret: string | null;
9504
10855
  cluster_uri: string | null;
9505
10856
  company_code: string | null;
@@ -9511,7 +10862,7 @@ export type Database = {
9511
10862
  is_active: boolean;
9512
10863
  label: string | null;
9513
10864
  office_code: string | null;
9514
- redirect_uri: string | null;
10865
+ redirect_uri: string;
9515
10866
  refresh_token: string | null;
9516
10867
  token_expires_at: string | null;
9517
10868
  updated_at: string;
@@ -9519,7 +10870,7 @@ export type Database = {
9519
10870
  };
9520
10871
  Insert: {
9521
10872
  access_token?: string | null;
9522
- client_id?: string | null;
10873
+ client_id: string;
9523
10874
  client_secret?: string | null;
9524
10875
  cluster_uri?: string | null;
9525
10876
  company_code?: string | null;
@@ -9531,7 +10882,7 @@ export type Database = {
9531
10882
  is_active?: boolean;
9532
10883
  label?: string | null;
9533
10884
  office_code?: string | null;
9534
- redirect_uri?: string | null;
10885
+ redirect_uri: string;
9535
10886
  refresh_token?: string | null;
9536
10887
  token_expires_at?: string | null;
9537
10888
  updated_at?: string;
@@ -9539,7 +10890,7 @@ export type Database = {
9539
10890
  };
9540
10891
  Update: {
9541
10892
  access_token?: string | null;
9542
- client_id?: string | null;
10893
+ client_id?: string;
9543
10894
  client_secret?: string | null;
9544
10895
  cluster_uri?: string | null;
9545
10896
  company_code?: string | null;
@@ -9551,7 +10902,7 @@ export type Database = {
9551
10902
  is_active?: boolean;
9552
10903
  label?: string | null;
9553
10904
  office_code?: string | null;
9554
- redirect_uri?: string | null;
10905
+ redirect_uri?: string;
9555
10906
  refresh_token?: string | null;
9556
10907
  token_expires_at?: string | null;
9557
10908
  updated_at?: string;
@@ -9611,6 +10962,7 @@ export type Database = {
9611
10962
  country: string | null;
9612
10963
  created_at: string;
9613
10964
  email: string | null;
10965
+ external_group_key: string | null;
9614
10966
  id: string;
9615
10967
  last_synced_at: string | null;
9616
10968
  name: string;
@@ -9629,6 +10981,7 @@ export type Database = {
9629
10981
  country?: string | null;
9630
10982
  created_at?: string;
9631
10983
  email?: string | null;
10984
+ external_group_key?: string | null;
9632
10985
  id?: string;
9633
10986
  last_synced_at?: string | null;
9634
10987
  name: string;
@@ -9647,6 +11000,7 @@ export type Database = {
9647
11000
  country?: string | null;
9648
11001
  created_at?: string;
9649
11002
  email?: string | null;
11003
+ external_group_key?: string | null;
9650
11004
  id?: string;
9651
11005
  last_synced_at?: string | null;
9652
11006
  name?: string;
@@ -9814,9 +11168,58 @@ export type Database = {
9814
11168
  }
9815
11169
  ];
9816
11170
  };
11171
+ twinfield_invoice_pdf_cache: {
11172
+ Row: {
11173
+ connection_id: string;
11174
+ created_at: string;
11175
+ fetched_at: string;
11176
+ id: string;
11177
+ invoice_number: string;
11178
+ last_accessed_at: string;
11179
+ object_path: string;
11180
+ office_code: string;
11181
+ size_bytes: number;
11182
+ updated_at: string;
11183
+ };
11184
+ Insert: {
11185
+ connection_id: string;
11186
+ created_at?: string;
11187
+ fetched_at?: string;
11188
+ id?: string;
11189
+ invoice_number: string;
11190
+ last_accessed_at?: string;
11191
+ object_path: string;
11192
+ office_code: string;
11193
+ size_bytes?: number;
11194
+ updated_at?: string;
11195
+ };
11196
+ Update: {
11197
+ connection_id?: string;
11198
+ created_at?: string;
11199
+ fetched_at?: string;
11200
+ id?: string;
11201
+ invoice_number?: string;
11202
+ last_accessed_at?: string;
11203
+ object_path?: string;
11204
+ office_code?: string;
11205
+ size_bytes?: number;
11206
+ updated_at?: string;
11207
+ };
11208
+ Relationships: [
11209
+ {
11210
+ foreignKeyName: "twinfield_invoice_pdf_cache_connection_id_fkey";
11211
+ columns: ["connection_id"];
11212
+ isOneToOne: false;
11213
+ referencedRelation: "twinfield_connections";
11214
+ referencedColumns: ["id"];
11215
+ }
11216
+ ];
11217
+ };
9817
11218
  twinfield_invoice_settings: {
9818
11219
  Row: {
9819
11220
  created_at: string;
11221
+ debtor_gl_account: string;
11222
+ default_credit_invoice_type: string | null;
9820
11223
  default_gl_account: string;
9821
11224
  default_invoice_type: string;
9822
11225
  default_payment_term_days: number;
@@ -9825,11 +11228,15 @@ export type Database = {
9825
11228
  invoice_enabled_fo: boolean;
9826
11229
  invoice_enabled_ho: boolean;
9827
11230
  invoice_enabled_mo: boolean;
11231
+ payment_gl_account: string;
11232
+ payment_journal_code: string;
9828
11233
  updated_at: string;
9829
11234
  user_id: string;
9830
11235
  };
9831
11236
  Insert: {
9832
11237
  created_at?: string;
11238
+ debtor_gl_account?: string;
11239
+ default_credit_invoice_type?: string | null;
9833
11240
  default_gl_account?: string;
9834
11241
  default_invoice_type?: string;
9835
11242
  default_payment_term_days?: number;
@@ -9838,11 +11245,15 @@ export type Database = {
9838
11245
  invoice_enabled_fo?: boolean;
9839
11246
  invoice_enabled_ho?: boolean;
9840
11247
  invoice_enabled_mo?: boolean;
11248
+ payment_gl_account?: string;
11249
+ payment_journal_code?: string;
9841
11250
  updated_at?: string;
9842
11251
  user_id: string;
9843
11252
  };
9844
11253
  Update: {
9845
11254
  created_at?: string;
11255
+ debtor_gl_account?: string;
11256
+ default_credit_invoice_type?: string | null;
9846
11257
  default_gl_account?: string;
9847
11258
  default_invoice_type?: string;
9848
11259
  default_payment_term_days?: number;
@@ -9851,6 +11262,8 @@ export type Database = {
9851
11262
  invoice_enabled_fo?: boolean;
9852
11263
  invoice_enabled_ho?: boolean;
9853
11264
  invoice_enabled_mo?: boolean;
11265
+ payment_gl_account?: string;
11266
+ payment_journal_code?: string;
9854
11267
  updated_at?: string;
9855
11268
  user_id?: string;
9856
11269
  };
@@ -10073,43 +11486,49 @@ export type Database = {
10073
11486
  };
10074
11487
  twinfield_push_queue: {
10075
11488
  Row: {
11489
+ action: string;
10076
11490
  attempts: number;
10077
11491
  connection_id: string;
10078
11492
  created_at: string;
11493
+ customer_id: string | null;
10079
11494
  external_id: string | null;
10080
11495
  id: string;
10081
11496
  idempotency_key: string;
10082
11497
  last_error: string | null;
10083
11498
  next_attempt_at: string;
10084
- office_code: string;
11499
+ office_code: string | null;
10085
11500
  payload: Json;
10086
11501
  status: string;
10087
11502
  updated_at: string;
10088
11503
  };
10089
11504
  Insert: {
11505
+ action?: string;
10090
11506
  attempts?: number;
10091
11507
  connection_id: string;
10092
11508
  created_at?: string;
11509
+ customer_id?: string | null;
10093
11510
  external_id?: string | null;
10094
11511
  id?: string;
10095
11512
  idempotency_key: string;
10096
11513
  last_error?: string | null;
10097
11514
  next_attempt_at?: string;
10098
- office_code: string;
11515
+ office_code?: string | null;
10099
11516
  payload: Json;
10100
11517
  status?: string;
10101
11518
  updated_at?: string;
10102
11519
  };
10103
11520
  Update: {
11521
+ action?: string;
10104
11522
  attempts?: number;
10105
11523
  connection_id?: string;
10106
11524
  created_at?: string;
11525
+ customer_id?: string | null;
10107
11526
  external_id?: string | null;
10108
11527
  id?: string;
10109
11528
  idempotency_key?: string;
10110
11529
  last_error?: string | null;
10111
11530
  next_attempt_at?: string;
10112
- office_code?: string;
11531
+ office_code?: string | null;
10113
11532
  payload?: Json;
10114
11533
  status?: string;
10115
11534
  updated_at?: string;
@@ -10121,6 +11540,13 @@ export type Database = {
10121
11540
  isOneToOne: false;
10122
11541
  referencedRelation: "twinfield_connections";
10123
11542
  referencedColumns: ["id"];
11543
+ },
11544
+ {
11545
+ foreignKeyName: "twinfield_push_queue_customer_id_fkey";
11546
+ columns: ["customer_id"];
11547
+ isOneToOne: false;
11548
+ referencedRelation: "customers";
11549
+ referencedColumns: ["id"];
10124
11550
  }
10125
11551
  ];
10126
11552
  };
@@ -10358,50 +11784,412 @@ export type Database = {
10358
11784
  };
10359
11785
  Relationships: [];
10360
11786
  };
10361
- voorraad_publish_attempts: {
11787
+ voorraad_publish_attempts: {
11788
+ Row: {
11789
+ action: string;
11790
+ connection_id: string | null;
11791
+ created_at: string;
11792
+ error: string | null;
11793
+ gateway_attempt_id: string | null;
11794
+ gateway_status: number | null;
11795
+ id: string;
11796
+ intent: string;
11797
+ ok: boolean;
11798
+ request_summary: Json | null;
11799
+ trade_item_id: string | null;
11800
+ user_id: string;
11801
+ };
11802
+ Insert: {
11803
+ action: string;
11804
+ connection_id?: string | null;
11805
+ created_at?: string;
11806
+ error?: string | null;
11807
+ gateway_attempt_id?: string | null;
11808
+ gateway_status?: number | null;
11809
+ id?: string;
11810
+ intent: string;
11811
+ ok: boolean;
11812
+ request_summary?: Json | null;
11813
+ trade_item_id?: string | null;
11814
+ user_id: string;
11815
+ };
11816
+ Update: {
11817
+ action?: string;
11818
+ connection_id?: string | null;
11819
+ created_at?: string;
11820
+ error?: string | null;
11821
+ gateway_attempt_id?: string | null;
11822
+ gateway_status?: number | null;
11823
+ id?: string;
11824
+ intent?: string;
11825
+ ok?: boolean;
11826
+ request_summary?: Json | null;
11827
+ trade_item_id?: string | null;
11828
+ user_id?: string;
11829
+ };
11830
+ Relationships: [];
11831
+ };
11832
+ werkbon_package_ai_rules: {
11833
+ Row: {
11834
+ active: boolean;
11835
+ case_sensitive: boolean;
11836
+ created_at: string;
11837
+ id: string;
11838
+ package_id: string;
11839
+ priority: number;
11840
+ rule_type: string;
11841
+ updated_at: string;
11842
+ value: string;
11843
+ };
11844
+ Insert: {
11845
+ active?: boolean;
11846
+ case_sensitive?: boolean;
11847
+ created_at?: string;
11848
+ id?: string;
11849
+ package_id: string;
11850
+ priority?: number;
11851
+ rule_type: string;
11852
+ updated_at?: string;
11853
+ value: string;
11854
+ };
11855
+ Update: {
11856
+ active?: boolean;
11857
+ case_sensitive?: boolean;
11858
+ created_at?: string;
11859
+ id?: string;
11860
+ package_id?: string;
11861
+ priority?: number;
11862
+ rule_type?: string;
11863
+ updated_at?: string;
11864
+ value?: string;
11865
+ };
11866
+ Relationships: [
11867
+ {
11868
+ foreignKeyName: "werkbon_package_ai_rules_package_id_fkey";
11869
+ columns: ["package_id"];
11870
+ isOneToOne: false;
11871
+ referencedRelation: "werkbon_packages";
11872
+ referencedColumns: ["id"];
11873
+ }
11874
+ ];
11875
+ };
11876
+ werkbon_package_categories: {
11877
+ Row: {
11878
+ active: boolean;
11879
+ created_at: string;
11880
+ id: string;
11881
+ kleur: string | null;
11882
+ naam: string;
11883
+ sort_order: number;
11884
+ updated_at: string;
11885
+ };
11886
+ Insert: {
11887
+ active?: boolean;
11888
+ created_at?: string;
11889
+ id?: string;
11890
+ kleur?: string | null;
11891
+ naam: string;
11892
+ sort_order?: number;
11893
+ updated_at?: string;
11894
+ };
11895
+ Update: {
11896
+ active?: boolean;
11897
+ created_at?: string;
11898
+ id?: string;
11899
+ kleur?: string | null;
11900
+ naam?: string;
11901
+ sort_order?: number;
11902
+ updated_at?: string;
11903
+ };
11904
+ Relationships: [];
11905
+ };
11906
+ werkbon_package_lines: {
11907
+ Row: {
11908
+ created_at: string;
11909
+ created_by: string | null;
11910
+ id: string;
11911
+ package_id: string;
11912
+ quantity: number;
11913
+ unit_price_cents_snapshot: number;
11914
+ werkbon_id: string;
11915
+ };
11916
+ Insert: {
11917
+ created_at?: string;
11918
+ created_by?: string | null;
11919
+ id?: string;
11920
+ package_id: string;
11921
+ quantity?: number;
11922
+ unit_price_cents_snapshot?: number;
11923
+ werkbon_id: string;
11924
+ };
11925
+ Update: {
11926
+ created_at?: string;
11927
+ created_by?: string | null;
11928
+ id?: string;
11929
+ package_id?: string;
11930
+ quantity?: number;
11931
+ unit_price_cents_snapshot?: number;
11932
+ werkbon_id?: string;
11933
+ };
11934
+ Relationships: [
11935
+ {
11936
+ foreignKeyName: "werkbon_package_lines_package_id_fkey";
11937
+ columns: ["package_id"];
11938
+ isOneToOne: false;
11939
+ referencedRelation: "werkbon_packages";
11940
+ referencedColumns: ["id"];
11941
+ },
11942
+ {
11943
+ foreignKeyName: "werkbon_package_lines_werkbon_id_fkey";
11944
+ columns: ["werkbon_id"];
11945
+ isOneToOne: false;
11946
+ referencedRelation: "werkbonnen";
11947
+ referencedColumns: ["id"];
11948
+ }
11949
+ ];
11950
+ };
11951
+ werkbon_packages: {
11952
+ Row: {
11953
+ active: boolean;
11954
+ ai_tags: string[];
11955
+ category_id: string | null;
11956
+ code: string;
11957
+ created_at: string;
11958
+ default_quantity: number;
11959
+ description: string | null;
11960
+ duration_minutes: number | null;
11961
+ id: string;
11962
+ mandaat_type: string | null;
11963
+ name: string;
11964
+ sort_order: number;
11965
+ unit_price_cents: number;
11966
+ updated_at: string;
11967
+ };
11968
+ Insert: {
11969
+ active?: boolean;
11970
+ ai_tags?: string[];
11971
+ category_id?: string | null;
11972
+ code: string;
11973
+ created_at?: string;
11974
+ default_quantity?: number;
11975
+ description?: string | null;
11976
+ duration_minutes?: number | null;
11977
+ id?: string;
11978
+ mandaat_type?: string | null;
11979
+ name: string;
11980
+ sort_order?: number;
11981
+ unit_price_cents?: number;
11982
+ updated_at?: string;
11983
+ };
11984
+ Update: {
11985
+ active?: boolean;
11986
+ ai_tags?: string[];
11987
+ category_id?: string | null;
11988
+ code?: string;
11989
+ created_at?: string;
11990
+ default_quantity?: number;
11991
+ description?: string | null;
11992
+ duration_minutes?: number | null;
11993
+ id?: string;
11994
+ mandaat_type?: string | null;
11995
+ name?: string;
11996
+ sort_order?: number;
11997
+ unit_price_cents?: number;
11998
+ updated_at?: string;
11999
+ };
12000
+ Relationships: [
12001
+ {
12002
+ foreignKeyName: "werkbon_packages_category_id_fkey";
12003
+ columns: ["category_id"];
12004
+ isOneToOne: false;
12005
+ referencedRelation: "werkbon_package_categories";
12006
+ referencedColumns: ["id"];
12007
+ }
12008
+ ];
12009
+ };
12010
+ werkbon_photos: {
12011
+ Row: {
12012
+ created_at: string;
12013
+ id: string;
12014
+ storage_path: string;
12015
+ user_id: string;
12016
+ werkbon_id: string;
12017
+ };
12018
+ Insert: {
12019
+ created_at?: string;
12020
+ id?: string;
12021
+ storage_path: string;
12022
+ user_id: string;
12023
+ werkbon_id: string;
12024
+ };
12025
+ Update: {
12026
+ created_at?: string;
12027
+ id?: string;
12028
+ storage_path?: string;
12029
+ user_id?: string;
12030
+ werkbon_id?: string;
12031
+ };
12032
+ Relationships: [
12033
+ {
12034
+ foreignKeyName: "werkbon_photos_werkbon_id_fkey";
12035
+ columns: ["werkbon_id"];
12036
+ isOneToOne: false;
12037
+ referencedRelation: "werkbonnen";
12038
+ referencedColumns: ["id"];
12039
+ }
12040
+ ];
12041
+ };
12042
+ werkbon_time_logs: {
10362
12043
  Row: {
10363
- action: string;
10364
- connection_id: string | null;
12044
+ activity: string;
10365
12045
  created_at: string;
10366
- error: string | null;
10367
- gateway_attempt_id: string | null;
10368
- gateway_status: number | null;
12046
+ ended_at: string | null;
10369
12047
  id: string;
10370
- intent: string;
10371
- ok: boolean;
10372
- request_summary: Json | null;
10373
- trade_item_id: string | null;
12048
+ started_at: string;
10374
12049
  user_id: string;
12050
+ werkbon_id: string;
10375
12051
  };
10376
12052
  Insert: {
10377
- action: string;
10378
- connection_id?: string | null;
12053
+ activity: string;
10379
12054
  created_at?: string;
10380
- error?: string | null;
10381
- gateway_attempt_id?: string | null;
10382
- gateway_status?: number | null;
12055
+ ended_at?: string | null;
10383
12056
  id?: string;
10384
- intent: string;
10385
- ok: boolean;
10386
- request_summary?: Json | null;
10387
- trade_item_id?: string | null;
12057
+ started_at?: string;
10388
12058
  user_id: string;
12059
+ werkbon_id: string;
10389
12060
  };
10390
12061
  Update: {
10391
- action?: string;
10392
- connection_id?: string | null;
12062
+ activity?: string;
10393
12063
  created_at?: string;
10394
- error?: string | null;
10395
- gateway_attempt_id?: string | null;
10396
- gateway_status?: number | null;
12064
+ ended_at?: string | null;
10397
12065
  id?: string;
10398
- intent?: string;
10399
- ok?: boolean;
10400
- request_summary?: Json | null;
10401
- trade_item_id?: string | null;
12066
+ started_at?: string;
10402
12067
  user_id?: string;
12068
+ werkbon_id?: string;
10403
12069
  };
10404
- Relationships: [];
12070
+ Relationships: [
12071
+ {
12072
+ foreignKeyName: "werkbon_time_logs_werkbon_id_fkey";
12073
+ columns: ["werkbon_id"];
12074
+ isOneToOne: false;
12075
+ referencedRelation: "werkbonnen";
12076
+ referencedColumns: ["id"];
12077
+ }
12078
+ ];
12079
+ };
12080
+ werkbonnen: {
12081
+ Row: {
12082
+ assigned_user_id: string | null;
12083
+ budget_mandate_cents: number;
12084
+ complaint_description: string | null;
12085
+ created_at: string;
12086
+ created_by: string | null;
12087
+ customer_id: string | null;
12088
+ externe_referentie: string | null;
12089
+ first_time_fix: boolean | null;
12090
+ id: string;
12091
+ internal_notes: string | null;
12092
+ parent_werkbon_id: string | null;
12093
+ parsed_payload: Json | null;
12094
+ planning_status: string;
12095
+ project_number: string | null;
12096
+ room_number: string | null;
12097
+ scheduled_end_time: string | null;
12098
+ scheduled_start_time: string | null;
12099
+ sequence_number: number;
12100
+ source_email_meta: Json | null;
12101
+ source_mailbox_message_id: string | null;
12102
+ source_pdf_path: string | null;
12103
+ source_type: string;
12104
+ status: string;
12105
+ technician_id: string | null;
12106
+ technician_notes: string | null;
12107
+ technician_notes_raw: string | null;
12108
+ technician_task_description: string | null;
12109
+ updated_at: string;
12110
+ version: number;
12111
+ work_address: string | null;
12112
+ };
12113
+ Insert: {
12114
+ assigned_user_id?: string | null;
12115
+ budget_mandate_cents?: number;
12116
+ complaint_description?: string | null;
12117
+ created_at?: string;
12118
+ created_by?: string | null;
12119
+ customer_id?: string | null;
12120
+ externe_referentie?: string | null;
12121
+ first_time_fix?: boolean | null;
12122
+ id?: string;
12123
+ internal_notes?: string | null;
12124
+ parent_werkbon_id?: string | null;
12125
+ parsed_payload?: Json | null;
12126
+ planning_status?: string;
12127
+ project_number?: string | null;
12128
+ room_number?: string | null;
12129
+ scheduled_end_time?: string | null;
12130
+ scheduled_start_time?: string | null;
12131
+ sequence_number: number;
12132
+ source_email_meta?: Json | null;
12133
+ source_mailbox_message_id?: string | null;
12134
+ source_pdf_path?: string | null;
12135
+ source_type?: string;
12136
+ status?: string;
12137
+ technician_id?: string | null;
12138
+ technician_notes?: string | null;
12139
+ technician_notes_raw?: string | null;
12140
+ technician_task_description?: string | null;
12141
+ updated_at?: string;
12142
+ version?: number;
12143
+ work_address?: string | null;
12144
+ };
12145
+ Update: {
12146
+ assigned_user_id?: string | null;
12147
+ budget_mandate_cents?: number;
12148
+ complaint_description?: string | null;
12149
+ created_at?: string;
12150
+ created_by?: string | null;
12151
+ customer_id?: string | null;
12152
+ externe_referentie?: string | null;
12153
+ first_time_fix?: boolean | null;
12154
+ id?: string;
12155
+ internal_notes?: string | null;
12156
+ parent_werkbon_id?: string | null;
12157
+ parsed_payload?: Json | null;
12158
+ planning_status?: string;
12159
+ project_number?: string | null;
12160
+ room_number?: string | null;
12161
+ scheduled_end_time?: string | null;
12162
+ scheduled_start_time?: string | null;
12163
+ sequence_number?: number;
12164
+ source_email_meta?: Json | null;
12165
+ source_mailbox_message_id?: string | null;
12166
+ source_pdf_path?: string | null;
12167
+ source_type?: string;
12168
+ status?: string;
12169
+ technician_id?: string | null;
12170
+ technician_notes?: string | null;
12171
+ technician_notes_raw?: string | null;
12172
+ technician_task_description?: string | null;
12173
+ updated_at?: string;
12174
+ version?: number;
12175
+ work_address?: string | null;
12176
+ };
12177
+ Relationships: [
12178
+ {
12179
+ foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
12180
+ columns: ["parent_werkbon_id"];
12181
+ isOneToOne: false;
12182
+ referencedRelation: "werkbonnen";
12183
+ referencedColumns: ["id"];
12184
+ },
12185
+ {
12186
+ foreignKeyName: "werkbonnen_source_mailbox_message_id_fkey";
12187
+ columns: ["source_mailbox_message_id"];
12188
+ isOneToOne: false;
12189
+ referencedRelation: "mailbox_messages";
12190
+ referencedColumns: ["id"];
12191
+ }
12192
+ ];
10405
12193
  };
10406
12194
  work_order_monteurs: {
10407
12195
  Row: {
@@ -10579,6 +12367,8 @@ export type Database = {
10579
12367
  created_at: string | null;
10580
12368
  created_by: string | null;
10581
12369
  display_name: string | null;
12370
+ graph_subscription_expires_at: string | null;
12371
+ graph_subscription_id: string | null;
10582
12372
  has_access_token: boolean | null;
10583
12373
  has_client_id: boolean | null;
10584
12374
  has_client_secret: boolean | null;
@@ -10596,6 +12386,7 @@ export type Database = {
10596
12386
  oauth_mode: string | null;
10597
12387
  provider: string | null;
10598
12388
  purpose_assignments: Json | null;
12389
+ realtime_mode: string | null;
10599
12390
  scopes: string[] | null;
10600
12391
  smtp_host: string | null;
10601
12392
  smtp_port: number | null;
@@ -10610,6 +12401,8 @@ export type Database = {
10610
12401
  created_at?: string | null;
10611
12402
  created_by?: string | null;
10612
12403
  display_name?: string | null;
12404
+ graph_subscription_expires_at?: string | null;
12405
+ graph_subscription_id?: string | null;
10613
12406
  has_access_token?: never;
10614
12407
  has_client_id?: never;
10615
12408
  has_client_secret?: never;
@@ -10627,6 +12420,7 @@ export type Database = {
10627
12420
  oauth_mode?: string | null;
10628
12421
  provider?: string | null;
10629
12422
  purpose_assignments?: Json | null;
12423
+ realtime_mode?: string | null;
10630
12424
  scopes?: string[] | null;
10631
12425
  smtp_host?: string | null;
10632
12426
  smtp_port?: number | null;
@@ -10641,6 +12435,8 @@ export type Database = {
10641
12435
  created_at?: string | null;
10642
12436
  created_by?: string | null;
10643
12437
  display_name?: string | null;
12438
+ graph_subscription_expires_at?: string | null;
12439
+ graph_subscription_id?: string | null;
10644
12440
  has_access_token?: never;
10645
12441
  has_client_id?: never;
10646
12442
  has_client_secret?: never;
@@ -10658,6 +12454,7 @@ export type Database = {
10658
12454
  oauth_mode?: string | null;
10659
12455
  provider?: string | null;
10660
12456
  purpose_assignments?: Json | null;
12457
+ realtime_mode?: string | null;
10661
12458
  scopes?: string[] | null;
10662
12459
  smtp_host?: string | null;
10663
12460
  smtp_port?: number | null;
@@ -10768,6 +12565,25 @@ export type Database = {
10768
12565
  };
10769
12566
  Relationships: [];
10770
12567
  };
12568
+ floriday_customer_discounts: {
12569
+ Row: {
12570
+ base_price: number | null;
12571
+ buyer_organization_id: string | null;
12572
+ currency: string | null;
12573
+ discount_type: string | null;
12574
+ discount_value: number | null;
12575
+ min_quantity: number | null;
12576
+ net_price: number | null;
12577
+ product_group_id: string | null;
12578
+ raw: Json | null;
12579
+ source: string | null;
12580
+ source_id: string | null;
12581
+ trade_item_id: string | null;
12582
+ valid_from: string | null;
12583
+ valid_until: string | null;
12584
+ };
12585
+ Relationships: [];
12586
+ };
10771
12587
  local_customer_discounts: {
10772
12588
  Row: {
10773
12589
  base_price: number | null;
@@ -11116,6 +12932,21 @@ export type Database = {
11116
12932
  };
11117
12933
  Returns: string;
11118
12934
  };
12935
+ ai_usage_by_module: {
12936
+ Args: {
12937
+ _from: string;
12938
+ _to: string;
12939
+ };
12940
+ Returns: {
12941
+ calls: number;
12942
+ consumer_module_id: string;
12943
+ cost_usd: number;
12944
+ errors: number;
12945
+ input_tokens: number;
12946
+ output_tokens: number;
12947
+ total_tokens: number;
12948
+ }[];
12949
+ };
11119
12950
  apply_stock_consumption: {
11120
12951
  Args: {
11121
12952
  p_order_id: string;
@@ -11173,6 +13004,12 @@ export type Database = {
11173
13004
  processed_items: number;
11174
13005
  }[];
11175
13006
  };
13007
+ calculate_layer_stock: {
13008
+ Args: {
13009
+ p_product_id: string;
13010
+ };
13011
+ Returns: number;
13012
+ };
11176
13013
  call_exact_route: {
11177
13014
  Args: {
11178
13015
  path: string;
@@ -11201,6 +13038,33 @@ export type Database = {
11201
13038
  };
11202
13039
  Returns: Json;
11203
13040
  };
13041
+ claim_twinfield_push_batch: {
13042
+ Args: {
13043
+ _limit?: number;
13044
+ };
13045
+ Returns: {
13046
+ action: string;
13047
+ attempts: number;
13048
+ connection_id: string;
13049
+ created_at: string;
13050
+ customer_id: string | null;
13051
+ external_id: string | null;
13052
+ id: string;
13053
+ idempotency_key: string;
13054
+ last_error: string | null;
13055
+ next_attempt_at: string;
13056
+ office_code: string | null;
13057
+ payload: Json;
13058
+ status: string;
13059
+ updated_at: string;
13060
+ }[];
13061
+ SetofOptions: {
13062
+ from: "*";
13063
+ to: "twinfield_push_queue";
13064
+ isOneToOne: false;
13065
+ isSetofReturn: true;
13066
+ };
13067
+ };
11204
13068
  cleanup_old_bookings: {
11205
13069
  Args: never;
11206
13070
  Returns: undefined;
@@ -11259,6 +13123,12 @@ export type Database = {
11259
13123
  Args: never;
11260
13124
  Returns: string;
11261
13125
  };
13126
+ custom_access_token_hook: {
13127
+ Args: {
13128
+ event: Json;
13129
+ };
13130
+ Returns: Json;
13131
+ };
11262
13132
  dashboard_alert_counts: {
11263
13133
  Args: never;
11264
13134
  Returns: Json;
@@ -11326,6 +13196,16 @@ export type Database = {
11326
13196
  status: string;
11327
13197
  }[];
11328
13198
  };
13199
+ email_auth_upsert_connection: {
13200
+ Args: {
13201
+ _account_email: string;
13202
+ _created_by: string;
13203
+ _is_active: boolean;
13204
+ _provider: string;
13205
+ _status: string;
13206
+ };
13207
+ Returns: string;
13208
+ };
11329
13209
  enqueue_cart_replan_if_unlocked: {
11330
13210
  Args: {
11331
13211
  p_order_id: string;
@@ -11445,6 +13325,19 @@ export type Database = {
11445
13325
  resource: string;
11446
13326
  }[];
11447
13327
  };
13328
+ get_floriday_agreements_active: {
13329
+ Args: {
13330
+ p_on_date?: string;
13331
+ };
13332
+ Returns: {
13333
+ buyer_organization_id: string;
13334
+ data: Json;
13335
+ floriday_id: string;
13336
+ status: string;
13337
+ valid_from: string;
13338
+ valid_until: string;
13339
+ }[];
13340
+ };
11448
13341
  get_floriday_clock_supplies_window: {
11449
13342
  Args: {
11450
13343
  p_from: string;
@@ -11532,6 +13425,12 @@ export type Database = {
11532
13425
  };
11533
13426
  Returns: string;
11534
13427
  };
13428
+ get_inventory_stock_for_key: {
13429
+ Args: {
13430
+ p_key: string;
13431
+ };
13432
+ Returns: number;
13433
+ };
11535
13434
  get_offer_by_link_code: {
11536
13435
  Args: {
11537
13436
  p_code: string;
@@ -11562,6 +13461,12 @@ export type Database = {
11562
13461
  };
11563
13462
  Returns: string;
11564
13463
  };
13464
+ get_product_group_available_stock: {
13465
+ Args: {
13466
+ p_group_id: string;
13467
+ };
13468
+ Returns: number;
13469
+ };
11565
13470
  get_room_busy_windows: {
11566
13471
  Args: {
11567
13472
  p_from: string;
@@ -11593,6 +13498,14 @@ export type Database = {
11593
13498
  };
11594
13499
  Returns: string;
11595
13500
  };
13501
+ has_module_permission: {
13502
+ Args: {
13503
+ _min: string;
13504
+ _module_id: string;
13505
+ _user_id: string;
13506
+ };
13507
+ Returns: boolean;
13508
+ };
11596
13509
  has_role: {
11597
13510
  Args: {
11598
13511
  _role: Database["public"]["Enums"]["app_role"];
@@ -11600,6 +13513,10 @@ export type Database = {
11600
13513
  };
11601
13514
  Returns: boolean;
11602
13515
  };
13516
+ has_twinfield_link: {
13517
+ Args: never;
13518
+ Returns: boolean;
13519
+ };
11603
13520
  is_authenticated: {
11604
13521
  Args: never;
11605
13522
  Returns: boolean;
@@ -11614,6 +13531,37 @@ export type Database = {
11614
13531
  };
11615
13532
  Returns: boolean;
11616
13533
  };
13534
+ jwt_has_role: {
13535
+ Args: {
13536
+ _role: Database["public"]["Enums"]["app_role"];
13537
+ };
13538
+ Returns: boolean;
13539
+ };
13540
+ list_monteurs: {
13541
+ Args: never;
13542
+ Returns: {
13543
+ avatar_url: string;
13544
+ display_name: string;
13545
+ email: string;
13546
+ id: string;
13547
+ }[];
13548
+ };
13549
+ list_my_planning_items: {
13550
+ Args: {
13551
+ _from: string;
13552
+ _to: string;
13553
+ };
13554
+ Returns: {
13555
+ assigned_monteur_id: string;
13556
+ end_at: string;
13557
+ id: string;
13558
+ notes: string;
13559
+ role: string;
13560
+ start_at: string;
13561
+ status: Database["public"]["Enums"]["planning_item_status"];
13562
+ werkbon_id: string;
13563
+ }[];
13564
+ };
11617
13565
  local_effective_price: {
11618
13566
  Args: {
11619
13567
  _customer_id: string;
@@ -11630,6 +13578,22 @@ export type Database = {
11630
13578
  source_id: string;
11631
13579
  }[];
11632
13580
  };
13581
+ log_ai_call: {
13582
+ Args: {
13583
+ _consumer_module_id: string;
13584
+ _cost_usd: number;
13585
+ _duration_ms: number;
13586
+ _error_code: string;
13587
+ _error_message: string;
13588
+ _input_tokens: number;
13589
+ _model_slug: string;
13590
+ _output_tokens: number;
13591
+ _provider_slug: string;
13592
+ _status: string;
13593
+ _total_tokens: number;
13594
+ };
13595
+ Returns: string;
13596
+ };
11633
13597
  mark_offer_clicked: {
11634
13598
  Args: {
11635
13599
  p_code: string;
@@ -11681,6 +13645,10 @@ export type Database = {
11681
13645
  };
11682
13646
  Returns: string;
11683
13647
  };
13648
+ next_twinfield_code: {
13649
+ Args: never;
13650
+ Returns: string;
13651
+ };
11684
13652
  next_work_order_number: {
11685
13653
  Args: {
11686
13654
  p_parent_work_order_id?: string;
@@ -11737,6 +13705,15 @@ export type Database = {
11737
13705
  };
11738
13706
  Returns: undefined;
11739
13707
  };
13708
+ pickstation_resolve_delivery_orders: {
13709
+ Args: {
13710
+ p_sales_order_ids: string[];
13711
+ };
13712
+ Returns: {
13713
+ delivery_order_id: string;
13714
+ sales_order_id: string;
13715
+ }[];
13716
+ };
11740
13717
  pickstation_set_cart_status: {
11741
13718
  Args: {
11742
13719
  p_cart_index: number;
@@ -11807,6 +13784,12 @@ export type Database = {
11807
13784
  };
11808
13785
  Returns: number;
11809
13786
  };
13787
+ reorder_customer_price_groups: {
13788
+ Args: {
13789
+ _ids: string[];
13790
+ };
13791
+ Returns: undefined;
13792
+ };
11810
13793
  reset_floriday_sync_cursor: {
11811
13794
  Args: {
11812
13795
  p_connection_id: string;
@@ -11842,6 +13825,12 @@ export type Database = {
11842
13825
  };
11843
13826
  Returns: string;
11844
13827
  };
13828
+ retry_twinfield_push: {
13829
+ Args: {
13830
+ _customer_id: string;
13831
+ };
13832
+ Returns: number;
13833
+ };
11845
13834
  reverse_production: {
11846
13835
  Args: {
11847
13836
  p_connection_id?: string;
@@ -11859,6 +13848,20 @@ export type Database = {
11859
13848
  };
11860
13849
  Returns: number;
11861
13850
  };
13851
+ schedule_floriday_agreement_calloffs_sync: {
13852
+ Args: {
13853
+ p_apikey: string;
13854
+ p_url: string;
13855
+ };
13856
+ Returns: number;
13857
+ };
13858
+ schedule_floriday_agreements_sync: {
13859
+ Args: {
13860
+ p_apikey: string;
13861
+ p_url: string;
13862
+ };
13863
+ Returns: number;
13864
+ };
11862
13865
  schedule_floriday_base_items_sync: {
11863
13866
  Args: {
11864
13867
  p_apikey: string;
@@ -12105,6 +14108,17 @@ export type Database = {
12105
14108
  };
12106
14109
  Returns: number;
12107
14110
  };
14111
+ self_heal_floriday_links: {
14112
+ Args: never;
14113
+ Returns: number;
14114
+ };
14115
+ set_planning_status: {
14116
+ Args: {
14117
+ _id: string;
14118
+ _status: Database["public"]["Enums"]["planning_item_status"];
14119
+ };
14120
+ Returns: undefined;
14121
+ };
12108
14122
  show_limit: {
12109
14123
  Args: never;
12110
14124
  Returns: number;
@@ -12115,12 +14129,22 @@ export type Database = {
12115
14129
  };
12116
14130
  Returns: string[];
12117
14131
  };
14132
+ sync_all_layer_stocks: {
14133
+ Args: never;
14134
+ Returns: undefined;
14135
+ };
12118
14136
  sync_cached_packing_from_product: {
12119
14137
  Args: {
12120
14138
  p_product_id: string;
12121
14139
  };
12122
14140
  Returns: undefined;
12123
14141
  };
14142
+ sync_layer_stock: {
14143
+ Args: {
14144
+ p_product_id: string;
14145
+ };
14146
+ Returns: undefined;
14147
+ };
12124
14148
  sync_order_cart_item_packing_from_product: {
12125
14149
  Args: {
12126
14150
  p_product_id: string;
@@ -12164,9 +14188,12 @@ export type Database = {
12164
14188
  };
12165
14189
  };
12166
14190
  Enums: {
12167
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
14191
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
12168
14192
  exact_env: "staging" | "live";
12169
14193
  exact_push_status: "pending" | "sent" | "error";
14194
+ itk_customer_segment: "Business" | "Private";
14195
+ itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
14196
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd" | "concept" | "vrijgegeven";
12170
14197
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
12171
14198
  };
12172
14199
  CompositeTypes: {
@@ -12226,9 +14253,12 @@ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof Defaul
12226
14253
  export declare const Constants: {
12227
14254
  readonly public: {
12228
14255
  readonly Enums: {
12229
- readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer", "receptie", "monteur"];
14256
+ readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin"];
12230
14257
  readonly exact_env: readonly ["staging", "live"];
12231
14258
  readonly exact_push_status: readonly ["pending", "sent", "error"];
14259
+ readonly itk_customer_segment: readonly ["Business", "Private"];
14260
+ readonly itk_dynamic_field_type: readonly ["text", "select", "date", "checkbox"];
14261
+ readonly planning_item_status: readonly ["gepland", "bezig", "afgerond", "geannuleerd", "concept", "vrijgegeven"];
12232
14262
  readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
12233
14263
  };
12234
14264
  };