@flowselections/floriday-klanten-module 1.0.16 → 1.0.17

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 (42) 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/integrations/supabase/auth-middleware.d.ts +886 -54
  5. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  6. package/dist-lib/integrations/supabase/client.d.ts +886 -54
  7. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  8. package/dist-lib/integrations/supabase/client.server.d.ts +886 -54
  9. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  10. package/dist-lib/integrations/supabase/types.d.ts +904 -45
  11. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  12. package/dist-lib/integrations/supabase/types.js +3 -9
  13. package/dist-lib/lib/accounting/twinfield/mapping.d.ts.map +1 -1
  14. package/dist-lib/lib/accounting/twinfield/mapping.js +14 -2
  15. package/dist-lib/lib/accounting/twinfield/worker.functions.d.ts +2538 -42
  16. package/dist-lib/lib/accounting/twinfield/worker.functions.d.ts.map +1 -1
  17. package/dist-lib/lib/accounting.functions.d.ts +2538 -42
  18. package/dist-lib/lib/accounting.functions.d.ts.map +1 -1
  19. package/dist-lib/lib/customer-analytics.functions.d.ts +886 -54
  20. package/dist-lib/lib/customer-analytics.functions.d.ts.map +1 -1
  21. package/dist-lib/lib/customers.functions.d.ts +7614 -126
  22. package/dist-lib/lib/customers.functions.d.ts.map +1 -1
  23. package/dist-lib/lib/delivery-locations.functions.d.ts +3384 -56
  24. package/dist-lib/lib/delivery-locations.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/external-customers.functions.d.ts +3384 -56
  26. package/dist-lib/lib/external-customers.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/floriday-assortment.functions.d.ts +886 -54
  28. package/dist-lib/lib/floriday-assortment.functions.d.ts.map +1 -1
  29. package/dist-lib/lib/floriday-discounts.functions.d.ts +1834 -170
  30. package/dist-lib/lib/floriday-discounts.functions.d.ts.map +1 -1
  31. package/dist-lib/lib/floriday-trade-items.functions.d.ts +886 -54
  32. package/dist-lib/lib/floriday-trade-items.functions.d.ts.map +1 -1
  33. package/dist-lib/lib/local-discounts.functions.d.ts +5922 -98
  34. package/dist-lib/lib/local-discounts.functions.d.ts.map +1 -1
  35. package/dist-lib/lib/overdue-invoices.functions.d.ts +886 -54
  36. package/dist-lib/lib/overdue-invoices.functions.d.ts.map +1 -1
  37. package/dist-lib/lib/price-groups-local.functions.d.ts +5922 -98
  38. package/dist-lib/lib/price-groups-local.functions.d.ts.map +1 -1
  39. package/dist-lib/lib/price-groups.functions.d.ts +886 -54
  40. package/dist-lib/lib/price-groups.functions.d.ts.map +1 -1
  41. package/package.json +3 -2
  42. 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;
@@ -5872,56 +6153,351 @@ export type Database = {
5872
6153
  };
5873
6154
  Relationships: [
5874
6155
  {
5875
- foreignKeyName: "invoice_run_items_booking_id_fkey";
5876
- columns: ["booking_id"];
5877
- isOneToOne: false;
5878
- referencedRelation: "bookings";
5879
- referencedColumns: ["id"];
5880
- },
5881
- {
5882
- foreignKeyName: "invoice_run_items_invoice_run_id_fkey";
5883
- columns: ["invoice_run_id"];
6156
+ foreignKeyName: "invoice_run_items_booking_id_fkey";
6157
+ columns: ["booking_id"];
6158
+ isOneToOne: false;
6159
+ referencedRelation: "bookings";
6160
+ referencedColumns: ["id"];
6161
+ },
6162
+ {
6163
+ foreignKeyName: "invoice_run_items_invoice_run_id_fkey";
6164
+ columns: ["invoice_run_id"];
6165
+ isOneToOne: false;
6166
+ referencedRelation: "invoice_runs";
6167
+ referencedColumns: ["id"];
6168
+ }
6169
+ ];
6170
+ };
6171
+ invoice_runs: {
6172
+ Row: {
6173
+ created_at: string;
6174
+ created_by: string | null;
6175
+ id: string;
6176
+ period_end: string;
6177
+ period_start: string;
6178
+ status: string;
6179
+ total_excl_vat: number | null;
6180
+ total_incl_vat: number | null;
6181
+ vat_amount: number | null;
6182
+ };
6183
+ Insert: {
6184
+ created_at?: string;
6185
+ created_by?: string | null;
6186
+ id?: string;
6187
+ period_end: string;
6188
+ period_start: string;
6189
+ status?: string;
6190
+ total_excl_vat?: number | null;
6191
+ total_incl_vat?: number | null;
6192
+ vat_amount?: number | null;
6193
+ };
6194
+ Update: {
6195
+ created_at?: string;
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"];
5884
6452
  isOneToOne: false;
5885
- referencedRelation: "invoice_runs";
6453
+ referencedRelation: "itk_customers";
5886
6454
  referencedColumns: ["id"];
5887
6455
  }
5888
6456
  ];
