@flowselections/floriday-klanten-module 1.0.16 → 1.0.18

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 (48) hide show
  1. package/dist-lib/components/klanten/FloridayDeeplinkButton.d.ts.map +1 -1
  2. package/dist-lib/components/klanten/FloridayDeeplinkButton.js +2 -2
  3. package/dist-lib/components/klanten/KlantenOverzicht.js +3 -3
  4. package/dist-lib/components/klanten/pricegroups/PriceGroupEditRoute.d.ts +2 -0
  5. package/dist-lib/components/klanten/pricegroups/PriceGroupEditRoute.d.ts.map +1 -0
  6. package/dist-lib/components/klanten/pricegroups/PriceGroupEditRoute.js +8 -0
  7. package/dist-lib/index.d.ts +2 -0
  8. package/dist-lib/index.d.ts.map +1 -1
  9. package/dist-lib/index.js +2 -0
  10. package/dist-lib/integrations/supabase/auth-middleware.d.ts +905 -27
  11. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  12. package/dist-lib/integrations/supabase/client.d.ts +905 -27
  13. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  14. package/dist-lib/integrations/supabase/client.server.d.ts +905 -27
  15. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  16. package/dist-lib/integrations/supabase/types.d.ts +930 -22
  17. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  18. package/dist-lib/integrations/supabase/types.js +4 -9
  19. package/dist-lib/lib/accounting/twinfield/mapping.d.ts.map +1 -1
  20. package/dist-lib/lib/accounting/twinfield/mapping.js +14 -2
  21. package/dist-lib/lib/accounting/twinfield/worker.functions.d.ts +2676 -42
  22. package/dist-lib/lib/accounting/twinfield/worker.functions.d.ts.map +1 -1
  23. package/dist-lib/lib/accounting.functions.d.ts +2676 -42
  24. package/dist-lib/lib/accounting.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/customer-analytics.functions.d.ts +905 -27
  26. package/dist-lib/lib/customer-analytics.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/customers.functions.d.ts +8028 -126
  28. package/dist-lib/lib/customers.functions.d.ts.map +1 -1
  29. package/dist-lib/lib/delivery-locations.functions.d.ts +3568 -56
  30. package/dist-lib/lib/delivery-locations.functions.d.ts.map +1 -1
  31. package/dist-lib/lib/external-customers.functions.d.ts +3568 -56
  32. package/dist-lib/lib/external-customers.functions.d.ts.map +1 -1
  33. package/dist-lib/lib/floriday-assortment.functions.d.ts +905 -27
  34. package/dist-lib/lib/floriday-assortment.functions.d.ts.map +1 -1
  35. package/dist-lib/lib/floriday-discounts.functions.d.ts +1888 -132
  36. package/dist-lib/lib/floriday-discounts.functions.d.ts.map +1 -1
  37. package/dist-lib/lib/floriday-trade-items.functions.d.ts +905 -27
  38. package/dist-lib/lib/floriday-trade-items.functions.d.ts.map +1 -1
  39. package/dist-lib/lib/local-discounts.functions.d.ts +6244 -98
  40. package/dist-lib/lib/local-discounts.functions.d.ts.map +1 -1
  41. package/dist-lib/lib/overdue-invoices.functions.d.ts +905 -27
  42. package/dist-lib/lib/overdue-invoices.functions.d.ts.map +1 -1
  43. package/dist-lib/lib/price-groups-local.functions.d.ts +6244 -98
  44. package/dist-lib/lib/price-groups-local.functions.d.ts.map +1 -1
  45. package/dist-lib/lib/price-groups.functions.d.ts +905 -27
  46. package/dist-lib/lib/price-groups.functions.d.ts.map +1 -1
  47. package/package.json +8 -2
  48. package/public/flowselections-assets/Klanten/floriday-logo.png +0 -0
@@ -277,6 +277,57 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
277
277
  referencedColumns: ["id"];
278
278
  }];
279
279
  };
280
+ ai_call_log: {
281
+ Row: {
282
+ consumer_module_id: string;
283
+ cost_usd: number | null;
284
+ created_at: string;
285
+ created_by: string | null;
286
+ duration_ms: number | null;
287
+ error_code: string | null;
288
+ error_message: string | null;
289
+ id: string;
290
+ input_tokens: number;
291
+ model_slug: string | null;
292
+ output_tokens: number;
293
+ provider_slug: string | null;
294
+ status: string;
295
+ total_tokens: number;
296
+ };
297
+ Insert: {
298
+ consumer_module_id: string;
299
+ cost_usd?: number | null;
300
+ created_at?: string;
301
+ created_by?: string | null;
302
+ duration_ms?: number | null;
303
+ error_code?: string | null;
304
+ error_message?: string | null;
305
+ id?: string;
306
+ input_tokens?: number;
307
+ model_slug?: string | null;
308
+ output_tokens?: number;
309
+ provider_slug?: string | null;
310
+ status: string;
311
+ total_tokens?: number;
312
+ };
313
+ Update: {
314
+ consumer_module_id?: string;
315
+ cost_usd?: number | null;
316
+ created_at?: string;
317
+ created_by?: string | null;
318
+ duration_ms?: number | null;
319
+ error_code?: string | null;
320
+ error_message?: string | null;
321
+ id?: string;
322
+ input_tokens?: number;
323
+ model_slug?: string | null;
324
+ output_tokens?: number;
325
+ provider_slug?: string | null;
326
+ status?: string;
327
+ total_tokens?: number;
328
+ };
329
+ Relationships: [];
330
+ };
280
331
  ai_credentials: {
281
332
  Row: {
282
333
  active: boolean;
@@ -313,6 +364,36 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
313
364
  referencedColumns: ["id"];
314
365
  }];
315
366
  };
367
+ ai_goals: {
368
+ Row: {
369
+ active: boolean;
370
+ created_at: string;
371
+ description: string | null;
372
+ key: string;
373
+ label: string;
374
+ sort_order: number;
375
+ updated_at: string;
376
+ };
377
+ Insert: {
378
+ active?: boolean;
379
+ created_at?: string;
380
+ description?: string | null;
381
+ key: string;
382
+ label: string;
383
+ sort_order?: number;
384
+ updated_at?: string;
385
+ };
386
+ Update: {
387
+ active?: boolean;
388
+ created_at?: string;
389
+ description?: string | null;
390
+ key?: string;
391
+ label?: string;
392
+ sort_order?: number;
393
+ updated_at?: string;
394
+ };
395
+ Relationships: [];
396
+ };
316
397
  ai_model_pricing: {
317
398
  Row: {
318
399
  created_at: string;
@@ -1099,6 +1180,141 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
1099
1180
  };
1100
1181
  Relationships: [];
1101
1182
  };
1183
+ cart_planning_pick_times: {
1184
+ Row: {
1185
+ created_at: string;
1186
+ id: string;
1187
+ pot_size: string;
1188
+ seconds_per_cart: number;
1189
+ updated_at: string;
1190
+ };
1191
+ Insert: {
1192
+ created_at?: string;
1193
+ id?: string;
1194
+ pot_size: string;
1195
+ seconds_per_cart: number;
1196
+ updated_at?: string;
1197
+ };
1198
+ Update: {
1199
+ created_at?: string;
1200
+ id?: string;
1201
+ pot_size?: string;
1202
+ seconds_per_cart?: number;
1203
+ updated_at?: string;
1204
+ };
1205
+ Relationships: [];
1206
+ };
1207
+ cart_planning_product_overrides: {
1208
+ Row: {
1209
+ created_at: string;
1210
+ id: string;
1211
+ max_party_share_per_layer_pct_override: number | null;
1212
+ never_mix: boolean;
1213
+ notes: string | null;
1214
+ product_id: string;
1215
+ updated_at: string;
1216
+ };
1217
+ Insert: {
1218
+ created_at?: string;
1219
+ id?: string;
1220
+ max_party_share_per_layer_pct_override?: number | null;
1221
+ never_mix?: boolean;
1222
+ notes?: string | null;
1223
+ product_id: string;
1224
+ updated_at?: string;
1225
+ };
1226
+ Update: {
1227
+ created_at?: string;
1228
+ id?: string;
1229
+ max_party_share_per_layer_pct_override?: number | null;
1230
+ never_mix?: boolean;
1231
+ notes?: string | null;
1232
+ product_id?: string;
1233
+ updated_at?: string;
1234
+ };
1235
+ Relationships: [{
1236
+ foreignKeyName: "cart_planning_product_overrides_product_id_fkey";
1237
+ columns: ["product_id"];
1238
+ isOneToOne: true;
1239
+ referencedRelation: "products";
1240
+ referencedColumns: ["id"];
1241
+ }];
1242
+ };
1243
+ cart_planning_settings: {
1244
+ Row: {
1245
+ allow_editing_after_pickstation_send: boolean;
1246
+ buffer_grouping_mode: string;
1247
+ combine_floriday_orders: boolean;
1248
+ combine_floriday_orders_window: string;
1249
+ combine_orders_scope: string;
1250
+ default_workers: number;
1251
+ id: number;
1252
+ max_beladingen_per_layer: number;
1253
+ max_customers_per_cart: number;
1254
+ max_one_customer_per_layer: boolean;
1255
+ max_party_share_per_layer_pct: number;
1256
+ optimization_strategy: string;
1257
+ own_cart_from_layers: number;
1258
+ pick_time_mode: string;
1259
+ plants_per_day: number;
1260
+ plants_per_hour: number;
1261
+ require_same_carrier: boolean;
1262
+ require_same_crate_type: boolean;
1263
+ require_same_delivery_date: boolean;
1264
+ require_same_delivery_location: boolean;
1265
+ updated_at: string;
1266
+ updated_by: string | null;
1267
+ };
1268
+ Insert: {
1269
+ allow_editing_after_pickstation_send?: boolean;
1270
+ buffer_grouping_mode?: string;
1271
+ combine_floriday_orders?: boolean;
1272
+ combine_floriday_orders_window?: string;
1273
+ combine_orders_scope?: string;
1274
+ default_workers?: number;
1275
+ id?: number;
1276
+ max_beladingen_per_layer?: number;
1277
+ max_customers_per_cart?: number;
1278
+ max_one_customer_per_layer?: boolean;
1279
+ max_party_share_per_layer_pct?: number;
1280
+ optimization_strategy?: string;
1281
+ own_cart_from_layers?: number;
1282
+ pick_time_mode?: string;
1283
+ plants_per_day?: number;
1284
+ plants_per_hour?: number;
1285
+ require_same_carrier?: boolean;
1286
+ require_same_crate_type?: boolean;
1287
+ require_same_delivery_date?: boolean;
1288
+ require_same_delivery_location?: boolean;
1289
+ updated_at?: string;
1290
+ updated_by?: string | null;
1291
+ };
1292
+ Update: {
1293
+ allow_editing_after_pickstation_send?: boolean;
1294
+ buffer_grouping_mode?: string;
1295
+ combine_floriday_orders?: boolean;
1296
+ combine_floriday_orders_window?: string;
1297
+ combine_orders_scope?: string;
1298
+ default_workers?: number;
1299
+ id?: number;
1300
+ max_beladingen_per_layer?: number;
1301
+ max_customers_per_cart?: number;
1302
+ max_one_customer_per_layer?: boolean;
1303
+ max_party_share_per_layer_pct?: number;
1304
+ optimization_strategy?: string;
1305
+ own_cart_from_layers?: number;
1306
+ pick_time_mode?: string;
1307
+ plants_per_day?: number;
1308
+ plants_per_hour?: number;
1309
+ require_same_carrier?: boolean;
1310
+ require_same_crate_type?: boolean;
1311
+ require_same_delivery_date?: boolean;
1312
+ require_same_delivery_location?: boolean;
1313
+ updated_at?: string;
1314
+ updated_by?: string | null;
1315
+ };
1316
+ Relationships: [];
1317
+ };
1102
1318
  cart_replan_queue: {
1103
1319
  Row: {
1104
1320
  attempts: number;
@@ -1129,6 +1345,39 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
1129
1345
  referencedColumns: ["id"];
1130
1346
  }];
1131
1347
  };
1348
+ cart_types: {
1349
+ Row: {
1350
+ created_at: string;
1351
+ id: string;
1352
+ is_default: boolean;
1353
+ layer_length_cm: number;
1354
+ layer_width_cm: number;
1355
+ layers_per_cart: number;
1356
+ name: string;
1357
+ updated_at: string;
1358
+ };
1359
+ Insert: {
1360
+ created_at?: string;
1361
+ id?: string;
1362
+ is_default?: boolean;
1363
+ layer_length_cm: number;
1364
+ layer_width_cm: number;
1365
+ layers_per_cart?: number;
1366
+ name: string;
1367
+ updated_at?: string;
1368
+ };
1369
+ Update: {
1370
+ created_at?: string;
1371
+ id?: string;
1372
+ is_default?: boolean;
1373
+ layer_length_cm?: number;
1374
+ layer_width_cm?: number;
1375
+ layers_per_cart?: number;
1376
+ name?: string;
1377
+ updated_at?: string;
1378
+ };
1379
+ Relationships: [];
1380
+ };
1132
1381
  catalog_articles_cache: {
1133
1382
  Row: {
1134
1383
  created_at: string;
@@ -1216,6 +1465,36 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
1216
1465
  };
1217
1466
  Relationships: [];
1218
1467
  };
1468
+ crate_types: {
1469
+ Row: {
1470
+ created_at: string;
1471
+ id: string;
1472
+ length_cm: number;
1473
+ name: string;
1474
+ plants_per_crate: number;
1475
+ updated_at: string;
1476
+ width_cm: number;
1477
+ };
1478
+ Insert: {
1479
+ created_at?: string;
1480
+ id?: string;
1481
+ length_cm: number;
1482
+ name: string;
1483
+ plants_per_crate?: number;
1484
+ updated_at?: string;
1485
+ width_cm: number;
1486
+ };
1487
+ Update: {
1488
+ created_at?: string;
1489
+ id?: string;
1490
+ length_cm?: number;
1491
+ name?: string;
1492
+ plants_per_crate?: number;
1493
+ updated_at?: string;
1494
+ width_cm?: number;
1495
+ };
1496
+ Relationships: [];
1497
+ };
1219
1498
  customer_audit_log: {
1220
1499
  Row: {
1221
1500
  action: string;
@@ -5755,6 +6034,288 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
5755
6034
  };
5756
6035
  Relationships: [];
5757
6036
  };
