@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
@@ -285,6 +285,57 @@ export type Database = {
285
285
  }
286
286
  ];
287
287
  };
288
+ ai_call_log: {
289
+ Row: {
290
+ consumer_module_id: string;
291
+ cost_usd: number | null;
292
+ created_at: string;
293
+ created_by: string | null;
294
+ duration_ms: number | null;
295
+ error_code: string | null;
296
+ error_message: string | null;
297
+ id: string;
298
+ input_tokens: number;
299
+ model_slug: string | null;
300
+ output_tokens: number;
301
+ provider_slug: string | null;
302
+ status: string;
303
+ total_tokens: number;
304
+ };
305
+ Insert: {
306
+ consumer_module_id: string;
307
+ cost_usd?: number | null;
308
+ created_at?: string;
309
+ created_by?: string | null;
310
+ duration_ms?: number | null;
311
+ error_code?: string | null;
312
+ error_message?: string | null;
313
+ id?: string;
314
+ input_tokens?: number;
315
+ model_slug?: string | null;
316
+ output_tokens?: number;
317
+ provider_slug?: string | null;
318
+ status: string;
319
+ total_tokens?: number;
320
+ };
321
+ Update: {
322
+ consumer_module_id?: string;
323
+ cost_usd?: number | null;
324
+ created_at?: string;
325
+ created_by?: string | null;
326
+ duration_ms?: number | null;
327
+ error_code?: string | null;
328
+ error_message?: string | null;
329
+ id?: string;
330
+ input_tokens?: number;
331
+ model_slug?: string | null;
332
+ output_tokens?: number;
333
+ provider_slug?: string | null;
334
+ status?: string;
335
+ total_tokens?: number;
336
+ };
337
+ Relationships: [];
338
+ };
288
339
  ai_credentials: {
289
340
  Row: {
290
341
  active: boolean;
@@ -323,6 +374,36 @@ export type Database = {
323
374
  }
324
375
  ];
325
376
  };