5889
6457
  };
5890
- invoice_runs: {
6458
+ leave_requests: {
5891
6459
  Row: {
5892
6460
  created_at: string;
5893
- created_by: string | null;
6461
+ end_date: string;
5894
6462
  id: string;
5895
- period_end: string;
5896
- period_start: string;
6463
+ reason: string | null;
6464
+ start_date: string;
5897
6465
  status: string;
5898
- total_excl_vat: number | null;
5899
- total_incl_vat: number | null;
5900
- vat_amount: number | null;
6466
+ tenant_id: string;
6467
+ updated_at: string;
6468
+ user_id: string;
5901
6469
  };
5902
6470
  Insert: {
5903
6471
  created_at?: string;
5904
- created_by?: string | null;
6472
+ end_date: string;
5905
6473
  id?: string;
5906
- period_end: string;
5907
- period_start: string;
6474
+ reason?: string | null;
6475
+ start_date: string;
5908
6476
  status?: string;
5909
- total_excl_vat?: number | null;
5910
- total_incl_vat?: number | null;
5911
- vat_amount?: number | null;
6477
+ tenant_id?: string;
6478
+ updated_at?: string;
6479
+ user_id: string;
5912
6480
  };
5913
6481
  Update: {
5914
6482
  created_at?: string;
5915
- created_by?: string | null;
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"];
@@ -7936,6 +8706,8 @@ export type Database = {
7936
8706
  Row: {
7937
8707
  created_at: string;
7938
8708
  description: string | null;
8709
+ head_product_id: string | null;
8710
+ head_trade_item_floriday_id: string | null;
7939
8711
  id: string;
7940
8712
  is_active: boolean;
7941
8713
  name: string;
@@ -7945,6 +8717,8 @@ export type Database = {
7945
8717
  Insert: {
7946
8718
  created_at?: string;
7947
8719
  description?: string | null;
8720
+ head_product_id?: string | null;
8721
+ head_trade_item_floriday_id?: string | null;
7948
8722
  id?: string;
7949
8723
  is_active?: boolean;
7950
8724
  name: string;
@@ -7954,13 +8728,23 @@ export type Database = {
7954
8728
  Update: {
7955
8729
  created_at?: string;
7956
8730
  description?: string | null;
8731
+ head_product_id?: string | null;
8732
+ head_trade_item_floriday_id?: string | null;
7957
8733
  id?: string;
7958
8734
  is_active?: boolean;
7959
8735
  name?: string;
7960
8736
  tenant_id?: string;
7961
8737
  updated_at?: string;
7962
8738
  };
7963
- Relationships: [];
8739
+ Relationships: [
8740
+ {
8741
+ foreignKeyName: "product_groups_head_product_id_fkey";
8742
+ columns: ["head_product_id"];
8743
+ isOneToOne: false;
8744
+ referencedRelation: "products";
8745
+ referencedColumns: ["id"];
8746
+ }
8747
+ ];
7964
8748
  };
7965
8749
  products: {
7966
8750
  Row: {
@@ -10577,6 +11361,7 @@ export type Database = {
10577
11361
  internal_notes: string | null;
10578
11362
  parent_werkbon_id: string | null;
10579
11363
  parsed_payload: Json | null;
11364
+ planning_status: string;
10580
11365
  project_number: string | null;
10581
11366
  room_number: string | null;
10582
11367
  scheduled_end_time: string | null;
@@ -10584,6 +11369,7 @@ export type Database = {
10584
11369
  sequence_number: number;
10585
11370
  source_pdf_path: string | null;
10586
11371
  status: string;
11372
+ technician_id: string | null;
10587
11373
  technician_notes: string | null;
10588
11374
  technician_notes_raw: string | null;
10589
11375
  technician_task_description: string | null;
@@ -10604,6 +11390,7 @@ export type Database = {
10604
11390
  internal_notes?: string | null;
10605
11391
  parent_werkbon_id?: string | null;
10606
11392
  parsed_payload?: Json | null;
11393
+ planning_status?: string;
10607
11394
  project_number?: string | null;
10608
11395
  room_number?: string | null;
10609
11396
  scheduled_end_time?: string | null;
@@ -10611,6 +11398,7 @@ export type Database = {
10611
11398
  sequence_number: number;
10612
11399
  source_pdf_path?: string | null;
10613
11400
  status?: string;
11401
+ technician_id?: string | null;
10614
11402
  technician_notes?: string | null;
10615
11403
  technician_notes_raw?: string | null;
10616
11404
  technician_task_description?: string | null;
@@ -10631,6 +11419,7 @@ export type Database = {
10631
11419
  internal_notes?: string | null;
10632
11420
  parent_werkbon_id?: string | null;
10633
11421
  parsed_payload?: Json | null;
11422
+ planning_status?: string;
10634
11423
  project_number?: string | null;
10635
11424
  room_number?: string | null;
10636
11425
  scheduled_end_time?: string | null;
@@ -10638,6 +11427,7 @@ export type Database = {
10638
11427
  sequence_number?: number;
10639
11428
  source_pdf_path?: string | null;
10640
11429
  status?: string;
11430
+ technician_id?: string | null;
10641
11431
  technician_notes?: string | null;
10642
11432
  technician_notes_raw?: string | null;
10643
11433
  technician_task_description?: string | null;
@@ -10647,17 +11437,17 @@ export type Database = {
10647
11437
  };
10648
11438
  Relationships: [
10649
11439
  {
10650
- foreignKeyName: "werkbonnen_customer_id_fkey";
10651
- columns: ["customer_id"];
11440
+ foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
11441
+ columns: ["parent_werkbon_id"];
10652
11442
  isOneToOne: false;
10653
- referencedRelation: "customers";
11443
+ referencedRelation: "werkbonnen";
10654
11444
  referencedColumns: ["id"];
10655
11445
  },
10656
11446
  {
10657
- foreignKeyName: "werkbonnen_parent_werkbon_id_fkey";
10658
- columns: ["parent_werkbon_id"];
11447
+ foreignKeyName: "werkbonnen_technician_id_fkey";
11448
+ columns: ["technician_id"];
10659
11449
  isOneToOne: false;
10660
- referencedRelation: "werkbonnen";
11450
+ referencedRelation: "monteurs";
10661
11451
  referencedColumns: ["id"];
10662
11452
  }
10663
11453
  ];
@@ -11396,6 +12186,21 @@ export type Database = {
11396
12186
  };
11397
12187
  Returns: string;
11398
12188
  };
12189
+ ai_usage_by_module: {
12190
+ Args: {
12191
+ _from: string;
12192
+ _to: string;
12193
+ };
12194
+ Returns: {
12195
+ calls: number;
12196
+ consumer_module_id: string;
12197
+ cost_usd: number;
12198
+ errors: number;
12199
+ input_tokens: number;
12200
+ output_tokens: number;
12201
+ total_tokens: number;
12202
+ }[];
12203
+ };
11399
12204
  apply_stock_consumption: {
11400
12205
  Args: {
11401
12206
  p_order_id: string;
@@ -11544,6 +12349,12 @@ export type Database = {
11544
12349
  Args: never;
11545
12350
  Returns: string;
11546
12351
  };
12352
+ custom_access_token_hook: {
12353
+ Args: {
12354
+ event: Json;
12355
+ };
12356
+ Returns: Json;
12357
+ };
11547
12358
  dashboard_alert_counts: {
11548
12359
  Args: never;
11549
12360
  Returns: Json;
@@ -11879,6 +12690,14 @@ export type Database = {
11879
12690
  };
11880
12691
  Returns: string;
11881
12692
  };
12693
+ has_module_permission: {
12694
+ Args: {
12695
+ _min: string;
12696
+ _module_id: string;
12697
+ _user_id: string;
12698
+ };
12699
+ Returns: boolean;
12700
+ };
11882
12701
  has_role: {
11883
12702
  Args: {
11884
12703
  _role: Database["public"]["Enums"]["app_role"];
@@ -11904,6 +12723,20 @@ export type Database = {
11904
12723
  };
11905
12724
  Returns: boolean;
11906
12725
  };
12726
+ jwt_has_role: {
12727
+ Args: {
12728
+ _role: Database["public"]["Enums"]["app_role"];
12729
+ };
12730
+ Returns: boolean;
12731
+ };
12732
+ list_monteurs: {
12733
+ Args: never;
12734
+ Returns: {
12735
+ display_name: string;
12736
+ email: string;
12737
+ user_id: string;
12738
+ }[];
12739
+ };
11907
12740
  local_effective_price: {
11908
12741
  Args: {
11909
12742
  _customer_id: string;
@@ -11920,6 +12753,22 @@ export type Database = {
11920
12753
  source_id: string;
11921
12754
  }[];
11922
12755
  };
12756
+ log_ai_call: {
12757
+ Args: {
12758
+ _consumer_module_id: string;
12759
+ _cost_usd: number;
12760
+ _duration_ms: number;
12761
+ _error_code: string;
12762
+ _error_message: string;
12763
+ _input_tokens: number;
12764
+ _model_slug: string;
12765
+ _output_tokens: number;
12766
+ _provider_slug: string;
12767
+ _status: string;
12768
+ _total_tokens: number;
12769
+ };
12770
+ Returns: string;
12771
+ };
11923
12772
  mark_offer_clicked: {
11924
12773
  Args: {
11925
12774
  p_code: string;
@@ -11932,6 +12781,12 @@ export type Database = {
11932
12781
  };
11933
12782
  Returns: undefined;
11934
12783
  };
12784
+ mark_shipment_shipped: {
12785
+ Args: {
12786
+ p_shipment_id: string;
12787
+ };
12788
+ Returns: undefined;
12789
+ };
11935
12790
  next_order_number: {
11936
12791
  Args: {
11937
12792
  p_prefix: string;
@@ -12408,9 +13263,11 @@ export type Database = {
12408
13263
  };
12409
13264
  };
12410
13265
  Enums: {
12411
- app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";
13266
+ app_role: "admin" | "planner" | "monteur" | "administratie" | "ai_admin";
12412
13267
  exact_env: "staging" | "live";
12413
13268
  exact_push_status: "pending" | "sent" | "error";
13269
+ itk_customer_segment: "Business" | "Private";
13270
+ itk_dynamic_field_type: "text" | "select" | "date" | "checkbox";
12414
13271
  quote_status: "concept" | "verzonden" | "bekeken" | "in_behandeling" | "geaccepteerd" | "afgewezen" | "verlopen" | "gearchiveerd";
12415
13272
  };
12416
13273
  CompositeTypes: {
@@ -12470,9 +13327,11 @@ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof Defaul
12470
13327
  export declare const Constants: {
12471
13328
  readonly public: {
12472
13329
  readonly Enums: {
12473
- readonly app_role: readonly ["admin", "manager", "warehouse", "sales", "developer", "receptie", "monteur"];
13330
+ readonly app_role: readonly ["admin", "planner", "monteur", "administratie", "ai_admin"];
12474
13331
  readonly exact_env: readonly ["staging", "live"];
12475
13332
  readonly exact_push_status: readonly ["pending", "sent", "error"];
13333
+ readonly itk_customer_segment: readonly ["Business", "Private"];
13334
+ readonly itk_dynamic_field_type: readonly ["text", "select", "date", "checkbox"];
12476
13335
  readonly quote_status: readonly ["concept", "verzonden", "bekeken", "in_behandeling", "geaccepteerd", "afgewezen", "verlopen", "gearchiveerd"];
12477
13336
  };
12478
13337
  };