@flowselections/floriday-voorraad 1.0.22 → 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 (65) 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 +655 -93
  4. package/dist-lib/components/voorraad/FloridayInfoCard.d.ts +12 -0
  5. package/dist-lib/components/voorraad/FloridayInfoCard.d.ts.map +1 -0
  6. package/dist-lib/components/voorraad/FloridayInfoCard.js +85 -0
  7. package/dist-lib/components/voorraad/StepSamenstelling.d.ts +10 -0
  8. package/dist-lib/components/voorraad/StepSamenstelling.d.ts.map +1 -0
  9. package/dist-lib/components/voorraad/StepSamenstelling.js +333 -0
  10. package/dist-lib/components/voorraad/VoorraadPage.d.ts.map +1 -1
  11. package/dist-lib/components/voorraad/VoorraadPage.js +14 -3
  12. package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
  13. package/dist-lib/components/voorraad/VoorraadTable.js +8 -1
  14. package/dist-lib/hooks/useFloridayPriceGroups.d.ts +20 -0
  15. package/dist-lib/hooks/useFloridayPriceGroups.d.ts.map +1 -0
  16. package/dist-lib/hooks/useFloridayPriceGroups.js +55 -0
  17. package/dist-lib/hooks/useFloridayVbnRequired.d.ts +5 -0
  18. package/dist-lib/hooks/useFloridayVbnRequired.d.ts.map +1 -0
  19. package/dist-lib/hooks/useFloridayVbnRequired.js +16 -0
  20. package/dist-lib/hooks/useLocalTradeItems.d.ts.map +1 -1
  21. package/dist-lib/hooks/useLocalTradeItems.js +14 -0
  22. package/dist-lib/hooks/useTradeItemSpec.d.ts.map +1 -1
  23. package/dist-lib/hooks/useTradeItemSpec.js +48 -1
  24. package/dist-lib/hooks/useVoorraadData.d.ts.map +1 -1
  25. package/dist-lib/hooks/useVoorraadData.js +36 -5
  26. package/dist-lib/integrations/supabase/auth-middleware.d.ts +2388 -345
  27. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  28. package/dist-lib/integrations/supabase/client.d.ts +2388 -345
  29. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  30. package/dist-lib/integrations/supabase/client.server.d.ts +2388 -345
  31. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  32. package/dist-lib/integrations/supabase/types.d.ts +2437 -343
  33. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  34. package/dist-lib/integrations/supabase/types.js +11 -9
  35. package/dist-lib/lib/centralSecrets.server.d.ts +21 -0
  36. package/dist-lib/lib/centralSecrets.server.d.ts.map +1 -0
  37. package/dist-lib/lib/centralSecrets.server.js +111 -0
  38. package/dist-lib/lib/floricode-required-features.functions.d.ts +2388 -345
  39. package/dist-lib/lib/floricode-required-features.functions.d.ts.map +1 -1
  40. package/dist-lib/lib/floriday-client.d.ts +4 -0
  41. package/dist-lib/lib/floriday-client.d.ts.map +1 -1
  42. package/dist-lib/lib/floriday-customer-offer.functions.d.ts +2388 -345
  43. package/dist-lib/lib/floriday-customer-offer.functions.d.ts.map +1 -1
  44. package/dist-lib/lib/floriday-gateway.functions.d.ts +10860 -645
  45. package/dist-lib/lib/floriday-gateway.functions.d.ts.map +1 -1
  46. package/dist-lib/lib/floriday-gateway.server.d.ts.map +1 -1
  47. package/dist-lib/lib/floriday-gateway.server.js +34 -9
  48. package/dist-lib/lib/floriday-info.d.ts +54 -0
  49. package/dist-lib/lib/floriday-info.d.ts.map +1 -0
  50. package/dist-lib/lib/floriday-info.js +114 -0
  51. package/dist-lib/lib/floriday-payload.d.ts +21 -3
  52. package/dist-lib/lib/floriday-payload.d.ts.map +1 -1
  53. package/dist-lib/lib/floriday-payload.js +167 -34
  54. package/dist-lib/lib/floriday-vbn-required.functions.d.ts +27769 -0
  55. package/dist-lib/lib/floriday-vbn-required.functions.d.ts.map +1 -0
  56. package/dist-lib/lib/floriday-vbn-required.functions.js +85 -0
  57. package/dist-lib/lib/floriday-warehouse.functions.d.ts +6602 -473
  58. package/dist-lib/lib/floriday-warehouse.functions.d.ts.map +1 -1
  59. package/dist-lib/lib/floriday-writes.functions.d.ts +4681 -594
  60. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  61. package/dist-lib/lib/floriday-writes.functions.js +36 -1
  62. package/dist-lib/lib/trade-item-prices.d.ts +43 -0
  63. package/dist-lib/lib/trade-item-prices.d.ts.map +1 -0
  64. package/dist-lib/lib/trade-item-prices.js +229 -0
  65. 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;
@@ -5045,47 +5679,6 @@ export type Database = {
5045
5679
  }
5046
5680
  ];
5047
5681
  };