377
+ ai_goals: {
378
+ Row: {
379
+ active: boolean;
380
+ created_at: string;
381
+ description: string | null;
382
+ key: string;
383
+ label: string;
384
+ sort_order: number;
385
+ updated_at: string;
386
+ };
387
+ Insert: {
388
+ active?: boolean;
389
+ created_at?: string;
390
+ description?: string | null;
391
+ key: string;
392
+ label: string;
393
+ sort_order?: number;
394
+ updated_at?: string;
395
+ };
396
+ Update: {
397
+ active?: boolean;
398
+ created_at?: string;
399
+ description?: string | null;
400
+ key?: string;
401
+ label?: string;
402
+ sort_order?: number;
403
+ updated_at?: string;
404
+ };
405
+ Relationships: [];
406
+ };
326
407
  ai_model_pricing: {
327
408
  Row: {
328
409
  created_at: string;
@@ -1125,6 +1206,143 @@ export type Database = {
1125
1206
  };
1126
1207
  Relationships: [];
1127
1208
  };
1209
+ cart_planning_pick_times: {
1210
+ Row: {
1211
+ created_at: string;
1212
+ id: string;
1213
+ pot_size: string;
1214
+ seconds_per_cart: number;
1215
+ updated_at: string;
1216
+ };
1217
+ Insert: {
1218
+ created_at?: string;
1219
+ id?: string;
1220
+ pot_size: string;
1221
+ seconds_per_cart: number;
1222
+ updated_at?: string;
1223
+ };
1224
+ Update: {
1225
+ created_at?: string;
1226
+ id?: string;
1227
+ pot_size?: string;
1228
+ seconds_per_cart?: number;
1229
+ updated_at?: string;
1230
+ };
1231
+ Relationships: [];
1232
+ };
1233
+ cart_planning_product_overrides: {
1234
+ Row: {
1235
+ created_at: string;
1236
+ id: string;
1237
+ max_party_share_per_layer_pct_override: number | null;
1238
+ never_mix: boolean;
1239
+ notes: string | null;
1240
+ product_id: string;
1241
+ updated_at: string;
1242
+ };
1243
+ Insert: {
1244
+ created_at?: string;
1245
+ id?: string;
1246
+ max_party_share_per_layer_pct_override?: number | null;
1247
+ never_mix?: boolean;
1248
+ notes?: string | null;
1249
+ product_id: string;
1250
+ updated_at?: string;
1251
+ };
1252
+ Update: {
1253
+ created_at?: string;
1254
+ id?: string;
1255
+ max_party_share_per_layer_pct_override?: number | null;
1256
+ never_mix?: boolean;
1257
+ notes?: string | null;
1258
+ product_id?: string;
1259
+ updated_at?: string;
1260
+ };
1261
+ Relationships: [
1262
+ {
1263
+ foreignKeyName: "cart_planning_product_overrides_product_id_fkey";
1264
+ columns: ["product_id"];
1265
+ isOneToOne: true;
1266
+ referencedRelation: "products";
1267
+ referencedColumns: ["id"];
1268
+ }
1269
+ ];
1270
+ };
1271
+ cart_planning_settings: {
1272
+ Row: {
1273
+ allow_editing_after_pickstation_send: boolean;
1274
+ buffer_grouping_mode: string;
1275
+ combine_floriday_orders: boolean;
1276
+ combine_floriday_orders_window: string;
1277
+ combine_orders_scope: string;
1278
+ default_workers: number;
1279
+ id: number;
1280
+ max_beladingen_per_layer: number;
1281
+ max_customers_per_cart: number;
1282
+ max_one_customer_per_layer: boolean;
1283
+ max_party_share_per_layer_pct: number;
1284
+ optimization_strategy: string;
1285
+ own_cart_from_layers: number;
1286
+ pick_time_mode: string;
1287
+ plants_per_day: number;
1288
+ plants_per_hour: number;
1289
+ require_same_carrier: boolean;
1290
+ require_same_crate_type: boolean;
1291
+ require_same_delivery_date: boolean;
1292
+ require_same_delivery_location: boolean;
1293
+ updated_at: string;
1294
+ updated_by: string | null;
1295
+ };
1296
+ Insert: {
1297
+ allow_editing_after_pickstation_send?: boolean;
1298
+ buffer_grouping_mode?: string;
1299
+ combine_floriday_orders?: boolean;
1300
+ combine_floriday_orders_window?: string;
1301
+ combine_orders_scope?: string;
1302
+ default_workers?: number;
1303
+ id?: number;
1304
+ max_beladingen_per_layer?: number;
1305
+ max_customers_per_cart?: number;
1306
+ max_one_customer_per_layer?: boolean;
1307
+ max_party_share_per_layer_pct?: number;
1308
+ optimization_strategy?: string;
1309
+ own_cart_from_layers?: number;
1310
+ pick_time_mode?: string;
1311
+ plants_per_day?: number;
1312
+ plants_per_hour?: number;
1313
+ require_same_carrier?: boolean;
1314
+ require_same_crate_type?: boolean;
1315
+ require_same_delivery_date?: boolean;
1316
+ require_same_delivery_location?: boolean;
1317
+ updated_at?: string;
1318
+ updated_by?: string | null;
1319
+ };
1320
+ Update: {
1321
+ allow_editing_after_pickstation_send?: boolean;
1322
+ buffer_grouping_mode?: string;
1323
+ combine_floriday_orders?: boolean;
1324
+ combine_floriday_orders_window?: string;
1325
+ combine_orders_scope?: string;
1326
+ default_workers?: number;
1327
+ id?: number;
1328
+ max_beladingen_per_layer?: number;
1329
+ max_customers_per_cart?: number;
1330
+ max_one_customer_per_layer?: boolean;
1331
+ max_party_share_per_layer_pct?: number;
1332
+ optimization_strategy?: string;
1333
+ own_cart_from_layers?: number;
1334
+ pick_time_mode?: string;
1335
+ plants_per_day?: number;
1336
+ plants_per_hour?: number;
1337
+ require_same_carrier?: boolean;
1338
+ require_same_crate_type?: boolean;
1339
+ require_same_delivery_date?: boolean;
1340
+ require_same_delivery_location?: boolean;
1341
+ updated_at?: string;
1342
+ updated_by?: string | null;
1343
+ };
1344
+ Relationships: [];
1345
+ };
1128
1346
  cart_replan_queue: {
1129
1347
  Row: {
1130
1348
  attempts: number;
@@ -1157,6 +1375,39 @@ export type Database = {
1157
1375
  }
1158
1376
  ];
1159
1377
  };
1378
+ cart_types: {
1379
+ Row: {
1380
+ created_at: string;
1381
+ id: string;
1382
+ is_default: boolean;
1383
+ layer_length_cm: number;
1384
+ layer_width_cm: number;
1385
+ layers_per_cart: number;
1386
+ name: string;
1387
+ updated_at: string;
1388
+ };
1389
+ Insert: {
1390
+ created_at?: string;
1391
+ id?: string;
1392
+ is_default?: boolean;
1393
+ layer_length_cm: number;
1394
+ layer_width_cm: number;
1395
+ layers_per_cart?: number;
1396
+ name: string;
1397
+ updated_at?: string;
1398
+ };
1399
+ Update: {
1400
+ created_at?: string;
1401
+ id?: string;
1402
+ is_default?: boolean;
1403
+ layer_length_cm?: number;
1404
+ layer_width_cm?: number;
1405
+ layers_per_cart?: number;
1406
+ name?: string;
1407
+ updated_at?: string;
1408
+ };
1409
+ Relationships: [];
1410
+ };
1160
1411
  catalog_articles_cache: {
1161
1412
  Row: {
1162
1413
  created_at: string;
@@ -1244,6 +1495,36 @@ export type Database = {
1244
1495
  };
1245
1496
  Relationships: [];
1246
1497
  };
1498
+ crate_types: {
1499
+ Row: {
1500
+ created_at: string;
1501
+ id: string;
1502
+ length_cm: number;
1503
+ name: string;
1504
+ plants_per_crate: number;
1505
+ updated_at: string;
1506
+ width_cm: number;
1507
+ };
1508
+ Insert: {
1509
+ created_at?: string;
1510
+ id?: string;
1511
+ length_cm: number;
1512
+ name: string;
1513
+ plants_per_crate?: number;
1514
+ updated_at?: string;
1515
+ width_cm: number;
1516
+ };
1517
+ Update: {
1518
+ created_at?: string;
1519
+ id?: string;
1520
+ length_cm?: number;
1521
+ name?: string;
1522
+ plants_per_crate?: number;
1523
+ updated_at?: string;
1524
+ width_cm?: number;
1525
+ };
1526
+ Relationships: [];
1527
+ };
1247
1528
  customer_audit_log: {
1248
1529
  Row: {
1249
1530
  action: string;
@@ -5912,16 +6193,311 @@ export type Database = {
5912
6193
  };
5913
6194
  Update: {
5914
6195
  created_at?: string;
5915
- created_by?: string | null;
6196
+ created_by?: string | null;
6197
+ id?: string;
6198
+ period_end?: string;
6199
+ period_start?: string;
6200
+ status?: string;
6201
+ total_excl_vat?: number | null;
6202
+ total_incl_vat?: number | null;
6203
+ vat_amount?: number | null;
6204
+ };
6205
+ Relationships: [];
6206
+ };
6207
+ itk_contact_persons: {
6208
+ Row: {
6209
+ created_at: string;
6210
+ customer_id: string;
6211
+ email: string | null;
6212
+ id: string;
6213
+ name: string;
6214
+ phone: string | null;
6215
+ role: string | null;
6216
+ updated_at: string;
6217
+ };
6218
+ Insert: {
6219
+ created_at?: string;
6220
+ customer_id: string;
6221
+ email?: string | null;
6222
+ id?: string;
6223
+ name: string;
6224
+ phone?: string | null;
6225
+ role?: string | null;
6226
+ updated_at?: string;
6227
+ };
6228
+ Update: {
6229
+ created_at?: string;
6230
+ customer_id?: string;
6231
+ email?: string | null;
6232
+ id?: string;
6233
+ name?: string;
6234
+ phone?: string | null;
6235
+ role?: string | null;
6236
+ updated_at?: string;
6237
+ };
6238
+ Relationships: [
6239
+ {
6240
+ foreignKeyName: "itk_contact_persons_customer_id_fkey";
6241
+ columns: ["customer_id"];
6242
+ isOneToOne: false;
6243
+ referencedRelation: "itk_customers";
6244
+ referencedColumns: ["id"];
6245
+ }
6246
+ ];
6247
+ };
6248
+ itk_customer_dynamic_values: {
6249
+ Row: {
6250
+ created_at: string;
6251
+ customer_id: string;
6252
+ field_id: string;
6253
+ id: string;
6254
+ updated_at: string;
6255
+ value: string | null;
6256
+ };
6257
+ Insert: {
6258
+ created_at?: string;
6259
+ customer_id: string;
6260
+ field_id: string;
6261
+ id?: string;
6262
+ updated_at?: string;
6263
+ value?: string | null;
6264
+ };
6265
+ Update: {
6266
+ created_at?: string;
6267
+ customer_id?: string;
6268
+ field_id?: string;
6269
+ id?: string;
6270
+ updated_at?: string;
6271
+ value?: string | null;
6272
+ };
6273
+ Relationships: [
6274
+ {
6275
+ foreignKeyName: "itk_customer_dynamic_values_customer_id_fkey";
6276
+ columns: ["customer_id"];
6277
+ isOneToOne: false;
6278
+ referencedRelation: "itk_customers";
6279
+ referencedColumns: ["id"];
6280
+ },
6281
+ {
6282
+ foreignKeyName: "itk_customer_dynamic_values_field_id_fkey";
6283
+ columns: ["field_id"];
6284
+ isOneToOne: false;
6285
+ referencedRelation: "itk_dynamic_fields";
6286
+ referencedColumns: ["id"];
6287
+ }
6288
+ ];
6289
+ };
6290
+ itk_customer_notes: {
6291
+ Row: {
6292
+ body: string;
6293
+ created_at: string;
6294
+ created_by: string | null;
6295
+ customer_id: string;
6296
+ id: string;
6297
+ note_type: string;
6298
+ updated_at: string;
6299
+ };
6300
+ Insert: {
6301
+ body: string;
6302
+ created_at?: string;
6303
+ created_by?: string | null;
6304
+ customer_id: string;
6305
+ id?: string;
6306
+ note_type?: string;
6307
+ updated_at?: string;
6308
+ };
6309
+ Update: {
6310
+ body?: string;
6311
+ created_at?: string;
6312
+ created_by?: string | null;
6313
+ customer_id?: string;
6314
+ id?: string;
6315
+ note_type?: string;
6316
+ updated_at?: string;
6317
+ };
6318
+ Relationships: [
6319
+ {
6320
+ foreignKeyName: "itk_customer_notes_customer_id_fkey";
6321
+ columns: ["customer_id"];
6322
+ isOneToOne: false;
6323
+ referencedRelation: "itk_customers";
6324
+ referencedColumns: ["id"];
6325
+ }
6326
+ ];
6327
+ };
6328
+ itk_customers: {
6329
+ Row: {
6330
+ billing_city: string | null;
6331
+ billing_postcode: string | null;
6332
+ billing_street: string | null;
6333
+ created_at: string;
6334
+ general_email: string | null;
6335
+ general_phone: string | null;
6336
+ id: string;
6337
+ legacy_customer_id: string | null;
6338
+ name: string;
6339
+ segment: Database["public"]["Enums"]["itk_customer_segment"];
6340
+ updated_at: string;
6341
+ };
6342
+ Insert: {
6343
+ billing_city?: string | null;
6344
+ billing_postcode?: string | null;
6345
+ billing_street?: string | null;
6346
+ created_at?: string;
6347
+ general_email?: string | null;
6348
+ general_phone?: string | null;
6349
+ id?: string;
6350
+ legacy_customer_id?: string | null;
6351
+ name: string;
6352
+ segment?: Database["public"]["Enums"]["itk_customer_segment"];
6353
+ updated_at?: string;
6354
+ };
6355
+ Update: {
6356
+ billing_city?: string | null;
6357
+ billing_postcode?: string | null;
6358
+ billing_street?: string | null;
6359
+ created_at?: string;
6360
+ general_email?: string | null;
6361
+ general_phone?: string | null;
6362
+ id?: string;
6363
+ legacy_customer_id?: string | null;
6364
+ name?: string;
6365
+ segment?: Database["public"]["Enums"]["itk_customer_segment"];
6366
+ updated_at?: string;
6367
+ };
6368
+ Relationships: [
6369
+ {
6370
+ foreignKeyName: "itk_customers_legacy_customer_id_fkey";
6371
+ columns: ["legacy_customer_id"];
6372
+ isOneToOne: false;
6373
+ referencedRelation: "customers";
6374
+ referencedColumns: ["id"];
6375
+ }
6376
+ ];
6377
+ };
6378
+ itk_dynamic_fields: {
6379
+ Row: {
6380
+ created_at: string;
6381
+ field_name: string;
6382
+ field_type: Database["public"]["Enums"]["itk_dynamic_field_type"];
6383
+ id: string;
6384
+ options: Json;
6385
+ sort_order: number;
6386
+ updated_at: string;
6387
+ };
6388
+ Insert: {
6389
+ created_at?: string;
6390
+ field_name: string;
6391
+ field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"];
6392
+ id?: string;
6393
+ options?: Json;
6394
+ sort_order?: number;
6395
+ updated_at?: string;
6396
+ };
6397
+ Update: {
6398
+ created_at?: string;
6399
+ field_name?: string;
6400
+ field_type?: Database["public"]["Enums"]["itk_dynamic_field_type"];
6401
+ id?: string;
6402
+ options?: Json;
6403
+ sort_order?: number;
6404
+ updated_at?: string;
6405
+ };
6406
+ Relationships: [];
6407
+ };
6408
+ itk_work_locations: {
6409
+ Row: {
6410
+ city: string | null;
6411
+ created_at: string;
6412
+ customer_id: string;
6413
+ id: string;
6414
+ instructions: string | null;
6415
+ label: string;
6416
+ latitude: number | null;
6417
+ longitude: number | null;
6418
+ postcode: string | null;
6419
+ street: string | null;
6420
+ updated_at: string;
6421
+ };
6422
+ Insert: {
6423
+ city?: string | null;
6424
+ created_at?: string;
6425
+ customer_id: string;
6426
+ id?: string;
6427
+ instructions?: string | null;
6428
+ label: string;
6429
+ latitude?: number | null;
6430
+ longitude?: number | null;
6431
+ postcode?: string | null;
6432
+ street?: string | null;
6433
+ updated_at?: string;
6434
+ };
6435
+ Update: {
6436
+ city?: string | null;
6437
+ created_at?: string;
6438
+ customer_id?: string;
6439
+ id?: string;
6440
+ instructions?: string | null;
6441
+ label?: string;
6442
+ latitude?: number | null;
6443
+ longitude?: number | null;
6444
+ postcode?: string | null;
6445
+ street?: string | null;
6446
+ updated_at?: string;
6447
+ };
6448
+ Relationships: [
6449
+ {
6450
+ foreignKeyName: "itk_work_locations_customer_id_fkey";
6451
+ columns: ["customer_id"];
6452
+ isOneToOne: false;
6453
+ referencedRelation: "itk_customers";
6454
+ referencedColumns: ["id"];
6455
+ }
6456
+ ];
6457
+ };
6458
+ leave_requests: {
6459
+ Row: {
6460
+ created_at: string;
6461
+ end_date: string;
6462
+ id: string;
6463
+ reason: string | null;
6464
+ start_date: string;
6465
+ status: string;
6466
+ tenant_id: string;
6467
+ updated_at: string;
6468
+ user_id: string;
6469
+ };
6470
+ Insert: {
6471
+ created_at?: string;
6472
+ end_date: string;
6473
+ id?: string;
6474
+ reason?: string | null;
6475
+ start_date: string;
6476
+ status?: string;
6477
+ tenant_id?: string;
6478
+ updated_at?: string;
6479
+ user_id: string;
6480
+ };
6481
+ Update: {
6482
+ created_at?: string;
6483
+ end_date?: string;
5916
6484
  id?: string;
5917
- period_end?: string;
5918
- period_start?: string;
6485
+ reason?: string | null;
6486
+ start_date?: string;
5919
6487
  status?: string;
5920
- total_excl_vat?: number | null;
5921
- total_incl_vat?: number | null;
5922
- vat_amount?: number | null;
6488
+ tenant_id?: string;
6489
+ updated_at?: string;
6490
+ user_id?: string;
5923
6491
  };
5924
- Relationships: [];
6492
+ Relationships: [
6493
+ {
6494
+ foreignKeyName: "leave_requests_user_id_fkey";
6495
+ columns: ["user_id"];
6496
+ isOneToOne: false;
6497
+ referencedRelation: "monteurs";
6498
+ referencedColumns: ["id"];
6499
+ }
6500
+ ];
5925
6501
  };
5926
6502
  local_customer_agreements: {
5927
6503
  Row: {
@@ -6603,6 +7179,33 @@ export type Database = {
6603
7179
  };
6604
7180
  Relationships: [];
6605
7181
  };
7182
+ module_permissions: {
7183
+ Row: {
7184
+ created_at: string;
7185
+ id: string;
7186
+ module_id: string;
7187
+ permission: string;
7188
+ role: Database["public"]["Enums"]["app_role"];
7189
+ updated_at: string;
7190
+ };
7191
+ Insert: {
7192
+ created_at?: string;
7193
+ id?: string;
7194
+ module_id: string;
7195
+ permission: string;
7196
+ role: Database["public"]["Enums"]["app_role"];
7197
+ updated_at?: string;
7198
+ };
7199
+ Update: {
7200
+ created_at?: string;
7201
+ id?: string;
7202
+ module_id?: string;
7203
+ permission?: string;
7204
+ role?: Database["public"]["Enums"]["app_role"];
7205
+ updated_at?: string;
7206
+ };
7207
+ Relationships: [];
7208
+ };
6606
7209
  monteurs: {
6607
7210
  Row: {
6608
7211
  avatar_url: string | null;
@@ -7357,6 +7960,42 @@ export type Database = {
7357
7960
  };
7358
7961
  Relationships: [];
7359
7962
  };
7963
+ order_buffers: {
7964
+ Row: {
7965
+ buffer_key: string;
7966
+ created_at: string;
7967
+ customer_id: string | null;
7968
+ grouping_mode: string;
7969
+ id: string;
7970
+ pickup_date: string | null;
7971
+ pickup_location: string | null;
7972
+ plan_locked_at: string | null;
7973
+ updated_at: string;
7974
+ };
7975
+ Insert: {
7976
+ buffer_key: string;
7977
+ created_at?: string;
7978
+ customer_id?: string | null;
7979
+ grouping_mode: string;
7980
+ id?: string;
7981
+ pickup_date?: string | null;
7982
+ pickup_location?: string | null;
7983
+ plan_locked_at?: string | null;
7984
+ updated_at?: string;
7985
+ };
7986
+ Update: {
7987
+ buffer_key?: string;
7988
+ created_at?: string;
7989
+ customer_id?: string | null;
7990
+ grouping_mode?: string;
7991
+ id?: string;
7992
+ pickup_date?: string | null;
7993
+ pickup_location?: string | null;
7994
+ plan_locked_at?: string | null;
7995
+ updated_at?: string;
7996
+ };
7997
+ Relationships: [];
7998
+ };
7360
7999
  order_cart_items: {
7361
8000
  Row: {
7362
8001
  cart_id: string;
@@ -7427,6 +8066,7 @@ export type Database = {
7427
8066
  order_carts: {
7428
8067
  Row: {
7429
8068
  algorithm_version: number;
8069
+ buffer_id: string | null;
7430
8070
  cart_number: number;
7431
8071
  created_at: string;
7432
8072
  id: string;
@@ -7434,13 +8074,14 @@ export type Database = {
7434
8074
  is_complete: boolean;
7435
8075
  notes: string | null;
7436
8076
  occupancy_pct: number;
7437
- order_id: string;
8077
+ order_id: string | null;
7438
8078
  source: string;
7439
8079
  total_layers_used: number;
7440
8080
  updated_at: string;
7441
8081
  };
7442
8082
  Insert: {
7443
8083
  algorithm_version?: number;
8084
+ buffer_id?: string | null;
7444
8085
  cart_number: number;
7445
8086
  created_at?: string;
7446
8087
  id?: string;
@@ -7448,13 +8089,14 @@ export type Database = {
7448
8089
  is_complete?: boolean;
7449
8090
  notes?: string | null;
7450
8091
  occupancy_pct?: number;
7451
- order_id: string;
8092
+ order_id?: string | null;
7452
8093
  source?: string;
7453
8094
  total_layers_used?: number;
7454
8095
  updated_at?: string;
7455
8096
  };
7456
8097
  Update: {
7457
8098
  algorithm_version?: number;
8099
+ buffer_id?: string | null;
7458
8100
  cart_number?: number;
7459
8101
  created_at?: string;
7460
8102
  id?: string;
@@ -7462,12 +8104,19 @@ export type Database = {
7462
8104
  is_complete?: boolean;
7463
8105
  notes?: string | null;
7464
8106
  occupancy_pct?: number;
7465
- order_id?: string;
8107
+ order_id?: string | null;
7466
8108
  source?: string;
7467
8109
  total_layers_used?: number;
7468
8110
  updated_at?: string;
7469
8111
  };
7470
8112
  Relationships: [
8113
+ {
8114
+ foreignKeyName: "order_carts_buffer_id_fkey";
8115
+ columns: ["buffer_id"];
8116
+ isOneToOne: false;
8117
+ referencedRelation: "order_buffers";
8118
+ referencedColumns: ["id"];
8119
+ },
7471
8120
  {
7472
8121
  foreignKeyName: "order_carts_order_id_fkey";
7473
8122
  columns: ["order_id"];
@@ -7611,15 +8260,123 @@ export type Database = {
7611
8260
  };
7612
8261
  Relationships: [];
7613
8262
  };
8263
+ order_shipment_items: {
8264
+ Row: {
8265
+ created_at: string;
8266
+ id: string;
8267
+ order_item_id: string;
8268
+ product_id: string | null;
8269
+ product_name: string;
8270
+ quantity: number;
8271
+ shipment_id: string;
8272
+ updated_at: string;
8273
+ };
8274
+ Insert: {
8275
+ created_at?: string;
8276
+ id?: string;
8277
+ order_item_id: string;
8278
+ product_id?: string | null;
8279
+ product_name: string;
8280
+ quantity: number;
8281
+ shipment_id: string;
8282
+ updated_at?: string;
8283
+ };
8284
+ Update: {
8285
+ created_at?: string;
8286
+ id?: string;
8287
+ order_item_id?: string;
8288
+ product_id?: string | null;
8289
+ product_name?: string;
8290
+ quantity?: number;
8291
+ shipment_id?: string;
8292
+ updated_at?: string;
8293
+ };
8294
+ Relationships: [
8295
+ {
8296
+ foreignKeyName: "order_shipment_items_order_item_id_fkey";
8297
+ columns: ["order_item_id"];
8298
+ isOneToOne: false;
8299
+ referencedRelation: "order_items";
8300
+ referencedColumns: ["id"];
8301
+ },
8302
+ {
8303
+ foreignKeyName: "order_shipment_items_shipment_id_fkey";
8304
+ columns: ["shipment_id"];
8305
+ isOneToOne: false;
8306
+ referencedRelation: "order_shipments";
8307
+ referencedColumns: ["id"];
8308
+ }
8309
+ ];
8310
+ };
8311
+ order_shipments: {
8312
+ Row: {
8313
+ carrier_id: string | null;
8314
+ created_at: string;
8315
+ delivery_date: string | null;
8316
+ delivery_location_id: string | null;
8317
+ id: string;
8318
+ notes: string | null;
8319
+ order_id: string;
8320
+ shipment_number: number;
8321
+ shipped_at: string | null;
8322
+ status: string;
8323
+ updated_at: string;
8324
+ };
8325
+ Insert: {
8326
+ carrier_id?: string | null;
8327
+ created_at?: string;
8328
+ delivery_date?: string | null;
8329
+ delivery_location_id?: string | null;
8330
+ id?: string;
8331
+ notes?: string | null;
8332
+ order_id: string;
8333
+ shipment_number: number;
8334
+ shipped_at?: string | null;
8335
+ status?: string;
8336
+ updated_at?: string;
8337
+ };
8338
+ Update: {
8339
+ carrier_id?: string | null;
8340
+ created_at?: string;
8341
+ delivery_date?: string | null;
8342
+ delivery_location_id?: string | null;
8343
+ id?: string;
8344
+ notes?: string | null;
8345
+ order_id?: string;
8346
+ shipment_number?: number;
8347
+ shipped_at?: string | null;
8348
+ status?: string;
8349
+ updated_at?: string;
8350
+ };
8351
+ Relationships: [
8352
+ {
8353
+ foreignKeyName: "order_shipments_carrier_id_fkey";
8354
+ columns: ["carrier_id"];
8355
+ isOneToOne: false;
8356
+ referencedRelation: "carriers";
8357
+ referencedColumns: ["id"];
8358
+ },
8359
+ {
8360
+ foreignKeyName: "order_shipments_order_id_fkey";
8361
+ columns: ["order_id"];
8362
+ isOneToOne: false;
8363
+ referencedRelation: "orders";
8364
+ referencedColumns: ["id"];
8365
+ }
8366
+ ];
8367
+ };
7614
8368
  orders: {
7615
8369
  Row: {
8370
+ buffer_id: string | null;
7616
8371
  created_at: string;
7617
8372
  custom_fields: Json;
7618
8373
  customer_id: string | null;
7619
8374
  customer_name: string;
7620
8375
  deleted_at: string | null;
7621
- delivery_date: string;
8376
+ delivery_date: string | null;
8377
+ floriday_sales_order_id: string | null;
7622
8378
  id: string;
8379
+ is_reservation: boolean;
7623
8380
  notes: string | null;
7624
8381
  order_date: string;
7625
8382
  order_number: string;
@@ -7631,13 +8388,16 @@ export type Database = {
7631
8388
  updated_at: string;
7632
8389
  };
7633
8390
  Insert: {
8391
+ buffer_id?: string | null;
7634
8392
  created_at?: string;
7635
8393
  custom_fields?: Json;
7636
8394
  customer_id?: string | null;
7637
8395
  customer_name?: string;
7638
8396
  deleted_at?: string | null;
7639
- delivery_date: string;
8397
+ delivery_date?: string | null;
8398
+ floriday_sales_order_id?: string | null;
7640
8399
  id?: string;
8400
+ is_reservation?: boolean;
7641
8401
  notes?: string | null;
7642
8402
  order_date?: string;
7643
8403
  order_number: string;
@@ -7649,13 +8409,16 @@ export type Database = {
7649
8409
  updated_at?: string;
7650
8410
  };
7651
8411
  Update: {
8412
+ buffer_id?: string | null;
7652
8413
  created_at?: string;
7653
8414
  custom_fields?: Json;
7654
8415
  customer_id?: string | null;
7655
8416
  customer_name?: string;
7656
8417
  deleted_at?: string | null;
7657
- delivery_date?: string;
8418
+ delivery_date?: string | null;
8419
+ floriday_sales_order_id?: string | null;
7658
8420
  id?: string;
8421
+ is_reservation?: boolean;
7659
8422
  notes?: string | null;
7660
8423
  order_date?: string;
7661
8424
  order_number?: string;
@@ -7667,6 +8430,13 @@ export type Database = {
7667
8430
  updated_at?: string;
7668
8431
  };
7669
8432
  Relationships: [
8433
+ {
8434
+ foreignKeyName: "orders_buffer_id_fkey";
8435
+ columns: ["buffer_id"];
8436
+ isOneToOne: false;
8437
+ referencedRelation: "order_buffers";
8438
+ referencedColumns: ["id"];
8439
+ },
7670
8440
  {
7671
8441
  foreignKeyName: "orders_customer_id_fkey";
7672
8442
  columns: ["customer_id"];
@@ -7799,6 +8569,53 @@ export type Database = {
7799
8569
  };
7800
8570
  Relationships: [];
7801
8571
  };
8572
+ planning_items: {
8573
+ Row: {
8574
+ assigned_monteur_id: string;
8575
+ created_at: string;
8576
+ created_by: string | null;
8577
+ end_at: string;
8578
+ id: string;
8579
+ notes: string | null;
8580
+ start_at: string;
8581
+ status: Database["public"]["Enums"]["planning_item_status"];
8582
+ updated_at: string;
8583
+ werkbon_id: string;
8584
+ };
8585
+ Insert: {
8586
+ assigned_monteur_id: string;
8587
+ created_at?: string;
8588
+ created_by?: string | null;
8589
+ end_at: string;
8590
+ id?: string;
8591
+ notes?: string | null;
8592
+ start_at: string;
8593
+ status?: Database["public"]["Enums"]["planning_item_status"];
8594
+ updated_at?: string;
8595
+ werkbon_id: string;
8596
+ };
8597
+ Update: {
8598
+ assigned_monteur_id?: string;
8599
+ created_at?: string;
8600
+ created_by?: string | null;
8601
+ end_at?: string;
8602
+ id?: string;
8603
+ notes?: string | null;
8604
+ start_at?: string;
8605
+ status?: Database["public"]["Enums"]["planning_item_status"];
8606
+ updated_at?: string;
8607
+ werkbon_id?: string;
8608
+ };
8609
+ Relationships: [
8610
+ {
8611
+ foreignKeyName: "planning_items_werkbon_id_fkey";
8612
+ columns: ["werkbon_id"];
8613
+ isOneToOne: false;
8614
+ referencedRelation: "werkbonnen";
8615
+ referencedColumns: ["id"];
8616
+ }
8617
+ ];
8618
+ };
7802
8619
  product_categories: {
7803
8620
  Row: {
7804
8621
  color: string;
@@ -7936,6 +8753,8 @@ export type Database = {
7936
8753
  Row: {
7937
8754
  created_at: string;
7938
8755
  description: string | null;
8756
+ head_product_id: string | null;
8757
+ head_trade_item_floriday_id: string | null;
7939
8758
  id: string;
7940
8759
  is_active: boolean;
7941
8760
  name: string;
@@ -7945,6 +8764,8 @@ export type Database = {
7945
8764
  Insert: {
7946
8765
  created_at?: string;
7947
8766
  description?: string | null;
8767
+ head_product_id?: string | null;
8768
+ head_trade_item_floriday_id?: string | null;
7948
8769
  id?: string;
7949
8770
  is_active?: boolean;
7950
8771
  name: string;
@@ -7954,13 +8775,23 @@ export type Database = {
7954
8775
  Update: {
7955
8776
  created_at?: string;
7956
8777
  description?: string | null;
8778
+ head_product_id?: string | null;
8779
+ head_trade_item_floriday_id?: string | null;
7957
8780
  id?: string;
7958
8781
  is_active?: boolean;
7959
8782
  name?: string;
7960
8783
  tenant_id?: string;
7961
8784
  updated_at?: string;
7962
8785
  };
7963
- Relationships: [];
8786
+ Relationships: [
8787
+ {
8788
+ foreignKeyName: "product_groups_head_product_id_fkey";
8789
+ columns: ["head_product_id"];
8790
+ isOneToOne: false;
8791
+ referencedRelation: "products";
8792
+ referencedColumns: ["id"];
8793
+ }
8794
+ ];
7964
8795
  };
7965
8796
  products: {
7966
8797
  Row: {
@@ -10577,6 +11408,7 @@ export type Database = {
10577
11408
  internal_notes: string | null;
10578
11409
  parent_werkbon_id: string | null;
10579
11410
  parsed_payload: Json | null;
11411
+ planning_status: string;
10580
11412
  project_number: string | null;
10581
11413
  room_number: string | null;
10582
11414
  scheduled_end_time: string | null;
@@ -10584,6 +11416,7 @@ export type Database = {
10584
11416
  sequence_number: number;
10585
11417
  source_pdf_path: string | null;
10586
11418
  status: string;
11419
+ technician_id: string | null;
10587
11420
  technician_notes: string | null;
10588
11421
  technician_notes_raw: string | null;
10589
11422
  technician_task_description: string | null;
@@ -10604,6 +11437,7 @@ export type Database = {
10604
11437
  internal_notes?: string | null;
10605
11438
  parent_werkbon_id?: string | null;
10606
11439
  parsed_payload?: Json | null;
11440
+ planning_status?: string;
10607
11441
  project_number?: string | null;
10608
11442
  room_number?: string | null;
10609
11443
  scheduled_end_time?: string | null;
@@ -10611,6 +11445,7 @@ export type Database = {
10611
11445
  sequence_number: number;
10612
11446
  source_pdf_path?: string | null;
10613
11447
  status?: string;
11448
+ technician_id?: string | null;
10614
11449
  technician_notes?: string | null;
10615
11450
  technician_notes_raw?: string | null;
10616
11451
  technician_task_description?: string | null;
@@ -10631,6 +11466,7 @@ export type Database = {
10631
11466
  internal_notes?: string | null;
10632
11467
  parent_werkbon_id?: string | null;
10633
11468
  parsed_payload?: Json | null;
11469
+ planning_status?: string;
10634
11470
  project_number?: string | null;
10635
11471
  room_number?: string | null;
10636
11472
  scheduled_end_time?: string | null;
@@ -10638,6 +11474,7 @@ export type Database = {
10638
11474
  sequence_number?: number;
10639
11475
  source_pdf_path?: string | null;
10640
11476
  status?: string;
11477
+ technician_id?: string | null;
10641
11478
  technician_notes?: string | null;
10642
11479
  technician_notes_raw?: string | null;
10643
11480
  technician_task_description?: string | null;
@@ -10647,17 +11484,17 @@ export type Database = {
10647
11484
  };
10648
11485
  Relationships: [
10649
11486
  {
10650
- foreignKeyName: "werkbonnen_customer_id_fkey";
10651
- columns: ["customer_id"];
11487
+ foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
11488
+ columns: ["parent_werkbon_id"];
10652
11489
  isOneToOne: false;
10653
- referencedRelation: "customers";
11490
+ referencedRelation: "werkbonnen";
10654
11491
  referencedColumns: ["id"];
10655
11492
  },
10656
11493
  {
10657
- foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
10658
- columns: ["parent_werkbon_id"];
11494
+ foreignKeyName: "werkbonnen_technician_id_fkey";
11495
+ columns: ["technician_id"];
10659
11496
  isOneToOne: false;
10660
- referencedRelation: "werkbonnen";
11497
+ referencedRelation: "monteurs";
10661
11498
  referencedColumns: ["id"];
10662
11499
  }
10663
11500
  ];
@@ -11396,6 +12233,21 @@ export type Database = {
11396
12233
  };
11397
12234
  Returns: string;
11398
12235
  };
12236
+ ai_usage_by_module: {
12237
+ Args: {
12238
+ _from: string;
12239
+ _to: string;
12240
+ };
12241
+ Returns: {
12242
+ calls: number;
12243
+ consumer_module_id: string;
12244
+ cost_usd: number;
12245
+ errors: number;
12246
+ input_tokens: number;
12247
+ output_tokens: number;
12248
+ total_tokens: number;
12249
+ }[];
12250
+ };
11399
12251
  apply_stock_consumption: {
11400
12252
  Args: {
11401
12253
  p_order_id: string;
@@ -11544,6 +12396,12 @@ export type Database = {
11544
12396
  Args: never;
11545
12397
  Returns: string;
11546
12398
  };
12399
+ custom_access_token_hook: {
12400
+ Args: {
12401
+ event: Json;
12402
+ };
12403
+ Returns: Json;
12404
+ };
11547
12405
  dashboard_alert_counts: {
11548
12406
  Args: never;
11549
12407
  Returns: Json;
@@ -11879,6 +12737,14 @@ export type Database = {
11879
12737
  };
11880
12738
  Returns: string;
11881
12739
  };
12740
+ has_module_permission: {
12741
+ Args: {
12742
+ _min: string;
12743
+ _module_id: string;
12744
+ _user_id: string;
12745
+ };
12746
+ Returns: boolean;
12747
+ };
11882
12748
  has_role: {
11883
12749
  Args: {
11884
12750
  _role: Database["public"]["Enums"]["app_role"];
@@ -11904,6 +12770,20 @@ export type Database = {
11904
12770
  };
11905
12771
  Returns: boolean;
11906
12772
  };
12773
+ jwt_has_role: {
12774
+ Args: {
12775
+ _role: Database["public"]["Enums"]["app_role"];
12776
+ };
12777
+ Returns: boolean;
12778
+ };
12779
+ list_monteurs: {
12780
+ Args: never;
12781
+ Returns: {
12782
+ display_name: string;
12783
+ email: string;
12784
+ user_id: string;
12785
+ }[];
12786
+ };
11907
12787
  local_effective_price: {
11908
12788
  Args: {
11909
12789
  _customer_id: string;
@@ -11920,6 +12800,22 @@ export type Database = {
11920
12800
  source_id: string;
11921
12801
  }[];
11922
12802
  };
12803
+ log_ai_call: {
12804
+ Args: {
12805
+ _consumer_module_id: string;
12806
+ _cost_usd: number;
12807
+ _duration_ms: number;
12808
+ _error_code: string;
12809
+ _error_message: string;
12810
+ _input_tokens: number;
12811
+ _model_slug: string;
12812
+ _output_tokens: number;
12813
+ _provider_slug: string;
12814
+ _status: string;
12815
+ _total_tokens: number;
12816
+ };
12817
+ Returns: string;
12818
+ };
11923
12819
  mark_offer_clicked: {
11924
12820
  Args: {
11925
12821
  p_code: string;
@@ -11932,6 +12828,12 @@ export type Database = {
11932
12828
  };
11933
12829
  Returns: undefined;
11934
12830
  };
12831
+ mark_shipment_shipped: {
12832
+ Args: {
12833
+ p_shipment_id: string;
12834
+ };
12835
+ Returns: undefined;
12836
+ };
11935
12837
  next_order_number: {
11936
12838
  Args: {
11937
12839
  p_prefix: string;
@@ -12408,9 +13310,12 @@ export type Database = {
12408
13310
  };
12409
13311
  };
12410
13312
  Enums: {
12411
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
13313
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
12412
13314
  exact_env: "staging" | "live";
12413
13315
  exact_push_status: "pending" | "sent" | "error";
13316
+ itk_customer_segment: "Business" | "Private";
13317
+ itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
13318
+ planning_item_status: "gepland" | "bezig" | "afgerond" | "geannuleerd";
12414
13319
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
12415
13320
  };
12416
13321
  CompositeTypes: {
@@ -12470,9 +13375,12 @@ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof Defaul
12470
13375
  export declare const Constants: {
12471
13376
  readonly public: {
12472
13377
  readonly Enums: {
12473
- readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer", "receptie", "monteur"];
13378
+ readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin"];
12474
13379
  readonly exact_env: readonly ["staging", "live"];
12475
13380
  readonly exact_push_status: readonly ["pending", "sent", "error"];
13381
+ readonly itk_customer_segment: readonly ["Business", "Private"];
13382
+ readonly itk_dynamic_field_type: readonly ["text", "select", "date", "checkbox"];
13383
+ readonly planning_item_status: readonly ["gepland", "bezig", "afgerond", "geannuleerd"];
12476
13384
  readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
12477
13385
  };
12478
13386
  };