6037
+ itk_contact_persons: {
6038
+ Row: {
6039
+ created_at: string;
6040
+ customer_id: string;
6041
+ email: string | null;
6042
+ id: string;
6043
+ name: string;
6044
+ phone: string | null;
6045
+ role: string | null;
6046
+ updated_at: string;
6047
+ };
6048
+ Insert: {
6049
+ created_at?: string;
6050
+ customer_id: string;
6051
+ email?: string | null;
6052
+ id?: string;
6053
+ name: string;
6054
+ phone?: string | null;
6055
+ role?: string | null;
6056
+ updated_at?: string;
6057
+ };
6058
+ Update: {
6059
+ created_at?: string;
6060
+ customer_id?: string;
6061
+ email?: string | null;
6062
+ id?: string;
6063
+ name?: string;
6064
+ phone?: string | null;
6065
+ role?: string | null;
6066
+ updated_at?: string;
6067
+ };
6068
+ Relationships: [{
6069
+ foreignKeyName: "itk_contact_persons_customer_id_fkey";
6070
+ columns: ["customer_id"];
6071
+ isOneToOne: false;
6072
+ referencedRelation: "itk_customers";
6073
+ referencedColumns: ["id"];
6074
+ }];
6075
+ };
6076
+ itk_customer_dynamic_values: {
6077
+ Row: {
6078
+ created_at: string;
6079
+ customer_id: string;
6080
+ field_id: string;
6081
+ id: string;
6082
+ updated_at: string;
6083
+ value: string | null;
6084
+ };
6085
+ Insert: {
6086
+ created_at?: string;
6087
+ customer_id: string;
6088
+ field_id: string;
6089
+ id?: string;
6090
+ updated_at?: string;
6091
+ value?: string | null;
6092
+ };
6093
+ Update: {
6094
+ created_at?: string;
6095
+ customer_id?: string;
6096
+ field_id?: string;
6097
+ id?: string;
6098
+ updated_at?: string;
6099
+ value?: string | null;
6100
+ };
6101
+ Relationships: [{
6102
+ foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey";
6103
+ columns: ["customer_id"];
6104
+ isOneToOne: false;
6105
+ referencedRelation: "itk_customers";
6106
+ referencedColumns: ["id"];
6107
+ }, {
6108
+ foreignKeyName: "itk_customer_dynamic_values_field_id_fkey";
6109
+ columns: ["field_id"];
6110
+ isOneToOne: false;
6111
+ referencedRelation: "itk_dynamic_fields";
6112
+ referencedColumns: ["id"];
6113
+ }];
6114
+ };
6115
+ itk_customer_notes: {
6116
+ Row: {
6117
+ body: string;
6118
+ created_at: string;
6119
+ created_by: string | null;
6120
+ customer_id: string;
6121
+ id: string;
6122
+ note_type: string;
6123
+ updated_at: string;
6124
+ };
6125
+ Insert: {
6126
+ body: string;
6127
+ created_at?: string;
6128
+ created_by?: string | null;
6129
+ customer_id: string;
6130
+ id?: string;
6131
+ note_type?: string;
6132
+ updated_at?: string;
6133
+ };
6134
+ Update: {
6135
+ body?: string;
6136
+ created_at?: string;
6137
+ created_by?: string | null;
6138
+ customer_id?: string;
6139
+ id?: string;
6140
+ note_type?: string;
6141
+ updated_at?: string;
6142
+ };
6143
+ Relationships: [{
6144
+ foreignKeyName: "itk_customer_notes_customer_id_fkey";
6145
+ columns: ["customer_id"];
6146
+ isOneToOne: false;
6147
+ referencedRelation: "itk_customers";
6148
+ referencedColumns: ["id"];
6149
+ }];
6150
+ };
6151
+ itk_customers: {
6152
+ Row: {
6153
+ billing_city: string | null;
6154
+ billing_postcode: string | null;
6155
+ billing_street: string | null;
6156
+ created_at: string;
6157
+ general_email: string | null;
6158
+ general_phone: string | null;
6159
+ id: string;
6160
+ legacy_customer_id: string | null;
6161
+ name: string;
6162
+ segment: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
6163
+ updated_at: string;
6164
+ };
6165
+ Insert: {
6166
+ billing_city?: string | null;
6167
+ billing_postcode?: string | null;
6168
+ billing_street?: string | null;
6169
+ created_at?: string;
6170
+ general_email?: string | null;
6171
+ general_phone?: string | null;
6172
+ id?: string;
6173
+ legacy_customer_id?: string | null;
6174
+ name: string;
6175
+ segment?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
6176
+ updated_at?: string;
6177
+ };
6178
+ Update: {
6179
+ billing_city?: string | null;
6180
+ billing_postcode?: string | null;
6181
+ billing_street?: string | null;
6182
+ created_at?: string;
6183
+ general_email?: string | null;
6184
+ general_phone?: string | null;
6185
+ id?: string;
6186
+ legacy_customer_id?: string | null;
6187
+ name?: string;
6188
+ segment?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
6189
+ updated_at?: string;
6190
+ };
6191
+ Relationships: [{
6192
+ foreignKeyName: "itk_customers_legacy_customer_id_fkey";
6193
+ columns: ["legacy_customer_id"];
6194
+ isOneToOne: false;
6195
+ referencedRelation: "customers";
6196
+ referencedColumns: ["id"];
6197
+ }];
6198
+ };
6199
+ itk_dynamic_fields: {
6200
+ Row: {
6201
+ created_at: string;
6202
+ field_name: string;
6203
+ field_type: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
6204
+ id: string;
6205
+ options: import("../../../integrations/supabase/types").Json;
6206
+ sort_order: number;
6207
+ updated_at: string;
6208
+ };
6209
+ Insert: {
6210
+ created_at?: string;
6211
+ field_name: string;
6212
+ field_type?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
6213
+ id?: string;
6214
+ options?: import("../../../integrations/supabase/types").Json;
6215
+ sort_order?: number;
6216
+ updated_at?: string;
6217
+ };
6218
+ Update: {
6219
+ created_at?: string;
6220
+ field_name?: string;
6221
+ field_type?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
6222
+ id?: string;
6223
+ options?: import("../../../integrations/supabase/types").Json;
6224
+ sort_order?: number;
6225
+ updated_at?: string;
6226
+ };
6227
+ Relationships: [];
6228
+ };
6229
+ itk_work_locations: {
6230
+ Row: {
6231
+ city: string | null;
6232
+ created_at: string;
6233
+ customer_id: string;
6234
+ id: string;
6235
+ instructions: string | null;
6236
+ label: string;
6237
+ latitude: number | null;
6238
+ longitude: number | null;
6239
+ postcode: string | null;
6240
+ street: string | null;
6241
+ updated_at: string;
6242
+ };
6243
+ Insert: {
6244
+ city?: string | null;
6245
+ created_at?: string;
6246
+ customer_id: string;
6247
+ id?: string;
6248
+ instructions?: string | null;
6249
+ label: string;
6250
+ latitude?: number | null;
6251
+ longitude?: number | null;
6252
+ postcode?: string | null;
6253
+ street?: string | null;
6254
+ updated_at?: string;
6255
+ };
6256
+ Update: {
6257
+ city?: string | null;
6258
+ created_at?: string;
6259
+ customer_id?: string;
6260
+ id?: string;
6261
+ instructions?: string | null;
6262
+ label?: string;
6263
+ latitude?: number | null;
6264
+ longitude?: number | null;
6265
+ postcode?: string | null;
6266
+ street?: string | null;
6267
+ updated_at?: string;
6268
+ };
6269
+ Relationships: [{
6270
+ foreignKeyName: "itk_work_locations_customer_id_fkey";
6271
+ columns: ["customer_id"];
6272
+ isOneToOne: false;
6273
+ referencedRelation: "itk_customers";
6274
+ referencedColumns: ["id"];
6275
+ }];
6276
+ };
6277
+ leave_requests: {
6278
+ Row: {
6279
+ created_at: string;
6280
+ end_date: string;
6281
+ id: string;
6282
+ reason: string | null;
6283
+ start_date: string;
6284
+ status: string;
6285
+ tenant_id: string;
6286
+ updated_at: string;
6287
+ user_id: string;
6288
+ };
6289
+ Insert: {
6290
+ created_at?: string;
6291
+ end_date: string;
6292
+ id?: string;
6293
+ reason?: string | null;
6294
+ start_date: string;
6295
+ status?: string;
6296
+ tenant_id?: string;
6297
+ updated_at?: string;
6298
+ user_id: string;
6299
+ };
6300
+ Update: {
6301
+ created_at?: string;
6302
+ end_date?: string;
6303
+ id?: string;
6304
+ reason?: string | null;
6305
+ start_date?: string;
6306
+ status?: string;
6307
+ tenant_id?: string;
6308
+ updated_at?: string;
6309
+ user_id?: string;
6310
+ };
6311
+ Relationships: [{
6312
+ foreignKeyName: "leave_requests_user_id_fkey";
6313
+ columns: ["user_id"];
6314
+ isOneToOne: false;
6315
+ referencedRelation: "monteurs";
6316
+ referencedColumns: ["id"];
6317
+ }];
6318
+ };
5758
6319
  local_customer_agreements: {
5759
6320
  Row: {
5760
6321
  base_price: number | null;
@@ -6406,6 +6967,33 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
6406
6967
  };
6407
6968
  Relationships: [];
6408
6969
  };
6970
+ module_permissions: {
6971
+ Row: {
6972
+ created_at: string;
6973
+ id: string;
6974
+ module_id: string;
6975
+ permission: string;
6976
+ role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
6977
+ updated_at: string;
6978
+ };
6979
+ Insert: {
6980
+ created_at?: string;
6981
+ id?: string;
6982
+ module_id: string;
6983
+ permission: string;
6984
+ role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
6985
+ updated_at?: string;
6986
+ };
6987
+ Update: {
6988
+ created_at?: string;
6989
+ id?: string;
6990
+ module_id?: string;
6991
+ permission?: string;
6992
+ role?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
6993
+ updated_at?: string;
6994
+ };
6995
+ Relationships: [];
6996
+ };
6409
6997
  monteurs: {
6410
6998
  Row: {
6411
6999
  avatar_url: string | null;
@@ -7135,6 +7723,42 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7135
7723
  };
7136
7724
  Relationships: [];
7137
7725
  };
