@flowselections/floriday-voorraad 1.0.23 → 1.0.26

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 (55) hide show
  1. package/dist-lib/assets/floriday-logo.png.asset.json +4 -4
  2. package/dist-lib/components/voorraad/ArtikelWizard.d.ts.map +1 -1
  3. package/dist-lib/components/voorraad/ArtikelWizard.js +633 -101
  4. package/dist-lib/components/voorraad/StepSamenstelling.d.ts +10 -0
  5. package/dist-lib/components/voorraad/StepSamenstelling.d.ts.map +1 -0
  6. package/dist-lib/components/voorraad/StepSamenstelling.js +333 -0
  7. package/dist-lib/components/voorraad/VoorraadPage.d.ts.map +1 -1
  8. package/dist-lib/components/voorraad/VoorraadPage.js +14 -3
  9. package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
  10. package/dist-lib/components/voorraad/VoorraadTable.js +6 -13
  11. package/dist-lib/hooks/useFloridayPriceGroups.d.ts +20 -0
  12. package/dist-lib/hooks/useFloridayPriceGroups.d.ts.map +1 -0
  13. package/dist-lib/hooks/useFloridayPriceGroups.js +55 -0
  14. package/dist-lib/hooks/useFloridayVbnRequired.d.ts +5 -0
  15. package/dist-lib/hooks/useFloridayVbnRequired.d.ts.map +1 -0
  16. package/dist-lib/hooks/useFloridayVbnRequired.js +16 -0
  17. package/dist-lib/hooks/useLocalTradeItems.d.ts.map +1 -1
  18. package/dist-lib/hooks/useLocalTradeItems.js +14 -0
  19. package/dist-lib/hooks/useTradeItemSpec.d.ts.map +1 -1
  20. package/dist-lib/hooks/useTradeItemSpec.js +48 -1
  21. package/dist-lib/integrations/supabase/auth-middleware.d.ts +2378 -361
  22. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  23. package/dist-lib/integrations/supabase/client.d.ts +2378 -361
  24. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  25. package/dist-lib/integrations/supabase/client.server.d.ts +2378 -361
  26. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  27. package/dist-lib/integrations/supabase/types.d.ts +2412 -344
  28. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  29. package/dist-lib/integrations/supabase/types.js +11 -9
  30. package/dist-lib/lib/centralSecrets.server.d.ts +21 -0
  31. package/dist-lib/lib/centralSecrets.server.d.ts.map +1 -0
  32. package/dist-lib/lib/centralSecrets.server.js +111 -0
  33. package/dist-lib/lib/floricode-required-features.functions.d.ts +2378 -361
  34. package/dist-lib/lib/floricode-required-features.functions.d.ts.map +1 -1
  35. package/dist-lib/lib/floriday-customer-offer.functions.d.ts +2378 -361
  36. package/dist-lib/lib/floriday-customer-offer.functions.d.ts.map +1 -1
  37. package/dist-lib/lib/floriday-gateway.functions.d.ts +10760 -675
  38. package/dist-lib/lib/floriday-gateway.functions.d.ts.map +1 -1
  39. package/dist-lib/lib/floriday-gateway.server.d.ts.map +1 -1
  40. package/dist-lib/lib/floriday-gateway.server.js +34 -9
  41. package/dist-lib/lib/floriday-payload.d.ts +21 -3
  42. package/dist-lib/lib/floriday-payload.d.ts.map +1 -1
  43. package/dist-lib/lib/floriday-payload.js +167 -34
  44. package/dist-lib/lib/floriday-vbn-required.functions.d.ts +27769 -0
  45. package/dist-lib/lib/floriday-vbn-required.functions.d.ts.map +1 -0
  46. package/dist-lib/lib/floriday-vbn-required.functions.js +85 -0
  47. package/dist-lib/lib/floriday-warehouse.functions.d.ts +6542 -491
  48. package/dist-lib/lib/floriday-warehouse.functions.d.ts.map +1 -1
  49. package/dist-lib/lib/floriday-writes.functions.d.ts +4647 -612
  50. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  51. package/dist-lib/lib/floriday-writes.functions.js +36 -1
  52. package/dist-lib/lib/trade-item-prices.d.ts +43 -0
  53. package/dist-lib/lib/trade-item-prices.d.ts.map +1 -0
  54. package/dist-lib/lib/trade-item-prices.js +229 -0
  55. package/package.json +3 -3
