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