5048
- floriday_trade_settings_customers_cache: {
5049
- Row: {
5050
- connection_id: string;
5051
- data: Json;
5052
- fetched_at: string;
5053
- floriday_id: string;
5054
- id: string;
5055
- is_deleted: boolean;
5056
- sequence_number: number;
5057
- updated_at: string;
5058
- };
5059
- Insert: {
5060
- connection_id: string;
5061
- data: Json;
5062
- fetched_at?: string;
5063
- floriday_id: string;
5064
- id?: string;
5065
- is_deleted?: boolean;
5066
- sequence_number?: number;
5067
- updated_at?: string;
5068
- };
5069
- Update: {
5070
- connection_id?: string;
5071
- data?: Json;
5072
- fetched_at?: string;
5073
- floriday_id?: string;
5074
- id?: string;
5075
- is_deleted?: boolean;
5076
- sequence_number?: number;
5077
- updated_at?: string;
5078
- };
5079
- Relationships: [
5080
- {
5081
- foreignKeyName: "floriday_trade_settings_customers_cache_connection_id_fkey";
5082
- columns: ["connection_id"];
5083
- isOneToOne: false;
5084
- referencedRelation: "floriday_connections";
5085
- referencedColumns: ["id"];
5086
- }
5087
- ];
5088
- };
5089
5682
  floriday_trips_cache: {
5090
5683
  Row: {
5091
5684
  carrier_organization_id: string | null;
@@ -5136,6 +5729,27 @@ export type Database = {
5136
5729
  }
5137
5730
  ];
5138
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
+ };
5139
5753
  floriday_warehouses_cache: {
5140
5754
  Row: {
5141
5755
  connection_id: string;
@@ -5632,237 +6246,817 @@ export type Database = {
5632
6246
  };
5633
6247
  Relationships: [];
5634
6248
  };
5635
- local_customer_agreements: {
6249
+ itk_contact_persons: {
5636
6250
  Row: {
5637
- base_price: number | null;
5638
6251
  created_at: string;
5639
- currency: string;
5640
6252
  customer_id: string;
6253
+ email: string | null;
5641
6254
  id: string;
5642
- min_quantity: number;
5643
- net_price: number;
5644
- notes: string | null;
5645
- product_category_id: string | null;
5646
- product_id: string | null;
6255
+ name: string;
6256
+ phone: string | null;
6257
+ role: string | null;
5647
6258
  updated_at: string;
5648
- valid_from: string | null;
5649
- valid_until: string | null;
5650
6259
  };
5651
6260
  Insert: {
5652
- base_price?: number | null;
5653
6261
  created_at?: string;
5654
- currency?: string;
5655
6262
  customer_id: string;
6263
+ email?: string | null;
5656
6264
  id?: string;
5657
- min_quantity?: number;
5658
- net_price: number;
5659
- notes?: string | null;
5660
- product_category_id?: string | null;
5661
- product_id?: string | null;
6265
+ name: string;
6266
+ phone?: string | null;
6267
+ role?: string | null;
5662
6268
  updated_at?: string;
5663
- valid_from?: string | null;
5664
- valid_until?: string | null;
5665
6269
  };
5666
6270
  Update: {
5667
- base_price?: number | null;
5668
6271
  created_at?: string;
5669
- currency?: string;
5670
6272
  customer_id?: string;
6273
+ email?: string | null;
5671
6274
  id?: string;
5672
- min_quantity?: number;
5673
- net_price?: number;
5674
- notes?: string | null;
5675
- product_category_id?: string | null;
5676
- product_id?: string | null;
6275
+ name?: string;
6276
+ phone?: string | null;
6277
+ role?: string | null;
5677
6278
  updated_at?: string;
5678
- valid_from?: string | null;
5679
- valid_until?: string | null;
5680
6279
  };
5681
6280
  Relationships: [
5682
6281
  {
5683
- foreignKeyName: "local_customer_agreements_customer_id_fkey";
6282
+ foreignKeyName: "itk_contact_persons_customer_id_fkey";
5684
6283
  columns: ["customer_id"];
5685
6284
  isOneToOne: false;
5686
- referencedRelation: "customers";
5687
- referencedColumns: ["id"];
5688
- },
5689
- {
5690
- foreignKeyName: "local_customer_agreements_product_category_id_fkey";
5691
- columns: ["product_category_id"];
5692
- isOneToOne: false;
5693
- referencedRelation: "product_categories";
5694
- referencedColumns: ["id"];
5695
- },
5696
- {
5697
- foreignKeyName: "local_customer_agreements_product_id_fkey";
5698
- columns: ["product_id"];
5699
- isOneToOne: false;
5700
- referencedRelation: "products";
6285
+ referencedRelation: "itk_customers";
5701
6286
  referencedColumns: ["id"];
5702
6287
  }
5703
6288
  ];
5704
6289
  };
5705
- local_customer_price_groups: {
6290
+ itk_customer_dynamic_values: {
5706
6291
  Row: {
5707
6292
  created_at: string;
5708
- currency: string;
5709
6293
  customer_id: string;
5710
- discount_type: string;
5711
- discount_value: number;
6294
+ field_id: string;
5712
6295
  id: string;
5713
- min_quantity: number;
5714
- notes: string | null;
5715
- product_category_id: string | null;
5716
- product_id: string | null;
5717
6296
  updated_at: string;
5718
- valid_from: string | null;
5719
- valid_until: string | null;
6297
+ value: string | null;
5720
6298
  };
5721
6299
  Insert: {
5722
6300
  created_at?: string;
5723
- currency?: string;
5724
6301
  customer_id: string;
5725
- discount_type: string;
5726
- discount_value: number;
6302
+ field_id: string;
5727
6303
  id?: string;
5728
- min_quantity?: number;
5729
- notes?: string | null;
5730
- product_category_id?: string | null;
5731
- product_id?: string | null;
5732
6304
  updated_at?: string;
5733
- valid_from?: string | null;
5734
- valid_until?: string | null;
6305
+ value?: string | null;
5735
6306
  };
5736
6307
  Update: {
5737
6308
  created_at?: string;
5738
- currency?: string;
5739
6309
  customer_id?: string;
5740
- discount_type?: string;
5741
- discount_value?: number;
6310
+ field_id?: string;
5742
6311
  id?: string;
5743
- min_quantity?: number;
5744
- notes?: string | null;
5745
- product_category_id?: string | null;
5746
- product_id?: string | null;
5747
6312
  updated_at?: string;
5748
- valid_from?: string | null;
5749
- valid_until?: string | null;
6313
+ value?: string | null;
5750
6314
  };
5751
6315
  Relationships: [
5752
6316
  {
5753
- foreignKeyName: "local_customer_price_groups_customer_id_fkey";
6317
+ foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey";
5754
6318
  columns: ["customer_id"];
5755
6319
  isOneToOne: false;
5756
- referencedRelation: "customers";
5757
- referencedColumns: ["id"];
5758
- },
5759
- {
5760
- foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
5761
- columns: ["product_category_id"];
5762
- isOneToOne: false;
5763
- referencedRelation: "product_categories";
6320
+ referencedRelation: "itk_customers";
5764
6321
  referencedColumns: ["id"];
5765
6322
  },
5766
6323
  {
5767
- foreignKeyName: "local_customer_price_groups_product_id_fkey";
5768
- columns: ["product_id"];
6324
+ foreignKeyName: "itk_customer_dynamic_values_field_id_fkey";
6325
+ columns: ["field_id"];
5769
6326
  isOneToOne: false;
5770
- referencedRelation: "products";
6327
+ referencedRelation: "itk_dynamic_fields";
5771
6328
  referencedColumns: ["id"];
5772
6329
  }
5773
6330
  ];
5774
6331
  };
5775
- local_customer_sales_strategies: {
6332
+ itk_customer_notes: {
5776
6333
  Row: {
6334
+ body: string;
5777
6335
  created_at: string;
5778
- currency: string;
6336
+ created_by: string | null;
5779
6337
  customer_id: string;
5780
- discount_type: string;
5781
- discount_value: number;
5782
6338
  id: string;
5783
- min_quantity: number;
5784
- notes: string | null;
5785
- product_category_id: string | null;
5786
- product_id: string | null;
6339
+ note_type: string;
6340
+ updated_at: string;
6341
+ };
6342
+ Insert: {
6343
+ body: string;
6344
+ created_at?: 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;
6703
+ customer_id: string;
6704
+ discount_type: string;
6705
+ discount_value: number;
6706
+ id?: string;
6707
+ min_quantity?: number;
6708
+ notes?: string | null;
6709
+ product_category_id?: string | null;
6710
+ product_id?: string | null;
6711
+ updated_at?: string;
6712
+ valid_from?: string | null;
6713
+ valid_until?: string | null;
6714
+ };
6715
+ Update: {
6716
+ created_at?: string;
6717
+ currency?: string;
6718
+ customer_id?: string;
6719
+ discount_type?: string;
6720
+ discount_value?: number;
6721
+ id?: string;
6722
+ min_quantity?: number;
6723
+ notes?: string | null;
6724
+ product_category_id?: string | null;
6725
+ product_id?: string | null;
6726
+ updated_at?: string;
6727
+ valid_from?: string | null;
6728
+ valid_until?: string | null;
6729
+ };
6730
+ Relationships: [
6731
+ {
6732
+ foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
6733
+ columns: ["customer_id"];
6734
+ isOneToOne: false;
6735
+ referencedRelation: "customers";
6736
+ referencedColumns: ["id"];
6737
+ },
6738
+ {
6739
+ foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
6740
+ columns: ["product_category_id"];
6741
+ isOneToOne: false;
6742
+ referencedRelation: "product_categories";
6743
+ referencedColumns: ["id"];
6744
+ },
6745
+ {
6746
+ foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
6747
+ columns: ["product_id"];
6748
+ isOneToOne: false;
6749
+ referencedRelation: "products";
6750
+ referencedColumns: ["id"];
6751
+ }
6752
+ ];
6753
+ };
6754
+ locations: {
6755
+ Row: {
6756
+ created_at: string;
6757
+ id: string;
6758
+ name: string;
6759
+ sort_order: number;
6760
+ updated_at: string;
6761
+ };
6762
+ Insert: {
6763
+ created_at?: string;
6764
+ id?: string;
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;
5787
6985
  updated_at: string;
5788
- valid_from: string | null;
5789
- valid_until: string | null;
6986
+ user_id: string;
5790
6987
  };
5791
6988
  Insert: {
6989
+ condition_expression?: string | null;
5792
6990
  created_at?: string;
5793
- currency?: string;
5794
- customer_id: string;
5795
- discount_type: string;
5796
- discount_value: number;
6991
+ end_date?: string | null;
5797
6992
  id?: string;
5798
- min_quantity?: number;
5799
- notes?: string | null;
5800
- product_category_id?: string | null;
5801
- product_id?: string | null;
6993
+ is_enabled?: boolean;
6994
+ priority?: number;
6995
+ rule_type: string;
6996
+ start_date?: string | null;
6997
+ strategy_id: string;
5802
6998
  updated_at?: string;
5803
- valid_from?: string | null;
5804
- valid_until?: string | null;
6999
+ user_id: string;
5805
7000
  };
5806
7001
  Update: {
7002
+ condition_expression?: string | null;
5807
7003
  created_at?: string;
5808
- currency?: string;
5809
- customer_id?: string;
5810
- discount_type?: string;
5811
- discount_value?: number;
7004
+ end_date?: string | null;
5812
7005
  id?: string;
5813
- min_quantity?: number;
5814
- notes?: string | null;
5815
- product_category_id?: string | null;
5816
- product_id?: string | null;
7006
+ is_enabled?: boolean;
7007
+ priority?: number;
7008
+ rule_type?: string;
7009
+ start_date?: string | null;
7010
+ strategy_id?: string;
5817
7011
  updated_at?: string;
5818
- valid_from?: string | null;
5819
- valid_until?: string | null;
7012
+ user_id?: string;
5820
7013
  };
5821
7014
  Relationships: [
5822
7015
  {
5823
- foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
5824
- columns: ["customer_id"];
5825
- isOneToOne: false;
5826
- referencedRelation: "customers";
5827
- referencedColumns: ["id"];
5828
- },
5829
- {
5830
- foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
5831
- columns: ["product_category_id"];
5832
- isOneToOne: false;
5833
- referencedRelation: "product_categories";
5834
- referencedColumns: ["id"];
5835
- },
5836
- {
5837
- foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
5838
- columns: ["product_id"];
7016
+ foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey";
7017
+ columns: ["strategy_id"];
5839
7018
  isOneToOne: false;
5840
- referencedRelation: "products";
7019
+ referencedRelation: "logistics_strategies";
5841
7020
  referencedColumns: ["id"];
5842
7021
  }
5843
7022
  ];
5844
7023
  };
5845
- locations: {
7024
+ logistics_variables: {
5846
7025
  Row: {
5847
7026
  created_at: string;
7027
+ default_value: string | null;
7028
+ description: string | null;
5848
7029
  id: string;
5849
- name: string;
5850
- sort_order: number;
7030
+ is_builtin: boolean;
7031
+ key: string;
7032
+ label: string;
5851
7033
  updated_at: string;
7034
+ user_id: string;
7035
+ value_type: string;
5852
7036
  };
5853
7037
  Insert: {
5854
7038
  created_at?: string;
7039
+ default_value?: string | null;
7040
+ description?: string | null;
5855
7041
  id?: string;
5856
- name: string;
5857
- sort_order?: number;
7042
+ is_builtin?: boolean;
7043
+ key: string;
7044
+ label: string;
5858
7045
  updated_at?: string;
7046
+ user_id: string;
7047
+ value_type: string;
5859
7048
  };
5860
7049
  Update: {
5861
7050
  created_at?: string;
7051
+ default_value?: string | null;
7052
+ description?: string | null;
5862
7053
  id?: string;
5863
- name?: string;
5864
- sort_order?: number;
7054
+ is_builtin?: boolean;
7055
+ key?: string;
7056
+ label?: string;
5865
7057
  updated_at?: string;
7058
+ user_id?: string;
7059
+ value_type?: string;
5866
7060
  };
5867
7061
  Relationships: [];
5868
7062
  };
@@ -6278,62 +7472,66 @@ export type Database = {
6278
7472
  };
6279
7473
  manufacture_products: {
6280
7474
  Row: {
6281
- aantal_te_produceren: number;
6282
7475
  created_at: string;
6283
7476
  description: string | null;
6284
7477
  id: string;
6285
7478
  is_active: boolean;
6286
- location_id: string | null;
6287
7479
  name: string;
6288
- partij_nummer: string | null;
6289
- photos: Json;
6290
7480
  produced_stock: number;
6291
7481
  product_code: string;
6292
7482
  tenant_id: string;
6293
- unit: string;
6294
7483
  updated_at: string;
6295
7484
  };
6296
7485
  Insert: {
6297
- aantal_te_produceren?: number;
6298
7486
  created_at?: string;
6299
7487
  description?: string | null;
6300
7488
  id?: string;
6301
7489
  is_active?: boolean;
6302
- location_id?: string | null;
6303
7490
  name: string;
6304
- partij_nummer?: string | null;
6305
- photos?: Json;
6306
7491
  produced_stock?: number;
6307
7492
  product_code: string;
6308
7493
  tenant_id: string;
6309
- unit?: string;
6310
7494
  updated_at?: string;
6311
7495
  };
6312
7496
  Update: {
6313
- aantal_te_produceren?: number;
6314
7497
  created_at?: string;
6315
7498
  description?: string | null;
6316
7499
  id?: string;
6317
7500
  is_active?: boolean;
6318
- location_id?: string | null;
6319
7501
  name?: string;
6320
- partij_nummer?: string | null;
6321
- photos?: Json;
6322
7502
  produced_stock?: number;
6323
7503
  product_code?: string;
6324
7504
  tenant_id?: string;
6325
- unit?: string;
6326
7505
  updated_at?: string;
6327
7506
  };
6328
- Relationships: [
6329
- {
6330
- foreignKeyName: "manufacture_products_location_id_fkey";
6331
- columns: ["location_id"];
6332
- isOneToOne: false;
6333
- referencedRelation: "locations";
6334
- referencedColumns: ["id"];
6335
- }
6336
- ];
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: [];
6337
7535
  };
6338
7536
  monteurs: {
6339
7537
  Row: {
@@ -7089,6 +8287,42 @@ export type Database = {
7089
8287
  };
7090
8288
  Relationships: [];
7091
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
+ };
7092
8326
  order_cart_items: {
7093
8327
  Row: {
7094
8328
  cart_id: string;
@@ -7159,6 +8393,7 @@ export type Database = {
7159
8393
  order_carts: {
7160
8394
  Row: {
7161
8395
  algorithm_version: number;
8396
+ buffer_id: string | null;
7162
8397
  cart_number: number;
7163
8398
  created_at: string;
7164
8399
  id: string;
@@ -7166,13 +8401,14 @@ export type Database = {
7166
8401
  is_complete: boolean;
7167
8402
  notes: string | null;
7168
8403
  occupancy_pct: number;
7169
- order_id: string;
8404
+ order_id: string | null;
7170
8405
  source: string;
7171
8406
  total_layers_used: number;
7172
8407
  updated_at: string;
7173
8408
  };
7174
8409
  Insert: {
7175
8410
  algorithm_version?: number;
8411
+ buffer_id?: string | null;
7176
8412
  cart_number: number;
7177
8413
  created_at?: string;
7178
8414
  id?: string;
@@ -7180,13 +8416,14 @@ export type Database = {
7180
8416
  is_complete?: boolean;
7181
8417
  notes?: string | null;
7182
8418
  occupancy_pct?: number;
7183
- order_id: string;
8419
+ order_id?: string | null;
7184
8420
  source?: string;
7185
8421
  total_layers_used?: number;
7186
8422
  updated_at?: string;
7187
8423
  };
7188
8424
  Update: {
7189
8425
  algorithm_version?: number;
8426
+ buffer_id?: string | null;
7190
8427
  cart_number?: number;
7191
8428
  created_at?: string;
7192
8429
  id?: string;
@@ -7194,12 +8431,19 @@ export type Database = {
7194
8431
  is_complete?: boolean;
7195
8432
  notes?: string | null;
7196
8433
  occupancy_pct?: number;
7197
- order_id?: string;
8434
+ order_id?: string | null;
7198
8435
  source?: string;
7199
8436
  total_layers_used?: number;
7200
8437
  updated_at?: string;
7201
8438
  };
7202
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
+ },
7203
8447
  {
7204
8448
  foreignKeyName: "order_carts_order_id_fkey";
7205
8449
  columns: ["order_id"];
@@ -7450,12 +8694,14 @@ export type Database = {
7450
8694
  };
7451
8695
  orders: {
7452
8696
  Row: {
8697
+ buffer_id: string | null;
7453
8698
  created_at: string;
7454
8699
  custom_fields: Json;
7455
8700
  customer_id: string | null;
7456
8701
  customer_name: string;
7457
8702
  deleted_at: string | null;
7458
8703
  delivery_date: string | null;
8704
+ floriday_sales_order_id: string | null;
7459
8705
  id: string;
7460
8706
  is_reservation: boolean;
7461
8707
  notes: string | null;
@@ -7469,12 +8715,14 @@ export type Database = {
7469
8715
  updated_at: string;
7470
8716
  };
7471
8717
  Insert: {
8718
+ buffer_id?: string | null;
7472
8719
  created_at?: string;
7473
8720
  custom_fields?: Json;
7474
8721
  customer_id?: string | null;
7475
8722
  customer_name?: string;
7476
8723
  deleted_at?: string | null;
7477
8724
  delivery_date?: string | null;
8725
+ floriday_sales_order_id?: string | null;
7478
8726
  id?: string;
7479
8727
  is_reservation?: boolean;
7480
8728
  notes?: string | null;
@@ -7488,12 +8736,14 @@ export type Database = {
7488
8736
  updated_at?: string;
7489
8737
  };
7490
8738
  Update: {
8739
+ buffer_id?: string | null;
7491
8740
  created_at?: string;
7492
8741
  custom_fields?: Json;
7493
8742
  customer_id?: string | null;
7494
8743
  customer_name?: string;
7495
8744
  deleted_at?: string | null;
7496
8745
  delivery_date?: string | null;
8746
+ floriday_sales_order_id?: string | null;
7497
8747
  id?: string;
7498
8748
  is_reservation?: boolean;
7499
8749
  notes?: string | null;
@@ -7507,6 +8757,13 @@ export type Database = {
7507
8757
  updated_at?: string;
7508
8758
  };
7509
8759
  Relationships: [
8760
+ {
8761
+ foreignKeyName: "orders_buffer_id_fkey";
8762
+ columns: ["buffer_id"];
8763
+ isOneToOne: false;
8764
+ referencedRelation: "order_buffers";
8765
+ referencedColumns: ["id"];
8766
+ },
7510
8767
  {
7511
8768
  foreignKeyName: "orders_customer_id_fkey";
7512
8769
  columns: ["customer_id"];
@@ -7639,6 +8896,82 @@ export type Database = {
7639
8896
  };
7640
8897
  Relationships: [];
7641
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
+ };
7642
8975
  product_bom_items: {
7643
8976
  Row: {
7644
8977
  component_product_id: string | null;
@@ -7646,6 +8979,7 @@ export type Database = {
7646
8979
  created_at: string;
7647
8980
  id: string;
7648
8981
  notes: string | null;
8982
+ packing_configuration_id: string | null;
7649
8983
  parent_product_id: string | null;
7650
8984
  parent_trade_item_floriday_id: string | null;
7651
8985
  quantity: number;
@@ -7660,6 +8994,7 @@ export type Database = {
7660
8994
  created_at?: string;
7661
8995
  id?: string;
7662
8996
  notes?: string | null;
8997
+ packing_configuration_id?: string | null;
7663
8998
  parent_product_id?: string | null;
7664
8999
  parent_trade_item_floriday_id?: string | null;
7665
9000
  quantity?: number;
@@ -7674,6 +9009,7 @@ export type Database = {
7674
9009
  created_at?: string;
7675
9010
  id?: string;
7676
9011
  notes?: string | null;
9012
+ packing_configuration_id?: string | null;
7677
9013
  parent_product_id?: string | null;
7678
9014
  parent_trade_item_floriday_id?: string | null;
7679
9015
  quantity?: number;
@@ -7884,11 +9220,13 @@ export type Database = {
7884
9220
  created_at: string;
7885
9221
  id: string;
7886
9222
  is_package: boolean;
9223
+ label: string | null;
7887
9224
  layers_per_load_carrier: number | null;
7888
9225
  load_carrier: string | null;
7889
9226
  package_id: string | null;
7890
9227
  package_label: string | null;
7891
9228
  packages_per_layer: number | null;
9229
+ packing_configuration_id: string;
7892
9230
  product_id: string | null;
7893
9231
  tenant_id: string;
7894
9232
  trade_item_floriday_id: string | null;
@@ -7899,11 +9237,13 @@ export type Database = {
7899
9237
  created_at?: string;
7900
9238
  id?: string;
7901
9239
  is_package?: boolean;
9240
+ label?: string | null;
7902
9241
  layers_per_load_carrier?: number | null;
7903
9242
  load_carrier?: string | null;
7904
9243
  package_id?: string | null;
7905
9244
  package_label?: string | null;
7906
9245
  packages_per_layer?: number | null;
9246
+ packing_configuration_id?: string;
7907
9247
  product_id?: string | null;
7908
9248
  tenant_id: string;
7909
9249
  trade_item_floriday_id?: string | null;
@@ -7914,11 +9254,13 @@ export type Database = {
7914
9254
  created_at?: string;
7915
9255
  id?: string;
7916
9256
  is_package?: boolean;
9257
+ label?: string | null;
7917
9258
  layers_per_load_carrier?: number | null;
7918
9259
  load_carrier?: string | null;
7919
9260
  package_id?: string | null;
7920
9261
  package_label?: string | null;
7921
9262
  packages_per_layer?: number | null;
9263
+ packing_configuration_id?: string;
7922
9264
  product_id?: string | null;
7923
9265
  tenant_id?: string;
7924
9266
  trade_item_floriday_id?: string | null;
@@ -7983,12 +9325,11 @@ export type Database = {
7983
9325
  crates_per_layer: number;
7984
9326
  created_at: string;
7985
9327
  custom_fields: Json;
7986
- floriday_active: boolean;
7987
- floriday_payload: Json;
7988
9328
  floriday_trade_item_id: string | null;
7989
9329
  id: string;
7990
9330
  image_url: string | null;
7991
9331
  incoming_quantity: number;
9332
+ is_layer: boolean;
7992
9333
  layers_per_cart: number;
7993
9334
  location: string;
7994
9335
  min_quantity: number;
@@ -8010,12 +9351,11 @@ export type Database = {
8010
9351
  crates_per_layer?: number;
8011
9352
  created_at?: string;
8012
9353
  custom_fields?: Json;
8013
- floriday_active?: boolean;
8014
- floriday_payload?: Json;
8015
9354
  floriday_trade_item_id?: string | null;
8016
9355
  id?: string;
8017
9356
  image_url?: string | null;
8018
9357
  incoming_quantity?: number;
9358
+ is_layer?: boolean;
8019
9359
  layers_per_cart?: number;
8020
9360
  location: string;
8021
9361
  min_quantity?: number;
@@ -8037,12 +9377,11 @@ export type Database = {
8037
9377
  crates_per_layer?: number;
8038
9378
  created_at?: string;
8039
9379
  custom_fields?: Json;
8040
- floriday_active?: boolean;
8041
- floriday_payload?: Json;
8042
9380
  floriday_trade_item_id?: string | null;
8043
9381
  id?: string;
8044
9382
  image_url?: string | null;
8045
9383
  incoming_quantity?: number;
9384
+ is_layer?: boolean;
8046
9385
  layers_per_cart?: number;
8047
9386
  location?: string;
8048
9387
  min_quantity?: number;
@@ -8062,6 +9401,7 @@ export type Database = {
8062
9401
  profiles: {
8063
9402
  Row: {
8064
9403
  address: string | null;
9404
+ avatar_url: string | null;
8065
9405
  created_at: string;
8066
9406
  display_name: string | null;
8067
9407
  email: string | null;
@@ -8073,6 +9413,7 @@ export type Database = {
8073
9413
  };
8074
9414
  Insert: {
8075
9415
  address?: string | null;
9416
+ avatar_url?: string | null;
8076
9417
  created_at?: string;
8077
9418
  display_name?: string | null;
8078
9419
  email?: string | null;
@@ -8084,6 +9425,7 @@ export type Database = {
8084
9425
  };
8085
9426
  Update: {
8086
9427
  address?: string | null;
9428
+ avatar_url?: string | null;
8087
9429
  created_at?: string;
8088
9430
  display_name?: string | null;
8089
9431
  email?: string | null;
@@ -8980,7 +10322,6 @@ export type Database = {
8980
10322
  order_id: string | null;
8981
10323
  order_item_id: string | null;
8982
10324
  order_source: string | null;
8983
- parent_trade_item_key: string | null;
8984
10325
  physical_after: number | null;
8985
10326
  physical_before: number | null;
8986
10327
  production_batch_id: string | null;
@@ -8999,7 +10340,6 @@ export type Database = {
8999
10340
  order_id?: string | null;
9000
10341
  order_item_id?: string | null;
9001
10342
  order_source?: string | null;
9002
- parent_trade_item_key?: string | null;
9003
10343
  physical_after?: number | null;
9004
10344
  physical_before?: number | null;
9005
10345
  production_batch_id?: string | null;
@@ -9018,7 +10358,6 @@ export type Database = {
9018
10358
  order_id?: string | null;
9019
10359
  order_item_id?: string | null;
9020
10360
  order_source?: string | null;
9021
- parent_trade_item_key?: string | null;
9022
10361
  physical_after?: number | null;
9023
10362
  physical_before?: number | null;
9024
10363
  production_batch_id?: string | null;
@@ -9125,6 +10464,27 @@ export type Database = {
9125
10464
  };
9126
10465
  Relationships: [];
9127
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
+ };
9128
10488
  tenants: {
9129
10489
  Row: {
9130
10490
  created_at: string;
@@ -9335,6 +10695,48 @@ export type Database = {
9335
10695
  };
9336
10696
  Relationships: [];
9337
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
+ };
9338
10740
  trade_item_stock: {
9339
10741
  Row: {
9340
10742
  connection_id: string;
@@ -9490,7 +10892,7 @@ export type Database = {
9490
10892
  twinfield_connections: {
9491
10893
  Row: {
9492
10894
  access_token: string | null;
9493
- client_id: string | null;
10895
+ client_id: string;
9494
10896
  client_secret: string | null;
9495
10897
  cluster_uri: string | null;
9496
10898
  company_code: string | null;
@@ -9502,7 +10904,7 @@ export type Database = {
9502
10904
  is_active: boolean;
9503
10905
  label: string | null;
9504
10906
  office_code: string | null;
9505
- redirect_uri: string | null;
10907
+ redirect_uri: string;
9506
10908
  refresh_token: string | null;
9507
10909
  token_expires_at: string | null;
9508
10910
  updated_at: string;
@@ -9510,7 +10912,7 @@ export type Database = {
9510
10912
  };
9511
10913
  Insert: {
9512
10914
  access_token?: string | null;
9513
- client_id?: string | null;
10915
+ client_id: string;
9514
10916
  client_secret?: string | null;
9515
10917
  cluster_uri?: string | null;
9516
10918
  company_code?: string | null;
@@ -9522,7 +10924,7 @@ export type Database = {
9522
10924
  is_active?: boolean;
9523
10925
  label?: string | null;
9524
10926
  office_code?: string | null;
9525
- redirect_uri?: string | null;
10927
+ redirect_uri: string;
9526
10928
  refresh_token?: string | null;
9527
10929
  token_expires_at?: string | null;
9528
10930
  updated_at?: string;
@@ -9530,7 +10932,7 @@ export type Database = {
9530
10932
  };
9531
10933
  Update: {
9532
10934
  access_token?: string | null;
9533
- client_id?: string | null;
10935
+ client_id?: string;
9534
10936
  client_secret?: string | null;
9535
10937
  cluster_uri?: string | null;
9536
10938
  company_code?: string | null;
@@ -9542,7 +10944,7 @@ export type Database = {
9542
10944
  is_active?: boolean;
9543
10945
  label?: string | null;
9544
10946
  office_code?: string | null;
9545
- redirect_uri?: string | null;
10947
+ redirect_uri?: string;
9546
10948
  refresh_token?: string | null;
9547
10949
  token_expires_at?: string | null;
9548
10950
  updated_at?: string;
@@ -9602,6 +11004,7 @@ export type Database = {
9602
11004
  country: string | null;
9603
11005
  created_at: string;
9604
11006
  email: string | null;
11007
+ external_group_key: string | null;
9605
11008
  id: string;
9606
11009
  last_synced_at: string | null;
9607
11010
  name: string;
@@ -9620,6 +11023,7 @@ export type Database = {
9620
11023
  country?: string | null;
9621
11024
  created_at?: string;
9622
11025
  email?: string | null;
11026
+ external_group_key?: string | null;
9623
11027
  id?: string;
9624
11028
  last_synced_at?: string | null;
9625
11029
  name: string;
@@ -9638,6 +11042,7 @@ export type Database = {
9638
11042
  country?: string | null;
9639
11043
  created_at?: string;
9640
11044
  email?: string | null;
11045
+ external_group_key?: string | null;
9641
11046
  id?: string;
9642
11047
  last_synced_at?: string | null;
9643
11048
  name?: string;
@@ -9805,9 +11210,58 @@ export type Database = {
9805
11210
  }
9806
11211
  ];
9807
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: {
11239
+ connection_id?: string;
11240
+ created_at?: string;
11241
+ fetched_at?: string;
11242
+ id?: string;
11243
+ invoice_number?: string;
11244
+ last_accessed_at?: string;
11245
+ object_path?: string;
11246
+ office_code?: string;
11247
+ size_bytes?: number;
11248
+ updated_at?: string;
11249
+ };
11250
+ Relationships: [
11251
+ {
11252
+ foreignKeyName: "twinfield_invoice_pdf_cache_connection_id_fkey";
11253
+ columns: ["connection_id"];
11254
+ isOneToOne: false;
11255
+ referencedRelation: "twinfield_connections";
11256
+ referencedColumns: ["id"];
11257
+ }
11258
+ ];
11259
+ };
9808
11260
  twinfield_invoice_settings: {
9809
11261
  Row: {
9810
11262
  created_at: string;
11263
+ debtor_gl_account: string;
11264
+ default_credit_invoice_type: string | null;
9811
11265
  default_gl_account: string;
9812
11266
  default_invoice_type: string;
9813
11267
  default_payment_term_days: number;
@@ -9816,11 +11270,15 @@ export type Database = {
9816
11270
  invoice_enabled_fo: boolean;
9817
11271
  invoice_enabled_ho: boolean;
9818
11272
  invoice_enabled_mo: boolean;
11273
+ payment_gl_account: string;
11274
+ payment_journal_code: string;
9819
11275
  updated_at: string;
9820
11276
  user_id: string;
9821
11277
  };
9822
11278
  Insert: {
9823
11279
  created_at?: string;
11280
+ debtor_gl_account?: string;
11281
+ default_credit_invoice_type?: string | null;
9824
11282
  default_gl_account?: string;
9825
11283
  default_invoice_type?: string;
9826
11284
  default_payment_term_days?: number;
@@ -9829,11 +11287,15 @@ export type Database = {
9829
11287
  invoice_enabled_fo?: boolean;
9830
11288
  invoice_enabled_ho?: boolean;
9831
11289
  invoice_enabled_mo?: boolean;
11290
+ payment_gl_account?: string;
11291
+ payment_journal_code?: string;
9832
11292
  updated_at?: string;
9833
11293
  user_id: string;
9834
11294
  };
9835
11295
  Update: {
9836
11296
  created_at?: string;
11297
+ debtor_gl_account?: string;
11298
+ default_credit_invoice_type?: string | null;
9837
11299
  default_gl_account?: string;
9838
11300
  default_invoice_type?: string;
9839
11301
  default_payment_term_days?: number;
@@ -9842,6 +11304,8 @@ export type Database = {
9842
11304
  invoice_enabled_fo?: boolean;
9843
11305
  invoice_enabled_ho?: boolean;
9844
11306
  invoice_enabled_mo?: boolean;
11307
+ payment_gl_account?: string;
11308
+ payment_journal_code?: string;
9845
11309
  updated_at?: string;
9846
11310
  user_id?: string;
9847
11311
  };
@@ -10064,43 +11528,49 @@ export type Database = {
10064
11528
  };
10065
11529
  twinfield_push_queue: {
10066
11530
  Row: {
11531
+ action: string;
10067
11532
  attempts: number;
10068
11533
  connection_id: string;
10069
11534
  created_at: string;
11535
+ customer_id: string | null;
10070
11536
  external_id: string | null;
10071
11537
  id: string;
10072
11538
  idempotency_key: string;
10073
11539
  last_error: string | null;
10074
11540
  next_attempt_at: string;
10075
- office_code: string;
11541
+ office_code: string | null;
10076
11542
  payload: Json;
10077
11543
  status: string;
10078
11544
  updated_at: string;
10079
11545
  };
10080
11546
  Insert: {
11547
+ action?: string;
10081
11548
  attempts?: number;
10082
11549
  connection_id: string;
10083
11550
  created_at?: string;
11551
+ customer_id?: string | null;
10084
11552
  external_id?: string | null;
10085
11553
  id?: string;
10086
11554
  idempotency_key: string;
10087
11555
  last_error?: string | null;
10088
11556
  next_attempt_at?: string;
10089
- office_code: string;
11557
+ office_code?: string | null;
10090
11558
  payload: Json;
10091
11559
  status?: string;
10092
11560
  updated_at?: string;
10093
11561
  };
10094
11562
  Update: {
11563
+ action?: string;
10095
11564
  attempts?: number;
10096
11565
  connection_id?: string;
10097
11566
  created_at?: string;
11567
+ customer_id?: string | null;
10098
11568
  external_id?: string | null;
10099
11569
  id?: string;
10100
11570
  idempotency_key?: string;
10101
11571
  last_error?: string | null;
10102
11572
  next_attempt_at?: string;
10103
- office_code?: string;
11573
+ office_code?: string | null;
10104
11574
  payload?: Json;
10105
11575
  status?: string;
10106
11576
  updated_at?: string;
@@ -10112,6 +11582,13 @@ export type Database = {
10112
11582
  isOneToOne: false;
10113
11583
  referencedRelation: "twinfield_connections";
10114
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"];
10115
11592
  }
10116
11593
  ];
10117
11594
  };
@@ -10354,45 +11831,407 @@ export type Database = {
10354
11831
  action: string;
10355
11832
  connection_id: string | null;
10356
11833
  created_at: string;
10357
- error: string | null;
10358
- gateway_attempt_id: string | null;
10359
- gateway_status: number | null;
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;
10360
12089
  id: string;
10361
- intent: string;
10362
- ok: boolean;
10363
- request_summary: Json | null;
10364
- trade_item_id: string | null;
12090
+ started_at: string;
10365
12091
  user_id: string;
12092
+ werkbon_id: string;
10366
12093
  };
10367
12094
  Insert: {
10368
- action: string;
10369
- connection_id?: string | null;
12095
+ activity: string;
10370
12096
  created_at?: string;
10371
- error?: string | null;
10372
- gateway_attempt_id?: string | null;
10373
- gateway_status?: number | null;
12097
+ ended_at?: string | null;
10374
12098
  id?: string;
10375
- intent: string;
10376
- ok: boolean;
10377
- request_summary?: Json | null;
10378
- trade_item_id?: string | null;
12099
+ started_at?: string;
10379
12100
  user_id: string;
12101
+ werkbon_id: string;
10380
12102
  };
10381
12103
  Update: {
10382
- action?: string;
10383
- connection_id?: string | null;
12104
+ activity?: string;
10384
12105
  created_at?: string;
10385
- error?: string | null;
10386
- gateway_attempt_id?: string | null;
10387
- gateway_status?: number | null;
12106
+ ended_at?: string | null;
10388
12107
  id?: string;
10389
- intent?: string;
10390
- ok?: boolean;
10391
- request_summary?: Json | null;
10392
- trade_item_id?: string | null;
12108
+ started_at?: string;
10393
12109
  user_id?: string;
12110
+ werkbon_id?: string;
10394
12111
  };
10395
- 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
+ ];
12121
+ };
12122
+ werkbonnen: {
12123
+ Row: {
12124
+ assigned_user_id: string | null;
12125
+ budget_mandate_cents: number;
12126
+ complaint_description: string | null;
12127
+ created_at: string;
12128
+ created_by: string | null;
12129
+ customer_id: string | null;
12130
+ externe_referentie: string | null;
12131
+ first_time_fix: boolean | null;
12132
+ 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;
12154
+ };
12155
+ Insert: {
12156
+ assigned_user_id?: string | null;
12157
+ budget_mandate_cents?: number;
12158
+ complaint_description?: string | null;
12159
+ created_at?: string;
12160
+ created_by?: string | null;
12161
+ customer_id?: string | null;
12162
+ externe_referentie?: string | null;
12163
+ first_time_fix?: boolean | null;
12164
+ 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;
12186
+ };
12187
+ Update: {
12188
+ assigned_user_id?: string | null;
12189
+ budget_mandate_cents?: number;
12190
+ complaint_description?: string | null;
12191
+ created_at?: string;
12192
+ created_by?: string | null;
12193
+ customer_id?: string | null;
12194
+ externe_referentie?: string | null;
12195
+ first_time_fix?: boolean | null;
12196
+ 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;
12218
+ };
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
+ ];
10396
12235
  };
10397
12236
  work_order_monteurs: {
10398
12237
  Row: {
@@ -10570,6 +12409,8 @@ export type Database = {
10570
12409
  created_at: string | null;
10571
12410
  created_by: string | null;
10572
12411
  display_name: string | null;
12412
+ graph_subscription_expires_at: string | null;
12413
+ graph_subscription_id: string | null;
10573
12414
  has_access_token: boolean | null;
10574
12415
  has_client_id: boolean | null;
10575
12416
  has_client_secret: boolean | null;
@@ -10587,6 +12428,7 @@ export type Database = {
10587
12428
  oauth_mode: string | null;
10588
12429
  provider: string | null;
10589
12430
  purpose_assignments: Json | null;
12431
+ realtime_mode: string | null;
10590
12432
  scopes: string[] | null;
10591
12433
  smtp_host: string | null;
10592
12434
  smtp_port: number | null;
@@ -10601,6 +12443,8 @@ export type Database = {
10601
12443
  created_at?: string | null;
10602
12444
  created_by?: string | null;
10603
12445
  display_name?: string | null;
12446
+ graph_subscription_expires_at?: string | null;
12447
+ graph_subscription_id?: string | null;
10604
12448
  has_access_token?: never;
10605
12449
  has_client_id?: never;
10606
12450
  has_client_secret?: never;
@@ -10618,6 +12462,7 @@ export type Database = {
10618
12462
  oauth_mode?: string | null;
10619
12463
  provider?: string | null;
10620
12464
  purpose_assignments?: Json | null;
12465
+ realtime_mode?: string | null;
10621
12466
  scopes?: string[] | null;
10622
12467
  smtp_host?: string | null;
10623
12468
  smtp_port?: number | null;
@@ -10632,6 +12477,8 @@ export type Database = {
10632
12477
  created_at?: string | null;
10633
12478
  created_by?: string | null;
10634
12479
  display_name?: string | null;
12480
+ graph_subscription_expires_at?: string | null;
12481
+ graph_subscription_id?: string | null;
10635
12482
  has_access_token?: never;
10636
12483
  has_client_id?: never;
10637
12484
  has_client_secret?: never;
@@ -10649,6 +12496,7 @@ export type Database = {
10649
12496
  oauth_mode?: string | null;
10650
12497
  provider?: string | null;
10651
12498
  purpose_assignments?: Json | null;
12499
+ realtime_mode?: string | null;
10652
12500
  scopes?: string[] | null;
10653
12501
  smtp_host?: string | null;
10654
12502
  smtp_port?: number | null;
@@ -10759,6 +12607,25 @@ export type Database = {
10759
12607
  };
10760
12608
  Relationships: [];
10761
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
+ };
10762
12629
  local_customer_discounts: {
10763
12630
  Row: {
10764
12631
  base_price: number | null;
@@ -11107,6 +12974,21 @@ export type Database = {
11107
12974
  };
11108
12975
  Returns: string;
11109
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
+ };
11110
12992
  apply_stock_consumption: {
11111
12993
  Args: {
11112
12994
  p_order_id: string;
@@ -11164,6 +13046,12 @@ export type Database = {
11164
13046
  processed_items: number;
11165
13047
  }[];
11166
13048
  };
13049
+ calculate_layer_stock: {
13050
+ Args: {
13051
+ p_product_id: string;
13052
+ };
13053
+ Returns: number;
13054
+ };
11167
13055
  call_exact_route: {
11168
13056
  Args: {
11169
13057
  path: string;
@@ -11192,6 +13080,33 @@ export type Database = {
11192
13080
  };
11193
13081
  Returns: Json;
11194
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
+ };
11195
13110
  cleanup_old_bookings: {
11196
13111
  Args: never;
11197
13112
  Returns: undefined;
@@ -11250,6 +13165,12 @@ export type Database = {
11250
13165
  Args: never;
11251
13166
  Returns: string;
11252
13167
  };
13168
+ custom_access_token_hook: {
13169
+ Args: {
13170
+ event: Json;
13171
+ };
13172
+ Returns: Json;
13173
+ };
11253
13174
  dashboard_alert_counts: {
11254
13175
  Args: never;
11255
13176
  Returns: Json;
@@ -11317,6 +13238,16 @@ export type Database = {
11317
13238
  status: string;
11318
13239
  }[];
11319
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
+ };
11320
13251
  enqueue_cart_replan_if_unlocked: {
11321
13252
  Args: {
11322
13253
  p_order_id: string;
@@ -11436,6 +13367,19 @@ export type Database = {
11436
13367
  resource: string;
11437
13368
  }[];
11438
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
+ };
11439
13383
  get_floriday_clock_supplies_window: {
11440
13384
  Args: {
11441
13385
  p_from: string;
@@ -11523,6 +13467,12 @@ export type Database = {
11523
13467
  };
11524
13468
  Returns: string;
11525
13469
  };
13470
+ get_inventory_stock_for_key: {
13471
+ Args: {
13472
+ p_key: string;
13473
+ };
13474
+ Returns: number;
13475
+ };
11526
13476
  get_offer_by_link_code: {
11527
13477
  Args: {
11528
13478
  p_code: string;
@@ -11553,6 +13503,12 @@ export type Database = {
11553
13503
  };
11554
13504
  Returns: string;
11555
13505
  };
13506
+ get_product_group_available_stock: {
13507
+ Args: {
13508
+ p_group_id: string;
13509
+ };
13510
+ Returns: number;
13511
+ };
11556
13512
  get_room_busy_windows: {
11557
13513
  Args: {
11558
13514
  p_from: string;
@@ -11584,6 +13540,14 @@ export type Database = {
11584
13540
  };
11585
13541
  Returns: string;
11586
13542
  };
13543
+ has_module_permission: {
13544
+ Args: {
13545
+ _min: string;
13546
+ _module_id: string;
13547
+ _user_id: string;
13548
+ };
13549
+ Returns: boolean;
13550
+ };
11587
13551
  has_role: {
11588
13552
  Args: {
11589
13553
  _role: Database["public"]["Enums"]["app_role"];
@@ -11591,6 +13555,10 @@ export type Database = {
11591
13555
  };
11592
13556
  Returns: boolean;
11593
13557
  };
13558
+ has_twinfield_link: {
13559
+ Args: never;
13560
+ Returns: boolean;
13561
+ };
11594
13562
  is_authenticated: {
11595
13563
  Args: never;
11596
13564
  Returns: boolean;
@@ -11605,6 +13573,37 @@ export type Database = {
11605
13573
  };
11606
13574
  Returns: boolean;
11607
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
+ };
11608
13607
  local_effective_price: {
11609
13608
  Args: {
11610
13609
  _customer_id: string;
@@ -11621,6 +13620,22 @@ export type Database = {
11621
13620
  source_id: string;
11622
13621
  }[];
11623
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
+ };
11624
13639
  mark_offer_clicked: {
11625
13640
  Args: {
11626
13641
  p_code: string;
@@ -11633,6 +13648,13 @@ export type Database = {
11633
13648
  };
11634
13649
  Returns: undefined;
11635
13650
  };
13651
+ mark_salesorder_controlled: {
13652
+ Args: {
13653
+ p_controlled: boolean;
13654
+ p_floriday_id: string;
13655
+ };
13656
+ Returns: undefined;
13657
+ };
11636
13658
  mark_shipment_shipped: {
11637
13659
  Args: {
11638
13660
  p_shipment_id: string;
@@ -11665,6 +13687,10 @@ export type Database = {
11665
13687
  };
11666
13688
  Returns: string;
11667
13689
  };
13690
+ next_twinfield_code: {
13691
+ Args: never;
13692
+ Returns: string;
13693
+ };
11668
13694
  next_work_order_number: {
11669
13695
  Args: {
11670
13696
  p_parent_work_order_id?: string;
@@ -11721,6 +13747,15 @@ export type Database = {
11721
13747
  };
11722
13748
  Returns: undefined;
11723
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
+ };
11724
13759
  pickstation_set_cart_status: {
11725
13760
  Args: {
11726
13761
  p_cart_index: number;
@@ -11791,6 +13826,12 @@ export type Database = {
11791
13826
  };
11792
13827
  Returns: number;
11793
13828
  };
13829
+ reorder_customer_price_groups: {
13830
+ Args: {
13831
+ _ids: string[];
13832
+ };
13833
+ Returns: undefined;
13834
+ };
11794
13835
  reset_floriday_sync_cursor: {
11795
13836
  Args: {
11796
13837
  p_connection_id: string;
@@ -11826,6 +13867,12 @@ export type Database = {
11826
13867
  };
11827
13868
  Returns: string;
11828
13869
  };
13870
+ retry_twinfield_push: {
13871
+ Args: {
13872
+ _customer_id: string;
13873
+ };
13874
+ Returns: number;
13875
+ };
11829
13876
  reverse_production: {
11830
13877
  Args: {
11831
13878
  p_connection_id?: string;
@@ -11843,6 +13890,20 @@ export type Database = {
11843
13890
  };
11844
13891
  Returns: number;
11845
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
+ };
11846
13907
  schedule_floriday_base_items_sync: {
11847
13908
  Args: {
11848
13909
  p_apikey: string;
@@ -12089,6 +14150,17 @@ export type Database = {
12089
14150
  };
12090
14151
  Returns: number;
12091
14152
  };
14153
+ self_heal_floriday_links: {
14154
+ Args: never;
14155
+ Returns: number;
14156
+ };
14157
+ set_planning_status: {
14158
+ Args: {
14159
+ _id: string;
14160
+ _status: Database["public"]["Enums"]["planning_item_status"];
14161
+ };
14162
+ Returns: undefined;
14163
+ };
12092
14164
  show_limit: {
12093
14165
  Args: never;
12094
14166
  Returns: number;
@@ -12099,18 +14171,34 @@ export type Database = {
12099
14171
  };
12100
14172
  Returns: string[];
12101
14173
  };
14174
+ sync_all_layer_stocks: {
14175
+ Args: never;
14176
+ Returns: undefined;
14177
+ };
12102
14178
  sync_cached_packing_from_product: {
12103
14179
  Args: {
12104
14180
  p_product_id: string;
12105
14181
  };
12106
14182
  Returns: undefined;
12107
14183
  };
14184
+ sync_layer_stock: {
14185
+ Args: {
14186
+ p_product_id: string;
14187
+ };
14188
+ Returns: undefined;
14189
+ };
12108
14190
  sync_order_cart_item_packing_from_product: {
12109
14191
  Args: {
12110
14192
  p_product_id: string;
12111
14193
  };
12112
14194
  Returns: undefined;
12113
14195
  };
14196
+ sync_product_group_belading: {
14197
+ Args: {
14198
+ _group_id: string;
14199
+ };
14200
+ Returns: undefined;
14201
+ };
12114
14202
  sync_product_packing_from_floriday_cache: {
12115
14203
  Args: {
12116
14204
  p_floriday_id: string;
@@ -12142,9 +14230,12 @@ export type Database = {
12142
14230
  };
12143
14231
  };
12144
14232
  Enums: {
12145
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
14233
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
12146
14234
  exact_env: "staging" | "live";
12147
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";
12148
14239
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
12149
14240
  };
12150
14241
  CompositeTypes: {
@@ -12204,9 +14295,12 @@ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof Defaul
12204
14295
  export declare const Constants: {
12205
14296
  readonly public: {
12206
14297
  readonly Enums: {
12207
- readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer", "receptie", "monteur"];
14298
+ readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin"];
12208
14299
  readonly exact_env: readonly ["staging", "live"];
12209
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"];
12210
14304
  readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
12211
14305
  };
12212
14306
  };