@@ -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;
@@ -4832,8 +5466,6 @@ export type Database = {
4832
5466
  Row: {
4833
5467
  buyer_organization_id: string | null;
4834
5468
  connection_id: string;
4835
- controlled_at: string | null;
4836
- controlled_by: string | null;
4837
5469
  created_at: string;
4838
5470
  data: Json;
4839
5471
  floriday_id: string;
@@ -4845,8 +5477,6 @@ export type Database = {
4845
5477
  Insert: {
4846
5478
  buyer_organization_id?: string | null;
4847
5479
  connection_id: string;
4848
- controlled_at?: string | null;
4849
- controlled_by?: string | null;
4850
5480
  created_at?: string;
4851
5481
  data: Json;
4852
5482
  floriday_id: string;
@@ -4858,8 +5488,6 @@ export type Database = {
4858
5488
  Update: {
4859
5489
  buyer_organization_id?: string | null;
4860
5490
  connection_id?: string;
4861
- controlled_at?: string | null;
4862
- controlled_by?: string | null;
4863
5491
  created_at?: string;
4864
5492
  data?: Json;
4865
5493
  floriday_id?: string;
@@ -5051,47 +5679,6 @@ export type Database = {
5051
5679
  }
5052
5680
  ];
5053
5681
  };
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
5682
  floriday_trips_cache: {
5096
5683
  Row: {
5097
5684
  carrier_organization_id: string | null;
@@ -5142,6 +5729,27 @@ export type Database = {
5142
5729
  }
5143
5730
  ];
5144
5731
  };
5732
+ floriday_vbn_required_characteristics: {
5733
+ Row: {
5734
+ required_codes: string[];
5735
+ updated_at: string;
5736
+ updated_by: string | null;
5737
+ vbn_code: string;
5738
+ };
5739
+ Insert: {
5740
+ required_codes?: string[];
5741
+ updated_at?: string;
5742
+ updated_by?: string | null;
5743
+ vbn_code: string;
5744
+ };
5745
+ Update: {
5746
+ required_codes?: string[];
5747
+ updated_at?: string;
5748
+ updated_by?: string | null;
5749
+ vbn_code?: string;
5750
+ };
5751
+ Relationships: [];
5752
+ };
5145
5753
  floriday_warehouses_cache: {
5146
5754
  Row: {
5147
5755
  connection_id: string;
@@ -5638,165 +6246,460 @@ export type Database = {
5638
6246
  };
5639
6247
  Relationships: [];
5640
6248
  };
5641
- local_customer_agreements: {
6249
+ itk_contact_persons: {
5642
6250
  Row: {
5643
- base_price: number | null;
5644
6251
  created_at: string;
5645
- currency: string;
5646
6252
  customer_id: string;
6253
+ email: string | null;
5647
6254
  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;
6255
+ name: string;
6256
+ phone: string | null;
6257
+ role: string | null;
5653
6258
  updated_at: string;
5654
- valid_from: string | null;
5655
- valid_until: string | null;
5656
6259
  };
5657
6260
  Insert: {
5658
- base_price?: number | null;
5659
6261
  created_at?: string;
5660
- currency?: string;
5661
6262
  customer_id: string;
6263
+ email?: string | null;
5662
6264
  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;
6265
+ name: string;
6266
+ phone?: string | null;
6267
+ role?: string | null;
5668
6268
  updated_at?: string;
5669
- valid_from?: string | null;
5670
- valid_until?: string | null;
5671
6269
  };
5672
6270
  Update: {
5673
- base_price?: number | null;
5674
6271
  created_at?: string;
5675
- currency?: string;
5676
6272
  customer_id?: string;
6273
+ email?: string | null;
5677
6274
  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;
6275
+ name?: string;
6276
+ phone?: string | null;
6277
+ role?: string | null;
5683
6278
  updated_at?: string;
5684
- valid_from?: string | null;
5685
- valid_until?: string | null;
5686
6279
  };
5687
6280
  Relationships: [
5688
6281
  {
5689
- foreignKeyName: "local_customer_agreements_customer_id_fkey";
6282
+ foreignKeyName: "itk_contact_persons_customer_id_fkey";
5690
6283
  columns: ["customer_id"];
5691
6284
  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";
6285
+ referencedRelation: "itk_customers";
5707
6286
  referencedColumns: ["id"];
5708
6287
  }
5709
6288
  ];
5710
6289
  };
5711
- local_customer_price_groups: {
6290
+ itk_customer_dynamic_values: {
5712
6291
  Row: {
5713
6292
  created_at: string;
5714
- currency: string;
5715
6293
  customer_id: string;
5716
- discount_type: string;
5717
- discount_value: number;
6294
+ field_id: string;
5718
6295
  id: string;
5719
- min_quantity: number;
5720
- notes: string | null;
5721
- product_category_id: string | null;
5722
- product_id: string | null;
5723
6296
  updated_at: string;
5724
- valid_from: string | null;
5725
- valid_until: string | null;
6297
+ value: string | null;
5726
6298
  };
5727
6299
  Insert: {
5728
6300
  created_at?: string;
5729
- currency?: string;
5730
6301
  customer_id: string;
5731
- discount_type: string;
5732
- discount_value: number;
6302
+ field_id: string;
5733
6303
  id?: string;
5734
- min_quantity?: number;
5735
- notes?: string | null;
5736
- product_category_id?: string | null;
5737
- product_id?: string | null;
5738
6304
  updated_at?: string;
5739
- valid_from?: string | null;
5740
- valid_until?: string | null;
6305
+ value?: string | null;
5741
6306
  };
5742
6307
  Update: {
5743
6308
  created_at?: string;
5744
- currency?: string;
5745
6309
  customer_id?: string;
5746
- discount_type?: string;
5747
- discount_value?: number;
6310
+ field_id?: string;
5748
6311
  id?: string;
5749
- min_quantity?: number;
5750
- notes?: string | null;
5751
- product_category_id?: string | null;
5752
- product_id?: string | null;
5753
6312
  updated_at?: string;
5754
- valid_from?: string | null;
5755
- valid_until?: string | null;
6313
+ value?: string | null;
5756
6314
  };
5757
6315
  Relationships: [
5758
6316
  {
5759
- foreignKeyName: "local_customer_price_groups_customer_id_fkey";
6317
+ foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey";
5760
6318
  columns: ["customer_id"];
5761
6319
  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";
6320
+ referencedRelation: "itk_customers";
5770
6321
  referencedColumns: ["id"];
5771
6322
  },
5772
6323
  {
5773
- foreignKeyName: "local_customer_price_groups_product_id_fkey";
5774
- columns: ["product_id"];
6324
+ foreignKeyName: "itk_customer_dynamic_values_field_id_fkey";
6325
+ columns: ["field_id"];
5775
6326
  isOneToOne: false;
5776
- referencedRelation: "products";
6327
+ referencedRelation: "itk_dynamic_fields";
5777
6328
  referencedColumns: ["id"];
5778
6329
  }
5779
6330
  ];
5780
6331
  };
5781
- local_customer_sales_strategies: {
6332
+ itk_customer_notes: {
5782
6333
  Row: {
6334
+ body: string;
5783
6335
  created_at: string;
5784
- currency: string;
6336
+ created_by: string | null;
5785
6337
  customer_id: string;
5786
- discount_type: string;
5787
- discount_value: number;
5788
6338
  id: string;
5789
- min_quantity: number;
5790
- notes: string | null;
5791
- product_category_id: string | null;
5792
- product_id: string | null;
6339
+ note_type: string;
5793
6340
  updated_at: string;
5794
- valid_from: string | null;
5795
- valid_until: string | null;
5796
6341
  };
5797
6342
  Insert: {
6343
+ body: string;
5798
6344
  created_at?: string;
5799
- currency?: string;
6345
+ created_by?: string | null;
6346
+ customer_id: string;
6347
+ id?: string;
6348
+ note_type?: string;
6349
+ updated_at?: string;
6350
+ };
6351
+ Update: {
6352
+ body?: string;
6353
+ created_at?: string;
6354
+ created_by?: string | null;
6355
+ customer_id?: string;
6356
+ id?: string;
6357
+ note_type?: string;
6358
+ updated_at?: string;
6359
+ };
6360
+ Relationships: [
6361
+ {
6362
+ foreignKeyName: "itk_customer_notes_customer_id_fkey";
6363
+ columns: ["customer_id"];
6364
+ isOneToOne: false;
6365
+ referencedRelation: "itk_customers";
6366
+ referencedColumns: ["id"];
6367
+ }
6368
+ ];
6369
+ };
6370
+ itk_customers: {
6371
+ Row: {
6372
+ billing_city: string | null;
6373
+ billing_postcode: string | null;
6374
+ billing_street: string | null;
6375
+ created_at: string;
6376
+ general_email: string | null;
6377
+ general_phone: string | null;
6378
+ id: string;
6379
+ legacy_customer_id: string | null;
6380
+ name: string;
6381
+ segment: Database["public"]["Enums"]["itk_customer_segment"];
6382
+ updated_at: string;
6383
+ };
6384
+ Insert: {
6385
+ billing_city?: string | null;
6386
+ billing_postcode?: string | null;
6387
+ billing_street?: string | null;
6388
+ created_at?: string;
6389
+ general_email?: string | null;
6390
+ general_phone?: string | null;
6391
+ id?: string;
6392
+ legacy_customer_id?: string | null;
6393
+ name: string;
6394
+ segment?: Database["public"]["Enums"]["itk_customer_segment"];
6395
+ updated_at?: string;
6396
+ };
6397
+ Update: {
6398
+ billing_city?: string | null;
6399
+ billing_postcode?: string | null;
6400
+ billing_street?: string | null;
6401
+ created_at?: string;
6402
+ general_email?: string | null;
6403
+ general_phone?: string | null;
6404
+ id?: string;
6405
+ legacy_customer_id?: string | null;
6406
+ name?: string;
6407
+ segment?: Database["public"]["Enums"]["itk_customer_segment"];
6408
+ updated_at?: string;
6409
+ };
6410
+ Relationships: [
6411
+ {
6412
+ foreignKeyName: "itk_customers_legacy_customer_id_fkey";
6413
+ columns: ["legacy_customer_id"];
6414
+ isOneToOne: false;
6415
+ referencedRelation: "customers";
6416
+ referencedColumns: ["id"];
6417
+ }
6418
+ ];
6419
+ };
6420
+ itk_dynamic_fields: {
6421
+ Row: {
6422
+ created_at: string;
6423
+ field_name: string;
6424
+ field_type: Database["public"]["Enums"]["itk_dynamic_field_type"];
6425
+ id: string;
6426
+ options: Json;
6427
+ sort_order: number;
6428
+ updated_at: string;
6429
+ };
6430
+ Insert: {
6431
+ created_at?: string;
6432
+ field_name: string;
6433
+ field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"];
6434
+ id?: string;
6435
+ options?: Json;
6436
+ sort_order?: number;
6437
+ updated_at?: string;
6438
+ };
6439
+ Update: {
6440
+ created_at?: string;
6441
+ field_name?: string;
6442
+ field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"];
6443
+ id?: string;
6444
+ options?: Json;
6445
+ sort_order?: number;
6446
+ updated_at?: string;
6447
+ };
6448
+ Relationships: [];
6449
+ };
6450
+ itk_work_locations: {
6451
+ Row: {
6452
+ city: string | null;
6453
+ created_at: string;
6454
+ customer_id: string;
6455
+ id: string;
6456
+ instructions: string | null;
6457
+ label: string;
6458
+ latitude: number | null;
6459
+ longitude: number | null;
6460
+ postcode: string | null;
6461
+ street: string | null;
6462
+ updated_at: string;
6463
+ };
6464
+ Insert: {
6465
+ city?: string | null;
6466
+ created_at?: string;
6467
+ customer_id: string;
6468
+ id?: string;
6469
+ instructions?: string | null;
6470
+ label: string;
6471
+ latitude?: number | null;
6472
+ longitude?: number | null;
6473
+ postcode?: string | null;
6474
+ street?: string | null;
6475
+ updated_at?: string;
6476
+ };
6477
+ Update: {
6478
+ city?: string | null;
6479
+ created_at?: string;
6480
+ customer_id?: string;
6481
+ id?: string;
6482
+ instructions?: string | null;
6483
+ label?: string;
6484
+ latitude?: number | null;
6485
+ longitude?: number | null;
6486
+ postcode?: string | null;
6487
+ street?: string | null;
6488
+ updated_at?: string;
6489
+ };
6490
+ Relationships: [
6491
+ {
6492
+ foreignKeyName: "itk_work_locations_customer_id_fkey";
6493
+ columns: ["customer_id"];
6494
+ isOneToOne: false;
6495
+ referencedRelation: "itk_customers";
6496
+ referencedColumns: ["id"];
6497
+ }
6498
+ ];
6499
+ };
6500
+ leave_requests: {
6501
+ Row: {
6502
+ created_at: string;
6503
+ end_date: string;
6504
+ id: string;
6505
+ reason: string | null;
6506
+ start_date: string;
6507
+ status: string;
6508
+ tenant_id: string;
6509
+ updated_at: string;
6510
+ user_id: string;
6511
+ };
6512
+ Insert: {
6513
+ created_at?: string;
6514
+ end_date: string;
6515
+ id?: string;
6516
+ reason?: string | null;
6517
+ start_date: string;
6518
+ status?: string;
6519
+ tenant_id?: string;
6520
+ updated_at?: string;
6521
+ user_id: string;
6522
+ };
6523
+ Update: {
6524
+ created_at?: string;
6525
+ end_date?: string;
6526
+ id?: string;
6527
+ reason?: string | null;
6528
+ start_date?: string;
6529
+ status?: string;
6530
+ tenant_id?: string;
6531
+ updated_at?: string;
6532
+ user_id?: string;
6533
+ };
6534
+ Relationships: [
6535
+ {
6536
+ foreignKeyName: "leave_requests_user_id_fkey";
6537
+ columns: ["user_id"];
6538
+ isOneToOne: false;
6539
+ referencedRelation: "monteurs";
6540
+ referencedColumns: ["id"];
6541
+ }
6542
+ ];
6543
+ };
6544
+ local_customer_agreements: {
6545
+ Row: {
6546
+ base_price: number | null;
6547
+ created_at: string;
6548
+ currency: string;
6549
+ customer_id: string;
6550
+ id: string;
6551
+ min_quantity: number;
6552
+ net_price: number;
6553
+ notes: string | null;
6554
+ product_category_id: string | null;
6555
+ product_id: string | null;
6556
+ updated_at: string;
6557
+ valid_from: string | null;
6558
+ valid_until: string | null;
6559
+ };
6560
+ Insert: {
6561
+ base_price?: number | null;
6562
+ created_at?: string;
6563
+ currency?: string;
6564
+ customer_id: string;
6565
+ id?: string;
6566
+ min_quantity?: number;
6567
+ net_price: number;
6568
+ notes?: string | null;
6569
+ product_category_id?: string | null;
6570
+ product_id?: string | null;
6571
+ updated_at?: string;
6572
+ valid_from?: string | null;
6573
+ valid_until?: string | null;
6574
+ };
6575
+ Update: {
6576
+ base_price?: number | null;
6577
+ created_at?: string;
6578
+ currency?: string;
6579
+ customer_id?: string;
6580
+ id?: string;
6581
+ min_quantity?: number;
6582
+ net_price?: number;
6583
+ notes?: string | null;
6584
+ product_category_id?: string | null;
6585
+ product_id?: string | null;
6586
+ updated_at?: string;
6587
+ valid_from?: string | null;
6588
+ valid_until?: string | null;
6589
+ };
6590
+ Relationships: [
6591
+ {
6592
+ foreignKeyName: "local_customer_agreements_customer_id_fkey";
6593
+ columns: ["customer_id"];
6594
+ isOneToOne: false;
6595
+ referencedRelation: "customers";
6596
+ referencedColumns: ["id"];
6597
+ },
6598
+ {
6599
+ foreignKeyName: "local_customer_agreements_product_category_id_fkey";
6600
+ columns: ["product_category_id"];
6601
+ isOneToOne: false;
6602
+ referencedRelation: "product_categories";
6603
+ referencedColumns: ["id"];
6604
+ },
6605
+ {
6606
+ foreignKeyName: "local_customer_agreements_product_id_fkey";
6607
+ columns: ["product_id"];
6608
+ isOneToOne: false;
6609
+ referencedRelation: "products";
6610
+ referencedColumns: ["id"];
6611
+ }
6612
+ ];
6613
+ };
6614
+ local_customer_price_groups: {
6615
+ Row: {
6616
+ created_at: string;
6617
+ currency: string;
6618
+ customer_id: string;
6619
+ discount_type: string;
6620
+ discount_value: number;
6621
+ id: string;
6622
+ min_quantity: number;
6623
+ notes: string | null;
6624
+ product_category_id: string | null;
6625
+ product_id: string | null;
6626
+ updated_at: string;
6627
+ valid_from: string | null;
6628
+ valid_until: string | null;
6629
+ };
6630
+ Insert: {
6631
+ created_at?: string;
6632
+ currency?: string;
6633
+ customer_id: string;
6634
+ discount_type: string;
6635
+ discount_value: number;
6636
+ id?: string;
6637
+ min_quantity?: number;
6638
+ notes?: string | null;
6639
+ product_category_id?: string | null;
6640
+ product_id?: string | null;
6641
+ updated_at?: string;
6642
+ valid_from?: string | null;
6643
+ valid_until?: string | null;
6644
+ };
6645
+ Update: {
6646
+ created_at?: string;
6647
+ currency?: string;
6648
+ customer_id?: string;
6649
+ discount_type?: string;
6650
+ discount_value?: number;
6651
+ id?: string;
6652
+ min_quantity?: number;
6653
+ notes?: string | null;
6654
+ product_category_id?: string | null;
6655
+ product_id?: string | null;
6656
+ updated_at?: string;
6657
+ valid_from?: string | null;
6658
+ valid_until?: string | null;
6659
+ };
6660
+ Relationships: [
6661
+ {
6662
+ foreignKeyName: "local_customer_price_groups_customer_id_fkey";
6663
+ columns: ["customer_id"];
6664
+ isOneToOne: false;
6665
+ referencedRelation: "customers";
6666
+ referencedColumns: ["id"];
6667
+ },
6668
+ {
6669
+ foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
6670
+ columns: ["product_category_id"];
6671
+ isOneToOne: false;
6672
+ referencedRelation: "product_categories";
6673
+ referencedColumns: ["id"];
6674
+ },
6675
+ {
6676
+ foreignKeyName: "local_customer_price_groups_product_id_fkey";
6677
+ columns: ["product_id"];
6678
+ isOneToOne: false;
6679
+ referencedRelation: "products";
6680
+ referencedColumns: ["id"];
6681
+ }
6682
+ ];
6683
+ };
6684
+ local_customer_sales_strategies: {
6685
+ Row: {
6686
+ created_at: string;
6687
+ currency: string;
6688
+ customer_id: string;
6689
+ discount_type: string;
6690
+ discount_value: number;
6691
+ id: string;
6692
+ min_quantity: number;
6693
+ notes: string | null;
6694
+ product_category_id: string | null;
6695
+ product_id: string | null;
6696
+ updated_at: string;
6697
+ valid_from: string | null;
6698
+ valid_until: string | null;
6699
+ };
6700
+ Insert: {
6701
+ created_at?: string;
6702
+ currency?: string;
5800
6703
  customer_id: string;
5801
6704
  discount_type: string;
5802
6705
  discount_value: number;
@@ -5859,16 +6762,301 @@ export type Database = {
5859
6762
  Insert: {
5860
6763
  created_at?: string;
5861
6764
  id?: string;
5862
- name: string;
5863
- sort_order?: number;
6765
+ name: string;
6766
+ sort_order?: number;
6767
+ updated_at?: string;
6768
+ };
6769
+ Update: {
6770
+ created_at?: string;
6771
+ id?: string;
6772
+ name?: string;
6773
+ sort_order?: number;
6774
+ updated_at?: string;
6775
+ };
6776
+ Relationships: [];
6777
+ };
6778
+ logistics_capacity_events: {
6779
+ Row: {
6780
+ available_carts: number;
6781
+ created_at: string;
6782
+ id: string;
6783
+ measures: Json;
6784
+ note: string | null;
6785
+ outcome: string;
6786
+ required_carts: number;
6787
+ reserve_minutes: number;
6788
+ shortage_carts: number;
6789
+ status: string;
6790
+ user_id: string;
6791
+ };
6792
+ Insert: {
6793
+ available_carts?: number;
6794
+ created_at?: string;
6795
+ id?: string;
6796
+ measures?: Json;
6797
+ note?: string | null;
6798
+ outcome?: string;
6799
+ required_carts?: number;
6800
+ reserve_minutes?: number;
6801
+ shortage_carts?: number;
6802
+ status: string;
6803
+ user_id: string;
6804
+ };
6805
+ Update: {
6806
+ available_carts?: number;
6807
+ created_at?: string;
6808
+ id?: string;
6809
+ measures?: Json;
6810
+ note?: string | null;
6811
+ outcome?: string;
6812
+ required_carts?: number;
6813
+ reserve_minutes?: number;
6814
+ shortage_carts?: number;
6815
+ status?: string;
6816
+ user_id?: string;
6817
+ };
6818
+ Relationships: [];
6819
+ };
6820
+ logistics_capacity_settings: {
6821
+ Row: {
6822
+ created_at: string;
6823
+ settings: Json;
6824
+ updated_at: string;
6825
+ user_id: string;
6826
+ };
6827
+ Insert: {
6828
+ created_at?: string;
6829
+ settings?: Json;
6830
+ updated_at?: string;
6831
+ user_id: string;
6832
+ };
6833
+ Update: {
6834
+ created_at?: string;
6835
+ settings?: Json;
6836
+ updated_at?: string;
6837
+ user_id?: string;
6838
+ };
6839
+ Relationships: [];
6840
+ };
6841
+ logistics_decisions: {
6842
+ Row: {
6843
+ created_at: string;
6844
+ explanation: string | null;
6845
+ id: string;
6846
+ input_snapshot: Json;
6847
+ result: Json;
6848
+ slot: string;
6849
+ strategy_id: string | null;
6850
+ subject_id: string;
6851
+ subject_type: string;
6852
+ user_id: string;
6853
+ };
6854
+ Insert: {
6855
+ created_at?: string;
6856
+ explanation?: string | null;
6857
+ id?: string;
6858
+ input_snapshot?: Json;
6859
+ result?: Json;
6860
+ slot: string;
6861
+ strategy_id?: string | null;
6862
+ subject_id: string;
6863
+ subject_type: string;
6864
+ user_id: string;
6865
+ };
6866
+ Update: {
6867
+ created_at?: string;
6868
+ explanation?: string | null;
6869
+ id?: string;
6870
+ input_snapshot?: Json;
6871
+ result?: Json;
6872
+ slot?: string;
6873
+ strategy_id?: string | null;
6874
+ subject_id?: string;
6875
+ subject_type?: string;
6876
+ user_id?: string;
6877
+ };
6878
+ Relationships: [
6879
+ {
6880
+ foreignKeyName: "logistics_decisions_strategy_id_fkey";
6881
+ columns: ["strategy_id"];
6882
+ isOneToOne: false;
6883
+ referencedRelation: "logistics_strategies";
6884
+ referencedColumns: ["id"];
6885
+ }
6886
+ ];
6887
+ };
6888
+ logistics_formulas: {
6889
+ Row: {
6890
+ created_at: string;
6891
+ expression: string;
6892
+ id: string;
6893
+ notes: string | null;
6894
+ slot: string;
6895
+ strategy_id: string;
6896
+ updated_at: string;
6897
+ user_id: string;
6898
+ version: number;
6899
+ };
6900
+ Insert: {
6901
+ created_at?: string;
6902
+ expression?: string;
6903
+ id?: string;
6904
+ notes?: string | null;
6905
+ slot: string;
6906
+ strategy_id: string;
6907
+ updated_at?: string;
6908
+ user_id: string;
6909
+ version?: number;
6910
+ };
6911
+ Update: {
6912
+ created_at?: string;
6913
+ expression?: string;
6914
+ id?: string;
6915
+ notes?: string | null;
6916
+ slot?: string;
6917
+ strategy_id?: string;
6918
+ updated_at?: string;
6919
+ user_id?: string;
6920
+ version?: number;
6921
+ };
6922
+ Relationships: [
6923
+ {
6924
+ foreignKeyName: "logistics_formulas_strategy_id_fkey";
6925
+ columns: ["strategy_id"];
6926
+ isOneToOne: false;
6927
+ referencedRelation: "logistics_strategies";
6928
+ referencedColumns: ["id"];
6929
+ }
6930
+ ];
6931
+ };
6932
+ logistics_strategies: {
6933
+ Row: {
6934
+ color: string;
6935
+ created_at: string;
6936
+ description: string | null;
6937
+ id: string;
6938
+ is_active: boolean;
6939
+ name: string;
6940
+ priority: number;
6941
+ updated_at: string;
6942
+ updated_by: string | null;
6943
+ user_id: string;
6944
+ version: number;
6945
+ };
6946
+ Insert: {
6947
+ color?: string;
6948
+ created_at?: string;
6949
+ description?: string | null;
6950
+ id?: string;
6951
+ is_active?: boolean;
6952
+ name: string;
6953
+ priority?: number;
6954
+ updated_at?: string;
6955
+ updated_by?: string | null;
6956
+ user_id: string;
6957
+ version?: number;
6958
+ };
6959
+ Update: {
6960
+ color?: string;
6961
+ created_at?: string;
6962
+ description?: string | null;
6963
+ id?: string;
6964
+ is_active?: boolean;
6965
+ name?: string;
6966
+ priority?: number;
6967
+ updated_at?: string;
6968
+ updated_by?: string | null;
6969
+ user_id?: string;
6970
+ version?: number;
6971
+ };
6972
+ Relationships: [];
6973
+ };
6974
+ logistics_strategy_schedules: {
6975
+ Row: {
6976
+ condition_expression: string | null;
6977
+ created_at: string;
6978
+ end_date: string | null;
6979
+ id: string;
6980
+ is_enabled: boolean;
6981
+ priority: number;
6982
+ rule_type: string;
6983
+ start_date: string | null;
6984
+ strategy_id: string;
6985
+ updated_at: string;
6986
+ user_id: string;
6987
+ };
6988
+ Insert: {
6989
+ condition_expression?: string | null;
6990
+ created_at?: string;
6991
+ end_date?: string | null;
6992
+ id?: string;
6993
+ is_enabled?: boolean;
6994
+ priority?: number;
6995
+ rule_type: string;
6996
+ start_date?: string | null;
6997
+ strategy_id: string;
6998
+ updated_at?: string;
6999
+ user_id: string;
7000
+ };
7001
+ Update: {
7002
+ condition_expression?: string | null;
7003
+ created_at?: string;
7004
+ end_date?: string | null;
7005
+ id?: string;
7006
+ is_enabled?: boolean;
7007
+ priority?: number;
7008
+ rule_type?: string;
7009
+ start_date?: string | null;
7010
+ strategy_id?: string;
7011
+ updated_at?: string;
7012
+ user_id?: string;
7013
+ };
7014
+ Relationships: [
7015
+ {
7016
+ foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey";
7017
+ columns: ["strategy_id"];
7018
+ isOneToOne: false;
7019
+ referencedRelation: "logistics_strategies";
7020
+ referencedColumns: ["id"];
7021
+ }
7022
+ ];
7023
+ };
7024
+ logistics_variables: {
7025
+ Row: {
7026
+ created_at: string;
7027
+ default_value: string | null;
7028
+ description: string | null;
7029
+ id: string;
7030
+ is_builtin: boolean;
7031
+ key: string;
7032
+ label: string;
7033
+ updated_at: string;
7034
+ user_id: string;
7035
+ value_type: string;
7036
+ };
7037
+ Insert: {
7038
+ created_at?: string;
7039
+ default_value?: string | null;
7040
+ description?: string | null;
7041
+ id?: string;
7042
+ is_builtin?: boolean;
7043
+ key: string;
7044
+ label: string;
5864
7045
  updated_at?: string;
7046
+ user_id: string;
7047
+ value_type: string;
5865
7048
  };
5866
7049
  Update: {
5867
7050
  created_at?: string;
7051
+ default_value?: string | null;
7052
+ description?: string | null;
5868
7053
  id?: string;
5869
- name?: string;
5870
- sort_order?: number;
7054
+ is_builtin?: boolean;
7055
+ key?: string;
7056
+ label?: string;
5871
7057
  updated_at?: string;
7058
+ user_id?: string;
7059
+ value_type?: string;
5872
7060
  };
5873
7061
  Relationships: [];
5874
7062
  };
@@ -6284,62 +7472,66 @@ export type Database = {
6284
7472
  };
6285
7473
  manufacture_products: {
6286
7474
  Row: {
6287
- aantal_te_produceren: number;
6288
7475
  created_at: string;
6289
7476
  description: string | null;
6290
7477
  id: string;
6291
7478
  is_active: boolean;
6292
- location_id: string | null;
6293
7479
  name: string;
6294
- partij_nummer: string | null;
6295
- photos: Json;
6296
7480
  produced_stock: number;
6297
7481
  product_code: string;
6298
7482
  tenant_id: string;
6299
- unit: string;
6300
7483
  updated_at: string;
6301
7484
  };
6302
7485
  Insert: {
6303
- aantal_te_produceren?: number;
6304
7486
  created_at?: string;
6305
7487
  description?: string | null;
6306
7488
  id?: string;
6307
7489
  is_active?: boolean;
6308
- location_id?: string | null;
6309
7490
  name: string;
6310
- partij_nummer?: string | null;
6311
- photos?: Json;
6312
7491
  produced_stock?: number;
6313
7492
  product_code: string;
6314
7493
  tenant_id: string;
6315
- unit?: string;
6316
7494
  updated_at?: string;
6317
7495
  };
6318
7496
  Update: {
6319
- aantal_te_produceren?: number;
6320
7497
  created_at?: string;
6321
7498
  description?: string | null;
6322
7499
  id?: string;
6323
7500
  is_active?: boolean;
6324
- location_id?: string | null;
6325
7501
  name?: string;
6326
- partij_nummer?: string | null;
6327
- photos?: Json;
6328
7502
  produced_stock?: number;
6329
7503
  product_code?: string;
6330
7504
  tenant_id?: string;
6331
- unit?: string;
6332
7505
  updated_at?: string;
6333
7506
  };
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
- ];
7507
+ Relationships: [];
7508
+ };
7509
+ module_permissions: {
7510
+ Row: {
7511
+ created_at: string;
7512
+ id: string;
7513
+ module_id: string;
7514
+ permission: string;
7515
+ role: Database["public"]["Enums"]["app_role"];
7516
+ updated_at: string;
7517
+ };
7518
+ Insert: {
7519
+ created_at?: string;
7520
+ id?: string;
7521
+ module_id: string;
7522
+ permission: string;
7523
+ role: Database["public"]["Enums"]["app_role"];
7524
+ updated_at?: string;
7525
+ };
7526
+ Update: {
7527
+ created_at?: string;
7528
+ id?: string;
7529
+ module_id?: string;
7530
+ permission?: string;
7531
+ role?: Database["public"]["Enums"]["app_role"];
7532
+ updated_at?: string;
7533
+ };
7534
+ Relationships: [];
6343
7535
  };
6344
7536
  monteurs: {
6345
7537
  Row: {
@@ -7095,6 +8287,42 @@ export type Database = {
7095
8287
  };
7096
8288
  Relationships: [];
7097
8289
  };
8290
+ order_buffers: {
8291
+ Row: {
8292
+ buffer_key: string;
8293
+ created_at: string;
8294
+ customer_id: string | null;
8295
+ grouping_mode: string;
8296
+ id: string;
8297
+ pickup_date: string | null;
8298
+ pickup_location: string | null;
8299
+ plan_locked_at: string | null;
8300
+ updated_at: string;
8301
+ };
8302
+ Insert: {
8303
+ buffer_key: string;
8304
+ created_at?: string;
8305
+ customer_id?: string | null;
8306
+ grouping_mode: string;
8307
+ id?: string;
8308
+ pickup_date?: string | null;
8309
+ pickup_location?: string | null;
8310
+ plan_locked_at?: string | null;
8311
+ updated_at?: string;
8312
+ };
8313
+ Update: {
8314
+ buffer_key?: string;
8315
+ created_at?: string;
8316
+ customer_id?: string | null;
8317
+ grouping_mode?: string;
8318
+ id?: string;
8319
+ pickup_date?: string | null;
8320
+ pickup_location?: string | null;
8321
+ plan_locked_at?: string | null;
8322
+ updated_at?: string;
8323
+ };
8324
+ Relationships: [];
8325
+ };
7098
8326
  order_cart_items: {
7099
8327
  Row: {
7100
8328
  cart_id: string;
@@ -7165,6 +8393,7 @@ export type Database = {
7165
8393
  order_carts: {
7166
8394
  Row: {
7167
8395
  algorithm_version: number;
8396
+ buffer_id: string | null;
7168
8397
  cart_number: number;
7169
8398
  created_at: string;
7170
8399
  id: string;
@@ -7172,13 +8401,14 @@ export type Database = {
7172
8401
  is_complete: boolean;
7173
8402
  notes: string | null;
7174
8403
  occupancy_pct: number;
7175
- order_id: string;
8404
+ order_id: string | null;
7176
8405
  source: string;
7177
8406
  total_layers_used: number;
7178
8407
  updated_at: string;
7179
8408
  };
7180
8409
  Insert: {
7181
8410
  algorithm_version?: number;
8411
+ buffer_id?: string | null;
7182
8412
  cart_number: number;
7183
8413
  created_at?: string;
7184
8414
  id?: string;
@@ -7186,13 +8416,14 @@ export type Database = {
7186
8416
  is_complete?: boolean;
7187
8417
  notes?: string | null;
7188
8418
  occupancy_pct?: number;
7189
- order_id: string;
8419
+ order_id?: string | null;
7190
8420
  source?: string;
7191
8421
  total_layers_used?: number;
7192
8422
  updated_at?: string;
7193
8423
  };
7194
8424
  Update: {
7195
8425
  algorithm_version?: number;
8426
+ buffer_id?: string | null;
7196
8427
  cart_number?: number;
7197
8428
  created_at?: string;
7198
8429
  id?: string;
@@ -7200,12 +8431,19 @@ export type Database = {
7200
8431
  is_complete?: boolean;
7201
8432
  notes?: string | null;
7202
8433
  occupancy_pct?: number;
7203
- order_id?: string;
8434
+ order_id?: string | null;
7204
8435
  source?: string;
7205
8436
  total_layers_used?: number;
7206
8437
  updated_at?: string;
7207
8438
  };
7208
8439
  Relationships: [
8440
+ {
8441
+ foreignKeyName: "order_carts_buffer_id_fkey";
8442
+ columns: ["buffer_id"];
8443
+ isOneToOne: false;
8444
+ referencedRelation: "order_buffers";
8445
+ referencedColumns: ["id"];
8446
+ },
7209
8447
  {
7210
8448
  foreignKeyName: "order_carts_order_id_fkey";
7211
8449
  columns: ["order_id"];
@@ -7456,12 +8694,14 @@ export type Database = {
7456
8694
  };
7457
8695
  orders: {
7458
8696
  Row: {
8697
+ buffer_id: string | null;
7459
8698
  created_at: string;
7460
8699
  custom_fields: Json;
7461
8700
  customer_id: string | null;
7462
8701
  customer_name: string;
7463
8702
  deleted_at: string | null;
7464
8703
  delivery_date: string | null;
8704
+ floriday_sales_order_id: string | null;
7465
8705
  id: string;
7466
8706
  is_reservation: boolean;
7467
8707
  notes: string | null;
@@ -7475,12 +8715,14 @@ export type Database = {
7475
8715
  updated_at: string;
7476
8716
  };
7477
8717
  Insert: {
8718
+ buffer_id?: string | null;
7478
8719
  created_at?: string;
7479
8720
  custom_fields?: Json;
7480
8721
  customer_id?: string | null;
7481
8722
  customer_name?: string;
7482
8723
  deleted_at?: string | null;
7483
8724
  delivery_date?: string | null;
8725
+ floriday_sales_order_id?: string | null;
7484
8726
  id?: string;
7485
8727
  is_reservation?: boolean;
7486
8728
  notes?: string | null;
@@ -7494,12 +8736,14 @@ export type Database = {
7494
8736
  updated_at?: string;
7495
8737
  };
7496
8738
  Update: {
8739
+ buffer_id?: string | null;
7497
8740
  created_at?: string;
7498
8741
  custom_fields?: Json;
7499
8742
  customer_id?: string | null;
7500
8743
  customer_name?: string;
7501
8744
  deleted_at?: string | null;
7502
8745
  delivery_date?: string | null;
8746
+ floriday_sales_order_id?: string | null;
7503
8747
  id?: string;
7504
8748
  is_reservation?: boolean;
7505
8749
  notes?: string | null;
@@ -7513,6 +8757,13 @@ export type Database = {
7513
8757
  updated_at?: string;
7514
8758
  };
7515
8759
  Relationships: [
8760
+ {
8761
+ foreignKeyName: "orders_buffer_id_fkey";
8762
+ columns: ["buffer_id"];
8763
+ isOneToOne: false;
8764
+ referencedRelation: "order_buffers";
8765
+ referencedColumns: ["id"];
8766
+ },
7516
8767
  {
7517
8768
  foreignKeyName: "orders_customer_id_fkey";
7518
8769
  columns: ["customer_id"];
@@ -7645,6 +8896,82 @@ export type Database = {
7645
8896
  };
7646
8897
  Relationships: [];
7647
8898
  };
8899
+ planning_item_assistants: {
8900
+ Row: {
8901
+ created_at: string;
8902
+ created_by: string | null;
8903
+ monteur_id: string;
8904
+ planning_item_id: string;
8905
+ };
8906
+ Insert: {
8907
+ created_at?: string;
8908
+ created_by?: string | null;
8909
+ monteur_id: string;
8910
+ planning_item_id: string;
8911
+ };
8912
+ Update: {
8913
+ created_at?: string;
8914
+ created_by?: string | null;
8915
+ monteur_id?: string;
8916
+ planning_item_id?: string;
8917
+ };
8918
+ Relationships: [
8919
+ {
8920
+ foreignKeyName: "planning_item_assistants_planning_item_id_fkey";
8921
+ columns: ["planning_item_id"];
8922
+ isOneToOne: false;
8923
+ referencedRelation: "planning_items";
8924
+ referencedColumns: ["id"];
8925
+ }
8926
+ ];
8927
+ };
8928
+ planning_items: {
8929
+ Row: {
8930
+ assigned_monteur_id: string;
8931
+ created_at: string;
8932
+ created_by: string | null;
8933
+ end_at: string;
8934
+ id: string;
8935
+ notes: string | null;
8936
+ start_at: string;
8937
+ status: Database["public"]["Enums"]["planning_item_status"];
8938
+ updated_at: string;
8939
+ werkbon_id: string;
8940
+ };
8941
+ Insert: {
8942
+ assigned_monteur_id: string;
8943
+ created_at?: string;
8944
+ created_by?: string | null;
8945
+ end_at: string;
8946
+ id?: string;
8947
+ notes?: string | null;
8948
+ start_at: string;
8949
+ status?: Database["public"]["Enums"]["planning_item_status"];
8950
+ updated_at?: string;
8951
+ werkbon_id: string;
8952
+ };
8953
+ Update: {
8954
+ assigned_monteur_id?: string;
8955
+ created_at?: string;
8956
+ created_by?: string | null;
8957
+ end_at?: string;
8958
+ id?: string;
8959
+ notes?: string | null;
8960
+ start_at?: string;
8961
+ status?: Database["public"]["Enums"]["planning_item_status"];
8962
+ updated_at?: string;
8963
+ werkbon_id?: string;
8964
+ };
8965
+ Relationships: [
8966
+ {
8967
+ foreignKeyName: "planning_items_werkbon_id_fkey";
8968
+ columns: ["werkbon_id"];
8969
+ isOneToOne: false;
8970
+ referencedRelation: "werkbonnen";
8971
+ referencedColumns: ["id"];
8972
+ }
8973
+ ];
8974
+ };
7648
8975
  product_bom_items: {
7649
8976
  Row: {
7650
8977
  component_product_id: string | null;
@@ -7652,6 +8979,7 @@ export type Database = {
7652
8979
  created_at: string;
7653
8980
  id: string;
7654
8981
  notes: string | null;
8982
+ packing_configuration_id: string | null;
7655
8983
  parent_product_id: string | null;
7656
8984
  parent_trade_item_floriday_id: string | null;
7657
8985
  quantity: number;
@@ -7666,6 +8994,7 @@ export type Database = {
7666
8994
  created_at?: string;
7667
8995
  id?: string;
7668
8996
  notes?: string | null;
8997
+ packing_configuration_id?: string | null;
7669
8998
  parent_product_id?: string | null;
7670
8999
  parent_trade_item_floriday_id?: string | null;
7671
9000
  quantity?: number;
@@ -7680,6 +9009,7 @@ export type Database = {
7680
9009
  created_at?: string;
7681
9010
  id?: string;
7682
9011
  notes?: string | null;
9012
+ packing_configuration_id?: string | null;
7683
9013
  parent_product_id?: string | null;
7684
9014
  parent_trade_item_floriday_id?: string | null;
7685
9015
  quantity?: number;
@@ -7890,11 +9220,13 @@ export type Database = {
7890
9220
  created_at: string;
7891
9221
  id: string;
7892
9222
  is_package: boolean;
9223
+ label: string | null;
7893
9224
  layers_per_load_carrier: number | null;
7894
9225
  load_carrier: string | null;
7895
9226
  package_id: string | null;
7896
9227
  package_label: string | null;
7897
9228
  packages_per_layer: number | null;
9229
+ packing_configuration_id: string;
7898
9230
  product_id: string | null;
7899
9231
  tenant_id: string;
7900
9232
  trade_item_floriday_id: string | null;
@@ -7905,11 +9237,13 @@ export type Database = {
7905
9237
  created_at?: string;
7906
9238
  id?: string;
7907
9239
  is_package?: boolean;
9240
+ label?: string | null;
7908
9241
  layers_per_load_carrier?: number | null;
7909
9242
  load_carrier?: string | null;
7910
9243
  package_id?: string | null;
7911
9244
  package_label?: string | null;
7912
9245
  packages_per_layer?: number | null;
9246
+ packing_configuration_id?: string;
7913
9247
  product_id?: string | null;
7914
9248
  tenant_id: string;
7915
9249
  trade_item_floriday_id?: string | null;
@@ -7920,11 +9254,13 @@ export type Database = {
7920
9254
  created_at?: string;
7921
9255
  id?: string;
7922
9256
  is_package?: boolean;
9257
+ label?: string | null;
7923
9258
  layers_per_load_carrier?: number | null;
7924
9259
  load_carrier?: string | null;
7925
9260
  package_id?: string | null;
7926
9261
  package_label?: string | null;
7927
9262
  packages_per_layer?: number | null;
9263
+ packing_configuration_id?: string;
7928
9264
  product_id?: string | null;
7929
9265
  tenant_id?: string;
7930
9266
  trade_item_floriday_id?: string | null;
@@ -7989,8 +9325,6 @@ export type Database = {
7989
9325
  crates_per_layer: number;
7990
9326
  created_at: string;
7991
9327
  custom_fields: Json;
7992
- floriday_active: boolean;
7993
- floriday_payload: Json;
7994
9328
  floriday_trade_item_id: string | null;
7995
9329
  id: string;
7996
9330
  image_url: string | null;
@@ -8017,8 +9351,6 @@ export type Database = {
8017
9351
  crates_per_layer?: number;
8018
9352
  created_at?: string;
8019
9353
  custom_fields?: Json;
8020
- floriday_active?: boolean;
8021
- floriday_payload?: Json;
8022
9354
  floriday_trade_item_id?: string | null;
8023
9355
  id?: string;
8024
9356
  image_url?: string | null;
@@ -8045,8 +9377,6 @@ export type Database = {
8045
9377
  crates_per_layer?: number;
8046
9378
  created_at?: string;
8047
9379
  custom_fields?: Json;
8048
- floriday_active?: boolean;
8049
- floriday_payload?: Json;
8050
9380
  floriday_trade_item_id?: string | null;
8051
9381
  id?: string;
8052
9382
  image_url?: string | null;
@@ -8071,6 +9401,7 @@ export type Database = {
8071
9401
  profiles: {
8072
9402
  Row: {
8073
9403
  address: string | null;
9404
+ avatar_url: string | null;
8074
9405
  created_at: string;
8075
9406
  display_name: string | null;
8076
9407
  email: string | null;
@@ -8082,6 +9413,7 @@ export type Database = {
8082
9413
  };
8083
9414
  Insert: {
8084
9415
  address?: string | null;
9416
+ avatar_url?: string | null;
8085
9417
  created_at?: string;
8086
9418
  display_name?: string | null;
8087
9419
  email?: string | null;
@@ -8093,6 +9425,7 @@ export type Database = {
8093
9425
  };
8094
9426
  Update: {
8095
9427
  address?: string | null;
9428
+ avatar_url?: string | null;
8096
9429
  created_at?: string;
8097
9430
  display_name?: string | null;
8098
9431
  email?: string | null;
@@ -8989,7 +10322,6 @@ export type Database = {
8989
10322
  order_id: string | null;
8990
10323
  order_item_id: string | null;
8991
10324
  order_source: string | null;
8992
- parent_trade_item_key: string | null;
8993
10325
  physical_after: number | null;
8994
10326
  physical_before: number | null;
8995
10327
  production_batch_id: string | null;
@@ -9008,7 +10340,6 @@ export type Database = {
9008
10340
  order_id?: string | null;
9009
10341
  order_item_id?: string | null;
9010
10342
  order_source?: string | null;
9011
- parent_trade_item_key?: string | null;
9012
10343
  physical_after?: number | null;
9013
10344
  physical_before?: number | null;
9014
10345
  production_batch_id?: string | null;
@@ -9027,7 +10358,6 @@ export type Database = {
9027
10358
  order_id?: string | null;
9028
10359
  order_item_id?: string | null;
9029
10360
  order_source?: string | null;
9030
- parent_trade_item_key?: string | null;
9031
10361
  physical_after?: number | null;
9032
10362
  physical_before?: number | null;
9033
10363
  production_batch_id?: string | null;
@@ -9134,6 +10464,27 @@ export type Database = {
9134
10464
  };
9135
10465
  Relationships: [];
9136
10466
  };
10467
+ technician_rates: {
10468
+ Row: {
10469
+ created_at: string;
10470
+ hourly_rate_cents: number;
10471
+ updated_at: string;
10472
+ user_id: string;
10473
+ };
10474
+ Insert: {
10475
+ created_at?: string;
10476
+ hourly_rate_cents?: number;
10477
+ updated_at?: string;
10478
+ user_id: string;
10479
+ };
10480
+ Update: {
10481
+ created_at?: string;
10482
+ hourly_rate_cents?: number;
10483
+ updated_at?: string;
10484
+ user_id?: string;
10485
+ };
10486
+ Relationships: [];
10487
+ };
9137
10488
  tenants: {
9138
10489
  Row: {
9139
10490
  created_at: string;
@@ -9344,6 +10695,48 @@ export type Database = {
9344
10695
  };
9345
10696
  Relationships: [];
9346
10697
  };
10698
+ trade_item_prices: {
10699
+ Row: {
10700
+ created_at: string;
10701
+ currency: string;
10702
+ id: string;
10703
+ last_push_error: string | null;
10704
+ last_pushed_at: string | null;
10705
+ price_group_id: string | null;
10706
+ price_per_piece: number;
10707
+ supply_line_id: string | null;
10708
+ trade_item_key: string;
10709
+ updated_at: string;
10710
+ user_id: string;
10711
+ };
10712
+ Insert: {
10713
+ created_at?: string;
10714
+ currency?: string;
10715
+ id?: string;
10716
+ last_push_error?: string | null;
10717
+ last_pushed_at?: string | null;
10718
+ price_group_id?: string | null;
10719
+ price_per_piece: number;
10720
+ supply_line_id?: string | null;
10721
+ trade_item_key: string;
10722
+ updated_at?: string;
10723
+ user_id: string;
10724
+ };
10725
+ Update: {
10726
+ created_at?: string;
10727
+ currency?: string;
10728
+ id?: string;
10729
+ last_push_error?: string | null;
10730
+ last_pushed_at?: string | null;
10731
+ price_group_id?: string | null;
10732
+ price_per_piece?: number;
10733
+ supply_line_id?: string | null;
10734
+ trade_item_key?: string;
10735
+ updated_at?: string;
10736
+ user_id?: string;
10737
+ };
10738
+ Relationships: [];
10739
+ };
9347
10740
  trade_item_stock: {
9348
10741
  Row: {
9349
10742
  connection_id: string;
@@ -9499,7 +10892,7 @@ export type Database = {
9499
10892
  twinfield_connections: {
9500
10893
  Row: {
9501
10894
  access_token: string | null;
9502
- client_id: string | null;
10895
+ client_id: string;
9503
10896
  client_secret: string | null;
9504
10897
  cluster_uri: string | null;
9505
10898
  company_code: string | null;
@@ -9511,7 +10904,7 @@ export type Database = {
9511
10904
  is_active: boolean;
9512
10905
  label: string | null;
9513
10906
  office_code: string | null;
9514
- redirect_uri: string | null;
10907
+ redirect_uri: string;
9515
10908
  refresh_token: string | null;
9516
10909
  token_expires_at: string | null;
9517
10910
  updated_at: string;
@@ -9519,7 +10912,7 @@ export type Database = {
9519
10912
  };
9520
10913
  Insert: {
9521
10914
  access_token?: string | null;
9522
- client_id?: string | null;
10915
+ client_id: string;
9523
10916
  client_secret?: string | null;
9524
10917
  cluster_uri?: string | null;
9525
10918
  company_code?: string | null;
@@ -9531,7 +10924,7 @@ export type Database = {
9531
10924
  is_active?: boolean;
9532
10925
  label?: string | null;
9533
10926
  office_code?: string | null;
9534
- redirect_uri?: string | null;
10927
+ redirect_uri: string;
9535
10928
  refresh_token?: string | null;
9536
10929
  token_expires_at?: string | null;
9537
10930
  updated_at?: string;
@@ -9539,7 +10932,7 @@ export type Database = {
9539
10932
  };
9540
10933
  Update: {
9541
10934
  access_token?: string | null;
9542
- client_id?: string | null;
10935
+ client_id?: string;
9543
10936
  client_secret?: string | null;
9544
10937
  cluster_uri?: string | null;
9545
10938
  company_code?: string | null;
@@ -9551,7 +10944,7 @@ export type Database = {
9551
10944
  is_active?: boolean;
9552
10945
  label?: string | null;
9553
10946
  office_code?: string | null;
9554
- redirect_uri?: string | null;
10947
+ redirect_uri?: string;
9555
10948
  refresh_token?: string | null;
9556
10949
  token_expires_at?: string | null;
9557
10950
  updated_at?: string;
@@ -9611,6 +11004,7 @@ export type Database = {
9611
11004
  country: string | null;
9612
11005
  created_at: string;
9613
11006
  email: string | null;
11007
+ external_group_key: string | null;
9614
11008
  id: string;
9615
11009
  last_synced_at: string | null;
9616
11010
  name: string;
@@ -9629,6 +11023,7 @@ export type Database = {
9629
11023
  country?: string | null;
9630
11024
  created_at?: string;
9631
11025
  email?: string | null;
11026
+ external_group_key?: string | null;
9632
11027
  id?: string;
9633
11028
  last_synced_at?: string | null;
9634
11029
  name: string;
@@ -9647,6 +11042,7 @@ export type Database = {
9647
11042
  country?: string | null;
9648
11043
  created_at?: string;
9649
11044
  email?: string | null;
11045
+ external_group_key?: string | null;
9650
11046
  id?: string;
9651
11047
  last_synced_at?: string | null;
9652
11048
  name?: string;
@@ -9791,22 +11187,69 @@ export type Database = {
9791
11187
  vat_rate?: number | null;
9792
11188
  };
9793
11189
  Update: {
9794
- article_code?: string | null;
11190
+ article_code?: string | null;
11191
+ connection_id?: string;
11192
+ data?: Json;
11193
+ description?: string | null;
11194
+ fetched_at?: string;
11195
+ invoice_number?: string;
11196
+ line_number?: number;
11197
+ line_total?: number | null;
11198
+ quantity?: number | null;
11199
+ unit_price?: number | null;
11200
+ vat_code?: string | null;
11201
+ vat_rate?: number | null;
11202
+ };
11203
+ Relationships: [
11204
+ {
11205
+ foreignKeyName: "twinfield_invoice_lines_cache_v2_connection_id_fkey";
11206
+ columns: ["connection_id"];
11207
+ isOneToOne: false;
11208
+ referencedRelation: "twinfield_connections";
11209
+ referencedColumns: ["id"];
11210
+ }
11211
+ ];
11212
+ };
11213
+ twinfield_invoice_pdf_cache: {
11214
+ Row: {
11215
+ connection_id: string;
11216
+ created_at: string;
11217
+ fetched_at: string;
11218
+ id: string;
11219
+ invoice_number: string;
11220
+ last_accessed_at: string;
11221
+ object_path: string;
11222
+ office_code: string;
11223
+ size_bytes: number;
11224
+ updated_at: string;
11225
+ };
11226
+ Insert: {
11227
+ connection_id: string;
11228
+ created_at?: string;
11229
+ fetched_at?: string;
11230
+ id?: string;
11231
+ invoice_number: string;
11232
+ last_accessed_at?: string;
11233
+ object_path: string;
11234
+ office_code: string;
11235
+ size_bytes?: number;
11236
+ updated_at?: string;
11237
+ };
11238
+ Update: {
9795
11239
  connection_id?: string;
9796
- data?: Json;
9797
- description?: string | null;
11240
+ created_at?: string;
9798
11241
  fetched_at?: string;
11242
+ id?: string;
9799
11243
  invoice_number?: string;
9800
- line_number?: number;
9801
- line_total?: number | null;
9802
- quantity?: number | null;
9803
- unit_price?: number | null;
9804
- vat_code?: string | null;
9805
- vat_rate?: number | null;
11244
+ last_accessed_at?: string;
11245
+ object_path?: string;
11246
+ office_code?: string;
11247
+ size_bytes?: number;
11248
+ updated_at?: string;
9806
11249
  };
9807
11250
  Relationships: [
9808
11251
  {
9809
- foreignKeyName: "twinfield_invoice_lines_cache_v2_connection_id_fkey";
11252
+ foreignKeyName: "twinfield_invoice_pdf_cache_connection_id_fkey";
9810
11253
  columns: ["connection_id"];
9811
11254
  isOneToOne: false;
9812
11255
  referencedRelation: "twinfield_connections";
@@ -9817,6 +11260,8 @@ export type Database = {
9817
11260
  twinfield_invoice_settings: {
9818
11261
  Row: {
9819
11262
  created_at: string;
11263
+ debtor_gl_account: string;
11264
+ default_credit_invoice_type: string | null;
9820
11265
  default_gl_account: string;
9821
11266
  default_invoice_type: string;
9822
11267
  default_payment_term_days: number;
@@ -9825,11 +11270,15 @@ export type Database = {
9825
11270
  invoice_enabled_fo: boolean;
9826
11271
  invoice_enabled_ho: boolean;
9827
11272
  invoice_enabled_mo: boolean;
11273
+ payment_gl_account: string;
11274
+ payment_journal_code: string;
9828
11275
  updated_at: string;
9829
11276
  user_id: string;
9830
11277
  };
9831
11278
  Insert: {
9832
11279
  created_at?: string;
11280
+ debtor_gl_account?: string;
11281
+ default_credit_invoice_type?: string | null;
9833
11282
  default_gl_account?: string;
9834
11283
  default_invoice_type?: string;
9835
11284
  default_payment_term_days?: number;
@@ -9838,11 +11287,15 @@ export type Database = {
9838
11287
  invoice_enabled_fo?: boolean;
9839
11288
  invoice_enabled_ho?: boolean;
9840
11289
  invoice_enabled_mo?: boolean;
11290
+ payment_gl_account?: string;
11291
+ payment_journal_code?: string;
9841
11292
  updated_at?: string;
9842
11293
  user_id: string;
9843
11294
  };
9844
11295
  Update: {
9845
11296
  created_at?: string;
11297
+ debtor_gl_account?: string;
11298
+ default_credit_invoice_type?: string | null;
9846
11299
  default_gl_account?: string;
9847
11300
  default_invoice_type?: string;
9848
11301
  default_payment_term_days?: number;
@@ -9851,6 +11304,8 @@ export type Database = {
9851
11304
  invoice_enabled_fo?: boolean;
9852
11305
  invoice_enabled_ho?: boolean;
9853
11306
  invoice_enabled_mo?: boolean;
11307
+ payment_gl_account?: string;
11308
+ payment_journal_code?: string;
9854
11309
  updated_at?: string;
9855
11310
  user_id?: string;
9856
11311
  };
@@ -10073,43 +11528,49 @@ export type Database = {
10073
11528
  };
10074
11529
  twinfield_push_queue: {
10075
11530
  Row: {
11531
+ action: string;
10076
11532
  attempts: number;
10077
11533
  connection_id: string;
10078
11534
  created_at: string;
11535
+ customer_id: string | null;
10079
11536
  external_id: string | null;
10080
11537
  id: string;
10081
11538
  idempotency_key: string;
10082
11539
  last_error: string | null;
10083
11540
  next_attempt_at: string;
10084
- office_code: string;
11541
+ office_code: string | null;
10085
11542
  payload: Json;
10086
11543
  status: string;
10087
11544
  updated_at: string;
10088
11545
  };
10089
11546
  Insert: {
11547
+ action?: string;
10090
11548
  attempts?: number;
10091
11549
  connection_id: string;
10092
11550
  created_at?: string;
11551
+ customer_id?: string | null;
10093
11552
  external_id?: string | null;
10094
11553
  id?: string;
10095
11554
  idempotency_key: string;
10096
11555
  last_error?: string | null;
10097
11556
  next_attempt_at?: string;
10098
- office_code: string;
11557
+ office_code?: string | null;
10099
11558
  payload: Json;
10100
11559
  status?: string;
10101
11560
  updated_at?: string;
10102
11561
  };
10103
11562
  Update: {
11563
+ action?: string;
10104
11564
  attempts?: number;
10105
11565
  connection_id?: string;
10106
11566
  created_at?: string;
11567
+ customer_id?: string | null;
10107
11568
  external_id?: string | null;
10108
11569
  id?: string;
10109
11570
  idempotency_key?: string;
10110
11571
  last_error?: string | null;
10111
11572
  next_attempt_at?: string;
10112
- office_code?: string;
11573
+ office_code?: string | null;
10113
11574
  payload?: Json;
10114
11575
  status?: string;
10115
11576
  updated_at?: string;
@@ -10121,6 +11582,13 @@ export type Database = {
10121
11582
  isOneToOne: false;
10122
11583
  referencedRelation: "twinfield_connections";
10123
11584
  referencedColumns: ["id"];
11585
+ },
11586
+ {
11587
+ foreignKeyName: "twinfield_push_queue_customer_id_fkey";
11588
+ columns: ["customer_id"];
11589
+ isOneToOne: false;
11590
+ referencedRelation: "customers";
11591
+ referencedColumns: ["id"];
10124
11592
  }
10125
11593
  ];
10126
11594
  };
@@ -10336,72 +11804,434 @@ export type Database = {
10336
11804
  size_bytes?: number | null;
10337
11805
  };
10338
11806
  Update: {
10339
- action?: string;
10340
- attempt_number?: number;
10341
- caller?: string;
10342
- client_user_id?: string | null;
10343
- content_type?: string | null;
11807
+ action?: string;
11808
+ attempt_number?: number;
11809
+ caller?: string;
11810
+ client_user_id?: string | null;
11811
+ content_type?: string | null;
11812
+ created_at?: string;
11813
+ environment?: string;
11814
+ error_message?: string | null;
11815
+ filename?: string | null;
11816
+ id?: string;
11817
+ idempotency_key?: string | null;
11818
+ module?: string;
11819
+ path?: string;
11820
+ reference_id?: string | null;
11821
+ request_body_hash?: string | null;
11822
+ request_timestamp?: number | null;
11823
+ response_content_type?: string | null;
11824
+ response_status?: number | null;
11825
+ size_bytes?: number | null;
11826
+ };
11827
+ Relationships: [];
11828
+ };
11829
+ voorraad_publish_attempts: {
11830
+ Row: {
11831
+ action: string;
11832
+ connection_id: string | null;
11833
+ created_at: string;
11834
+ error: string | null;
11835
+ gateway_attempt_id: string | null;
11836
+ gateway_status: number | null;
11837
+ id: string;
11838
+ intent: string;
11839
+ ok: boolean;
11840
+ request_summary: Json | null;
11841
+ trade_item_id: string | null;
11842
+ user_id: string;
11843
+ };
11844
+ Insert: {
11845
+ action: string;
11846
+ connection_id?: string | null;
11847
+ created_at?: string;
11848
+ error?: string | null;
11849
+ gateway_attempt_id?: string | null;
11850
+ gateway_status?: number | null;
11851
+ id?: string;
11852
+ intent: string;
11853
+ ok: boolean;
11854
+ request_summary?: Json | null;
11855
+ trade_item_id?: string | null;
11856
+ user_id: string;
11857
+ };
11858
+ Update: {
11859
+ action?: string;
11860
+ connection_id?: string | null;
11861
+ created_at?: string;
11862
+ error?: string | null;
11863
+ gateway_attempt_id?: string | null;
11864
+ gateway_status?: number | null;
11865
+ id?: string;
11866
+ intent?: string;
11867
+ ok?: boolean;
11868
+ request_summary?: Json | null;
11869
+ trade_item_id?: string | null;
11870
+ user_id?: string;
11871
+ };
11872
+ Relationships: [];
11873
+ };
11874
+ werkbon_package_ai_rules: {
11875
+ Row: {
11876
+ active: boolean;
11877
+ case_sensitive: boolean;
11878
+ created_at: string;
11879
+ id: string;
11880
+ package_id: string;
11881
+ priority: number;
11882
+ rule_type: string;
11883
+ updated_at: string;
11884
+ value: string;
11885
+ };
11886
+ Insert: {
11887
+ active?: boolean;
11888
+ case_sensitive?: boolean;
11889
+ created_at?: string;
11890
+ id?: string;
11891
+ package_id: string;
11892
+ priority?: number;
11893
+ rule_type: string;
11894
+ updated_at?: string;
11895
+ value: string;
11896
+ };
11897
+ Update: {
11898
+ active?: boolean;
11899
+ case_sensitive?: boolean;
11900
+ created_at?: string;
11901
+ id?: string;
11902
+ package_id?: string;
11903
+ priority?: number;
11904
+ rule_type?: string;
11905
+ updated_at?: string;
11906
+ value?: string;
11907
+ };
11908
+ Relationships: [
11909
+ {
11910
+ foreignKeyName: "werkbon_package_ai_rules_package_id_fkey";
11911
+ columns: ["package_id"];
11912
+ isOneToOne: false;
11913
+ referencedRelation: "werkbon_packages";
11914
+ referencedColumns: ["id"];
11915
+ }
11916
+ ];
11917
+ };
11918
+ werkbon_package_categories: {
11919
+ Row: {
11920
+ active: boolean;
11921
+ created_at: string;
11922
+ id: string;
11923
+ kleur: string | null;
11924
+ naam: string;
11925
+ sort_order: number;
11926
+ updated_at: string;
11927
+ };
11928
+ Insert: {
11929
+ active?: boolean;
11930
+ created_at?: string;
11931
+ id?: string;
11932
+ kleur?: string | null;
11933
+ naam: string;
11934
+ sort_order?: number;
11935
+ updated_at?: string;
11936
+ };
11937
+ Update: {
11938
+ active?: boolean;
11939
+ created_at?: string;
11940
+ id?: string;
11941
+ kleur?: string | null;
11942
+ naam?: string;
11943
+ sort_order?: number;
11944
+ updated_at?: string;
11945
+ };
11946
+ Relationships: [];
11947
+ };
11948
+ werkbon_package_lines: {
11949
+ Row: {
11950
+ created_at: string;
11951
+ created_by: string | null;
11952
+ id: string;
11953
+ package_id: string;
11954
+ quantity: number;
11955
+ unit_price_cents_snapshot: number;
11956
+ werkbon_id: string;
11957
+ };
11958
+ Insert: {
11959
+ created_at?: string;
11960
+ created_by?: string | null;
11961
+ id?: string;
11962
+ package_id: string;
11963
+ quantity?: number;
11964
+ unit_price_cents_snapshot?: number;
11965
+ werkbon_id: string;
11966
+ };
11967
+ Update: {
11968
+ created_at?: string;
11969
+ created_by?: string | null;
11970
+ id?: string;
11971
+ package_id?: string;
11972
+ quantity?: number;
11973
+ unit_price_cents_snapshot?: number;
11974
+ werkbon_id?: string;
11975
+ };
11976
+ Relationships: [
11977
+ {
11978
+ foreignKeyName: "werkbon_package_lines_package_id_fkey";
11979
+ columns: ["package_id"];
11980
+ isOneToOne: false;
11981
+ referencedRelation: "werkbon_packages";
11982
+ referencedColumns: ["id"];
11983
+ },
11984
+ {
11985
+ foreignKeyName: "werkbon_package_lines_werkbon_id_fkey";
11986
+ columns: ["werkbon_id"];
11987
+ isOneToOne: false;
11988
+ referencedRelation: "werkbonnen";
11989
+ referencedColumns: ["id"];
11990
+ }
11991
+ ];
11992
+ };
11993
+ werkbon_packages: {
11994
+ Row: {
11995
+ active: boolean;
11996
+ ai_tags: string[];
11997
+ category_id: string | null;
11998
+ code: string;
11999
+ created_at: string;
12000
+ default_quantity: number;
12001
+ description: string | null;
12002
+ duration_minutes: number | null;
12003
+ id: string;
12004
+ mandaat_type: string | null;
12005
+ name: string;
12006
+ sort_order: number;
12007
+ unit_price_cents: number;
12008
+ updated_at: string;
12009
+ };
12010
+ Insert: {
12011
+ active?: boolean;
12012
+ ai_tags?: string[];
12013
+ category_id?: string | null;
12014
+ code: string;
12015
+ created_at?: string;
12016
+ default_quantity?: number;
12017
+ description?: string | null;
12018
+ duration_minutes?: number | null;
12019
+ id?: string;
12020
+ mandaat_type?: string | null;
12021
+ name: string;
12022
+ sort_order?: number;
12023
+ unit_price_cents?: number;
12024
+ updated_at?: string;
12025
+ };
12026
+ Update: {
12027
+ active?: boolean;
12028
+ ai_tags?: string[];
12029
+ category_id?: string | null;
12030
+ code?: string;
12031
+ created_at?: string;
12032
+ default_quantity?: number;
12033
+ description?: string | null;
12034
+ duration_minutes?: number | null;
12035
+ id?: string;
12036
+ mandaat_type?: string | null;
12037
+ name?: string;
12038
+ sort_order?: number;
12039
+ unit_price_cents?: number;
12040
+ updated_at?: string;
12041
+ };
12042
+ Relationships: [
12043
+ {
12044
+ foreignKeyName: "werkbon_packages_category_id_fkey";
12045
+ columns: ["category_id"];
12046
+ isOneToOne: false;
12047
+ referencedRelation: "werkbon_package_categories";
12048
+ referencedColumns: ["id"];
12049
+ }
12050
+ ];
12051
+ };
12052
+ werkbon_photos: {
12053
+ Row: {
12054
+ created_at: string;
12055
+ id: string;
12056
+ storage_path: string;
12057
+ user_id: string;
12058
+ werkbon_id: string;
12059
+ };
12060
+ Insert: {
12061
+ created_at?: string;
12062
+ id?: string;
12063
+ storage_path: string;
12064
+ user_id: string;
12065
+ werkbon_id: string;
12066
+ };
12067
+ Update: {
12068
+ created_at?: string;
12069
+ id?: string;
12070
+ storage_path?: string;
12071
+ user_id?: string;
12072
+ werkbon_id?: string;
12073
+ };
12074
+ Relationships: [
12075
+ {
12076
+ foreignKeyName: "werkbon_photos_werkbon_id_fkey";
12077
+ columns: ["werkbon_id"];
12078
+ isOneToOne: false;
12079
+ referencedRelation: "werkbonnen";
12080
+ referencedColumns: ["id"];
12081
+ }
12082
+ ];
12083
+ };
12084
+ werkbon_time_logs: {
12085
+ Row: {
12086
+ activity: string;
12087
+ created_at: string;
12088
+ ended_at: string | null;
12089
+ id: string;
12090
+ started_at: string;
12091
+ user_id: string;
12092
+ werkbon_id: string;
12093
+ };
12094
+ Insert: {
12095
+ activity: string;
12096
+ created_at?: string;
12097
+ ended_at?: string | null;
12098
+ id?: string;
12099
+ started_at?: string;
12100
+ user_id: string;
12101
+ werkbon_id: string;
12102
+ };
12103
+ Update: {
12104
+ activity?: string;
10344
12105
  created_at?: string;
10345
- environment?: string;
10346
- error_message?: string | null;
10347
- filename?: string | null;
12106
+ ended_at?: string | null;
10348
12107
  id?: string;
10349
- idempotency_key?: string | null;
10350
- module?: string;
10351
- path?: string;
10352
- reference_id?: string | null;
10353
- request_body_hash?: string | null;
10354
- request_timestamp?: number | null;
10355
- response_content_type?: string | null;
10356
- response_status?: number | null;
10357
- size_bytes?: number | null;
12108
+ started_at?: string;
12109
+ user_id?: string;
12110
+ werkbon_id?: string;
10358
12111
  };
10359
- Relationships: [];
12112
+ Relationships: [
12113
+ {
12114
+ foreignKeyName: "werkbon_time_logs_werkbon_id_fkey";
12115
+ columns: ["werkbon_id"];
12116
+ isOneToOne: false;
12117
+ referencedRelation: "werkbonnen";
12118
+ referencedColumns: ["id"];
12119
+ }
12120
+ ];
10360
12121
  };
10361
- voorraad_publish_attempts: {
12122
+ werkbonnen: {
10362
12123
  Row: {
10363
- action: string;
10364
- connection_id: string | null;
12124
+ assigned_user_id: string | null;
12125
+ budget_mandate_cents: number;
12126
+ complaint_description: string | null;
10365
12127
  created_at: string;
10366
- error: string | null;
10367
- gateway_attempt_id: string | null;
10368
- gateway_status: number | null;
12128
+ created_by: string | null;
12129
+ customer_id: string | null;
12130
+ externe_referentie: string | null;
12131
+ first_time_fix: boolean | null;
10369
12132
  id: string;
10370
- intent: string;
10371
- ok: boolean;
10372
- request_summary: Json | null;
10373
- trade_item_id: string | null;
10374
- user_id: string;
12133
+ internal_notes: string | null;
12134
+ parent_werkbon_id: string | null;
12135
+ parsed_payload: Json | null;
12136
+ planning_status: string;
12137
+ project_number: string | null;
12138
+ room_number: string | null;
12139
+ scheduled_end_time: string | null;
12140
+ scheduled_start_time: string | null;
12141
+ sequence_number: number;
12142
+ source_email_meta: Json | null;
12143
+ source_mailbox_message_id: string | null;
12144
+ source_pdf_path: string | null;
12145
+ source_type: string;
12146
+ status: string;
12147
+ technician_id: string | null;
12148
+ technician_notes: string | null;
12149
+ technician_notes_raw: string | null;
12150
+ technician_task_description: string | null;
12151
+ updated_at: string;
12152
+ version: number;
12153
+ work_address: string | null;
10375
12154
  };
10376
12155
  Insert: {
10377
- action: string;
10378
- connection_id?: string | null;
12156
+ assigned_user_id?: string | null;
12157
+ budget_mandate_cents?: number;
12158
+ complaint_description?: string | null;
10379
12159
  created_at?: string;
10380
- error?: string | null;
10381
- gateway_attempt_id?: string | null;
10382
- gateway_status?: number | null;
12160
+ created_by?: string | null;
12161
+ customer_id?: string | null;
12162
+ externe_referentie?: string | null;
12163
+ first_time_fix?: boolean | null;
10383
12164
  id?: string;
10384
- intent: string;
10385
- ok: boolean;
10386
- request_summary?: Json | null;
10387
- trade_item_id?: string | null;
10388
- user_id: string;
12165
+ internal_notes?: string | null;
12166
+ parent_werkbon_id?: string | null;
12167
+ parsed_payload?: Json | null;
12168
+ planning_status?: string;
12169
+ project_number?: string | null;
12170
+ room_number?: string | null;
12171
+ scheduled_end_time?: string | null;
12172
+ scheduled_start_time?: string | null;
12173
+ sequence_number: number;
12174
+ source_email_meta?: Json | null;
12175
+ source_mailbox_message_id?: string | null;
12176
+ source_pdf_path?: string | null;
12177
+ source_type?: string;
12178
+ status?: string;
12179
+ technician_id?: string | null;
12180
+ technician_notes?: string | null;
12181
+ technician_notes_raw?: string | null;
12182
+ technician_task_description?: string | null;
12183
+ updated_at?: string;
12184
+ version?: number;
12185
+ work_address?: string | null;
10389
12186
  };
10390
12187
  Update: {
10391
- action?: string;
10392
- connection_id?: string | null;
12188
+ assigned_user_id?: string | null;
12189
+ budget_mandate_cents?: number;
12190
+ complaint_description?: string | null;
10393
12191
  created_at?: string;
10394
- error?: string | null;
10395
- gateway_attempt_id?: string | null;
10396
- gateway_status?: number | null;
12192
+ created_by?: string | null;
12193
+ customer_id?: string | null;
12194
+ externe_referentie?: string | null;
12195
+ first_time_fix?: boolean | null;
10397
12196
  id?: string;
10398
- intent?: string;
10399
- ok?: boolean;
10400
- request_summary?: Json | null;
10401
- trade_item_id?: string | null;
10402
- user_id?: string;
12197
+ internal_notes?: string | null;
12198
+ parent_werkbon_id?: string | null;
12199
+ parsed_payload?: Json | null;
12200
+ planning_status?: string;
12201
+ project_number?: string | null;
12202
+ room_number?: string | null;
12203
+ scheduled_end_time?: string | null;
12204
+ scheduled_start_time?: string | null;
12205
+ sequence_number?: number;
12206
+ source_email_meta?: Json | null;
12207
+ source_mailbox_message_id?: string | null;
12208
+ source_pdf_path?: string | null;
12209
+ source_type?: string;
12210
+ status?: string;
12211
+ technician_id?: string | null;
12212
+ technician_notes?: string | null;
12213
+ technician_notes_raw?: string | null;
12214
+ technician_task_description?: string | null;
12215
+ updated_at?: string;
12216
+ version?: number;
12217
+ work_address?: string | null;
10403
12218
  };
10404
- Relationships: [];
12219
+ Relationships: [
12220
+ {
12221
+ foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
12222
+ columns: ["parent_werkbon_id"];
12223
+ isOneToOne: false;
12224
+ referencedRelation: "werkbonnen";
12225
+ referencedColumns: ["id"];
12226
+ },
12227
+ {
12228
+ foreignKeyName: "werkbonnen_source_mailbox_message_id_fkey";
12229
+ columns: ["source_mailbox_message_id"];
12230
+ isOneToOne: false;
12231
+ referencedRelation: "mailbox_messages";
12232
+ referencedColumns: ["id"];
12233
+ }
12234
+ ];
10405
12235
  };
10406
12236
  work_order_monteurs: {
10407
12237
  Row: {
@@ -10579,6 +12409,8 @@ export type Database = {
10579
12409
  created_at: string | null;
10580
12410
  created_by: string | null;
10581
12411
  display_name: string | null;
12412
+ graph_subscription_expires_at: string | null;
12413
+ graph_subscription_id: string | null;
10582
12414
  has_access_token: boolean | null;
10583
12415
  has_client_id: boolean | null;
10584
12416
  has_client_secret: boolean | null;
@@ -10596,6 +12428,7 @@ export type Database = {
10596
12428
  oauth_mode: string | null;
10597
12429
  provider: string | null;
10598
12430
  purpose_assignments: Json | null;
12431
+ realtime_mode: string | null;
10599
12432
  scopes: string[] | null;
10600
12433
  smtp_host: string | null;
10601
12434
  smtp_port: number | null;
@@ -10610,6 +12443,8 @@ export type Database = {
10610
12443
  created_at?: string | null;
10611
12444
  created_by?: string | null;
10612
12445
  display_name?: string | null;
12446
+ graph_subscription_expires_at?: string | null;
12447
+ graph_subscription_id?: string | null;
10613
12448
  has_access_token?: never;
10614
12449
  has_client_id?: never;
10615
12450
  has_client_secret?: never;
@@ -10627,6 +12462,7 @@ export type Database = {
10627
12462
  oauth_mode?: string | null;
10628
12463
  provider?: string | null;
10629
12464
  purpose_assignments?: Json | null;
12465
+ realtime_mode?: string | null;
10630
12466
  scopes?: string[] | null;
10631
12467
  smtp_host?: string | null;
10632
12468
  smtp_port?: number | null;
@@ -10641,6 +12477,8 @@ export type Database = {
10641
12477
  created_at?: string | null;
10642
12478
  created_by?: string | null;
10643
12479
  display_name?: string | null;
12480
+ graph_subscription_expires_at?: string | null;
12481
+ graph_subscription_id?: string | null;
10644
12482
  has_access_token?: never;
10645
12483
  has_client_id?: never;
10646
12484
  has_client_secret?: never;
@@ -10658,6 +12496,7 @@ export type Database = {
10658
12496
  oauth_mode?: string | null;
10659
12497
  provider?: string | null;
10660
12498
  purpose_assignments?: Json | null;
12499
+ realtime_mode?: string | null;
10661
12500
  scopes?: string[] | null;
10662
12501
  smtp_host?: string | null;
10663
12502
  smtp_port?: number | null;
@@ -10768,6 +12607,25 @@ export type Database = {
10768
12607
  };
10769
12608
  Relationships: [];
10770
12609
  };
12610
+ floriday_customer_discounts: {
12611
+ Row: {
12612
+ base_price: number | null;
12613
+ buyer_organization_id: string | null;
12614
+ currency: string | null;
12615
+ discount_type: string | null;
12616
+ discount_value: number | null;
12617
+ min_quantity: number | null;
12618
+ net_price: number | null;
12619
+ product_group_id: string | null;
12620
+ raw: Json | null;
12621
+ source: string | null;
12622
+ source_id: string | null;
12623
+ trade_item_id: string | null;
12624
+ valid_from: string | null;
12625
+ valid_until: string | null;
12626
+ };
12627
+ Relationships: [];
12628
+ };
10771
12629
  local_customer_discounts: {
10772
12630
  Row: {
10773
12631
  base_price: number | null;
@@ -11116,6 +12974,21 @@ export type Database = {
11116
12974
  };
11117
12975
  Returns: string;
11118
12976
  };
12977
+ ai_usage_by_module: {
12978
+ Args: {
12979
+ _from: string;
12980
+ _to: string;
12981
+ };
12982
+ Returns: {
12983
+ calls: number;
12984
+ consumer_module_id: string;
12985
+ cost_usd: number;
12986
+ errors: number;
12987
+ input_tokens: number;
12988
+ output_tokens: number;
12989
+ total_tokens: number;
12990
+ }[];
12991
+ };
11119
12992
  apply_stock_consumption: {
11120
12993
  Args: {
11121
12994
  p_order_id: string;
@@ -11173,6 +13046,12 @@ export type Database = {
11173
13046
  processed_items: number;
11174
13047
  }[];
11175
13048
  };
13049
+ calculate_layer_stock: {
13050
+ Args: {
13051
+ p_product_id: string;
13052
+ };
13053
+ Returns: number;
13054
+ };
11176
13055
  call_exact_route: {
11177
13056
  Args: {
11178
13057
  path: string;
@@ -11201,6 +13080,33 @@ export type Database = {
11201
13080
  };
11202
13081
  Returns: Json;
11203
13082
  };
13083
+ claim_twinfield_push_batch: {
13084
+ Args: {
13085
+ _limit?: number;
13086
+ };
13087
+ Returns: {
13088
+ action: string;
13089
+ attempts: number;
13090
+ connection_id: string;
13091
+ created_at: string;
13092
+ customer_id: string | null;
13093
+ external_id: string | null;
13094
+ id: string;
13095
+ idempotency_key: string;
13096
+ last_error: string | null;
13097
+ next_attempt_at: string;
13098
+ office_code: string | null;
13099
+ payload: Json;
13100
+ status: string;
13101
+ updated_at: string;
13102
+ }[];
13103
+ SetofOptions: {
13104
+ from: "*";
13105
+ to: "twinfield_push_queue";
13106
+ isOneToOne: false;
13107
+ isSetofReturn: true;
13108
+ };
13109
+ };
11204
13110
  cleanup_old_bookings: {
11205
13111
  Args: never;
11206
13112
  Returns: undefined;
@@ -11259,6 +13165,12 @@ export type Database = {
11259
13165
  Args: never;
11260
13166
  Returns: string;
11261
13167
  };
13168
+ custom_access_token_hook: {
13169
+ Args: {
13170
+ event: Json;
13171
+ };
13172
+ Returns: Json;
13173
+ };
11262
13174
  dashboard_alert_counts: {
11263
13175
  Args: never;
11264
13176
  Returns: Json;
@@ -11326,6 +13238,16 @@ export type Database = {
11326
13238
  status: string;
11327
13239
  }[];
11328
13240
  };
13241
+ email_auth_upsert_connection: {
13242
+ Args: {
13243
+ _account_email: string;
13244
+ _created_by: string;
13245
+ _is_active: boolean;
13246
+ _provider: string;
13247
+ _status: string;
13248
+ };
13249
+ Returns: string;
13250
+ };
11329
13251
  enqueue_cart_replan_if_unlocked: {
11330
13252
  Args: {
11331
13253
  p_order_id: string;
@@ -11445,6 +13367,19 @@ export type Database = {
11445
13367
  resource: string;
11446
13368
  }[];
11447
13369
  };
13370
+ get_floriday_agreements_active: {
13371
+ Args: {
13372
+ p_on_date?: string;
13373
+ };
13374
+ Returns: {
13375
+ buyer_organization_id: string;
13376
+ data: Json;
13377
+ floriday_id: string;
13378
+ status: string;
13379
+ valid_from: string;
13380
+ valid_until: string;
13381
+ }[];
13382
+ };
11448
13383
  get_floriday_clock_supplies_window: {
11449
13384
  Args: {
11450
13385
  p_from: string;
@@ -11532,6 +13467,12 @@ export type Database = {
11532
13467
  };
11533
13468
  Returns: string;
11534
13469
  };
13470
+ get_inventory_stock_for_key: {
13471
+ Args: {
13472
+ p_key: string;
13473
+ };
13474
+ Returns: number;
13475
+ };
11535
13476
  get_offer_by_link_code: {
11536
13477
  Args: {
11537
13478
  p_code: string;
@@ -11562,6 +13503,12 @@ export type Database = {
11562
13503
  };
11563
13504
  Returns: string;
11564
13505
  };
13506
+ get_product_group_available_stock: {
13507
+ Args: {
13508
+ p_group_id: string;
13509
+ };
13510
+ Returns: number;
13511
+ };
11565
13512
  get_room_busy_windows: {
11566
13513
  Args: {
11567
13514
  p_from: string;
@@ -11593,6 +13540,14 @@ export type Database = {
11593
13540
  };
11594
13541
  Returns: string;
11595
13542
  };
13543
+ has_module_permission: {
13544
+ Args: {
13545
+ _min: string;
13546
+ _module_id: string;
13547
+ _user_id: string;
13548
+ };
13549
+ Returns: boolean;
13550
+ };
11596
13551
  has_role: {
11597
13552
  Args: {
11598
13553
  _role: Database["public"]["Enums"]["app_role"];
@@ -11600,6 +13555,10 @@ export type Database = {
11600
13555
  };
11601
13556
  Returns: boolean;
11602
13557
  };
13558
+ has_twinfield_link: {
13559
+ Args: never;
13560
+ Returns: boolean;
13561
+ };
11603
13562
  is_authenticated: {
11604
13563
  Args: never;
11605
13564
  Returns: boolean;
@@ -11614,6 +13573,37 @@ export type Database = {
11614
13573
  };
11615
13574
  Returns: boolean;
11616
13575
  };
13576
+ jwt_has_role: {
13577
+ Args: {
13578
+ _role: Database["public"]["Enums"]["app_role"];
13579
+ };
13580
+ Returns: boolean;
13581
+ };
13582
+ list_monteurs: {
13583
+ Args: never;
13584
+ Returns: {
13585
+ avatar_url: string;
13586
+ display_name: string;
13587
+ email: string;
13588
+ id: string;
13589
+ }[];
13590
+ };
13591
+ list_my_planning_items: {
13592
+ Args: {
13593
+ _from: string;
13594
+ _to: string;
13595
+ };
13596
+ Returns: {
13597
+ assigned_monteur_id: string;
13598
+ end_at: string;
13599
+ id: string;
13600
+ notes: string;
13601
+ role: string;
13602
+ start_at: string;
13603
+ status: Database["public"]["Enums"]["planning_item_status"];
13604
+ werkbon_id: string;
13605
+ }[];
13606
+ };
11617
13607
  local_effective_price: {
11618
13608
  Args: {
11619
13609
  _customer_id: string;
@@ -11630,6 +13620,22 @@ export type Database = {
11630
13620
  source_id: string;
11631
13621
  }[];
11632
13622
  };
13623
+ log_ai_call: {
13624
+ Args: {
13625
+ _consumer_module_id: string;
13626
+ _cost_usd: number;
13627
+ _duration_ms: number;
13628
+ _error_code: string;
13629
+ _error_message: string;
13630
+ _input_tokens: number;
13631
+ _model_slug: string;
13632
+ _output_tokens: number;
13633
+ _provider_slug: string;
13634
+ _status: string;
13635
+ _total_tokens: number;
13636
+ };
13637
+ Returns: string;
13638
+ };
11633
13639
  mark_offer_clicked: {
11634
13640
  Args: {
11635
13641
  p_code: string;
@@ -11681,6 +13687,10 @@ export type Database = {
11681
13687
  };
11682
13688
  Returns: string;
11683
13689
  };
13690
+ next_twinfield_code: {
13691
+ Args: never;
13692
+ Returns: string;
13693
+ };
11684
13694
  next_work_order_number: {
11685
13695
  Args: {
11686
13696
  p_parent_work_order_id?: string;
@@ -11737,6 +13747,15 @@ export type Database = {
11737
13747
  };
11738
13748
  Returns: undefined;
11739
13749
  };
13750
+ pickstation_resolve_delivery_orders: {
13751
+ Args: {
13752
+ p_sales_order_ids: string[];
13753
+ };
13754
+ Returns: {
13755
+ delivery_order_id: string;
13756
+ sales_order_id: string;
13757
+ }[];
13758
+ };
11740
13759
  pickstation_set_cart_status: {
11741
13760
  Args: {
11742
13761
  p_cart_index: number;
@@ -11807,6 +13826,12 @@ export type Database = {
11807
13826
  };
11808
13827
  Returns: number;
11809
13828
  };
13829
+ reorder_customer_price_groups: {
13830
+ Args: {
13831
+ _ids: string[];
13832
+ };
13833
+ Returns: undefined;
13834
+ };
11810
13835
  reset_floriday_sync_cursor: {
11811
13836
  Args: {
11812
13837
  p_connection_id: string;
@@ -11842,6 +13867,12 @@ export type Database = {
11842
13867
  };
11843
13868
  Returns: string;
11844
13869
  };
13870
+ retry_twinfield_push: {
13871
+ Args: {
13872
+ _customer_id: string;
13873
+ };
13874
+ Returns: number;
13875
+ };
11845
13876
  reverse_production: {
11846
13877
  Args: {
11847
13878
  p_connection_id?: string;
@@ -11859,6 +13890,20 @@ export type Database = {
11859
13890
  };
11860
13891
  Returns: number;
11861
13892
  };
13893
+ schedule_floriday_agreement_calloffs_sync: {
13894
+ Args: {
13895
+ p_apikey: string;
13896
+ p_url: string;
13897
+ };
13898
+ Returns: number;
13899
+ };
13900
+ schedule_floriday_agreements_sync: {
13901
+ Args: {
13902
+ p_apikey: string;
13903
+ p_url: string;
13904
+ };
13905
+ Returns: number;
13906
+ };
11862
13907
  schedule_floriday_base_items_sync: {
11863
13908
  Args: {
11864
13909
  p_apikey: string;
@@ -12109,6 +14154,13 @@ export type Database = {
12109
14154
  Args: never;
12110
14155
  Returns: number;
12111
14156
  };
14157
+ set_planning_status: {
14158
+ Args: {
14159
+ _id: string;
14160
+ _status: Database["public"]["Enums"]["planning_item_status"];
14161
+ };
14162
+ Returns: undefined;
14163
+ };
12112
14164
  show_limit: {
12113
14165
  Args: never;
12114
14166
  Returns: number;
@@ -12119,12 +14171,22 @@ export type Database = {
12119
14171
  };
12120
14172
  Returns: string[];
12121
14173
  };
14174
+ sync_all_layer_stocks: {
14175
+ Args: never;
14176
+ Returns: undefined;
14177
+ };
12122
14178
  sync_cached_packing_from_product: {
12123
14179
  Args: {
12124
14180
  p_product_id: string;
12125
14181
  };
12126
14182
  Returns: undefined;
12127
14183
  };
14184
+ sync_layer_stock: {
14185
+ Args: {
14186
+ p_product_id: string;
14187
+ };
14188
+ Returns: undefined;
14189
+ };
12128
14190
  sync_order_cart_item_packing_from_product: {
12129
14191
  Args: {
12130
14192
  p_product_id: string;
@@ -12168,9 +14230,12 @@ export type Database = {
12168
14230
  };
12169
14231
  };
12170
14232
  Enums: {
12171
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
14233
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
12172
14234
  exact_env: "staging" | "live";
12173
14235
  exact_push_status: "pending" | "sent" | "error";
14236
+ itk_customer_segment: "Business" | "Private";
14237
+ itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
14238
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd" | "concept" | "vrijgegeven";
12174
14239
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
12175
14240
  };
12176
14241
  CompositeTypes: {
@@ -12230,9 +14295,12 @@ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof Defaul
12230
14295
  export declare const Constants: {
12231
14296
  readonly public: {
12232
14297
  readonly Enums: {
12233
- readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer", "receptie", "monteur"];
14298
+ readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin"];
12234
14299
  readonly exact_env: readonly ["staging", "live"];
12235
14300
  readonly exact_push_status: readonly ["pending", "sent", "error"];
14301
+ readonly itk_customer_segment: readonly ["Business", "Private"];
14302
+ readonly itk_dynamic_field_type: readonly ["text", "select", "date", "checkbox"];
14303
+ readonly planning_item_status: readonly ["gepland", "bezig", "afgerond", "geannuleerd", "concept", "vrijgegeven"];
12236
14304
  readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
12237
14305
  };
12238
14306
  };