7726
+ order_buffers: {
7727
+ Row: {
7728
+ buffer_key: string;
7729
+ created_at: string;
7730
+ customer_id: string | null;
7731
+ grouping_mode: string;
7732
+ id: string;
7733
+ pickup_date: string | null;
7734
+ pickup_location: string | null;
7735
+ plan_locked_at: string | null;
7736
+ updated_at: string;
7737
+ };
7738
+ Insert: {
7739
+ buffer_key: string;
7740
+ created_at?: string;
7741
+ customer_id?: string | null;
7742
+ grouping_mode: string;
7743
+ id?: string;
7744
+ pickup_date?: string | null;
7745
+ pickup_location?: string | null;
7746
+ plan_locked_at?: string | null;
7747
+ updated_at?: string;
7748
+ };
7749
+ Update: {
7750
+ buffer_key?: string;
7751
+ created_at?: string;
7752
+ customer_id?: string | null;
7753
+ grouping_mode?: string;
7754
+ id?: string;
7755
+ pickup_date?: string | null;
7756
+ pickup_location?: string | null;
7757
+ plan_locked_at?: string | null;
7758
+ updated_at?: string;
7759
+ };
7760
+ Relationships: [];
7761
+ };
7138
7762
  order_cart_items: {
7139
7763
  Row: {
7140
7764
  cart_id: string;
@@ -7201,6 +7825,7 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7201
7825
  order_carts: {
7202
7826
  Row: {
7203
7827
  algorithm_version: number;
7828
+ buffer_id: string | null;
7204
7829
  cart_number: number;
7205
7830
  created_at: string;
7206
7831
  id: string;
@@ -7208,13 +7833,14 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7208
7833
  is_complete: boolean;
7209
7834
  notes: string | null;
7210
7835
  occupancy_pct: number;
7211
- order_id: string;
7836
+ order_id: string | null;
7212
7837
  source: string;
7213
7838
  total_layers_used: number;
7214
7839
  updated_at: string;
7215
7840
  };
7216
7841
  Insert: {
7217
7842
  algorithm_version?: number;
7843
+ buffer_id?: string | null;
7218
7844
  cart_number: number;
7219
7845
  created_at?: string;
7220
7846
  id?: string;
@@ -7222,13 +7848,14 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7222
7848
  is_complete?: boolean;
7223
7849
  notes?: string | null;
7224
7850
  occupancy_pct?: number;
7225
- order_id: string;
7851
+ order_id?: string | null;
7226
7852
  source?: string;
7227
7853
  total_layers_used?: number;
7228
7854
  updated_at?: string;
7229
7855
  };
7230
7856
  Update: {
7231
7857
  algorithm_version?: number;
7858
+ buffer_id?: string | null;
7232
7859
  cart_number?: number;
7233
7860
  created_at?: string;
7234
7861
  id?: string;
@@ -7236,12 +7863,18 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7236
7863
  is_complete?: boolean;
7237
7864
  notes?: string | null;
7238
7865
  occupancy_pct?: number;
7239
- order_id?: string;
7866
+ order_id?: string | null;
7240
7867
  source?: string;
7241
7868
  total_layers_used?: number;
7242
7869
  updated_at?: string;
7243
7870
  };
7244
7871
  Relationships: [{
7872
+ foreignKeyName: "order_carts_buffer_id_fkey";
7873
+ columns: ["buffer_id"];
7874
+ isOneToOne: false;
7875
+ referencedRelation: "order_buffers";
7876
+ referencedColumns: ["id"];
7877
+ }, {
7245
7878
  foreignKeyName: "order_carts_order_id_fkey";
7246
7879
  columns: ["order_id"];
7247
7880
  isOneToOne: false;
@@ -7378,15 +8011,117 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7378
8011
  };
7379
8012
  Relationships: [];
7380
8013
  };
8014
+ order_shipment_items: {
8015
+ Row: {
8016
+ created_at: string;
8017
+ id: string;
8018
+ order_item_id: string;
8019
+ product_id: string | null;
8020
+ product_name: string;
8021
+ quantity: number;
8022
+ shipment_id: string;
8023
+ updated_at: string;
8024
+ };
8025
+ Insert: {
8026
+ created_at?: string;
8027
+ id?: string;
8028
+ order_item_id: string;
8029
+ product_id?: string | null;
8030
+ product_name: string;
8031
+ quantity: number;
8032
+ shipment_id: string;
8033
+ updated_at?: string;
8034
+ };
8035
+ Update: {
8036
+ created_at?: string;
8037
+ id?: string;
8038
+ order_item_id?: string;
8039
+ product_id?: string | null;
8040
+ product_name?: string;
8041
+ quantity?: number;
8042
+ shipment_id?: string;
8043
+ updated_at?: string;
8044
+ };
8045
+ Relationships: [{
8046
+ foreignKeyName: "order_shipment_items_order_item_id_fkey";
8047
+ columns: ["order_item_id"];
8048
+ isOneToOne: false;
8049
+ referencedRelation: "order_items";
8050
+ referencedColumns: ["id"];
8051
+ }, {
8052
+ foreignKeyName: "order_shipment_items_shipment_id_fkey";
8053
+ columns: ["shipment_id"];
8054
+ isOneToOne: false;
8055
+ referencedRelation: "order_shipments";
8056
+ referencedColumns: ["id"];
8057
+ }];
8058
+ };
8059
+ order_shipments: {
8060
+ Row: {
8061
+ carrier_id: string | null;
8062
+ created_at: string;
8063
+ delivery_date: string | null;
8064
+ delivery_location_id: string | null;
8065
+ id: string;
8066
+ notes: string | null;
8067
+ order_id: string;
8068
+ shipment_number: number;
8069
+ shipped_at: string | null;
8070
+ status: string;
8071
+ updated_at: string;
8072
+ };
8073
+ Insert: {
8074
+ carrier_id?: string | null;
8075
+ created_at?: string;
8076
+ delivery_date?: string | null;
8077
+ delivery_location_id?: string | null;
8078
+ id?: string;
8079
+ notes?: string | null;
8080
+ order_id: string;
8081
+ shipment_number: number;
8082
+ shipped_at?: string | null;
8083
+ status?: string;
8084
+ updated_at?: string;
8085
+ };
8086
+ Update: {
8087
+ carrier_id?: string | null;
8088
+ created_at?: string;
8089
+ delivery_date?: string | null;
8090
+ delivery_location_id?: string | null;
8091
+ id?: string;
8092
+ notes?: string | null;
8093
+ order_id?: string;
8094
+ shipment_number?: number;
8095
+ shipped_at?: string | null;
8096
+ status?: string;
8097
+ updated_at?: string;
8098
+ };
8099
+ Relationships: [{
8100
+ foreignKeyName: "order_shipments_carrier_id_fkey";
8101
+ columns: ["carrier_id"];
8102
+ isOneToOne: false;
8103
+ referencedRelation: "carriers";
8104
+ referencedColumns: ["id"];
8105
+ }, {
8106
+ foreignKeyName: "order_shipments_order_id_fkey";
8107
+ columns: ["order_id"];
8108
+ isOneToOne: false;
8109
+ referencedRelation: "orders";
8110
+ referencedColumns: ["id"];
8111
+ }];
8112
+ };
7381
8113
  orders: {
7382
8114
  Row: {
8115
+ buffer_id: string | null;
7383
8116
  created_at: string;
7384
8117
  custom_fields: import("../../../integrations/supabase/types").Json;
7385
8118
  customer_id: string | null;
7386
8119
  customer_name: string;
7387
8120
  deleted_at: string | null;
7388
- delivery_date: string;
8121
+ delivery_date: string | null;
8122
+ floriday_sales_order_id: string | null;
7389
8123
  id: string;
8124
+ is_reservation: boolean;
7390
8125
  notes: string | null;
7391
8126
  order_date: string;
7392
8127
  order_number: string;
@@ -7398,13 +8133,16 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7398
8133
  updated_at: string;
7399
8134
  };
7400
8135
  Insert: {
8136
+ buffer_id?: string | null;
7401
8137
  created_at?: string;
7402
8138
  custom_fields?: import("../../../integrations/supabase/types").Json;
7403
8139
  customer_id?: string | null;
7404
8140
  customer_name?: string;
7405
8141
  deleted_at?: string | null;
7406
- delivery_date: string;
8142
+ delivery_date?: string | null;
8143
+ floriday_sales_order_id?: string | null;
7407
8144
  id?: string;
8145
+ is_reservation?: boolean;
7408
8146
  notes?: string | null;
7409
8147
  order_date?: string;
7410
8148
  order_number: string;
@@ -7416,13 +8154,16 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7416
8154
  updated_at?: string;
7417
8155
  };
7418
8156
  Update: {
8157
+ buffer_id?: string | null;
7419
8158
  created_at?: string;
7420
8159
  custom_fields?: import("../../../integrations/supabase/types").Json;
7421
8160
  customer_id?: string | null;
7422
8161
  customer_name?: string;
7423
8162
  deleted_at?: string | null;
7424
- delivery_date?: string;
8163
+ delivery_date?: string | null;
8164
+ floriday_sales_order_id?: string | null;
7425
8165
  id?: string;
8166
+ is_reservation?: boolean;
7426
8167
  notes?: string | null;
7427
8168
  order_date?: string;
7428
8169
  order_number?: string;
@@ -7434,6 +8175,12 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7434
8175
  updated_at?: string;
7435
8176
  };
7436
8177
  Relationships: [{
8178
+ foreignKeyName: "orders_buffer_id_fkey";
8179
+ columns: ["buffer_id"];
8180
+ isOneToOne: false;
8181
+ referencedRelation: "order_buffers";
8182
+ referencedColumns: ["id"];
8183
+ }, {
7437
8184
  foreignKeyName: "orders_customer_id_fkey";
7438
8185
  columns: ["customer_id"];
7439
8186
  isOneToOne: false;
@@ -7564,6 +8311,51 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7564
8311
  };
7565
8312
  Relationships: [];
7566
8313
  };
8314
+ planning_items: {
8315
+ Row: {
8316
+ assigned_monteur_id: string;
8317
+ created_at: string;
8318
+ created_by: string | null;
8319
+ end_at: string;
8320
+ id: string;
8321
+ notes: string | null;
8322
+ start_at: string;
8323
+ status: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
8324
+ updated_at: string;
8325
+ werkbon_id: string;
8326
+ };
8327
+ Insert: {
8328
+ assigned_monteur_id: string;
8329
+ created_at?: string;
8330
+ created_by?: string | null;
8331
+ end_at: string;
8332
+ id?: string;
8333
+ notes?: string | null;
8334
+ start_at: string;
8335
+ status?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
8336
+ updated_at?: string;
8337
+ werkbon_id: string;
8338
+ };
8339
+ Update: {
8340
+ assigned_monteur_id?: string;
8341
+ created_at?: string;
8342
+ created_by?: string | null;
8343
+ end_at?: string;
8344
+ id?: string;
8345
+ notes?: string | null;
8346
+ start_at?: string;
8347
+ status?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
8348
+ updated_at?: string;
8349
+ werkbon_id?: string;
8350
+ };
8351
+ Relationships: [{
8352
+ foreignKeyName: "planning_items_werkbon_id_fkey";
8353
+ columns: ["werkbon_id"];
8354
+ isOneToOne: false;
8355
+ referencedRelation: "werkbonnen";
8356
+ referencedColumns: ["id"];
8357
+ }];
8358
+ };
7567
8359
  product_categories: {
7568
8360
  Row: {
7569
8361
  color: string;
@@ -7697,6 +8489,8 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7697
8489
  Row: {
7698
8490
  created_at: string;
7699
8491
  description: string | null;
8492
+ head_product_id: string | null;
8493
+ head_trade_item_floriday_id: string | null;
7700
8494
  id: string;
7701
8495
  is_active: boolean;
7702
8496
  name: string;
@@ -7706,6 +8500,8 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7706
8500
  Insert: {
7707
8501
  created_at?: string;
7708
8502
  description?: string | null;
8503
+ head_product_id?: string | null;
8504
+ head_trade_item_floriday_id?: string | null;
7709
8505
  id?: string;
7710
8506
  is_active?: boolean;
7711
8507
  name: string;
@@ -7715,13 +8511,21 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
7715
8511
  Update: {
7716
8512
  created_at?: string;
7717
8513
  description?: string | null;
8514
+ head_product_id?: string | null;
8515
+ head_trade_item_floriday_id?: string | null;
7718
8516
  id?: string;
7719
8517
  is_active?: boolean;
7720
8518
  name?: string;
7721
8519
  tenant_id?: string;
7722
8520
  updated_at?: string;
7723
8521
  };
7724
- Relationships: [];
8522
+ Relationships: [{
8523
+ foreignKeyName: "product_groups_head_product_id_fkey";
8524
+ columns: ["head_product_id"];
8525
+ isOneToOne: false;
8526
+ referencedRelation: "products";
8527
+ referencedColumns: ["id"];
8528
+ }];
7725
8529
  };
7726
8530
  products: {
7727
8531
  Row: {
@@ -10272,6 +11076,7 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
10272
11076
  internal_notes: string | null;
10273
11077
  parent_werkbon_id: string | null;
10274
11078
  parsed_payload: import("../../../integrations/supabase/types").Json | null;
11079
+ planning_status: string;
10275
11080
  project_number: string | null;
10276
11081
  room_number: string | null;
10277
11082
  scheduled_end_time: string | null;
@@ -10279,6 +11084,7 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
10279
11084
  sequence_number: number;
10280
11085
  source_pdf_path: string | null;
10281
11086
  status: string;
11087
+ technician_id: string | null;
10282
11088
  technician_notes: string | null;
10283
11089
  technician_notes_raw: string | null;
10284
11090
  technician_task_description: string | null;
@@ -10299,6 +11105,7 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
10299
11105
  internal_notes?: string | null;
10300
11106
  parent_werkbon_id?: string | null;
10301
11107
  parsed_payload?: import("../../../integrations/supabase/types").Json | null;
11108
+ planning_status?: string;
10302
11109
  project_number?: string | null;
10303
11110
  room_number?: string | null;
10304
11111
  scheduled_end_time?: string | null;
@@ -10306,6 +11113,7 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
10306
11113
  sequence_number: number;
10307
11114
  source_pdf_path?: string | null;
10308
11115
  status?: string;
11116
+ technician_id?: string | null;
10309
11117
  technician_notes?: string | null;
10310
11118
  technician_notes_raw?: string | null;
10311
11119
  technician_task_description?: string | null;
@@ -10326,6 +11134,7 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
10326
11134
  internal_notes?: string | null;
10327
11135
  parent_werkbon_id?: string | null;
10328
11136
  parsed_payload?: import("../../../integrations/supabase/types").Json | null;
11137
+ planning_status?: string;
10329
11138
  project_number?: string | null;
10330
11139
  room_number?: string | null;
10331
11140
  scheduled_end_time?: string | null;
@@ -10333,6 +11142,7 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
10333
11142
  sequence_number?: number;
10334
11143
  source_pdf_path?: string | null;
10335
11144
  status?: string;
11145
+ technician_id?: string | null;
10336
11146
  technician_notes?: string | null;
10337
11147
  technician_notes_raw?: string | null;
10338
11148
  technician_task_description?: string | null;
@@ -10341,17 +11151,17 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
10341
11151
  work_address?: string | null;
10342
11152
  };
10343
11153
  Relationships: [{
10344
- foreignKeyName: "werkbonnen_customer_id_fkey";
10345
- columns: ["customer_id"];
10346
- isOneToOne: false;
10347
- referencedRelation: "customers";
10348
- referencedColumns: ["id"];
10349
- }, {
10350
11154
  foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
10351
11155
  columns: ["parent_werkbon_id"];
10352
11156
  isOneToOne: false;
10353
11157
  referencedRelation: "werkbonnen";
10354
11158
  referencedColumns: ["id"];
11159
+ }, {
11160
+ foreignKeyName: "werkbonnen_technician_id_fkey";
11161
+ columns: ["technician_id"];
11162
+ isOneToOne: false;
11163
+ referencedRelation: "monteurs";
11164
+ referencedColumns: ["id"];
10355
11165
  }];
10356
11166
  };
10357
11167
  work_order_monteurs: {
@@ -11070,6 +11880,21 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
11070
11880
  };
11071
11881
  Returns: string;
11072
11882
  };
11883
+ ai_usage_by_module: {
11884
+ Args: {
11885
+ _from: string;
11886
+ _to: string;
11887
+ };
11888
+ Returns: {
11889
+ calls: number;
11890
+ consumer_module_id: string;
11891
+ cost_usd: number;
11892
+ errors: number;
11893
+ input_tokens: number;
11894
+ output_tokens: number;
11895
+ total_tokens: number;
11896
+ }[];
11897
+ };
11073
11898
  apply_stock_consumption: {
11074
11899
  Args: {
11075
11900
  p_order_id: string;
@@ -11218,6 +12043,12 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
11218
12043
  Args: never;
11219
12044
  Returns: string;
11220
12045
  };
12046
+ custom_access_token_hook: {
12047
+ Args: {
12048
+ event: import("../../../integrations/supabase/types").Json;
12049
+ };
12050
+ Returns: import("../../../integrations/supabase/types").Json;
12051
+ };
11221
12052
  dashboard_alert_counts: {
11222
12053
  Args: never;
11223
12054
  Returns: import("../../../integrations/supabase/types").Json;
@@ -11553,6 +12384,14 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
11553
12384
  };
11554
12385
  Returns: string;
11555
12386
  };
12387
+ has_module_permission: {
12388
+ Args: {
12389
+ _min: string;
12390
+ _module_id: string;
12391
+ _user_id: string;
12392
+ };
12393
+ Returns: boolean;
12394
+ };
11556
12395
  has_role: {
11557
12396
  Args: {
11558
12397
  _role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
@@ -11578,6 +12417,20 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
11578
12417
  };
11579
12418
  Returns: boolean;
11580
12419
  };
12420
+ jwt_has_role: {
12421
+ Args: {
12422
+ _role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
12423
+ };
12424
+ Returns: boolean;
12425
+ };
12426
+ list_monteurs: {
12427
+ Args: never;
12428
+ Returns: {
12429
+ display_name: string;
12430
+ email: string;
12431
+ user_id: string;
12432
+ }[];
12433
+ };
11581
12434
  local_effective_price: {
11582
12435
  Args: {
11583
12436
  _customer_id: string;
@@ -11594,6 +12447,22 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
11594
12447
  source_id: string;
11595
12448
  }[];
11596
12449
  };
12450
+ log_ai_call: {
12451
+ Args: {
12452
+ _consumer_module_id: string;
12453
+ _cost_usd: number;
12454
+ _duration_ms: number;
12455
+ _error_code: string;
12456
+ _error_message: string;
12457
+ _input_tokens: number;
12458
+ _model_slug: string;
12459
+ _output_tokens: number;
12460
+ _provider_slug: string;
12461
+ _status: string;
12462
+ _total_tokens: number;
12463
+ };
12464
+ Returns: string;
12465
+ };
11597
12466
  mark_offer_clicked: {
11598
12467
  Args: {
11599
12468
  p_code: string;
@@ -11606,6 +12475,12 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
11606
12475
  };
11607
12476
  Returns: undefined;
11608
12477
  };
12478
+ mark_shipment_shipped: {
12479
+ Args: {
12480
+ p_shipment_id: string;
12481
+ };
12482
+ Returns: undefined;
12483
+ };
11609
12484
  next_order_number: {
11610
12485
  Args: {
11611
12486
  p_prefix: string;
@@ -12082,9 +12957,12 @@ export declare const processTwinfieldPushQueue: import("@tanstack/start-client-c
12082
12957
  };
12083
12958
  };
12084
12959
  Enums: {
12085
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
12960
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
12086
12961
  exact_env: "staging" | "live";
12087
12962
  exact_push_status: "pending" | "sent" | "error";
12963
+ itk_customer_segment: "Business" | "Private";
12964
+ itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
12965
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd";
12088
12966
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
12089
12967
  };
12090
12968
  CompositeTypes: { [_ in never]: never; };
@@ -12377,6 +13255,57 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
12377
13255
  referencedColumns: ["id"];
12378
13256
  }];
12379
13257
  };
13258
+ ai_call_log: {
13259
+ Row: {
13260
+ consumer_module_id: string;
13261
+ cost_usd: number | null;
13262
+ created_at: string;
13263
+ created_by: string | null;
13264
+ duration_ms: number | null;
13265
+ error_code: string | null;
13266
+ error_message: string | null;
13267
+ id: string;
13268
+ input_tokens: number;
13269
+ model_slug: string | null;
13270
+ output_tokens: number;
13271
+ provider_slug: string | null;
13272
+ status: string;
13273
+ total_tokens: number;
13274
+ };
13275
+ Insert: {
13276
+ consumer_module_id: string;
13277
+ cost_usd?: number | null;
13278
+ created_at?: string;
13279
+ created_by?: string | null;
13280
+ duration_ms?: number | null;
13281
+ error_code?: string | null;
13282
+ error_message?: string | null;
13283
+ id?: string;
13284
+ input_tokens?: number;
13285
+ model_slug?: string | null;
13286
+ output_tokens?: number;
13287
+ provider_slug?: string | null;
13288
+ status: string;
13289
+ total_tokens?: number;
13290
+ };
13291
+ Update: {
13292
+ consumer_module_id?: string;
13293
+ cost_usd?: number | null;
13294
+ created_at?: string;
13295
+ created_by?: string | null;
13296
+ duration_ms?: number | null;
13297
+ error_code?: string | null;
13298
+ error_message?: string | null;
13299
+ id?: string;
13300
+ input_tokens?: number;
13301
+ model_slug?: string | null;
13302
+ output_tokens?: number;
13303
+ provider_slug?: string | null;
13304
+ status?: string;
13305
+ total_tokens?: number;
13306
+ };
13307
+ Relationships: [];
13308
+ };
12380
13309
  ai_credentials: {
12381
13310
  Row: {
12382
13311
  active: boolean;
@@ -12413,6 +13342,36 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
12413
13342
  referencedColumns: ["id"];
12414
13343
  }];
12415
13344
  };
13345
+ ai_goals: {
13346
+ Row: {
13347
+ active: boolean;
13348
+ created_at: string;
13349
+ description: string | null;
13350
+ key: string;
13351
+ label: string;
13352
+ sort_order: number;
13353
+ updated_at: string;
13354
+ };
13355
+ Insert: {
13356
+ active?: boolean;
13357
+ created_at?: string;
13358
+ description?: string | null;
13359
+ key: string;
13360
+ label: string;
13361
+ sort_order?: number;
13362
+ updated_at?: string;
13363
+ };
13364
+ Update: {
13365
+ active?: boolean;
13366
+ created_at?: string;
13367
+ description?: string | null;
13368
+ key?: string;
13369
+ label?: string;
13370
+ sort_order?: number;
13371
+ updated_at?: string;
13372
+ };
13373
+ Relationships: [];
13374
+ };
12416
13375
  ai_model_pricing: {
12417
13376
  Row: {
12418
13377
  created_at: string;
@@ -13199,6 +14158,141 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
13199
14158
  };
13200
14159
  Relationships: [];
13201
14160
  };
14161
+ cart_planning_pick_times: {
14162
+ Row: {
14163
+ created_at: string;
14164
+ id: string;
14165
+ pot_size: string;
14166
+ seconds_per_cart: number;
14167
+ updated_at: string;
14168
+ };
14169
+ Insert: {
14170
+ created_at?: string;
14171
+ id?: string;
14172
+ pot_size: string;
14173
+ seconds_per_cart: number;
14174
+ updated_at?: string;
14175
+ };
14176
+ Update: {
14177
+ created_at?: string;
14178
+ id?: string;
14179
+ pot_size?: string;
14180
+ seconds_per_cart?: number;
14181
+ updated_at?: string;
14182
+ };
14183
+ Relationships: [];
14184
+ };
14185
+ cart_planning_product_overrides: {
14186
+ Row: {
14187
+ created_at: string;
14188
+ id: string;
14189
+ max_party_share_per_layer_pct_override: number | null;
14190
+ never_mix: boolean;
14191
+ notes: string | null;
14192
+ product_id: string;
14193
+ updated_at: string;
14194
+ };
14195
+ Insert: {
14196
+ created_at?: string;
14197
+ id?: string;
14198
+ max_party_share_per_layer_pct_override?: number | null;
14199
+ never_mix?: boolean;
14200
+ notes?: string | null;
14201
+ product_id: string;
14202
+ updated_at?: string;
14203
+ };
14204
+ Update: {
14205
+ created_at?: string;
14206
+ id?: string;
14207
+ max_party_share_per_layer_pct_override?: number | null;
14208
+ never_mix?: boolean;
14209
+ notes?: string | null;
14210
+ product_id?: string;
14211
+ updated_at?: string;
14212
+ };
14213
+ Relationships: [{
14214
+ foreignKeyName: "cart_planning_product_overrides_product_id_fkey";
14215
+ columns: ["product_id"];
14216
+ isOneToOne: true;
14217
+ referencedRelation: "products";
14218
+ referencedColumns: ["id"];
14219
+ }];
14220
+ };
14221
+ cart_planning_settings: {
14222
+ Row: {
14223
+ allow_editing_after_pickstation_send: boolean;
14224
+ buffer_grouping_mode: string;
14225
+ combine_floriday_orders: boolean;
14226
+ combine_floriday_orders_window: string;
14227
+ combine_orders_scope: string;
14228
+ default_workers: number;
14229
+ id: number;
14230
+ max_beladingen_per_layer: number;
14231
+ max_customers_per_cart: number;
14232
+ max_one_customer_per_layer: boolean;
14233
+ max_party_share_per_layer_pct: number;
14234
+ optimization_strategy: string;
14235
+ own_cart_from_layers: number;
14236
+ pick_time_mode: string;
14237
+ plants_per_day: number;
14238
+ plants_per_hour: number;
14239
+ require_same_carrier: boolean;
14240
+ require_same_crate_type: boolean;
14241
+ require_same_delivery_date: boolean;
14242
+ require_same_delivery_location: boolean;
14243
+ updated_at: string;
14244
+ updated_by: string | null;
14245
+ };
14246
+ Insert: {
14247
+ allow_editing_after_pickstation_send?: boolean;
14248
+ buffer_grouping_mode?: string;
14249
+ combine_floriday_orders?: boolean;
14250
+ combine_floriday_orders_window?: string;
14251
+ combine_orders_scope?: string;
14252
+ default_workers?: number;
14253
+ id?: number;
14254
+ max_beladingen_per_layer?: number;
14255
+ max_customers_per_cart?: number;
14256
+ max_one_customer_per_layer?: boolean;
14257
+ max_party_share_per_layer_pct?: number;
14258
+ optimization_strategy?: string;
14259
+ own_cart_from_layers?: number;
14260
+ pick_time_mode?: string;
14261
+ plants_per_day?: number;
14262
+ plants_per_hour?: number;
14263
+ require_same_carrier?: boolean;
14264
+ require_same_crate_type?: boolean;
14265
+ require_same_delivery_date?: boolean;
14266
+ require_same_delivery_location?: boolean;
14267
+ updated_at?: string;
14268
+ updated_by?: string | null;
14269
+ };
14270
+ Update: {
14271
+ allow_editing_after_pickstation_send?: boolean;
14272
+ buffer_grouping_mode?: string;
14273
+ combine_floriday_orders?: boolean;
14274
+ combine_floriday_orders_window?: string;
14275
+ combine_orders_scope?: string;
14276
+ default_workers?: number;
14277
+ id?: number;
14278
+ max_beladingen_per_layer?: number;
14279
+ max_customers_per_cart?: number;
14280
+ max_one_customer_per_layer?: boolean;
14281
+ max_party_share_per_layer_pct?: number;
14282
+ optimization_strategy?: string;
14283
+ own_cart_from_layers?: number;
14284
+ pick_time_mode?: string;
14285
+ plants_per_day?: number;
14286
+ plants_per_hour?: number;
14287
+ require_same_carrier?: boolean;
14288
+ require_same_crate_type?: boolean;
14289
+ require_same_delivery_date?: boolean;
14290
+ require_same_delivery_location?: boolean;
14291
+ updated_at?: string;
14292
+ updated_by?: string | null;
14293
+ };
14294
+ Relationships: [];
14295
+ };
13202
14296
  cart_replan_queue: {
13203
14297
  Row: {
13204
14298
  attempts: number;
@@ -13229,6 +14323,39 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
13229
14323
  referencedColumns: ["id"];
13230
14324
  }];
13231
14325
  };
14326
+ cart_types: {
14327
+ Row: {
14328
+ created_at: string;
14329
+ id: string;
14330
+ is_default: boolean;
14331
+ layer_length_cm: number;
14332
+ layer_width_cm: number;
14333
+ layers_per_cart: number;
14334
+ name: string;
14335
+ updated_at: string;
14336
+ };
14337
+ Insert: {
14338
+ created_at?: string;
14339
+ id?: string;
14340
+ is_default?: boolean;
14341
+ layer_length_cm: number;
14342
+ layer_width_cm: number;
14343
+ layers_per_cart?: number;
14344
+ name: string;
14345
+ updated_at?: string;
14346
+ };
14347
+ Update: {
14348
+ created_at?: string;
14349
+ id?: string;
14350
+ is_default?: boolean;
14351
+ layer_length_cm?: number;
14352
+ layer_width_cm?: number;
14353
+ layers_per_cart?: number;
14354
+ name?: string;
14355
+ updated_at?: string;
14356
+ };
14357
+ Relationships: [];
14358
+ };
13232
14359
  catalog_articles_cache: {
13233
14360
  Row: {
13234
14361
  created_at: string;
@@ -13316,6 +14443,36 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
13316
14443
  };
13317
14444
  Relationships: [];
13318
14445
  };
14446
+ crate_types: {
14447
+ Row: {
14448
+ created_at: string;
14449
+ id: string;
14450
+ length_cm: number;
14451
+ name: string;
14452
+ plants_per_crate: number;
14453
+ updated_at: string;
14454
+ width_cm: number;
14455
+ };
14456
+ Insert: {
14457
+ created_at?: string;
14458
+ id?: string;
14459
+ length_cm: number;
14460
+ name: string;
14461
+ plants_per_crate?: number;
14462
+ updated_at?: string;
14463
+ width_cm: number;
14464
+ };
14465
+ Update: {
14466
+ created_at?: string;
14467
+ id?: string;
14468
+ length_cm?: number;
14469
+ name?: string;
14470
+ plants_per_crate?: number;
14471
+ updated_at?: string;
14472
+ width_cm?: number;
14473
+ };
14474
+ Relationships: [];
14475
+ };
13319
14476
  customer_audit_log: {
13320
14477
  Row: {
13321
14478
  action: string;
@@ -17855,6 +19012,288 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
17855
19012
  };
17856
19013
  Relationships: [];
17857
19014
  };
19015
+ itk_contact_persons: {
19016
+ Row: {
19017
+ created_at: string;
19018
+ customer_id: string;
19019
+ email: string | null;
19020
+ id: string;
19021
+ name: string;
19022
+ phone: string | null;
19023
+ role: string | null;
19024
+ updated_at: string;
19025
+ };
19026
+ Insert: {
19027
+ created_at?: string;
19028
+ customer_id: string;
19029
+ email?: string | null;
19030
+ id?: string;
19031
+ name: string;
19032
+ phone?: string | null;
19033
+ role?: string | null;
19034
+ updated_at?: string;
19035
+ };
19036
+ Update: {
19037
+ created_at?: string;
19038
+ customer_id?: string;
19039
+ email?: string | null;
19040
+ id?: string;
19041
+ name?: string;
19042
+ phone?: string | null;
19043
+ role?: string | null;
19044
+ updated_at?: string;
19045
+ };
19046
+ Relationships: [{
19047
+ foreignKeyName: "itk_contact_persons_customer_id_fkey";
19048
+ columns: ["customer_id"];
19049
+ isOneToOne: false;
19050
+ referencedRelation: "itk_customers";
19051
+ referencedColumns: ["id"];
19052
+ }];
19053
+ };
19054
+ itk_customer_dynamic_values: {
19055
+ Row: {
19056
+ created_at: string;
19057
+ customer_id: string;
19058
+ field_id: string;
19059
+ id: string;
19060
+ updated_at: string;
19061
+ value: string | null;
19062
+ };
19063
+ Insert: {
19064
+ created_at?: string;
19065
+ customer_id: string;
19066
+ field_id: string;
19067
+ id?: string;
19068
+ updated_at?: string;
19069
+ value?: string | null;
19070
+ };
19071
+ Update: {
19072
+ created_at?: string;
19073
+ customer_id?: string;
19074
+ field_id?: string;
19075
+ id?: string;
19076
+ updated_at?: string;
19077
+ value?: string | null;
19078
+ };
19079
+ Relationships: [{
19080
+ foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey";
19081
+ columns: ["customer_id"];
19082
+ isOneToOne: false;
19083
+ referencedRelation: "itk_customers";
19084
+ referencedColumns: ["id"];
19085
+ }, {
19086
+ foreignKeyName: "itk_customer_dynamic_values_field_id_fkey";
19087
+ columns: ["field_id"];
19088
+ isOneToOne: false;
19089
+ referencedRelation: "itk_dynamic_fields";
19090
+ referencedColumns: ["id"];
19091
+ }];
19092
+ };
19093
+ itk_customer_notes: {
19094
+ Row: {
19095
+ body: string;
19096
+ created_at: string;
19097
+ created_by: string | null;
19098
+ customer_id: string;
19099
+ id: string;
19100
+ note_type: string;
19101
+ updated_at: string;
19102
+ };
19103
+ Insert: {
19104
+ body: string;
19105
+ created_at?: string;
19106
+ created_by?: string | null;
19107
+ customer_id: string;
19108
+ id?: string;
19109
+ note_type?: string;
19110
+ updated_at?: string;
19111
+ };
19112
+ Update: {
19113
+ body?: string;
19114
+ created_at?: string;
19115
+ created_by?: string | null;
19116
+ customer_id?: string;
19117
+ id?: string;
19118
+ note_type?: string;
19119
+ updated_at?: string;
19120
+ };
19121
+ Relationships: [{
19122
+ foreignKeyName: "itk_customer_notes_customer_id_fkey";
19123
+ columns: ["customer_id"];
19124
+ isOneToOne: false;
19125
+ referencedRelation: "itk_customers";
19126
+ referencedColumns: ["id"];
19127
+ }];
19128
+ };
19129
+ itk_customers: {
19130
+ Row: {
19131
+ billing_city: string | null;
19132
+ billing_postcode: string | null;
19133
+ billing_street: string | null;
19134
+ created_at: string;
19135
+ general_email: string | null;
19136
+ general_phone: string | null;
19137
+ id: string;
19138
+ legacy_customer_id: string | null;
19139
+ name: string;
19140
+ segment: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
19141
+ updated_at: string;
19142
+ };
19143
+ Insert: {
19144
+ billing_city?: string | null;
19145
+ billing_postcode?: string | null;
19146
+ billing_street?: string | null;
19147
+ created_at?: string;
19148
+ general_email?: string | null;
19149
+ general_phone?: string | null;
19150
+ id?: string;
19151
+ legacy_customer_id?: string | null;
19152
+ name: string;
19153
+ segment?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
19154
+ updated_at?: string;
19155
+ };
19156
+ Update: {
19157
+ billing_city?: string | null;
19158
+ billing_postcode?: string | null;
19159
+ billing_street?: string | null;
19160
+ created_at?: string;
19161
+ general_email?: string | null;
19162
+ general_phone?: string | null;
19163
+ id?: string;
19164
+ legacy_customer_id?: string | null;
19165
+ name?: string;
19166
+ segment?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
19167
+ updated_at?: string;
19168
+ };
19169
+ Relationships: [{
19170
+ foreignKeyName: "itk_customers_legacy_customer_id_fkey";
19171
+ columns: ["legacy_customer_id"];
19172
+ isOneToOne: false;
19173
+ referencedRelation: "customers";
19174
+ referencedColumns: ["id"];
19175
+ }];
19176
+ };
19177
+ itk_dynamic_fields: {
19178
+ Row: {
19179
+ created_at: string;
19180
+ field_name: string;
19181
+ field_type: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
19182
+ id: string;
19183
+ options: import("../../../integrations/supabase/types").Json;
19184
+ sort_order: number;
19185
+ updated_at: string;
19186
+ };
19187
+ Insert: {
19188
+ created_at?: string;
19189
+ field_name: string;
19190
+ field_type?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
19191
+ id?: string;
19192
+ options?: import("../../../integrations/supabase/types").Json;
19193
+ sort_order?: number;
19194
+ updated_at?: string;
19195
+ };
19196
+ Update: {
19197
+ created_at?: string;
19198
+ field_name?: string;
19199
+ field_type?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
19200
+ id?: string;
19201
+ options?: import("../../../integrations/supabase/types").Json;
19202
+ sort_order?: number;
19203
+ updated_at?: string;
19204
+ };
19205
+ Relationships: [];
19206
+ };
19207
+ itk_work_locations: {
19208
+ Row: {
19209
+ city: string | null;
19210
+ created_at: string;
19211
+ customer_id: string;
19212
+ id: string;
19213
+ instructions: string | null;
19214
+ label: string;
19215
+ latitude: number | null;
19216
+ longitude: number | null;
19217
+ postcode: string | null;
19218
+ street: string | null;
19219
+ updated_at: string;
19220
+ };
19221
+ Insert: {
19222
+ city?: string | null;
19223
+ created_at?: string;
19224
+ customer_id: string;
19225
+ id?: string;
19226
+ instructions?: string | null;
19227
+ label: string;
19228
+ latitude?: number | null;
19229
+ longitude?: number | null;
19230
+ postcode?: string | null;
19231
+ street?: string | null;
19232
+ updated_at?: string;
19233
+ };
19234
+ Update: {
19235
+ city?: string | null;
19236
+ created_at?: string;
19237
+ customer_id?: string;
19238
+ id?: string;
19239
+ instructions?: string | null;
19240
+ label?: string;
19241
+ latitude?: number | null;
19242
+ longitude?: number | null;
19243
+ postcode?: string | null;
19244
+ street?: string | null;
19245
+ updated_at?: string;
19246
+ };
19247
+ Relationships: [{
19248
+ foreignKeyName: "itk_work_locations_customer_id_fkey";
19249
+ columns: ["customer_id"];
19250
+ isOneToOne: false;
19251
+ referencedRelation: "itk_customers";
19252
+ referencedColumns: ["id"];
19253
+ }];
19254
+ };
19255
+ leave_requests: {
19256
+ Row: {
19257
+ created_at: string;
19258
+ end_date: string;
19259
+ id: string;
19260
+ reason: string | null;
19261
+ start_date: string;
19262
+ status: string;
19263
+ tenant_id: string;
19264
+ updated_at: string;
19265
+ user_id: string;
19266
+ };
19267
+ Insert: {
19268
+ created_at?: string;
19269
+ end_date: string;
19270
+ id?: string;
19271
+ reason?: string | null;
19272
+ start_date: string;
19273
+ status?: string;
19274
+ tenant_id?: string;
19275
+ updated_at?: string;
19276
+ user_id: string;
19277
+ };
19278
+ Update: {
19279
+ created_at?: string;
19280
+ end_date?: string;
19281
+ id?: string;
19282
+ reason?: string | null;
19283
+ start_date?: string;
19284
+ status?: string;
19285
+ tenant_id?: string;
19286
+ updated_at?: string;
19287
+ user_id?: string;
19288
+ };
19289
+ Relationships: [{
19290
+ foreignKeyName: "leave_requests_user_id_fkey";
19291
+ columns: ["user_id"];
19292
+ isOneToOne: false;
19293
+ referencedRelation: "monteurs";
19294
+ referencedColumns: ["id"];
19295
+ }];
19296
+ };
17858
19297
  local_customer_agreements: {
17859
19298
  Row: {
17860
19299
  base_price: number | null;
@@ -18506,6 +19945,33 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
18506
19945
  };
18507
19946
  Relationships: [];
18508
19947
  };
19948
+ module_permissions: {
19949
+ Row: {
19950
+ created_at: string;
19951
+ id: string;
19952
+ module_id: string;
19953
+ permission: string;
19954
+ role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
19955
+ updated_at: string;
19956
+ };
19957
+ Insert: {
19958
+ created_at?: string;
19959
+ id?: string;
19960
+ module_id: string;
19961
+ permission: string;
19962
+ role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
19963
+ updated_at?: string;
19964
+ };
19965
+ Update: {
19966
+ created_at?: string;
19967
+ id?: string;
19968
+ module_id?: string;
19969
+ permission?: string;
19970
+ role?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
19971
+ updated_at?: string;
19972
+ };
19973
+ Relationships: [];
19974
+ };
18509
19975
  monteurs: {
18510
19976
  Row: {
18511
19977
  avatar_url: string | null;
@@ -19235,6 +20701,42 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19235
20701
  };
19236
20702
  Relationships: [];
19237
20703
  };
20704
+ order_buffers: {
20705
+ Row: {
20706
+ buffer_key: string;
20707
+ created_at: string;
20708
+ customer_id: string | null;
20709
+ grouping_mode: string;
20710
+ id: string;
20711
+ pickup_date: string | null;
20712
+ pickup_location: string | null;
20713
+ plan_locked_at: string | null;
20714
+ updated_at: string;
20715
+ };
20716
+ Insert: {
20717
+ buffer_key: string;
20718
+ created_at?: string;
20719
+ customer_id?: string | null;
20720
+ grouping_mode: string;
20721
+ id?: string;
20722
+ pickup_date?: string | null;
20723
+ pickup_location?: string | null;
20724
+ plan_locked_at?: string | null;
20725
+ updated_at?: string;
20726
+ };
20727
+ Update: {
20728
+ buffer_key?: string;
20729
+ created_at?: string;
20730
+ customer_id?: string | null;
20731
+ grouping_mode?: string;
20732
+ id?: string;
20733
+ pickup_date?: string | null;
20734
+ pickup_location?: string | null;
20735
+ plan_locked_at?: string | null;
20736
+ updated_at?: string;
20737
+ };
20738
+ Relationships: [];
20739
+ };
19238
20740
  order_cart_items: {
19239
20741
  Row: {
19240
20742
  cart_id: string;
@@ -19301,6 +20803,7 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19301
20803
  order_carts: {
19302
20804
  Row: {
19303
20805
  algorithm_version: number;
20806
+ buffer_id: string | null;
19304
20807
  cart_number: number;
19305
20808
  created_at: string;
19306
20809
  id: string;
@@ -19308,13 +20811,14 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19308
20811
  is_complete: boolean;
19309
20812
  notes: string | null;
19310
20813
  occupancy_pct: number;
19311
- order_id: string;
20814
+ order_id: string | null;
19312
20815
  source: string;
19313
20816
  total_layers_used: number;
19314
20817
  updated_at: string;
19315
20818
  };
19316
20819
  Insert: {
19317
20820
  algorithm_version?: number;
20821
+ buffer_id?: string | null;
19318
20822
  cart_number: number;
19319
20823
  created_at?: string;
19320
20824
  id?: string;
@@ -19322,13 +20826,14 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19322
20826
  is_complete?: boolean;
19323
20827
  notes?: string | null;
19324
20828
  occupancy_pct?: number;
19325
- order_id: string;
20829
+ order_id?: string | null;
19326
20830
  source?: string;
19327
20831
  total_layers_used?: number;
19328
20832
  updated_at?: string;
19329
20833
  };
19330
20834
  Update: {
19331
20835
  algorithm_version?: number;
20836
+ buffer_id?: string | null;
19332
20837
  cart_number?: number;
19333
20838
  created_at?: string;
19334
20839
  id?: string;
@@ -19336,12 +20841,18 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19336
20841
  is_complete?: boolean;
19337
20842
  notes?: string | null;
19338
20843
  occupancy_pct?: number;
19339
- order_id?: string;
20844
+ order_id?: string | null;
19340
20845
  source?: string;
19341
20846
  total_layers_used?: number;
19342
20847
  updated_at?: string;
19343
20848
  };
19344
20849
  Relationships: [{
20850
+ foreignKeyName: "order_carts_buffer_id_fkey";
20851
+ columns: ["buffer_id"];
20852
+ isOneToOne: false;
20853
+ referencedRelation: "order_buffers";
20854
+ referencedColumns: ["id"];
20855
+ }, {
19345
20856
  foreignKeyName: "order_carts_order_id_fkey";
19346
20857
  columns: ["order_id"];
19347
20858
  isOneToOne: false;
@@ -19478,15 +20989,117 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19478
20989
  };
19479
20990
  Relationships: [];
19480
20991
  };
20992
+ order_shipment_items: {
20993
+ Row: {
20994
+ created_at: string;
20995
+ id: string;
20996
+ order_item_id: string;
20997
+ product_id: string | null;
20998
+ product_name: string;
20999
+ quantity: number;
21000
+ shipment_id: string;
21001
+ updated_at: string;
21002
+ };
21003
+ Insert: {
21004
+ created_at?: string;
21005
+ id?: string;
21006
+ order_item_id: string;
21007
+ product_id?: string | null;
21008
+ product_name: string;
21009
+ quantity: number;
21010
+ shipment_id: string;
21011
+ updated_at?: string;
21012
+ };
21013
+ Update: {
21014
+ created_at?: string;
21015
+ id?: string;
21016
+ order_item_id?: string;
21017
+ product_id?: string | null;
21018
+ product_name?: string;
21019
+ quantity?: number;
21020
+ shipment_id?: string;
21021
+ updated_at?: string;
21022
+ };
21023
+ Relationships: [{
21024
+ foreignKeyName: "order_shipment_items_order_item_id_fkey";
21025
+ columns: ["order_item_id"];
21026
+ isOneToOne: false;
21027
+ referencedRelation: "order_items";
21028
+ referencedColumns: ["id"];
21029
+ }, {
21030
+ foreignKeyName: "order_shipment_items_shipment_id_fkey";
21031
+ columns: ["shipment_id"];
21032
+ isOneToOne: false;
21033
+ referencedRelation: "order_shipments";
21034
+ referencedColumns: ["id"];
21035
+ }];
21036
+ };
21037
+ order_shipments: {
21038
+ Row: {
21039
+ carrier_id: string | null;
21040
+ created_at: string;
21041
+ delivery_date: string | null;
21042
+ delivery_location_id: string | null;
21043
+ id: string;
21044
+ notes: string | null;
21045
+ order_id: string;
21046
+ shipment_number: number;
21047
+ shipped_at: string | null;
21048
+ status: string;
21049
+ updated_at: string;
21050
+ };
21051
+ Insert: {
21052
+ carrier_id?: string | null;
21053
+ created_at?: string;
21054
+ delivery_date?: string | null;
21055
+ delivery_location_id?: string | null;
21056
+ id?: string;
21057
+ notes?: string | null;
21058
+ order_id: string;
21059
+ shipment_number: number;
21060
+ shipped_at?: string | null;
21061
+ status?: string;
21062
+ updated_at?: string;
21063
+ };
21064
+ Update: {
21065
+ carrier_id?: string | null;
21066
+ created_at?: string;
21067
+ delivery_date?: string | null;
21068
+ delivery_location_id?: string | null;
21069
+ id?: string;
21070
+ notes?: string | null;
21071
+ order_id?: string;
21072
+ shipment_number?: number;
21073
+ shipped_at?: string | null;
21074
+ status?: string;
21075
+ updated_at?: string;
21076
+ };
21077
+ Relationships: [{
21078
+ foreignKeyName: "order_shipments_carrier_id_fkey";
21079
+ columns: ["carrier_id"];
21080
+ isOneToOne: false;
21081
+ referencedRelation: "carriers";
21082
+ referencedColumns: ["id"];
21083
+ }, {
21084
+ foreignKeyName: "order_shipments_order_id_fkey";
21085
+ columns: ["order_id"];
21086
+ isOneToOne: false;
21087
+ referencedRelation: "orders";
21088
+ referencedColumns: ["id"];
21089
+ }];
21090
+ };
19481
21091
  orders: {
19482
21092
  Row: {
21093
+ buffer_id: string | null;
19483
21094
  created_at: string;
19484
21095
  custom_fields: import("../../../integrations/supabase/types").Json;
19485
21096
  customer_id: string | null;
19486
21097
  customer_name: string;
19487
21098
  deleted_at: string | null;
19488
- delivery_date: string;
21099
+ delivery_date: string | null;
21100
+ floriday_sales_order_id: string | null;
19489
21101
  id: string;
21102
+ is_reservation: boolean;
19490
21103
  notes: string | null;
19491
21104
  order_date: string;
19492
21105
  order_number: string;
@@ -19498,13 +21111,16 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19498
21111
  updated_at: string;
19499
21112
  };
19500
21113
  Insert: {
21114
+ buffer_id?: string | null;
19501
21115
  created_at?: string;
19502
21116
  custom_fields?: import("../../../integrations/supabase/types").Json;
19503
21117
  customer_id?: string | null;
19504
21118
  customer_name?: string;
19505
21119
  deleted_at?: string | null;
19506
- delivery_date: string;
21120
+ delivery_date?: string | null;
21121
+ floriday_sales_order_id?: string | null;
19507
21122
  id?: string;
21123
+ is_reservation?: boolean;
19508
21124
  notes?: string | null;
19509
21125
  order_date?: string;
19510
21126
  order_number: string;
@@ -19516,13 +21132,16 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19516
21132
  updated_at?: string;
19517
21133
  };
19518
21134
  Update: {
21135
+ buffer_id?: string | null;
19519
21136
  created_at?: string;
19520
21137
  custom_fields?: import("../../../integrations/supabase/types").Json;
19521
21138
  customer_id?: string | null;
19522
21139
  customer_name?: string;
19523
21140
  deleted_at?: string | null;
19524
- delivery_date?: string;
21141
+ delivery_date?: string | null;
21142
+ floriday_sales_order_id?: string | null;
19525
21143
  id?: string;
21144
+ is_reservation?: boolean;
19526
21145
  notes?: string | null;
19527
21146
  order_date?: string;
19528
21147
  order_number?: string;
@@ -19534,6 +21153,12 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19534
21153
  updated_at?: string;
19535
21154
  };
19536
21155
  Relationships: [{
21156
+ foreignKeyName: "orders_buffer_id_fkey";
21157
+ columns: ["buffer_id"];
21158
+ isOneToOne: false;
21159
+ referencedRelation: "order_buffers";
21160
+ referencedColumns: ["id"];
21161
+ }, {
19537
21162
  foreignKeyName: "orders_customer_id_fkey";
19538
21163
  columns: ["customer_id"];
19539
21164
  isOneToOne: false;
@@ -19664,6 +21289,51 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19664
21289
  };
19665
21290
  Relationships: [];
19666
21291
  };
21292
+ planning_items: {
21293
+ Row: {
21294
+ assigned_monteur_id: string;
21295
+ created_at: string;
21296
+ created_by: string | null;
21297
+ end_at: string;
21298
+ id: string;
21299
+ notes: string | null;
21300
+ start_at: string;
21301
+ status: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
21302
+ updated_at: string;
21303
+ werkbon_id: string;
21304
+ };
21305
+ Insert: {
21306
+ assigned_monteur_id: string;
21307
+ created_at?: string;
21308
+ created_by?: string | null;
21309
+ end_at: string;
21310
+ id?: string;
21311
+ notes?: string | null;
21312
+ start_at: string;
21313
+ status?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
21314
+ updated_at?: string;
21315
+ werkbon_id: string;
21316
+ };
21317
+ Update: {
21318
+ assigned_monteur_id?: string;
21319
+ created_at?: string;
21320
+ created_by?: string | null;
21321
+ end_at?: string;
21322
+ id?: string;
21323
+ notes?: string | null;
21324
+ start_at?: string;
21325
+ status?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
21326
+ updated_at?: string;
21327
+ werkbon_id?: string;
21328
+ };
21329
+ Relationships: [{
21330
+ foreignKeyName: "planning_items_werkbon_id_fkey";
21331
+ columns: ["werkbon_id"];
21332
+ isOneToOne: false;
21333
+ referencedRelation: "werkbonnen";
21334
+ referencedColumns: ["id"];
21335
+ }];
21336
+ };
19667
21337
  product_categories: {
19668
21338
  Row: {
19669
21339
  color: string;
@@ -19797,6 +21467,8 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19797
21467
  Row: {
19798
21468
  created_at: string;
19799
21469
  description: string | null;
21470
+ head_product_id: string | null;
21471
+ head_trade_item_floriday_id: string | null;
19800
21472
  id: string;
19801
21473
  is_active: boolean;
19802
21474
  name: string;
@@ -19806,6 +21478,8 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19806
21478
  Insert: {
19807
21479
  created_at?: string;
19808
21480
  description?: string | null;
21481
+ head_product_id?: string | null;
21482
+ head_trade_item_floriday_id?: string | null;
19809
21483
  id?: string;
19810
21484
  is_active?: boolean;
19811
21485
  name: string;
@@ -19815,13 +21489,21 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
19815
21489
  Update: {
19816
21490
  created_at?: string;
19817
21491
  description?: string | null;
21492
+ head_product_id?: string | null;
21493
+ head_trade_item_floriday_id?: string | null;
19818
21494
  id?: string;
19819
21495
  is_active?: boolean;
19820
21496
  name?: string;
19821
21497
  tenant_id?: string;
19822
21498
  updated_at?: string;
19823
21499
  };
19824
- Relationships: [];
21500
+ Relationships: [{
21501
+ foreignKeyName: "product_groups_head_product_id_fkey";
21502
+ columns: ["head_product_id"];
21503
+ isOneToOne: false;
21504
+ referencedRelation: "products";
21505
+ referencedColumns: ["id"];
21506
+ }];
19825
21507
  };
19826
21508
  products: {
19827
21509
  Row: {
@@ -22372,6 +24054,7 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
22372
24054
  internal_notes: string | null;
22373
24055
  parent_werkbon_id: string | null;
22374
24056
  parsed_payload: import("../../../integrations/supabase/types").Json | null;
24057
+ planning_status: string;
22375
24058
  project_number: string | null;
22376
24059
  room_number: string | null;
22377
24060
  scheduled_end_time: string | null;
@@ -22379,6 +24062,7 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
22379
24062
  sequence_number: number;
22380
24063
  source_pdf_path: string | null;
22381
24064
  status: string;
24065
+ technician_id: string | null;
22382
24066
  technician_notes: string | null;
22383
24067
  technician_notes_raw: string | null;
22384
24068
  technician_task_description: string | null;
@@ -22399,6 +24083,7 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
22399
24083
  internal_notes?: string | null;
22400
24084
  parent_werkbon_id?: string | null;
22401
24085
  parsed_payload?: import("../../../integrations/supabase/types").Json | null;
24086
+ planning_status?: string;
22402
24087
  project_number?: string | null;
22403
24088
  room_number?: string | null;
22404
24089
  scheduled_end_time?: string | null;
@@ -22406,6 +24091,7 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
22406
24091
  sequence_number: number;
22407
24092
  source_pdf_path?: string | null;
22408
24093
  status?: string;
24094
+ technician_id?: string | null;
22409
24095
  technician_notes?: string | null;
22410
24096
  technician_notes_raw?: string | null;
22411
24097
  technician_task_description?: string | null;
@@ -22426,6 +24112,7 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
22426
24112
  internal_notes?: string | null;
22427
24113
  parent_werkbon_id?: string | null;
22428
24114
  parsed_payload?: import("../../../integrations/supabase/types").Json | null;
24115
+ planning_status?: string;
22429
24116
  project_number?: string | null;
22430
24117
  room_number?: string | null;
22431
24118
  scheduled_end_time?: string | null;
@@ -22433,6 +24120,7 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
22433
24120
  sequence_number?: number;
22434
24121
  source_pdf_path?: string | null;
22435
24122
  status?: string;
24123
+ technician_id?: string | null;
22436
24124
  technician_notes?: string | null;
22437
24125
  technician_notes_raw?: string | null;
22438
24126
  technician_task_description?: string | null;
@@ -22441,17 +24129,17 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
22441
24129
  work_address?: string | null;
22442
24130
  };
22443
24131
  Relationships: [{
22444
- foreignKeyName: "werkbonnen_customer_id_fkey";
22445
- columns: ["customer_id"];
22446
- isOneToOne: false;
22447
- referencedRelation: "customers";
22448
- referencedColumns: ["id"];
22449
- }, {
22450
24132
  foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
22451
24133
  columns: ["parent_werkbon_id"];
22452
24134
  isOneToOne: false;
22453
24135
  referencedRelation: "werkbonnen";
22454
24136
  referencedColumns: ["id"];
24137
+ }, {
24138
+ foreignKeyName: "werkbonnen_technician_id_fkey";
24139
+ columns: ["technician_id"];
24140
+ isOneToOne: false;
24141
+ referencedRelation: "monteurs";
24142
+ referencedColumns: ["id"];
22455
24143
  }];
22456
24144
  };
22457
24145
  work_order_monteurs: {
@@ -23170,6 +24858,21 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
23170
24858
  };
23171
24859
  Returns: string;
23172
24860
  };
24861
+ ai_usage_by_module: {
24862
+ Args: {
24863
+ _from: string;
24864
+ _to: string;
24865
+ };
24866
+ Returns: {
24867
+ calls: number;
24868
+ consumer_module_id: string;
24869
+ cost_usd: number;
24870
+ errors: number;
24871
+ input_tokens: number;
24872
+ output_tokens: number;
24873
+ total_tokens: number;
24874
+ }[];
24875
+ };
23173
24876
  apply_stock_consumption: {
23174
24877
  Args: {
23175
24878
  p_order_id: string;
@@ -23318,6 +25021,12 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
23318
25021
  Args: never;
23319
25022
  Returns: string;
23320
25023
  };
25024
+ custom_access_token_hook: {
25025
+ Args: {
25026
+ event: import("../../../integrations/supabase/types").Json;
25027
+ };
25028
+ Returns: import("../../../integrations/supabase/types").Json;
25029
+ };
23321
25030
  dashboard_alert_counts: {
23322
25031
  Args: never;
23323
25032
  Returns: import("../../../integrations/supabase/types").Json;
@@ -23653,6 +25362,14 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
23653
25362
  };
23654
25363
  Returns: string;
23655
25364
  };
25365
+ has_module_permission: {
25366
+ Args: {
25367
+ _min: string;
25368
+ _module_id: string;
25369
+ _user_id: string;
25370
+ };
25371
+ Returns: boolean;
25372
+ };
23656
25373
  has_role: {
23657
25374
  Args: {
23658
25375
  _role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
@@ -23678,6 +25395,20 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
23678
25395
  };
23679
25396
  Returns: boolean;
23680
25397
  };
25398
+ jwt_has_role: {
25399
+ Args: {
25400
+ _role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
25401
+ };
25402
+ Returns: boolean;
25403
+ };
25404
+ list_monteurs: {
25405
+ Args: never;
25406
+ Returns: {
25407
+ display_name: string;
25408
+ email: string;
25409
+ user_id: string;
25410
+ }[];
25411
+ };
23681
25412
  local_effective_price: {
23682
25413
  Args: {
23683
25414
  _customer_id: string;
@@ -23694,6 +25425,22 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
23694
25425
  source_id: string;
23695
25426
  }[];
23696
25427
  };
25428
+ log_ai_call: {
25429
+ Args: {
25430
+ _consumer_module_id: string;
25431
+ _cost_usd: number;
25432
+ _duration_ms: number;
25433
+ _error_code: string;
25434
+ _error_message: string;
25435
+ _input_tokens: number;
25436
+ _model_slug: string;
25437
+ _output_tokens: number;
25438
+ _provider_slug: string;
25439
+ _status: string;
25440
+ _total_tokens: number;
25441
+ };
25442
+ Returns: string;
25443
+ };
23697
25444
  mark_offer_clicked: {
23698
25445
  Args: {
23699
25446
  p_code: string;
@@ -23706,6 +25453,12 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
23706
25453
  };
23707
25454
  Returns: undefined;
23708
25455
  };
25456
+ mark_shipment_shipped: {
25457
+ Args: {
25458
+ p_shipment_id: string;
25459
+ };
25460
+ Returns: undefined;
25461
+ };
23709
25462
  next_order_number: {
23710
25463
  Args: {
23711
25464
  p_prefix: string;
@@ -24182,9 +25935,12 @@ export declare const retryTwinfieldPush: import("@tanstack/start-client-core").R
24182
25935
  };
24183
25936
  };
24184
25937
  Enums: {
24185
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
25938
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
24186
25939
  exact_env: "staging" | "live";
24187
25940
  exact_push_status: "pending" | "sent" | "error";
25941
+ itk_customer_segment: "Business" | "Private";
25942
+ itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
25943
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd";
24188
25944
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
24189
25945
  };
24190
25946
  CompositeTypes: { [_ in never]: never; };
@@ -24479,6 +26235,57 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
24479
26235
  referencedColumns: ["id"];
24480
26236
  }];
24481
26237
  };
26238
+ ai_call_log: {
26239
+ Row: {
26240
+ consumer_module_id: string;
26241
+ cost_usd: number | null;
26242
+ created_at: string;
26243
+ created_by: string | null;
26244
+ duration_ms: number | null;
26245
+ error_code: string | null;
26246
+ error_message: string | null;
26247
+ id: string;
26248
+ input_tokens: number;
26249
+ model_slug: string | null;
26250
+ output_tokens: number;
26251
+ provider_slug: string | null;
26252
+ status: string;
26253
+ total_tokens: number;
26254
+ };
26255
+ Insert: {
26256
+ consumer_module_id: string;
26257
+ cost_usd?: number | null;
26258
+ created_at?: string;
26259
+ created_by?: string | null;
26260
+ duration_ms?: number | null;
26261
+ error_code?: string | null;
26262
+ error_message?: string | null;
26263
+ id?: string;
26264
+ input_tokens?: number;
26265
+ model_slug?: string | null;
26266
+ output_tokens?: number;
26267
+ provider_slug?: string | null;
26268
+ status: string;
26269
+ total_tokens?: number;
26270
+ };
26271
+ Update: {
26272
+ consumer_module_id?: string;
26273
+ cost_usd?: number | null;
26274
+ created_at?: string;
26275
+ created_by?: string | null;
26276
+ duration_ms?: number | null;
26277
+ error_code?: string | null;
26278
+ error_message?: string | null;
26279
+ id?: string;
26280
+ input_tokens?: number;
26281
+ model_slug?: string | null;
26282
+ output_tokens?: number;
26283
+ provider_slug?: string | null;
26284
+ status?: string;
26285
+ total_tokens?: number;
26286
+ };
26287
+ Relationships: [];
26288
+ };
24482
26289
  ai_credentials: {
24483
26290
  Row: {
24484
26291
  active: boolean;
@@ -24515,6 +26322,36 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
24515
26322
  referencedColumns: ["id"];
24516
26323
  }];
24517
26324
  };
26325
+ ai_goals: {
26326
+ Row: {
26327
+ active: boolean;
26328
+ created_at: string;
26329
+ description: string | null;
26330
+ key: string;
26331
+ label: string;
26332
+ sort_order: number;
26333
+ updated_at: string;
26334
+ };
26335
+ Insert: {
26336
+ active?: boolean;
26337
+ created_at?: string;
26338
+ description?: string | null;
26339
+ key: string;
26340
+ label: string;
26341
+ sort_order?: number;
26342
+ updated_at?: string;
26343
+ };
26344
+ Update: {
26345
+ active?: boolean;
26346
+ created_at?: string;
26347
+ description?: string | null;
26348
+ key?: string;
26349
+ label?: string;
26350
+ sort_order?: number;
26351
+ updated_at?: string;
26352
+ };
26353
+ Relationships: [];
26354
+ };
24518
26355
  ai_model_pricing: {
24519
26356
  Row: {
24520
26357
  created_at: string;
@@ -25301,6 +27138,141 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
25301
27138
  };
25302
27139
  Relationships: [];
25303
27140
  };
27141
+ cart_planning_pick_times: {
27142
+ Row: {
27143
+ created_at: string;
27144
+ id: string;
27145
+ pot_size: string;
27146
+ seconds_per_cart: number;
27147
+ updated_at: string;
27148
+ };
27149
+ Insert: {
27150
+ created_at?: string;
27151
+ id?: string;
27152
+ pot_size: string;
27153
+ seconds_per_cart: number;
27154
+ updated_at?: string;
27155
+ };
27156
+ Update: {
27157
+ created_at?: string;
27158
+ id?: string;
27159
+ pot_size?: string;
27160
+ seconds_per_cart?: number;
27161
+ updated_at?: string;
27162
+ };
27163
+ Relationships: [];
27164
+ };
27165
+ cart_planning_product_overrides: {
27166
+ Row: {
27167
+ created_at: string;
27168
+ id: string;
27169
+ max_party_share_per_layer_pct_override: number | null;
27170
+ never_mix: boolean;
27171
+ notes: string | null;
27172
+ product_id: string;
27173
+ updated_at: string;
27174
+ };
27175
+ Insert: {
27176
+ created_at?: string;
27177
+ id?: string;
27178
+ max_party_share_per_layer_pct_override?: number | null;
27179
+ never_mix?: boolean;
27180
+ notes?: string | null;
27181
+ product_id: string;
27182
+ updated_at?: string;
27183
+ };
27184
+ Update: {
27185
+ created_at?: string;
27186
+ id?: string;
27187
+ max_party_share_per_layer_pct_override?: number | null;
27188
+ never_mix?: boolean;
27189
+ notes?: string | null;
27190
+ product_id?: string;
27191
+ updated_at?: string;
27192
+ };
27193
+ Relationships: [{
27194
+ foreignKeyName: "cart_planning_product_overrides_product_id_fkey";
27195
+ columns: ["product_id"];
27196
+ isOneToOne: true;
27197
+ referencedRelation: "products";
27198
+ referencedColumns: ["id"];
27199
+ }];
27200
+ };
27201
+ cart_planning_settings: {
27202
+ Row: {
27203
+ allow_editing_after_pickstation_send: boolean;
27204
+ buffer_grouping_mode: string;
27205
+ combine_floriday_orders: boolean;
27206
+ combine_floriday_orders_window: string;
27207
+ combine_orders_scope: string;
27208
+ default_workers: number;
27209
+ id: number;
27210
+ max_beladingen_per_layer: number;
27211
+ max_customers_per_cart: number;
27212
+ max_one_customer_per_layer: boolean;
27213
+ max_party_share_per_layer_pct: number;
27214
+ optimization_strategy: string;
27215
+ own_cart_from_layers: number;
27216
+ pick_time_mode: string;
27217
+ plants_per_day: number;
27218
+ plants_per_hour: number;
27219
+ require_same_carrier: boolean;
27220
+ require_same_crate_type: boolean;
27221
+ require_same_delivery_date: boolean;
27222
+ require_same_delivery_location: boolean;
27223
+ updated_at: string;
27224
+ updated_by: string | null;
27225
+ };
27226
+ Insert: {
27227
+ allow_editing_after_pickstation_send?: boolean;
27228
+ buffer_grouping_mode?: string;
27229
+ combine_floriday_orders?: boolean;
27230
+ combine_floriday_orders_window?: string;
27231
+ combine_orders_scope?: string;
27232
+ default_workers?: number;
27233
+ id?: number;
27234
+ max_beladingen_per_layer?: number;
27235
+ max_customers_per_cart?: number;
27236
+ max_one_customer_per_layer?: boolean;
27237
+ max_party_share_per_layer_pct?: number;
27238
+ optimization_strategy?: string;
27239
+ own_cart_from_layers?: number;
27240
+ pick_time_mode?: string;
27241
+ plants_per_day?: number;
27242
+ plants_per_hour?: number;
27243
+ require_same_carrier?: boolean;
27244
+ require_same_crate_type?: boolean;
27245
+ require_same_delivery_date?: boolean;
27246
+ require_same_delivery_location?: boolean;
27247
+ updated_at?: string;
27248
+ updated_by?: string | null;
27249
+ };
27250
+ Update: {
27251
+ allow_editing_after_pickstation_send?: boolean;
27252
+ buffer_grouping_mode?: string;
27253
+ combine_floriday_orders?: boolean;
27254
+ combine_floriday_orders_window?: string;
27255
+ combine_orders_scope?: string;
27256
+ default_workers?: number;
27257
+ id?: number;
27258
+ max_beladingen_per_layer?: number;
27259
+ max_customers_per_cart?: number;
27260
+ max_one_customer_per_layer?: boolean;
27261
+ max_party_share_per_layer_pct?: number;
27262
+ optimization_strategy?: string;
27263
+ own_cart_from_layers?: number;
27264
+ pick_time_mode?: string;
27265
+ plants_per_day?: number;
27266
+ plants_per_hour?: number;
27267
+ require_same_carrier?: boolean;
27268
+ require_same_crate_type?: boolean;
27269
+ require_same_delivery_date?: boolean;
27270
+ require_same_delivery_location?: boolean;
27271
+ updated_at?: string;
27272
+ updated_by?: string | null;
27273
+ };
27274
+ Relationships: [];
27275
+ };
25304
27276
  cart_replan_queue: {
25305
27277
  Row: {
25306
27278
  attempts: number;
@@ -25331,6 +27303,39 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
25331
27303
  referencedColumns: ["id"];
25332
27304
  }];
25333
27305
  };
27306
+ cart_types: {
27307
+ Row: {
27308
+ created_at: string;
27309
+ id: string;
27310
+ is_default: boolean;
27311
+ layer_length_cm: number;
27312
+ layer_width_cm: number;
27313
+ layers_per_cart: number;
27314
+ name: string;
27315
+ updated_at: string;
27316
+ };
27317
+ Insert: {
27318
+ created_at?: string;
27319
+ id?: string;
27320
+ is_default?: boolean;
27321
+ layer_length_cm: number;
27322
+ layer_width_cm: number;
27323
+ layers_per_cart?: number;
27324
+ name: string;
27325
+ updated_at?: string;
27326
+ };
27327
+ Update: {
27328
+ created_at?: string;
27329
+ id?: string;
27330
+ is_default?: boolean;
27331
+ layer_length_cm?: number;
27332
+ layer_width_cm?: number;
27333
+ layers_per_cart?: number;
27334
+ name?: string;
27335
+ updated_at?: string;
27336
+ };
27337
+ Relationships: [];
27338
+ };
25334
27339
  catalog_articles_cache: {
25335
27340
  Row: {
25336
27341
  created_at: string;
@@ -25418,6 +27423,36 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
25418
27423
  };
25419
27424
  Relationships: [];
25420
27425
  };
27426
+ crate_types: {
27427
+ Row: {
27428
+ created_at: string;
27429
+ id: string;
27430
+ length_cm: number;
27431
+ name: string;
27432
+ plants_per_crate: number;
27433
+ updated_at: string;
27434
+ width_cm: number;
27435
+ };
27436
+ Insert: {
27437
+ created_at?: string;
27438
+ id?: string;
27439
+ length_cm: number;
27440
+ name: string;
27441
+ plants_per_crate?: number;
27442
+ updated_at?: string;
27443
+ width_cm: number;
27444
+ };
27445
+ Update: {
27446
+ created_at?: string;
27447
+ id?: string;
27448
+ length_cm?: number;
27449
+ name?: string;
27450
+ plants_per_crate?: number;
27451
+ updated_at?: string;
27452
+ width_cm?: number;
27453
+ };
27454
+ Relationships: [];
27455
+ };
25421
27456
  customer_audit_log: {
25422
27457
  Row: {
25423
27458
  action: string;
@@ -29957,6 +31992,288 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
29957
31992
  };
29958
31993
  Relationships: [];
29959
31994
  };
31995
+ itk_contact_persons: {
31996
+ Row: {
31997
+ created_at: string;
31998
+ customer_id: string;
31999
+ email: string | null;
32000
+ id: string;
32001
+ name: string;
32002
+ phone: string | null;
32003
+ role: string | null;
32004
+ updated_at: string;
32005
+ };
32006
+ Insert: {
32007
+ created_at?: string;
32008
+ customer_id: string;
32009
+ email?: string | null;
32010
+ id?: string;
32011
+ name: string;
32012
+ phone?: string | null;
32013
+ role?: string | null;
32014
+ updated_at?: string;
32015
+ };
32016
+ Update: {
32017
+ created_at?: string;
32018
+ customer_id?: string;
32019
+ email?: string | null;
32020
+ id?: string;
32021
+ name?: string;
32022
+ phone?: string | null;
32023
+ role?: string | null;
32024
+ updated_at?: string;
32025
+ };
32026
+ Relationships: [{
32027
+ foreignKeyName: "itk_contact_persons_customer_id_fkey";
32028
+ columns: ["customer_id"];
32029
+ isOneToOne: false;
32030
+ referencedRelation: "itk_customers";
32031
+ referencedColumns: ["id"];
32032
+ }];
32033
+ };
32034
+ itk_customer_dynamic_values: {
32035
+ Row: {
32036
+ created_at: string;
32037
+ customer_id: string;
32038
+ field_id: string;
32039
+ id: string;
32040
+ updated_at: string;
32041
+ value: string | null;
32042
+ };
32043
+ Insert: {
32044
+ created_at?: string;
32045
+ customer_id: string;
32046
+ field_id: string;
32047
+ id?: string;
32048
+ updated_at?: string;
32049
+ value?: string | null;
32050
+ };
32051
+ Update: {
32052
+ created_at?: string;
32053
+ customer_id?: string;
32054
+ field_id?: string;
32055
+ id?: string;
32056
+ updated_at?: string;
32057
+ value?: string | null;
32058
+ };
32059
+ Relationships: [{
32060
+ foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey";
32061
+ columns: ["customer_id"];
32062
+ isOneToOne: false;
32063
+ referencedRelation: "itk_customers";
32064
+ referencedColumns: ["id"];
32065
+ }, {
32066
+ foreignKeyName: "itk_customer_dynamic_values_field_id_fkey";
32067
+ columns: ["field_id"];
32068
+ isOneToOne: false;
32069
+ referencedRelation: "itk_dynamic_fields";
32070
+ referencedColumns: ["id"];
32071
+ }];
32072
+ };
32073
+ itk_customer_notes: {
32074
+ Row: {
32075
+ body: string;
32076
+ created_at: string;
32077
+ created_by: string | null;
32078
+ customer_id: string;
32079
+ id: string;
32080
+ note_type: string;
32081
+ updated_at: string;
32082
+ };
32083
+ Insert: {
32084
+ body: string;
32085
+ created_at?: string;
32086
+ created_by?: string | null;
32087
+ customer_id: string;
32088
+ id?: string;
32089
+ note_type?: string;
32090
+ updated_at?: string;
32091
+ };
32092
+ Update: {
32093
+ body?: string;
32094
+ created_at?: string;
32095
+ created_by?: string | null;
32096
+ customer_id?: string;
32097
+ id?: string;
32098
+ note_type?: string;
32099
+ updated_at?: string;
32100
+ };
32101
+ Relationships: [{
32102
+ foreignKeyName: "itk_customer_notes_customer_id_fkey";
32103
+ columns: ["customer_id"];
32104
+ isOneToOne: false;
32105
+ referencedRelation: "itk_customers";
32106
+ referencedColumns: ["id"];
32107
+ }];
32108
+ };
32109
+ itk_customers: {
32110
+ Row: {
32111
+ billing_city: string | null;
32112
+ billing_postcode: string | null;
32113
+ billing_street: string | null;
32114
+ created_at: string;
32115
+ general_email: string | null;
32116
+ general_phone: string | null;
32117
+ id: string;
32118
+ legacy_customer_id: string | null;
32119
+ name: string;
32120
+ segment: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
32121
+ updated_at: string;
32122
+ };
32123
+ Insert: {
32124
+ billing_city?: string | null;
32125
+ billing_postcode?: string | null;
32126
+ billing_street?: string | null;
32127
+ created_at?: string;
32128
+ general_email?: string | null;
32129
+ general_phone?: string | null;
32130
+ id?: string;
32131
+ legacy_customer_id?: string | null;
32132
+ name: string;
32133
+ segment?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
32134
+ updated_at?: string;
32135
+ };
32136
+ Update: {
32137
+ billing_city?: string | null;
32138
+ billing_postcode?: string | null;
32139
+ billing_street?: string | null;
32140
+ created_at?: string;
32141
+ general_email?: string | null;
32142
+ general_phone?: string | null;
32143
+ id?: string;
32144
+ legacy_customer_id?: string | null;
32145
+ name?: string;
32146
+ segment?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_customer_segment"];
32147
+ updated_at?: string;
32148
+ };
32149
+ Relationships: [{
32150
+ foreignKeyName: "itk_customers_legacy_customer_id_fkey";
32151
+ columns: ["legacy_customer_id"];
32152
+ isOneToOne: false;
32153
+ referencedRelation: "customers";
32154
+ referencedColumns: ["id"];
32155
+ }];
32156
+ };
32157
+ itk_dynamic_fields: {
32158
+ Row: {
32159
+ created_at: string;
32160
+ field_name: string;
32161
+ field_type: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
32162
+ id: string;
32163
+ options: import("../../../integrations/supabase/types").Json;
32164
+ sort_order: number;
32165
+ updated_at: string;
32166
+ };
32167
+ Insert: {
32168
+ created_at?: string;
32169
+ field_name: string;
32170
+ field_type?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
32171
+ id?: string;
32172
+ options?: import("../../../integrations/supabase/types").Json;
32173
+ sort_order?: number;
32174
+ updated_at?: string;
32175
+ };
32176
+ Update: {
32177
+ created_at?: string;
32178
+ field_name?: string;
32179
+ field_type?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["itk_dynamic_field_type"];
32180
+ id?: string;
32181
+ options?: import("../../../integrations/supabase/types").Json;
32182
+ sort_order?: number;
32183
+ updated_at?: string;
32184
+ };
32185
+ Relationships: [];
32186
+ };
32187
+ itk_work_locations: {
32188
+ Row: {
32189
+ city: string | null;
32190
+ created_at: string;
32191
+ customer_id: string;
32192
+ id: string;
32193
+ instructions: string | null;
32194
+ label: string;
32195
+ latitude: number | null;
32196
+ longitude: number | null;
32197
+ postcode: string | null;
32198
+ street: string | null;
32199
+ updated_at: string;
32200
+ };
32201
+ Insert: {
32202
+ city?: string | null;
32203
+ created_at?: string;
32204
+ customer_id: string;
32205
+ id?: string;
32206
+ instructions?: string | null;
32207
+ label: string;
32208
+ latitude?: number | null;
32209
+ longitude?: number | null;
32210
+ postcode?: string | null;
32211
+ street?: string | null;
32212
+ updated_at?: string;
32213
+ };
32214
+ Update: {
32215
+ city?: string | null;
32216
+ created_at?: string;
32217
+ customer_id?: string;
32218
+ id?: string;
32219
+ instructions?: string | null;
32220
+ label?: string;
32221
+ latitude?: number | null;
32222
+ longitude?: number | null;
32223
+ postcode?: string | null;
32224
+ street?: string | null;
32225
+ updated_at?: string;
32226
+ };
32227
+ Relationships: [{
32228
+ foreignKeyName: "itk_work_locations_customer_id_fkey";
32229
+ columns: ["customer_id"];
32230
+ isOneToOne: false;
32231
+ referencedRelation: "itk_customers";
32232
+ referencedColumns: ["id"];
32233
+ }];
32234
+ };
32235
+ leave_requests: {
32236
+ Row: {
32237
+ created_at: string;
32238
+ end_date: string;
32239
+ id: string;
32240
+ reason: string | null;
32241
+ start_date: string;
32242
+ status: string;
32243
+ tenant_id: string;
32244
+ updated_at: string;
32245
+ user_id: string;
32246
+ };
32247
+ Insert: {
32248
+ created_at?: string;
32249
+ end_date: string;
32250
+ id?: string;
32251
+ reason?: string | null;
32252
+ start_date: string;
32253
+ status?: string;
32254
+ tenant_id?: string;
32255
+ updated_at?: string;
32256
+ user_id: string;
32257
+ };
32258
+ Update: {
32259
+ created_at?: string;
32260
+ end_date?: string;
32261
+ id?: string;
32262
+ reason?: string | null;
32263
+ start_date?: string;
32264
+ status?: string;
32265
+ tenant_id?: string;
32266
+ updated_at?: string;
32267
+ user_id?: string;
32268
+ };
32269
+ Relationships: [{
32270
+ foreignKeyName: "leave_requests_user_id_fkey";
32271
+ columns: ["user_id"];
32272
+ isOneToOne: false;
32273
+ referencedRelation: "monteurs";
32274
+ referencedColumns: ["id"];
32275
+ }];
32276
+ };
29960
32277
  local_customer_agreements: {
29961
32278
  Row: {
29962
32279
  base_price: number | null;
@@ -30608,6 +32925,33 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
30608
32925
  };
30609
32926
  Relationships: [];
30610
32927
  };
32928
+ module_permissions: {
32929
+ Row: {
32930
+ created_at: string;
32931
+ id: string;
32932
+ module_id: string;
32933
+ permission: string;
32934
+ role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
32935
+ updated_at: string;
32936
+ };
32937
+ Insert: {
32938
+ created_at?: string;
32939
+ id?: string;
32940
+ module_id: string;
32941
+ permission: string;
32942
+ role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
32943
+ updated_at?: string;
32944
+ };
32945
+ Update: {
32946
+ created_at?: string;
32947
+ id?: string;
32948
+ module_id?: string;
32949
+ permission?: string;
32950
+ role?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
32951
+ updated_at?: string;
32952
+ };
32953
+ Relationships: [];
32954
+ };
30611
32955
  monteurs: {
30612
32956
  Row: {
30613
32957
  avatar_url: string | null;
@@ -31337,6 +33681,42 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31337
33681
  };
31338
33682
  Relationships: [];
31339
33683
  };
33684
+ order_buffers: {
33685
+ Row: {
33686
+ buffer_key: string;
33687
+ created_at: string;
33688
+ customer_id: string | null;
33689
+ grouping_mode: string;
33690
+ id: string;
33691
+ pickup_date: string | null;
33692
+ pickup_location: string | null;
33693
+ plan_locked_at: string | null;
33694
+ updated_at: string;
33695
+ };
33696
+ Insert: {
33697
+ buffer_key: string;
33698
+ created_at?: string;
33699
+ customer_id?: string | null;
33700
+ grouping_mode: string;
33701
+ id?: string;
33702
+ pickup_date?: string | null;
33703
+ pickup_location?: string | null;
33704
+ plan_locked_at?: string | null;
33705
+ updated_at?: string;
33706
+ };
33707
+ Update: {
33708
+ buffer_key?: string;
33709
+ created_at?: string;
33710
+ customer_id?: string | null;
33711
+ grouping_mode?: string;
33712
+ id?: string;
33713
+ pickup_date?: string | null;
33714
+ pickup_location?: string | null;
33715
+ plan_locked_at?: string | null;
33716
+ updated_at?: string;
33717
+ };
33718
+ Relationships: [];
33719
+ };
31340
33720
  order_cart_items: {
31341
33721
  Row: {
31342
33722
  cart_id: string;
@@ -31403,6 +33783,7 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31403
33783
  order_carts: {
31404
33784
  Row: {
31405
33785
  algorithm_version: number;
33786
+ buffer_id: string | null;
31406
33787
  cart_number: number;
31407
33788
  created_at: string;
31408
33789
  id: string;
@@ -31410,13 +33791,14 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31410
33791
  is_complete: boolean;
31411
33792
  notes: string | null;
31412
33793
  occupancy_pct: number;
31413
- order_id: string;
33794
+ order_id: string | null;
31414
33795
  source: string;
31415
33796
  total_layers_used: number;
31416
33797
  updated_at: string;
31417
33798
  };
31418
33799
  Insert: {
31419
33800
  algorithm_version?: number;
33801
+ buffer_id?: string | null;
31420
33802
  cart_number: number;
31421
33803
  created_at?: string;
31422
33804
  id?: string;
@@ -31424,13 +33806,14 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31424
33806
  is_complete?: boolean;
31425
33807
  notes?: string | null;
31426
33808
  occupancy_pct?: number;
31427
- order_id: string;
33809
+ order_id?: string | null;
31428
33810
  source?: string;
31429
33811
  total_layers_used?: number;
31430
33812
  updated_at?: string;
31431
33813
  };
31432
33814
  Update: {
31433
33815
  algorithm_version?: number;
33816
+ buffer_id?: string | null;
31434
33817
  cart_number?: number;
31435
33818
  created_at?: string;
31436
33819
  id?: string;
@@ -31438,12 +33821,18 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31438
33821
  is_complete?: boolean;
31439
33822
  notes?: string | null;
31440
33823
  occupancy_pct?: number;
31441
- order_id?: string;
33824
+ order_id?: string | null;
31442
33825
  source?: string;
31443
33826
  total_layers_used?: number;
31444
33827
  updated_at?: string;
31445
33828
  };
31446
33829
  Relationships: [{
33830
+ foreignKeyName: "order_carts_buffer_id_fkey";
33831
+ columns: ["buffer_id"];
33832
+ isOneToOne: false;
33833
+ referencedRelation: "order_buffers";
33834
+ referencedColumns: ["id"];
33835
+ }, {
31447
33836
  foreignKeyName: "order_carts_order_id_fkey";
31448
33837
  columns: ["order_id"];
31449
33838
  isOneToOne: false;
@@ -31580,15 +33969,117 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31580
33969
  };
31581
33970
  Relationships: [];
31582
33971
  };
33972
+ order_shipment_items: {
33973
+ Row: {
33974
+ created_at: string;
33975
+ id: string;
33976
+ order_item_id: string;
33977
+ product_id: string | null;
33978
+ product_name: string;
33979
+ quantity: number;
33980
+ shipment_id: string;
33981
+ updated_at: string;
33982
+ };
33983
+ Insert: {
33984
+ created_at?: string;
33985
+ id?: string;
33986
+ order_item_id: string;
33987
+ product_id?: string | null;
33988
+ product_name: string;
33989
+ quantity: number;
33990
+ shipment_id: string;
33991
+ updated_at?: string;
33992
+ };
33993
+ Update: {
33994
+ created_at?: string;
33995
+ id?: string;
33996
+ order_item_id?: string;
33997
+ product_id?: string | null;
33998
+ product_name?: string;
33999
+ quantity?: number;
34000
+ shipment_id?: string;
34001
+ updated_at?: string;
34002
+ };
34003
+ Relationships: [{
34004
+ foreignKeyName: "order_shipment_items_order_item_id_fkey";
34005
+ columns: ["order_item_id"];
34006
+ isOneToOne: false;
34007
+ referencedRelation: "order_items";
34008
+ referencedColumns: ["id"];
34009
+ }, {
34010
+ foreignKeyName: "order_shipment_items_shipment_id_fkey";
34011
+ columns: ["shipment_id"];
34012
+ isOneToOne: false;
34013
+ referencedRelation: "order_shipments";
34014
+ referencedColumns: ["id"];
34015
+ }];
34016
+ };
34017
+ order_shipments: {
34018
+ Row: {
34019
+ carrier_id: string | null;
34020
+ created_at: string;
34021
+ delivery_date: string | null;
34022
+ delivery_location_id: string | null;
34023
+ id: string;
34024
+ notes: string | null;
34025
+ order_id: string;
34026
+ shipment_number: number;
34027
+ shipped_at: string | null;
34028
+ status: string;
34029
+ updated_at: string;
34030
+ };
34031
+ Insert: {
34032
+ carrier_id?: string | null;
34033
+ created_at?: string;
34034
+ delivery_date?: string | null;
34035
+ delivery_location_id?: string | null;
34036
+ id?: string;
34037
+ notes?: string | null;
34038
+ order_id: string;
34039
+ shipment_number: number;
34040
+ shipped_at?: string | null;
34041
+ status?: string;
34042
+ updated_at?: string;
34043
+ };
34044
+ Update: {
34045
+ carrier_id?: string | null;
34046
+ created_at?: string;
34047
+ delivery_date?: string | null;
34048
+ delivery_location_id?: string | null;
34049
+ id?: string;
34050
+ notes?: string | null;
34051
+ order_id?: string;
34052
+ shipment_number?: number;
34053
+ shipped_at?: string | null;
34054
+ status?: string;
34055
+ updated_at?: string;
34056
+ };
34057
+ Relationships: [{
34058
+ foreignKeyName: "order_shipments_carrier_id_fkey";
34059
+ columns: ["carrier_id"];
34060
+ isOneToOne: false;
34061
+ referencedRelation: "carriers";
34062
+ referencedColumns: ["id"];
34063
+ }, {
34064
+ foreignKeyName: "order_shipments_order_id_fkey";
34065
+ columns: ["order_id"];
34066
+ isOneToOne: false;
34067
+ referencedRelation: "orders";
34068
+ referencedColumns: ["id"];
34069
+ }];
34070
+ };
31583
34071
  orders: {
31584
34072
  Row: {
34073
+ buffer_id: string | null;
31585
34074
  created_at: string;
31586
34075
  custom_fields: import("../../../integrations/supabase/types").Json;
31587
34076
  customer_id: string | null;
31588
34077
  customer_name: string;
31589
34078
  deleted_at: string | null;
31590
- delivery_date: string;
34079
+ delivery_date: string | null;
34080
+ floriday_sales_order_id: string | null;
31591
34081
  id: string;
34082
+ is_reservation: boolean;
31592
34083
  notes: string | null;
31593
34084
  order_date: string;
31594
34085
  order_number: string;
@@ -31600,13 +34091,16 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31600
34091
  updated_at: string;
31601
34092
  };
31602
34093
  Insert: {
34094
+ buffer_id?: string | null;
31603
34095
  created_at?: string;
31604
34096
  custom_fields?: import("../../../integrations/supabase/types").Json;
31605
34097
  customer_id?: string | null;
31606
34098
  customer_name?: string;
31607
34099
  deleted_at?: string | null;
31608
- delivery_date: string;
34100
+ delivery_date?: string | null;
34101
+ floriday_sales_order_id?: string | null;
31609
34102
  id?: string;
34103
+ is_reservation?: boolean;
31610
34104
  notes?: string | null;
31611
34105
  order_date?: string;
31612
34106
  order_number: string;
@@ -31618,13 +34112,16 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31618
34112
  updated_at?: string;
31619
34113
  };
31620
34114
  Update: {
34115
+ buffer_id?: string | null;
31621
34116
  created_at?: string;
31622
34117
  custom_fields?: import("../../../integrations/supabase/types").Json;
31623
34118
  customer_id?: string | null;
31624
34119
  customer_name?: string;
31625
34120
  deleted_at?: string | null;
31626
- delivery_date?: string;
34121
+ delivery_date?: string | null;
34122
+ floriday_sales_order_id?: string | null;
31627
34123
  id?: string;
34124
+ is_reservation?: boolean;
31628
34125
  notes?: string | null;
31629
34126
  order_date?: string;
31630
34127
  order_number?: string;
@@ -31636,6 +34133,12 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31636
34133
  updated_at?: string;
31637
34134
  };
31638
34135
  Relationships: [{
34136
+ foreignKeyName: "orders_buffer_id_fkey";
34137
+ columns: ["buffer_id"];
34138
+ isOneToOne: false;
34139
+ referencedRelation: "order_buffers";
34140
+ referencedColumns: ["id"];
34141
+ }, {
31639
34142
  foreignKeyName: "orders_customer_id_fkey";
31640
34143
  columns: ["customer_id"];
31641
34144
  isOneToOne: false;
@@ -31766,6 +34269,51 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31766
34269
  };
31767
34270
  Relationships: [];
31768
34271
  };
34272
+ planning_items: {
34273
+ Row: {
34274
+ assigned_monteur_id: string;
34275
+ created_at: string;
34276
+ created_by: string | null;
34277
+ end_at: string;
34278
+ id: string;
34279
+ notes: string | null;
34280
+ start_at: string;
34281
+ status: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
34282
+ updated_at: string;
34283
+ werkbon_id: string;
34284
+ };
34285
+ Insert: {
34286
+ assigned_monteur_id: string;
34287
+ created_at?: string;
34288
+ created_by?: string | null;
34289
+ end_at: string;
34290
+ id?: string;
34291
+ notes?: string | null;
34292
+ start_at: string;
34293
+ status?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
34294
+ updated_at?: string;
34295
+ werkbon_id: string;
34296
+ };
34297
+ Update: {
34298
+ assigned_monteur_id?: string;
34299
+ created_at?: string;
34300
+ created_by?: string | null;
34301
+ end_at?: string;
34302
+ id?: string;
34303
+ notes?: string | null;
34304
+ start_at?: string;
34305
+ status?: import("../../../integrations/supabase/types").Database["public"]["Enums"]["planning_item_status"];
34306
+ updated_at?: string;
34307
+ werkbon_id?: string;
34308
+ };
34309
+ Relationships: [{
34310
+ foreignKeyName: "planning_items_werkbon_id_fkey";
34311
+ columns: ["werkbon_id"];
34312
+ isOneToOne: false;
34313
+ referencedRelation: "werkbonnen";
34314
+ referencedColumns: ["id"];
34315
+ }];
34316
+ };
31769
34317
  product_categories: {
31770
34318
  Row: {
31771
34319
  color: string;
@@ -31899,6 +34447,8 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31899
34447
  Row: {
31900
34448
  created_at: string;
31901
34449
  description: string | null;
34450
+ head_product_id: string | null;
34451
+ head_trade_item_floriday_id: string | null;
31902
34452
  id: string;
31903
34453
  is_active: boolean;
31904
34454
  name: string;
@@ -31908,6 +34458,8 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31908
34458
  Insert: {
31909
34459
  created_at?: string;
31910
34460
  description?: string | null;
34461
+ head_product_id?: string | null;
34462
+ head_trade_item_floriday_id?: string | null;
31911
34463
  id?: string;
31912
34464
  is_active?: boolean;
31913
34465
  name: string;
@@ -31917,13 +34469,21 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
31917
34469
  Update: {
31918
34470
  created_at?: string;
31919
34471
  description?: string | null;
34472
+ head_product_id?: string | null;
34473
+ head_trade_item_floriday_id?: string | null;
31920
34474
  id?: string;
31921
34475
  is_active?: boolean;
31922
34476
  name?: string;
31923
34477
  tenant_id?: string;
31924
34478
  updated_at?: string;
31925
34479
  };
31926
- Relationships: [];
34480
+ Relationships: [{
34481
+ foreignKeyName: "product_groups_head_product_id_fkey";
34482
+ columns: ["head_product_id"];
34483
+ isOneToOne: false;
34484
+ referencedRelation: "products";
34485
+ referencedColumns: ["id"];
34486
+ }];
31927
34487
  };
31928
34488
  products: {
31929
34489
  Row: {
@@ -34474,6 +37034,7 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
34474
37034
  internal_notes: string | null;
34475
37035
  parent_werkbon_id: string | null;
34476
37036
  parsed_payload: import("../../../integrations/supabase/types").Json | null;
37037
+ planning_status: string;
34477
37038
  project_number: string | null;
34478
37039
  room_number: string | null;
34479
37040
  scheduled_end_time: string | null;
@@ -34481,6 +37042,7 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
34481
37042
  sequence_number: number;
34482
37043
  source_pdf_path: string | null;
34483
37044
  status: string;
37045
+ technician_id: string | null;
34484
37046
  technician_notes: string | null;
34485
37047
  technician_notes_raw: string | null;
34486
37048
  technician_task_description: string | null;
@@ -34501,6 +37063,7 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
34501
37063
  internal_notes?: string | null;
34502
37064
  parent_werkbon_id?: string | null;
34503
37065
  parsed_payload?: import("../../../integrations/supabase/types").Json | null;
37066
+ planning_status?: string;
34504
37067
  project_number?: string | null;
34505
37068
  room_number?: string | null;
34506
37069
  scheduled_end_time?: string | null;
@@ -34508,6 +37071,7 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
34508
37071
  sequence_number: number;
34509
37072
  source_pdf_path?: string | null;
34510
37073
  status?: string;
37074
+ technician_id?: string | null;
34511
37075
  technician_notes?: string | null;
34512
37076
  technician_notes_raw?: string | null;
34513
37077
  technician_task_description?: string | null;
@@ -34528,6 +37092,7 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
34528
37092
  internal_notes?: string | null;
34529
37093
  parent_werkbon_id?: string | null;
34530
37094
  parsed_payload?: import("../../../integrations/supabase/types").Json | null;
37095
+ planning_status?: string;
34531
37096
  project_number?: string | null;
34532
37097
  room_number?: string | null;
34533
37098
  scheduled_end_time?: string | null;
@@ -34535,6 +37100,7 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
34535
37100
  sequence_number?: number;
34536
37101
  source_pdf_path?: string | null;
34537
37102
  status?: string;
37103
+ technician_id?: string | null;
34538
37104
  technician_notes?: string | null;
34539
37105
  technician_notes_raw?: string | null;
34540
37106
  technician_task_description?: string | null;
@@ -34543,17 +37109,17 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
34543
37109
  work_address?: string | null;
34544
37110
  };
34545
37111
  Relationships: [{
34546
- foreignKeyName: "werkbonnen_customer_id_fkey";
34547
- columns: ["customer_id"];
34548
- isOneToOne: false;
34549
- referencedRelation: "customers";
34550
- referencedColumns: ["id"];
34551
- }, {
34552
37112
  foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
34553
37113
  columns: ["parent_werkbon_id"];
34554
37114
  isOneToOne: false;
34555
37115
  referencedRelation: "werkbonnen";
34556
37116
  referencedColumns: ["id"];
37117
+ }, {
37118
+ foreignKeyName: "werkbonnen_technician_id_fkey";
37119
+ columns: ["technician_id"];
37120
+ isOneToOne: false;
37121
+ referencedRelation: "monteurs";
37122
+ referencedColumns: ["id"];
34557
37123
  }];
34558
37124
  };
34559
37125
  work_order_monteurs: {
@@ -35272,6 +37838,21 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
35272
37838
  };
35273
37839
  Returns: string;
35274
37840
  };
37841
+ ai_usage_by_module: {
37842
+ Args: {
37843
+ _from: string;
37844
+ _to: string;
37845
+ };
37846
+ Returns: {
37847
+ calls: number;
37848
+ consumer_module_id: string;
37849
+ cost_usd: number;
37850
+ errors: number;
37851
+ input_tokens: number;
37852
+ output_tokens: number;
37853
+ total_tokens: number;
37854
+ }[];
37855
+ };
35275
37856
  apply_stock_consumption: {
35276
37857
  Args: {
35277
37858
  p_order_id: string;
@@ -35420,6 +38001,12 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
35420
38001
  Args: never;
35421
38002
  Returns: string;
35422
38003
  };
38004
+ custom_access_token_hook: {
38005
+ Args: {
38006
+ event: import("../../../integrations/supabase/types").Json;
38007
+ };
38008
+ Returns: import("../../../integrations/supabase/types").Json;
38009
+ };
35423
38010
  dashboard_alert_counts: {
35424
38011
  Args: never;
35425
38012
  Returns: import("../../../integrations/supabase/types").Json;
@@ -35755,6 +38342,14 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
35755
38342
  };
35756
38343
  Returns: string;
35757
38344
  };
38345
+ has_module_permission: {
38346
+ Args: {
38347
+ _min: string;
38348
+ _module_id: string;
38349
+ _user_id: string;
38350
+ };
38351
+ Returns: boolean;
38352
+ };
35758
38353
  has_role: {
35759
38354
  Args: {
35760
38355
  _role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
@@ -35780,6 +38375,20 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
35780
38375
  };
35781
38376
  Returns: boolean;
35782
38377
  };
38378
+ jwt_has_role: {
38379
+ Args: {
38380
+ _role: import("../../../integrations/supabase/types").Database["public"]["Enums"]["app_role"];
38381
+ };
38382
+ Returns: boolean;
38383
+ };
38384
+ list_monteurs: {
38385
+ Args: never;
38386
+ Returns: {
38387
+ display_name: string;
38388
+ email: string;
38389
+ user_id: string;
38390
+ }[];
38391
+ };
35783
38392
  local_effective_price: {
35784
38393
  Args: {
35785
38394
  _customer_id: string;
@@ -35796,6 +38405,22 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
35796
38405
  source_id: string;
35797
38406
  }[];
35798
38407
  };
38408
+ log_ai_call: {
38409
+ Args: {
38410
+ _consumer_module_id: string;
38411
+ _cost_usd: number;
38412
+ _duration_ms: number;
38413
+ _error_code: string;
38414
+ _error_message: string;
38415
+ _input_tokens: number;
38416
+ _model_slug: string;
38417
+ _output_tokens: number;
38418
+ _provider_slug: string;
38419
+ _status: string;
38420
+ _total_tokens: number;
38421
+ };
38422
+ Returns: string;
38423
+ };
35799
38424
  mark_offer_clicked: {
35800
38425
  Args: {
35801
38426
  p_code: string;
@@ -35808,6 +38433,12 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
35808
38433
  };
35809
38434
  Returns: undefined;
35810
38435
  };
38436
+ mark_shipment_shipped: {
38437
+ Args: {
38438
+ p_shipment_id: string;
38439
+ };
38440
+ Returns: undefined;
38441
+ };
35811
38442
  next_order_number: {
35812
38443
  Args: {
35813
38444
  p_prefix: string;
@@ -36284,9 +38915,12 @@ export declare const getTwinfieldSyncStatus: import("@tanstack/start-client-core
36284
38915
  };
36285
38916
  };
36286
38917
  Enums: {
36287
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
38918
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
36288
38919
  exact_env: "staging" | "live";
36289
38920
  exact_push_status: "pending" | "sent" | "error";
38921
+ itk_customer_segment: "Business" | "Private";
38922
+ itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
38923
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd";
36290
38924
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
36291
38925
  };
36292
38926
  CompositeTypes: { [_ in never]: never; };