@flowselections/floriday-afhandeling-module 1.0.14 → 1.0.16

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 (92) hide show
  1. package/dist-lib/components/afhandeling/LeveringenPage.d.ts.map +1 -1
  2. package/dist-lib/components/afhandeling/LeveringenPage.js +2 -2
  3. package/dist-lib/components/afhandeling/PickAgendaView.d.ts.map +1 -1
  4. package/dist-lib/components/afhandeling/PickAgendaView.js +2 -3
  5. package/dist-lib/components/afhandeling/WeekAgendaView.d.ts.map +1 -1
  6. package/dist-lib/components/afhandeling/WeekAgendaView.js +31 -17
  7. package/dist-lib/components/engine/CapaciteitsmaatregelenPage.d.ts +2 -0
  8. package/dist-lib/components/engine/CapaciteitsmaatregelenPage.d.ts.map +1 -0
  9. package/dist-lib/components/engine/CapaciteitsmaatregelenPage.js +40 -0
  10. package/dist-lib/components/engine/CapaciteitsmonitorPage.d.ts +2 -0
  11. package/dist-lib/components/engine/CapaciteitsmonitorPage.d.ts.map +1 -0
  12. package/dist-lib/components/engine/CapaciteitsmonitorPage.js +49 -0
  13. package/dist-lib/components/engine/FormulesPage.d.ts +2 -0
  14. package/dist-lib/components/engine/FormulesPage.d.ts.map +1 -0
  15. package/dist-lib/components/engine/FormulesPage.js +255 -0
  16. package/dist-lib/components/engine/PlaceholderPage.d.ts +6 -0
  17. package/dist-lib/components/engine/PlaceholderPage.d.ts.map +1 -0
  18. package/dist-lib/components/engine/PlaceholderPage.js +6 -0
  19. package/dist-lib/components/engine/StrategieenPage.d.ts +2 -0
  20. package/dist-lib/components/engine/StrategieenPage.d.ts.map +1 -0
  21. package/dist-lib/components/engine/StrategieenPage.js +80 -0
  22. package/dist-lib/components/pickstation/PickstationPage.d.ts.map +1 -1
  23. package/dist-lib/components/pickstation/PickstationPage.js +16 -4
  24. package/dist-lib/hooks/useOrderPlanning.d.ts.map +1 -1
  25. package/dist-lib/hooks/useOrderPlanning.js +37 -3
  26. package/dist-lib/index.d.ts +1 -0
  27. package/dist-lib/index.d.ts.map +1 -1
  28. package/dist-lib/index.js +3 -1
  29. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1558 -262
  30. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  31. package/dist-lib/integrations/supabase/client.d.ts +1558 -262
  32. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  33. package/dist-lib/integrations/supabase/client.server.d.ts +1558 -262
  34. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  35. package/dist-lib/integrations/supabase/types.d.ts +1545 -218
  36. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  37. package/dist-lib/lib/afhandelingSettings.functions.d.ts +3087 -495
  38. package/dist-lib/lib/afhandelingSettings.functions.d.ts.map +1 -1
  39. package/dist-lib/lib/ai-gateway.server.d.ts +2 -0
  40. package/dist-lib/lib/ai-gateway.server.d.ts.map +1 -0
  41. package/dist-lib/lib/ai-gateway.server.js +11 -0
  42. package/dist-lib/lib/authGateway.server.d.ts +16 -0
  43. package/dist-lib/lib/authGateway.server.d.ts.map +1 -0
  44. package/dist-lib/lib/authGateway.server.js +195 -0
  45. package/dist-lib/lib/carriers.functions.d.ts +7680 -1200
  46. package/dist-lib/lib/carriers.functions.d.ts.map +1 -1
  47. package/dist-lib/lib/cartAssignments.functions.d.ts +7680 -1200
  48. package/dist-lib/lib/cartAssignments.functions.d.ts.map +1 -1
  49. package/dist-lib/lib/cartControl.functions.d.ts +16005 -3045
  50. package/dist-lib/lib/cartControl.functions.d.ts.map +1 -1
  51. package/dist-lib/lib/floriday.functions.d.ts +1558 -262
  52. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  53. package/dist-lib/lib/floriday.functions.js +41 -8
  54. package/dist-lib/lib/logisticsEngine/capacity.functions.d.ts +50090 -0
  55. package/dist-lib/lib/logisticsEngine/capacity.functions.d.ts.map +1 -0
  56. package/dist-lib/lib/logisticsEngine/capacity.functions.js +90 -0
  57. package/dist-lib/lib/logisticsEngine/config.d.ts +140 -0
  58. package/dist-lib/lib/logisticsEngine/config.d.ts.map +1 -0
  59. package/dist-lib/lib/logisticsEngine/config.js +488 -0
  60. package/dist-lib/lib/logisticsEngine/enginePickTime.d.ts +29 -0
  61. package/dist-lib/lib/logisticsEngine/enginePickTime.d.ts.map +1 -0
  62. package/dist-lib/lib/logisticsEngine/enginePickTime.js +136 -0
  63. package/dist-lib/lib/logisticsEngine/evaluate.functions.d.ts +12556 -0
  64. package/dist-lib/lib/logisticsEngine/evaluate.functions.d.ts.map +1 -0
  65. package/dist-lib/lib/logisticsEngine/evaluate.functions.js +104 -0
  66. package/dist-lib/lib/logisticsEngine/expression.d.ts +21 -0
  67. package/dist-lib/lib/logisticsEngine/expression.d.ts.map +1 -0
  68. package/dist-lib/lib/logisticsEngine/expression.js +263 -0
  69. package/dist-lib/lib/logisticsEngine/formulas.functions.d.ts +25068 -0
  70. package/dist-lib/lib/logisticsEngine/formulas.functions.d.ts.map +1 -0
  71. package/dist-lib/lib/logisticsEngine/formulas.functions.js +58 -0
  72. package/dist-lib/lib/logisticsEngine/safetyLayer.d.ts +83 -0
  73. package/dist-lib/lib/logisticsEngine/safetyLayer.d.ts.map +1 -0
  74. package/dist-lib/lib/logisticsEngine/safetyLayer.js +182 -0
  75. package/dist-lib/lib/logisticsEngine/strategies.functions.d.ts +100185 -0
  76. package/dist-lib/lib/logisticsEngine/strategies.functions.d.ts.map +1 -0
  77. package/dist-lib/lib/logisticsEngine/strategies.functions.js +176 -0
  78. package/dist-lib/lib/logisticsEngine/variables.d.ts +29 -0
  79. package/dist-lib/lib/logisticsEngine/variables.d.ts.map +1 -0
  80. package/dist-lib/lib/logisticsEngine/variables.js +144 -0
  81. package/dist-lib/lib/logisticsEngine/wizard.functions.d.ts +50096 -0
  82. package/dist-lib/lib/logisticsEngine/wizard.functions.d.ts.map +1 -0
  83. package/dist-lib/lib/logisticsEngine/wizard.functions.js +175 -0
  84. package/dist-lib/lib/pickstationI18n.d.ts +2 -0
  85. package/dist-lib/lib/pickstationI18n.d.ts.map +1 -1
  86. package/dist-lib/lib/pickstationI18n.js +12 -0
  87. package/dist-lib/lib/pickstationOrders.server.d.ts +5 -0
  88. package/dist-lib/lib/pickstationOrders.server.d.ts.map +1 -1
  89. package/dist-lib/lib/pickstationOrders.server.js +29 -0
  90. package/dist-lib/lib/pickstationTypes.d.ts +4 -0
  91. package/dist-lib/lib/pickstationTypes.d.ts.map +1 -1
  92. package/package.json +6 -4
@@ -247,6 +247,172 @@ export type Database = {
247
247
  };
248
248
  Relationships: [];
249
249
  };
250
+ ai_credentials: {
251
+ Row: {
252
+ active: boolean;
253
+ api_key: string;
254
+ created_at: string;
255
+ created_by: string | null;
256
+ id: string;
257
+ label: string;
258
+ provider_id: string;
259
+ updated_at: string;
260
+ };
261
+ Insert: {
262
+ active?: boolean;
263
+ api_key: string;
264
+ created_at?: string;
265
+ created_by?: string | null;
266
+ id?: string;
267
+ label: string;
268
+ provider_id: string;
269
+ updated_at?: string;
270
+ };
271
+ Update: {
272
+ active?: boolean;
273
+ api_key?: string;
274
+ created_at?: string;
275
+ created_by?: string | null;
276
+ id?: string;
277
+ label?: string;
278
+ provider_id?: string;
279
+ updated_at?: string;
280
+ };
281
+ Relationships: [
282
+ {
283
+ foreignKeyName: "ai_credentials_provider_id_fkey";
284
+ columns: ["provider_id"];
285
+ isOneToOne: false;
286
+ referencedRelation: "ai_providers";
287
+ referencedColumns: ["id"];
288
+ }
289
+ ];
290
+ };
291
+ ai_models: {
292
+ Row: {
293
+ active: boolean;
294
+ context_window: number | null;
295
+ created_at: string;
296
+ display_name: string;
297
+ id: string;
298
+ is_default: boolean;
299
+ modality: string;
300
+ provider_id: string;
301
+ slug: string;
302
+ updated_at: string;
303
+ };
304
+ Insert: {
305
+ active?: boolean;
306
+ context_window?: number | null;
307
+ created_at?: string;
308
+ display_name: string;
309
+ id?: string;
310
+ is_default?: boolean;
311
+ modality?: string;
312
+ provider_id: string;
313
+ slug: string;
314
+ updated_at?: string;
315
+ };
316
+ Update: {
317
+ active?: boolean;
318
+ context_window?: number | null;
319
+ created_at?: string;
320
+ display_name?: string;
321
+ id?: string;
322
+ is_default?: boolean;
323
+ modality?: string;
324
+ provider_id?: string;
325
+ slug?: string;
326
+ updated_at?: string;
327
+ };
328
+ Relationships: [
329
+ {
330
+ foreignKeyName: "ai_models_provider_id_fkey";
331
+ columns: ["provider_id"];
332
+ isOneToOne: false;
333
+ referencedRelation: "ai_providers";
334
+ referencedColumns: ["id"];
335
+ }
336
+ ];
337
+ };
338
+ ai_module_bindings: {
339
+ Row: {
340
+ consumer_module_id: string;
341
+ created_at: string;
342
+ credential_id: string;
343
+ id: string;
344
+ model_id: string;
345
+ notes: string | null;
346
+ updated_at: string;
347
+ };
348
+ Insert: {
349
+ consumer_module_id: string;
350
+ created_at?: string;
351
+ credential_id: string;
352
+ id?: string;
353
+ model_id: string;
354
+ notes?: string | null;
355
+ updated_at?: string;
356
+ };
357
+ Update: {
358
+ consumer_module_id?: string;
359
+ created_at?: string;
360
+ credential_id?: string;
361
+ id?: string;
362
+ model_id?: string;
363
+ notes?: string | null;
364
+ updated_at?: string;
365
+ };
366
+ Relationships: [
367
+ {
368
+ foreignKeyName: "ai_module_bindings_credential_id_fkey";
369
+ columns: ["credential_id"];
370
+ isOneToOne: false;
371
+ referencedRelation: "ai_credentials";
372
+ referencedColumns: ["id"];
373
+ },
374
+ {
375
+ foreignKeyName: "ai_module_bindings_model_id_fkey";
376
+ columns: ["model_id"];
377
+ isOneToOne: false;
378
+ referencedRelation: "ai_models";
379
+ referencedColumns: ["id"];
380
+ }
381
+ ];
382
+ };
383
+ ai_providers: {
384
+ Row: {
385
+ active: boolean;
386
+ auth_type: string;
387
+ base_url: string | null;
388
+ created_at: string;
389
+ id: string;
390
+ name: string;
391
+ slug: string;
392
+ updated_at: string;
393
+ };
394
+ Insert: {
395
+ active?: boolean;
396
+ auth_type?: string;
397
+ base_url?: string | null;
398
+ created_at?: string;
399
+ id?: string;
400
+ name: string;
401
+ slug: string;
402
+ updated_at?: string;
403
+ };
404
+ Update: {
405
+ active?: boolean;
406
+ auth_type?: string;
407
+ base_url?: string | null;
408
+ created_at?: string;
409
+ id?: string;
410
+ name?: string;
411
+ slug?: string;
412
+ updated_at?: string;
413
+ };
414
+ Relationships: [];
415
+ };
250
416
  app_settings: {
251
417
  Row: {
252
418
  created_at: string;
@@ -277,6 +443,9 @@ export type Database = {
277
443
  created_at: string;
278
444
  extra_id: string;
279
445
  id: string;
446
+ original_unit_price: number | null;
447
+ override_reason: string | null;
448
+ override_unit_price: number | null;
280
449
  quantity: number;
281
450
  total_price: number;
282
451
  unit_price: number;
@@ -286,6 +455,9 @@ export type Database = {
286
455
  created_at?: string;
287
456
  extra_id: string;
288
457
  id?: string;
458
+ original_unit_price?: number | null;
459
+ override_reason?: string | null;
460
+ override_unit_price?: number | null;
289
461
  quantity?: number;
290
462
  total_price?: number;
291
463
  unit_price?: number;
@@ -295,6 +467,9 @@ export type Database = {
295
467
  created_at?: string;
296
468
  extra_id?: string;
297
469
  id?: string;
470
+ original_unit_price?: number | null;
471
+ override_reason?: string | null;
472
+ override_unit_price?: number | null;
298
473
  quantity?: number;
299
474
  total_price?: number;
300
475
  unit_price?: number;
@@ -318,11 +493,15 @@ export type Database = {
318
493
  };
319
494
  bookings: {
320
495
  Row: {
496
+ archive_reason: string | null;
497
+ archived_at: string | null;
498
+ archived_by: string | null;
321
499
  company_name: string | null;
322
500
  conflict_checked_at: string | null;
323
501
  conflict_reason: string | null;
324
502
  created_at: string;
325
503
  created_by_role: string | null;
504
+ customer_address: string | null;
326
505
  customer_email: string | null;
327
506
  customer_name: string | null;
328
507
  end_time: string;
@@ -334,7 +513,12 @@ export type Database = {
334
513
  invoiced_at: string | null;
335
514
  notes: string | null;
336
515
  number_of_people: number;
516
+ overridden_at: string | null;
517
+ overridden_by: string | null;
518
+ override_reason: string | null;
519
+ price_override: boolean;
337
520
  room_id: string;
521
+ room_price_override: number | null;
338
522
  start_time: string;
339
523
  status: string;
340
524
  total_excl_vat: number | null;
@@ -343,11 +527,15 @@ export type Database = {
343
527
  vat_amount: number | null;
344
528
  };
345
529
  Insert: {
530
+ archive_reason?: string | null;
531
+ archived_at?: string | null;
532
+ archived_by?: string | null;
346
533
  company_name?: string | null;
347
534
  conflict_checked_at?: string | null;
348
535
  conflict_reason?: string | null;
349
536
  created_at?: string;
350
537
  created_by_role?: string | null;
538
+ customer_address?: string | null;
351
539
  customer_email?: string | null;
352
540
  customer_name?: string | null;
353
541
  end_time: string;
@@ -359,7 +547,12 @@ export type Database = {
359
547
  invoiced_at?: string | null;
360
548
  notes?: string | null;
361
549
  number_of_people?: number;
550
+ overridden_at?: string | null;
551
+ overridden_by?: string | null;
552
+ override_reason?: string | null;
553
+ price_override?: boolean;
362
554
  room_id: string;
555
+ room_price_override?: number | null;
363
556
  start_time: string;
364
557
  status?: string;
365
558
  total_excl_vat?: number | null;
@@ -368,11 +561,15 @@ export type Database = {
368
561
  vat_amount?: number | null;
369
562
  };
370
563
  Update: {
564
+ archive_reason?: string | null;
565
+ archived_at?: string | null;
566
+ archived_by?: string | null;
371
567
  company_name?: string | null;
372
568
  conflict_checked_at?: string | null;
373
569
  conflict_reason?: string | null;
374
570
  created_at?: string;
375
571
  created_by_role?: string | null;
572
+ customer_address?: string | null;
376
573
  customer_email?: string | null;
377
574
  customer_name?: string | null;
378
575
  end_time?: string;
@@ -384,7 +581,12 @@ export type Database = {
384
581
  invoiced_at?: string | null;
385
582
  notes?: string | null;
386
583
  number_of_people?: number;
584
+ overridden_at?: string | null;
585
+ overridden_by?: string | null;
586
+ override_reason?: string | null;
587
+ price_override?: boolean;
387
588
  room_id?: string;
589
+ room_price_override?: number | null;
388
590
  start_time?: string;
389
591
  status?: string;
390
592
  total_excl_vat?: number | null;
@@ -849,6 +1051,140 @@ export type Database = {
849
1051
  };
850
1052
  Relationships: [];
851
1053
  };
1054
+ cart_planning_pick_times: {
1055
+ Row: {
1056
+ created_at: string;
1057
+ id: string;
1058
+ pot_size: string;
1059
+ seconds_per_cart: number;
1060
+ updated_at: string;
1061
+ };
1062
+ Insert: {
1063
+ created_at?: string;
1064
+ id?: string;
1065
+ pot_size: string;
1066
+ seconds_per_cart: number;
1067
+ updated_at?: string;
1068
+ };
1069
+ Update: {
1070
+ created_at?: string;
1071
+ id?: string;
1072
+ pot_size?: string;
1073
+ seconds_per_cart?: number;
1074
+ updated_at?: string;
1075
+ };
1076
+ Relationships: [];
1077
+ };
1078
+ cart_planning_product_overrides: {
1079
+ Row: {
1080
+ created_at: string;
1081
+ id: string;
1082
+ max_party_share_per_layer_pct_override: number | null;
1083
+ never_mix: boolean;
1084
+ notes: string | null;
1085
+ product_id: string;
1086
+ updated_at: string;
1087
+ };
1088
+ Insert: {
1089
+ created_at?: string;
1090
+ id?: string;
1091
+ max_party_share_per_layer_pct_override?: number | null;
1092
+ never_mix?: boolean;
1093
+ notes?: string | null;
1094
+ product_id: string;
1095
+ updated_at?: string;
1096
+ };
1097
+ Update: {
1098
+ created_at?: string;
1099
+ id?: string;
1100
+ max_party_share_per_layer_pct_override?: number | null;
1101
+ never_mix?: boolean;
1102
+ notes?: string | null;
1103
+ product_id?: string;
1104
+ updated_at?: string;
1105
+ };
1106
+ Relationships: [
1107
+ {
1108
+ foreignKeyName: "cart_planning_product_overrides_product_id_fkey";
1109
+ columns: ["product_id"];
1110
+ isOneToOne: true;
1111
+ referencedRelation: "products";
1112
+ referencedColumns: ["id"];
1113
+ }
1114
+ ];
1115
+ };
1116
+ cart_planning_settings: {
1117
+ Row: {
1118
+ allow_editing_after_pickstation_send: boolean;
1119
+ buffer_grouping_mode: string;
1120
+ combine_floriday_orders: boolean;
1121
+ combine_floriday_orders_window: string;
1122
+ combine_orders_scope: string;
1123
+ default_workers: number;
1124
+ id: number;
1125
+ max_beladingen_per_layer: number;
1126
+ max_customers_per_cart: number;
1127
+ max_one_customer_per_layer: boolean;
1128
+ max_party_share_per_layer_pct: number;
1129
+ optimization_strategy: string;
1130
+ own_cart_from_layers: number;
1131
+ pick_time_mode: string;
1132
+ plants_per_hour: number;
1133
+ require_same_carrier: boolean;
1134
+ require_same_crate_type: boolean;
1135
+ require_same_delivery_date: boolean;
1136
+ require_same_delivery_location: boolean;
1137
+ updated_at: string;
1138
+ updated_by: string | null;
1139
+ };
1140
+ Insert: {
1141
+ allow_editing_after_pickstation_send?: boolean;
1142
+ buffer_grouping_mode?: string;
1143
+ combine_floriday_orders?: boolean;
1144
+ combine_floriday_orders_window?: string;
1145
+ combine_orders_scope?: string;
1146
+ default_workers?: number;
1147
+ id?: number;
1148
+ max_beladingen_per_layer?: number;
1149
+ max_customers_per_cart?: number;
1150
+ max_one_customer_per_layer?: boolean;
1151
+ max_party_share_per_layer_pct?: number;
1152
+ optimization_strategy?: string;
1153
+ own_cart_from_layers?: number;
1154
+ pick_time_mode?: string;
1155
+ plants_per_hour?: number;
1156
+ require_same_carrier?: boolean;
1157
+ require_same_crate_type?: boolean;
1158
+ require_same_delivery_date?: boolean;
1159
+ require_same_delivery_location?: boolean;
1160
+ updated_at?: string;
1161
+ updated_by?: string | null;
1162
+ };
1163
+ Update: {
1164
+ allow_editing_after_pickstation_send?: boolean;
1165
+ buffer_grouping_mode?: string;
1166
+ combine_floriday_orders?: boolean;
1167
+ combine_floriday_orders_window?: string;
1168
+ combine_orders_scope?: string;
1169
+ default_workers?: number;
1170
+ id?: number;
1171
+ max_beladingen_per_layer?: number;
1172
+ max_customers_per_cart?: number;
1173
+ max_one_customer_per_layer?: boolean;
1174
+ max_party_share_per_layer_pct?: number;
1175
+ optimization_strategy?: string;
1176
+ own_cart_from_layers?: number;
1177
+ pick_time_mode?: string;
1178
+ plants_per_hour?: number;
1179
+ require_same_carrier?: boolean;
1180
+ require_same_crate_type?: boolean;
1181
+ require_same_delivery_date?: boolean;
1182
+ require_same_delivery_location?: boolean;
1183
+ updated_at?: string;
1184
+ updated_by?: string | null;
1185
+ };
1186
+ Relationships: [];
1187
+ };
852
1188
  cart_replan_queue: {
853
1189
  Row: {
854
1190
  attempts: number;
@@ -881,6 +1217,39 @@ export type Database = {
881
1217
  }
882
1218
  ];
883
1219
  };
1220
+ cart_types: {
1221
+ Row: {
1222
+ created_at: string;
1223
+ id: string;
1224
+ is_default: boolean;
1225
+ layer_length_cm: number;
1226
+ layer_width_cm: number;
1227
+ layers_per_cart: number;
1228
+ name: string;
1229
+ updated_at: string;
1230
+ };
1231
+ Insert: {
1232
+ created_at?: string;
1233
+ id?: string;
1234
+ is_default?: boolean;
1235
+ layer_length_cm: number;
1236
+ layer_width_cm: number;
1237
+ layers_per_cart?: number;
1238
+ name: string;
1239
+ updated_at?: string;
1240
+ };
1241
+ Update: {
1242
+ created_at?: string;
1243
+ id?: string;
1244
+ is_default?: boolean;
1245
+ layer_length_cm?: number;
1246
+ layer_width_cm?: number;
1247
+ layers_per_cart?: number;
1248
+ name?: string;
1249
+ updated_at?: string;
1250
+ };
1251
+ Relationships: [];
1252
+ };
884
1253
  collections: {
885
1254
  Row: {
886
1255
  created_at: string;
@@ -905,6 +1274,36 @@ export type Database = {
905
1274
  };
906
1275
  Relationships: [];
907
1276
  };
1277
+ crate_types: {
1278
+ Row: {
1279
+ created_at: string;
1280
+ id: string;
1281
+ length_cm: number;
1282
+ name: string;
1283
+ plants_per_crate: number;
1284
+ updated_at: string;
1285
+ width_cm: number;
1286
+ };
1287
+ Insert: {
1288
+ created_at?: string;
1289
+ id?: string;
1290
+ length_cm: number;
1291
+ name: string;
1292
+ plants_per_crate?: number;
1293
+ updated_at?: string;
1294
+ width_cm: number;
1295
+ };
1296
+ Update: {
1297
+ created_at?: string;
1298
+ id?: string;
1299
+ length_cm?: number;
1300
+ name?: string;
1301
+ plants_per_crate?: number;
1302
+ updated_at?: string;
1303
+ width_cm?: number;
1304
+ };
1305
+ Relationships: [];
1306
+ };
908
1307
  customer_audit_log: {
909
1308
  Row: {
910
1309
  action: string;
@@ -1236,8 +1635,27 @@ export type Database = {
1236
1635
  customers: {
1237
1636
  Row: {
1238
1637
  address: string | null;
1638
+ address_line1: string | null;
1639
+ address_line2: string | null;
1640
+ address_type: string | null;
1641
+ attention_to: string | null;
1642
+ bank_account_holder: string | null;
1643
+ bank_account_number: string | null;
1644
+ bank_address_line1: string | null;
1645
+ bank_address_line2: string | null;
1646
+ bank_bic: string | null;
1647
+ bank_city: string | null;
1648
+ bank_country: string | null;
1649
+ bank_house_number: string | null;
1650
+ bank_iban: string | null;
1651
+ bank_name: string | null;
1652
+ bank_national_code: string | null;
1653
+ bank_postal_code: string | null;
1654
+ bank_state: string | null;
1655
+ billing_email: string | null;
1239
1656
  bio: string | null;
1240
1657
  city: string | null;
1658
+ coc_number: string | null;
1241
1659
  commercial_name: string | null;
1242
1660
  company_name: string;
1243
1661
  connection_status: string;
@@ -1246,21 +1664,28 @@ export type Database = {
1246
1664
  created_at: string;
1247
1665
  custom_fields: Json;
1248
1666
  customer_class: string | null;
1667
+ customer_number: string | null;
1668
+ discount_days: number | null;
1669
+ discount_percentage: number | null;
1249
1670
  email: string | null;
1250
1671
  external_id: string | null;
1672
+ fax: string | null;
1251
1673
  floriday_connection_id: string | null;
1252
1674
  floriday_organization_id: string | null;
1253
1675
  floriday_raw: Json | null;
1254
1676
  gln: string | null;
1255
1677
  house_number: string | null;
1678
+ icp_country_code: string | null;
1256
1679
  id: string;
1257
1680
  is_active: boolean;
1681
+ language: string | null;
1258
1682
  last_synced_at: string | null;
1259
1683
  logo_url: string | null;
1260
1684
  markets: string[];
1261
1685
  notes: string | null;
1262
1686
  organization_type: string | null;
1263
1687
  payment_methods: string[];
1688
+ payment_term_days: number | null;
1264
1689
  phone: string | null;
1265
1690
  postal_code: string | null;
1266
1691
  product_groups: string[];
@@ -1271,13 +1696,33 @@ export type Database = {
1271
1696
  sync_status: string;
1272
1697
  trade_forms: string[];
1273
1698
  updated_at: string;
1699
+ vat_display: string | null;
1274
1700
  vat_number: string | null;
1275
1701
  website: string | null;
1276
1702
  };
1277
1703
  Insert: {
1278
1704
  address?: string | null;
1705
+ address_line1?: string | null;
1706
+ address_line2?: string | null;
1707
+ address_type?: string | null;
1708
+ attention_to?: string | null;
1709
+ bank_account_holder?: string | null;
1710
+ bank_account_number?: string | null;
1711
+ bank_address_line1?: string | null;
1712
+ bank_address_line2?: string | null;
1713
+ bank_bic?: string | null;
1714
+ bank_city?: string | null;
1715
+ bank_country?: string | null;
1716
+ bank_house_number?: string | null;
1717
+ bank_iban?: string | null;
1718
+ bank_name?: string | null;
1719
+ bank_national_code?: string | null;
1720
+ bank_postal_code?: string | null;
1721
+ bank_state?: string | null;
1722
+ billing_email?: string | null;
1279
1723
  bio?: string | null;
1280
1724
  city?: string | null;
1725
+ coc_number?: string | null;
1281
1726
  commercial_name?: string | null;
1282
1727
  company_name: string;
1283
1728
  connection_status?: string;
@@ -1286,21 +1731,28 @@ export type Database = {
1286
1731
  created_at?: string;
1287
1732
  custom_fields?: Json;
1288
1733
  customer_class?: string | null;
1734
+ customer_number?: string | null;
1735
+ discount_days?: number | null;
1736
+ discount_percentage?: number | null;
1289
1737
  email?: string | null;
1290
1738
  external_id?: string | null;
1739
+ fax?: string | null;
1291
1740
  floriday_connection_id?: string | null;
1292
1741
  floriday_organization_id?: string | null;
1293
1742
  floriday_raw?: Json | null;
1294
1743
  gln?: string | null;
1295
1744
  house_number?: string | null;
1745
+ icp_country_code?: string | null;
1296
1746
  id?: string;
1297
1747
  is_active?: boolean;
1748
+ language?: string | null;
1298
1749
  last_synced_at?: string | null;
1299
1750
  logo_url?: string | null;
1300
1751
  markets?: string[];
1301
1752
  notes?: string | null;
1302
1753
  organization_type?: string | null;
1303
1754
  payment_methods?: string[];
1755
+ payment_term_days?: number | null;
1304
1756
  phone?: string | null;
1305
1757
  postal_code?: string | null;
1306
1758
  product_groups?: string[];
@@ -1311,13 +1763,33 @@ export type Database = {
1311
1763
  sync_status?: string;
1312
1764
  trade_forms?: string[];
1313
1765
  updated_at?: string;
1766
+ vat_display?: string | null;
1314
1767
  vat_number?: string | null;
1315
1768
  website?: string | null;
1316
1769
  };
1317
1770
  Update: {
1318
1771
  address?: string | null;
1772
+ address_line1?: string | null;
1773
+ address_line2?: string | null;
1774
+ address_type?: string | null;
1775
+ attention_to?: string | null;
1776
+ bank_account_holder?: string | null;
1777
+ bank_account_number?: string | null;
1778
+ bank_address_line1?: string | null;
1779
+ bank_address_line2?: string | null;
1780
+ bank_bic?: string | null;
1781
+ bank_city?: string | null;
1782
+ bank_country?: string | null;
1783
+ bank_house_number?: string | null;
1784
+ bank_iban?: string | null;
1785
+ bank_name?: string | null;
1786
+ bank_national_code?: string | null;
1787
+ bank_postal_code?: string | null;
1788
+ bank_state?: string | null;
1789
+ billing_email?: string | null;
1319
1790
  bio?: string | null;
1320
1791
  city?: string | null;
1792
+ coc_number?: string | null;
1321
1793
  commercial_name?: string | null;
1322
1794
  company_name?: string;
1323
1795
  connection_status?: string;
@@ -1326,21 +1798,28 @@ export type Database = {
1326
1798
  created_at?: string;
1327
1799
  custom_fields?: Json;
1328
1800
  customer_class?: string | null;
1801
+ customer_number?: string | null;
1802
+ discount_days?: number | null;
1803
+ discount_percentage?: number | null;
1329
1804
  email?: string | null;
1330
1805
  external_id?: string | null;
1806
+ fax?: string | null;
1331
1807
  floriday_connection_id?: string | null;
1332
1808
  floriday_organization_id?: string | null;
1333
1809
  floriday_raw?: Json | null;
1334
1810
  gln?: string | null;
1335
1811
  house_number?: string | null;
1812
+ icp_country_code?: string | null;
1336
1813
  id?: string;
1337
1814
  is_active?: boolean;
1815
+ language?: string | null;
1338
1816
  last_synced_at?: string | null;
1339
1817
  logo_url?: string | null;
1340
1818
  markets?: string[];
1341
1819
  notes?: string | null;
1342
1820
  organization_type?: string | null;
1343
1821
  payment_methods?: string[];
1822
+ payment_term_days?: number | null;
1344
1823
  phone?: string | null;
1345
1824
  postal_code?: string | null;
1346
1825
  product_groups?: string[];
@@ -1351,6 +1830,7 @@ export type Database = {
1351
1830
  sync_status?: string;
1352
1831
  trade_forms?: string[];
1353
1832
  updated_at?: string;
1833
+ vat_display?: string | null;
1354
1834
  vat_number?: string | null;
1355
1835
  website?: string | null;
1356
1836
  };
@@ -3207,110 +3687,7 @@ export type Database = {
3207
3687
  }
3208
3688
  ];
3209
3689
  };
3210
- floriday_agreement_calloffs_cache: {
3211
- Row: {
3212
- agreement_id: string | null;
3213
- connection_id: string;
3214
- data: Json;
3215
- delivery_date: string | null;
3216
- fetched_at: string;
3217
- floriday_id: string;
3218
- id: string;
3219
- is_deleted: boolean;
3220
- sequence_number: number;
3221
- status: string | null;
3222
- updated_at: string;
3223
- };
3224
- Insert: {
3225
- agreement_id?: string | null;
3226
- connection_id: string;
3227
- data?: Json;
3228
- delivery_date?: string | null;
3229
- fetched_at?: string;
3230
- floriday_id: string;
3231
- id?: string;
3232
- is_deleted?: boolean;
3233
- sequence_number?: number;
3234
- status?: string | null;
3235
- updated_at?: string;
3236
- };
3237
- Update: {
3238
- agreement_id?: string | null;
3239
- connection_id?: string;
3240
- data?: Json;
3241
- delivery_date?: string | null;
3242
- fetched_at?: string;
3243
- floriday_id?: string;
3244
- id?: string;
3245
- is_deleted?: boolean;
3246
- sequence_number?: number;
3247
- status?: string | null;
3248
- updated_at?: string;
3249
- };
3250
- Relationships: [
3251
- {
3252
- foreignKeyName: "floriday_agreement_calloffs_cache_connection_id_fkey";
3253
- columns: ["connection_id"];
3254
- isOneToOne: false;
3255
- referencedRelation: "floriday_connections";
3256
- referencedColumns: ["id"];
3257
- }
3258
- ];
3259
- };
3260
- floriday_agreements_cache: {
3261
- Row: {
3262
- buyer_organization_id: string | null;
3263
- connection_id: string;
3264
- data: Json;
3265
- fetched_at: string;
3266
- floriday_id: string;
3267
- id: string;
3268
- is_deleted: boolean;
3269
- sequence_number: number;
3270
- status: string | null;
3271
- updated_at: string;
3272
- valid_from: string | null;
3273
- valid_until: string | null;
3274
- };
3275
- Insert: {
3276
- buyer_organization_id?: string | null;
3277
- connection_id: string;
3278
- data?: Json;
3279
- fetched_at?: string;
3280
- floriday_id: string;
3281
- id?: string;
3282
- is_deleted?: boolean;
3283
- sequence_number?: number;
3284
- status?: string | null;
3285
- updated_at?: string;
3286
- valid_from?: string | null;
3287
- valid_until?: string | null;
3288
- };
3289
- Update: {
3290
- buyer_organization_id?: string | null;
3291
- connection_id?: string;
3292
- data?: Json;
3293
- fetched_at?: string;
3294
- floriday_id?: string;
3295
- id?: string;
3296
- is_deleted?: boolean;
3297
- sequence_number?: number;
3298
- status?: string | null;
3299
- updated_at?: string;
3300
- valid_from?: string | null;
3301
- valid_until?: string | null;
3302
- };
3303
- Relationships: [
3304
- {
3305
- foreignKeyName: "floriday_agreements_cache_connection_id_fkey";
3306
- columns: ["connection_id"];
3307
- isOneToOne: false;
3308
- referencedRelation: "floriday_connections";
3309
- referencedColumns: ["id"];
3310
- }
3311
- ];
3312
- };
3313
- floriday_auction_letters_cache: {
3690
+ floriday_auction_letters_cache: {
3314
3691
  Row: {
3315
3692
  auction_letter_code: string;
3316
3693
  clock_supply_id: string;
@@ -3828,6 +4205,27 @@ export type Database = {
3828
4205
  }
3829
4206
  ];
3830
4207
  };
4208
+ floriday_continuous_stock_cache: {
4209
+ Row: {
4210
+ connection_id: string;
4211
+ fetched_at: string;
4212
+ number_of_pieces: number;
4213
+ trade_item_id: string;
4214
+ };
4215
+ Insert: {
4216
+ connection_id: string;
4217
+ fetched_at?: string;
4218
+ number_of_pieces?: number;
4219
+ trade_item_id: string;
4220
+ };
4221
+ Update: {
4222
+ connection_id?: string;
4223
+ fetched_at?: string;
4224
+ number_of_pieces?: number;
4225
+ trade_item_id?: string;
4226
+ };
4227
+ Relationships: [];
4228
+ };
3831
4229
  floriday_continuous_stock_queue: {
3832
4230
  Row: {
3833
4231
  attempts: number;
@@ -4631,6 +5029,8 @@ export type Database = {
4631
5029
  Row: {
4632
5030
  buyer_organization_id: string | null;
4633
5031
  connection_id: string;
5032
+ controlled_at: string | null;
5033
+ controlled_by: string | null;
4634
5034
  created_at: string;
4635
5035
  data: Json;
4636
5036
  floriday_id: string;
@@ -4642,6 +5042,8 @@ export type Database = {
4642
5042
  Insert: {
4643
5043
  buyer_organization_id?: string | null;
4644
5044
  connection_id: string;
5045
+ controlled_at?: string | null;
5046
+ controlled_by?: string | null;
4645
5047
  created_at?: string;
4646
5048
  data: Json;
4647
5049
  floriday_id: string;
@@ -4653,6 +5055,8 @@ export type Database = {
4653
5055
  Update: {
4654
5056
  buyer_organization_id?: string | null;
4655
5057
  connection_id?: string;
5058
+ controlled_at?: string | null;
5059
+ controlled_by?: string | null;
4656
5060
  created_at?: string;
4657
5061
  data?: Json;
4658
5062
  floriday_id?: string;
@@ -4844,6 +5248,47 @@ export type Database = {
4844
5248
  }
4845
5249
  ];
4846
5250
  };
5251
+ floriday_trade_settings_customers_cache: {
5252
+ Row: {
5253
+ connection_id: string;
5254
+ data: Json;
5255
+ fetched_at: string;
5256
+ floriday_id: string;
5257
+ id: string;
5258
+ is_deleted: boolean;
5259
+ sequence_number: number;
5260
+ updated_at: string;
5261
+ };
5262
+ Insert: {
5263
+ connection_id: string;
5264
+ data: Json;
5265
+ fetched_at?: string;
5266
+ floriday_id: string;
5267
+ id?: string;
5268
+ is_deleted?: boolean;
5269
+ sequence_number?: number;
5270
+ updated_at?: string;
5271
+ };
5272
+ Update: {
5273
+ connection_id?: string;
5274
+ data?: Json;
5275
+ fetched_at?: string;
5276
+ floriday_id?: string;
5277
+ id?: string;
5278
+ is_deleted?: boolean;
5279
+ sequence_number?: number;
5280
+ updated_at?: string;
5281
+ };
5282
+ Relationships: [
5283
+ {
5284
+ foreignKeyName: "floriday_trade_settings_customers_cache_connection_id_fkey";
5285
+ columns: ["connection_id"];
5286
+ isOneToOne: false;
5287
+ referencedRelation: "floriday_connections";
5288
+ referencedColumns: ["id"];
5289
+ }
5290
+ ];
5291
+ };
4847
5292
  floriday_trips_cache: {
4848
5293
  Row: {
4849
5294
  carrier_organization_id: string | null;
@@ -4894,6 +5339,27 @@ export type Database = {
4894
5339
  }
4895
5340
  ];
4896
5341
  };
5342
+ floriday_vbn_required_characteristics: {
5343
+ Row: {
5344
+ required_codes: string[];
5345
+ updated_at: string;
5346
+ updated_by: string | null;
5347
+ vbn_code: string;
5348
+ };
5349
+ Insert: {
5350
+ required_codes?: string[];
5351
+ updated_at?: string;
5352
+ updated_by?: string | null;
5353
+ vbn_code: string;
5354
+ };
5355
+ Update: {
5356
+ required_codes?: string[];
5357
+ updated_at?: string;
5358
+ updated_by?: string | null;
5359
+ vbn_code?: string;
5360
+ };
5361
+ Relationships: [];
5362
+ };
4897
5363
  floriday_warehouses_cache: {
4898
5364
  Row: {
4899
5365
  connection_id: string;
@@ -5624,70 +6090,355 @@ export type Database = {
5624
6090
  };
5625
6091
  Relationships: [];
5626
6092
  };
5627
- mailbox_messages: {
6093
+ logistics_capacity_events: {
5628
6094
  Row: {
5629
- body_html: string | null;
5630
- body_text: string | null;
5631
- connection_id: string | null;
6095
+ available_carts: number;
5632
6096
  created_at: string;
5633
- error_message: string | null;
5634
- external_id: string | null;
5635
- from_email: string | null;
5636
- from_name: string | null;
5637
6097
  id: string;
5638
- message_id: string | null;
5639
- profile_id: string | null;
5640
- raw_size: number | null;
5641
- received_at: string | null;
6098
+ measures: Json;
6099
+ note: string | null;
6100
+ outcome: string;
6101
+ required_carts: number;
6102
+ reserve_minutes: number;
6103
+ shortage_carts: number;
5642
6104
  status: string;
5643
- subject: string | null;
5644
- uid: number | null;
5645
- updated_at: string;
6105
+ user_id: string;
5646
6106
  };
5647
6107
  Insert: {
5648
- body_html?: string | null;
5649
- body_text?: string | null;
5650
- connection_id?: string | null;
6108
+ available_carts?: number;
5651
6109
  created_at?: string;
5652
- error_message?: string | null;
5653
- external_id?: string | null;
5654
- from_email?: string | null;
5655
- from_name?: string | null;
5656
6110
  id?: string;
5657
- message_id?: string | null;
5658
- profile_id?: string | null;
5659
- raw_size?: number | null;
5660
- received_at?: string | null;
5661
- status?: string;
5662
- subject?: string | null;
5663
- uid?: number | null;
5664
- updated_at?: string;
6111
+ measures?: Json;
6112
+ note?: string | null;
6113
+ outcome?: string;
6114
+ required_carts?: number;
6115
+ reserve_minutes?: number;
6116
+ shortage_carts?: number;
6117
+ status: string;
6118
+ user_id: string;
5665
6119
  };
5666
6120
  Update: {
5667
- body_html?: string | null;
5668
- body_text?: string | null;
5669
- connection_id?: string | null;
6121
+ available_carts?: number;
5670
6122
  created_at?: string;
5671
- error_message?: string | null;
5672
- external_id?: string | null;
5673
- from_email?: string | null;
5674
- from_name?: string | null;
5675
6123
  id?: string;
5676
- message_id?: string | null;
5677
- profile_id?: string | null;
5678
- raw_size?: number | null;
5679
- received_at?: string | null;
6124
+ measures?: Json;
6125
+ note?: string | null;
6126
+ outcome?: string;
6127
+ required_carts?: number;
6128
+ reserve_minutes?: number;
6129
+ shortage_carts?: number;
5680
6130
  status?: string;
5681
- subject?: string | null;
5682
- uid?: number | null;
6131
+ user_id?: string;
6132
+ };
6133
+ Relationships: [];
6134
+ };
6135
+ logistics_capacity_settings: {
6136
+ Row: {
6137
+ created_at: string;
6138
+ settings: Json;
6139
+ updated_at: string;
6140
+ user_id: string;
6141
+ };
6142
+ Insert: {
6143
+ created_at?: string;
6144
+ settings?: Json;
6145
+ updated_at?: string;
6146
+ user_id: string;
6147
+ };
6148
+ Update: {
6149
+ created_at?: string;
6150
+ settings?: Json;
5683
6151
  updated_at?: string;
6152
+ user_id?: string;
6153
+ };
6154
+ Relationships: [];
6155
+ };
6156
+ logistics_decisions: {
6157
+ Row: {
6158
+ created_at: string;
6159
+ explanation: string | null;
6160
+ id: string;
6161
+ input_snapshot: Json;
6162
+ result: Json;
6163
+ slot: string;
6164
+ strategy_id: string | null;
6165
+ subject_id: string;
6166
+ subject_type: string;
6167
+ user_id: string;
6168
+ };
6169
+ Insert: {
6170
+ created_at?: string;
6171
+ explanation?: string | null;
6172
+ id?: string;
6173
+ input_snapshot?: Json;
6174
+ result?: Json;
6175
+ slot: string;
6176
+ strategy_id?: string | null;
6177
+ subject_id: string;
6178
+ subject_type: string;
6179
+ user_id: string;
6180
+ };
6181
+ Update: {
6182
+ created_at?: string;
6183
+ explanation?: string | null;
6184
+ id?: string;
6185
+ input_snapshot?: Json;
6186
+ result?: Json;
6187
+ slot?: string;
6188
+ strategy_id?: string | null;
6189
+ subject_id?: string;
6190
+ subject_type?: string;
6191
+ user_id?: string;
5684
6192
  };
5685
6193
  Relationships: [
5686
6194
  {
5687
- foreignKeyName: "mailbox_messages_connection_id_fkey";
5688
- columns: ["connection_id"];
6195
+ foreignKeyName: "logistics_decisions_strategy_id_fkey";
6196
+ columns: ["strategy_id"];
5689
6197
  isOneToOne: false;
5690
- referencedRelation: "email_auth_connections";
6198
+ referencedRelation: "logistics_strategies";
6199
+ referencedColumns: ["id"];
6200
+ }
6201
+ ];
6202
+ };
6203
+ logistics_formulas: {
6204
+ Row: {
6205
+ created_at: string;
6206
+ expression: string;
6207
+ id: string;
6208
+ notes: string | null;
6209
+ slot: string;
6210
+ strategy_id: string;
6211
+ updated_at: string;
6212
+ user_id: string;
6213
+ version: number;
6214
+ };
6215
+ Insert: {
6216
+ created_at?: string;
6217
+ expression?: string;
6218
+ id?: string;
6219
+ notes?: string | null;
6220
+ slot: string;
6221
+ strategy_id: string;
6222
+ updated_at?: string;
6223
+ user_id: string;
6224
+ version?: number;
6225
+ };
6226
+ Update: {
6227
+ created_at?: string;
6228
+ expression?: string;
6229
+ id?: string;
6230
+ notes?: string | null;
6231
+ slot?: string;
6232
+ strategy_id?: string;
6233
+ updated_at?: string;
6234
+ user_id?: string;
6235
+ version?: number;
6236
+ };
6237
+ Relationships: [
6238
+ {
6239
+ foreignKeyName: "logistics_formulas_strategy_id_fkey";
6240
+ columns: ["strategy_id"];
6241
+ isOneToOne: false;
6242
+ referencedRelation: "logistics_strategies";
6243
+ referencedColumns: ["id"];
6244
+ }
6245
+ ];
6246
+ };
6247
+ logistics_strategies: {
6248
+ Row: {
6249
+ color: string;
6250
+ created_at: string;
6251
+ description: string | null;
6252
+ id: string;
6253
+ is_active: boolean;
6254
+ name: string;
6255
+ priority: number;
6256
+ updated_at: string;
6257
+ updated_by: string | null;
6258
+ user_id: string;
6259
+ version: number;
6260
+ };
6261
+ Insert: {
6262
+ color?: string;
6263
+ created_at?: string;
6264
+ description?: string | null;
6265
+ id?: string;
6266
+ is_active?: boolean;
6267
+ name: string;
6268
+ priority?: number;
6269
+ updated_at?: string;
6270
+ updated_by?: string | null;
6271
+ user_id: string;
6272
+ version?: number;
6273
+ };
6274
+ Update: {
6275
+ color?: string;
6276
+ created_at?: string;
6277
+ description?: string | null;
6278
+ id?: string;
6279
+ is_active?: boolean;
6280
+ name?: string;
6281
+ priority?: number;
6282
+ updated_at?: string;
6283
+ updated_by?: string | null;
6284
+ user_id?: string;
6285
+ version?: number;
6286
+ };
6287
+ Relationships: [];
6288
+ };
6289
+ logistics_strategy_schedules: {
6290
+ Row: {
6291
+ condition_expression: string | null;
6292
+ created_at: string;
6293
+ end_date: string | null;
6294
+ id: string;
6295
+ is_enabled: boolean;
6296
+ priority: number;
6297
+ rule_type: string;
6298
+ start_date: string | null;
6299
+ strategy_id: string;
6300
+ updated_at: string;
6301
+ user_id: string;
6302
+ };
6303
+ Insert: {
6304
+ condition_expression?: string | null;
6305
+ created_at?: string;
6306
+ end_date?: string | null;
6307
+ id?: string;
6308
+ is_enabled?: boolean;
6309
+ priority?: number;
6310
+ rule_type: string;
6311
+ start_date?: string | null;
6312
+ strategy_id: string;
6313
+ updated_at?: string;
6314
+ user_id: string;
6315
+ };
6316
+ Update: {
6317
+ condition_expression?: string | null;
6318
+ created_at?: string;
6319
+ end_date?: string | null;
6320
+ id?: string;
6321
+ is_enabled?: boolean;
6322
+ priority?: number;
6323
+ rule_type?: string;
6324
+ start_date?: string | null;
6325
+ strategy_id?: string;
6326
+ updated_at?: string;
6327
+ user_id?: string;
6328
+ };
6329
+ Relationships: [
6330
+ {
6331
+ foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey";
6332
+ columns: ["strategy_id"];
6333
+ isOneToOne: false;
6334
+ referencedRelation: "logistics_strategies";
6335
+ referencedColumns: ["id"];
6336
+ }
6337
+ ];
6338
+ };
6339
+ logistics_variables: {
6340
+ Row: {
6341
+ created_at: string;
6342
+ default_value: string | null;
6343
+ description: string | null;
6344
+ id: string;
6345
+ is_builtin: boolean;
6346
+ key: string;
6347
+ label: string;
6348
+ updated_at: string;
6349
+ user_id: string;
6350
+ value_type: string;
6351
+ };
6352
+ Insert: {
6353
+ created_at?: string;
6354
+ default_value?: string | null;
6355
+ description?: string | null;
6356
+ id?: string;
6357
+ is_builtin?: boolean;
6358
+ key: string;
6359
+ label: string;
6360
+ updated_at?: string;
6361
+ user_id: string;
6362
+ value_type: string;
6363
+ };
6364
+ Update: {
6365
+ created_at?: string;
6366
+ default_value?: string | null;
6367
+ description?: string | null;
6368
+ id?: string;
6369
+ is_builtin?: boolean;
6370
+ key?: string;
6371
+ label?: string;
6372
+ updated_at?: string;
6373
+ user_id?: string;
6374
+ value_type?: string;
6375
+ };
6376
+ Relationships: [];
6377
+ };
6378
+ mailbox_messages: {
6379
+ Row: {
6380
+ body_html: string | null;
6381
+ body_text: string | null;
6382
+ connection_id: string | null;
6383
+ created_at: string;
6384
+ error_message: string | null;
6385
+ external_id: string | null;
6386
+ from_email: string | null;
6387
+ from_name: string | null;
6388
+ id: string;
6389
+ message_id: string | null;
6390
+ profile_id: string | null;
6391
+ raw_size: number | null;
6392
+ received_at: string | null;
6393
+ status: string;
6394
+ subject: string | null;
6395
+ uid: number | null;
6396
+ updated_at: string;
6397
+ };
6398
+ Insert: {
6399
+ body_html?: string | null;
6400
+ body_text?: string | null;
6401
+ connection_id?: string | null;
6402
+ created_at?: string;
6403
+ error_message?: string | null;
6404
+ external_id?: string | null;
6405
+ from_email?: string | null;
6406
+ from_name?: string | null;
6407
+ id?: string;
6408
+ message_id?: string | null;
6409
+ profile_id?: string | null;
6410
+ raw_size?: number | null;
6411
+ received_at?: string | null;
6412
+ status?: string;
6413
+ subject?: string | null;
6414
+ uid?: number | null;
6415
+ updated_at?: string;
6416
+ };
6417
+ Update: {
6418
+ body_html?: string | null;
6419
+ body_text?: string | null;
6420
+ connection_id?: string | null;
6421
+ created_at?: string;
6422
+ error_message?: string | null;
6423
+ external_id?: string | null;
6424
+ from_email?: string | null;
6425
+ from_name?: string | null;
6426
+ id?: string;
6427
+ message_id?: string | null;
6428
+ profile_id?: string | null;
6429
+ raw_size?: number | null;
6430
+ received_at?: string | null;
6431
+ status?: string;
6432
+ subject?: string | null;
6433
+ uid?: number | null;
6434
+ updated_at?: string;
6435
+ };
6436
+ Relationships: [
6437
+ {
6438
+ foreignKeyName: "mailbox_messages_connection_id_fkey";
6439
+ columns: ["connection_id"];
6440
+ isOneToOne: false;
6441
+ referencedRelation: "email_auth_connections";
5691
6442
  referencedColumns: ["id"];
5692
6443
  },
5693
6444
  {
@@ -6036,39 +6787,62 @@ export type Database = {
6036
6787
  };
6037
6788
  manufacture_products: {
6038
6789
  Row: {
6790
+ aantal_te_produceren: number;
6039
6791
  created_at: string;
6040
6792
  description: string | null;
6041
6793
  id: string;
6042
6794
  is_active: boolean;
6795
+ location_id: string | null;
6043
6796
  name: string;
6797
+ partij_nummer: string | null;
6798
+ photos: Json;
6044
6799
  produced_stock: number;
6045
6800
  product_code: string;
6046
6801
  tenant_id: string;
6802
+ unit: string;
6047
6803
  updated_at: string;
6048
6804
  };
6049
6805
  Insert: {
6806
+ aantal_te_produceren?: number;
6050
6807
  created_at?: string;
6051
6808
  description?: string | null;
6052
6809
  id?: string;
6053
6810
  is_active?: boolean;
6811
+ location_id?: string | null;
6054
6812
  name: string;
6813
+ partij_nummer?: string | null;
6814
+ photos?: Json;
6055
6815
  produced_stock?: number;
6056
6816
  product_code: string;
6057
6817
  tenant_id: string;
6818
+ unit?: string;
6058
6819
  updated_at?: string;
6059
6820
  };
6060
6821
  Update: {
6822
+ aantal_te_produceren?: number;
6061
6823
  created_at?: string;
6062
6824
  description?: string | null;
6063
6825
  id?: string;
6064
6826
  is_active?: boolean;
6827
+ location_id?: string | null;
6065
6828
  name?: string;
6829
+ partij_nummer?: string | null;
6830
+ photos?: Json;
6066
6831
  produced_stock?: number;
6067
6832
  product_code?: string;
6068
6833
  tenant_id?: string;
6834
+ unit?: string;
6069
6835
  updated_at?: string;
6070
6836
  };
6071
- Relationships: [];
6837
+ Relationships: [
6838
+ {
6839
+ foreignKeyName: "manufacture_products_location_id_fkey";
6840
+ columns: ["location_id"];
6841
+ isOneToOne: false;
6842
+ referencedRelation: "locations";
6843
+ referencedColumns: ["id"];
6844
+ }
6845
+ ];
6072
6846
  };
6073
6847
  monteurs: {
6074
6848
  Row: {
@@ -6824,6 +7598,42 @@ export type Database = {
6824
7598
  };
6825
7599
  Relationships: [];
6826
7600
  };
7601
+ order_buffers: {
7602
+ Row: {
7603
+ buffer_key: string;
7604
+ created_at: string;
7605
+ customer_id: string | null;
7606
+ grouping_mode: string;
7607
+ id: string;
7608
+ pickup_date: string | null;
7609
+ pickup_location: string | null;
7610
+ plan_locked_at: string | null;
7611
+ updated_at: string;
7612
+ };
7613
+ Insert: {
7614
+ buffer_key: string;
7615
+ created_at?: string;
7616
+ customer_id?: string | null;
7617
+ grouping_mode: string;
7618
+ id?: string;
7619
+ pickup_date?: string | null;
7620
+ pickup_location?: string | null;
7621
+ plan_locked_at?: string | null;
7622
+ updated_at?: string;
7623
+ };
7624
+ Update: {
7625
+ buffer_key?: string;
7626
+ created_at?: string;
7627
+ customer_id?: string | null;
7628
+ grouping_mode?: string;
7629
+ id?: string;
7630
+ pickup_date?: string | null;
7631
+ pickup_location?: string | null;
7632
+ plan_locked_at?: string | null;
7633
+ updated_at?: string;
7634
+ };
7635
+ Relationships: [];
7636
+ };
6827
7637
  order_cart_items: {
6828
7638
  Row: {
6829
7639
  cart_id: string;
@@ -6894,6 +7704,7 @@ export type Database = {
6894
7704
  order_carts: {
6895
7705
  Row: {
6896
7706
  algorithm_version: number;
7707
+ buffer_id: string | null;
6897
7708
  cart_number: number;
6898
7709
  created_at: string;
6899
7710
  id: string;
@@ -6901,13 +7712,14 @@ export type Database = {
6901
7712
  is_complete: boolean;
6902
7713
  notes: string | null;
6903
7714
  occupancy_pct: number;
6904
- order_id: string;
7715
+ order_id: string | null;
6905
7716
  source: string;
6906
7717
  total_layers_used: number;
6907
7718
  updated_at: string;
6908
7719
  };
6909
7720
  Insert: {
6910
7721
  algorithm_version?: number;
7722
+ buffer_id?: string | null;
6911
7723
  cart_number: number;
6912
7724
  created_at?: string;
6913
7725
  id?: string;
@@ -6915,13 +7727,14 @@ export type Database = {
6915
7727
  is_complete?: boolean;
6916
7728
  notes?: string | null;
6917
7729
  occupancy_pct?: number;
6918
- order_id: string;
7730
+ order_id?: string | null;
6919
7731
  source?: string;
6920
7732
  total_layers_used?: number;
6921
7733
  updated_at?: string;
6922
7734
  };
6923
7735
  Update: {
6924
7736
  algorithm_version?: number;
7737
+ buffer_id?: string | null;
6925
7738
  cart_number?: number;
6926
7739
  created_at?: string;
6927
7740
  id?: string;
@@ -6929,12 +7742,19 @@ export type Database = {
6929
7742
  is_complete?: boolean;
6930
7743
  notes?: string | null;
6931
7744
  occupancy_pct?: number;
6932
- order_id?: string;
7745
+ order_id?: string | null;
6933
7746
  source?: string;
6934
7747
  total_layers_used?: number;
6935
7748
  updated_at?: string;
6936
7749
  };
6937
7750
  Relationships: [
7751
+ {
7752
+ foreignKeyName: "order_carts_buffer_id_fkey";
7753
+ columns: ["buffer_id"];
7754
+ isOneToOne: false;
7755
+ referencedRelation: "order_buffers";
7756
+ referencedColumns: ["id"];
7757
+ },
6938
7758
  {
6939
7759
  foreignKeyName: "order_carts_order_id_fkey";
6940
7760
  columns: ["order_id"];
@@ -7078,15 +7898,123 @@ export type Database = {
7078
7898
  };
7079
7899
  Relationships: [];
7080
7900
  };
7901
+ order_shipment_items: {
7902
+ Row: {
7903
+ created_at: string;
7904
+ id: string;
7905
+ order_item_id: string;
7906
+ product_id: string | null;
7907
+ product_name: string;
7908
+ quantity: number;
7909
+ shipment_id: string;
7910
+ updated_at: string;
7911
+ };
7912
+ Insert: {
7913
+ created_at?: string;
7914
+ id?: string;
7915
+ order_item_id: string;
7916
+ product_id?: string | null;
7917
+ product_name: string;
7918
+ quantity: number;
7919
+ shipment_id: string;
7920
+ updated_at?: string;
7921
+ };
7922
+ Update: {
7923
+ created_at?: string;
7924
+ id?: string;
7925
+ order_item_id?: string;
7926
+ product_id?: string | null;
7927
+ product_name?: string;
7928
+ quantity?: number;
7929
+ shipment_id?: string;
7930
+ updated_at?: string;
7931
+ };
7932
+ Relationships: [
7933
+ {
7934
+ foreignKeyName: "order_shipment_items_order_item_id_fkey";
7935
+ columns: ["order_item_id"];
7936
+ isOneToOne: false;
7937
+ referencedRelation: "order_items";
7938
+ referencedColumns: ["id"];
7939
+ },
7940
+ {
7941
+ foreignKeyName: "order_shipment_items_shipment_id_fkey";
7942
+ columns: ["shipment_id"];
7943
+ isOneToOne: false;
7944
+ referencedRelation: "order_shipments";
7945
+ referencedColumns: ["id"];
7946
+ }
7947
+ ];
7948
+ };
7949
+ order_shipments: {
7950
+ Row: {
7951
+ carrier_id: string | null;
7952
+ created_at: string;
7953
+ delivery_date: string | null;
7954
+ delivery_location_id: string | null;
7955
+ id: string;
7956
+ notes: string | null;
7957
+ order_id: string;
7958
+ shipment_number: number;
7959
+ shipped_at: string | null;
7960
+ status: string;
7961
+ updated_at: string;
7962
+ };
7963
+ Insert: {
7964
+ carrier_id?: string | null;
7965
+ created_at?: string;
7966
+ delivery_date?: string | null;
7967
+ delivery_location_id?: string | null;
7968
+ id?: string;
7969
+ notes?: string | null;
7970
+ order_id: string;
7971
+ shipment_number: number;
7972
+ shipped_at?: string | null;
7973
+ status?: string;
7974
+ updated_at?: string;
7975
+ };
7976
+ Update: {
7977
+ carrier_id?: string | null;
7978
+ created_at?: string;
7979
+ delivery_date?: string | null;
7980
+ delivery_location_id?: string | null;
7981
+ id?: string;
7982
+ notes?: string | null;
7983
+ order_id?: string;
7984
+ shipment_number?: number;
7985
+ shipped_at?: string | null;
7986
+ status?: string;
7987
+ updated_at?: string;
7988
+ };
7989
+ Relationships: [
7990
+ {
7991
+ foreignKeyName: "order_shipments_carrier_id_fkey";
7992
+ columns: ["carrier_id"];
7993
+ isOneToOne: false;
7994
+ referencedRelation: "carriers";
7995
+ referencedColumns: ["id"];
7996
+ },
7997
+ {
7998
+ foreignKeyName: "order_shipments_order_id_fkey";
7999
+ columns: ["order_id"];
8000
+ isOneToOne: false;
8001
+ referencedRelation: "orders";
8002
+ referencedColumns: ["id"];
8003
+ }
8004
+ ];
8005
+ };
7081
8006
  orders: {
7082
8007
  Row: {
8008
+ buffer_id: string | null;
7083
8009
  created_at: string;
7084
8010
  custom_fields: Json;
7085
8011
  customer_id: string | null;
7086
8012
  customer_name: string;
7087
8013
  deleted_at: string | null;
7088
- delivery_date: string;
8014
+ delivery_date: string | null;
8015
+ floriday_sales_order_id: string | null;
7089
8016
  id: string;
8017
+ is_reservation: boolean;
7090
8018
  notes: string | null;
7091
8019
  order_date: string;
7092
8020
  order_number: string;
@@ -7098,13 +8026,16 @@ export type Database = {
7098
8026
  updated_at: string;
7099
8027
  };
7100
8028
  Insert: {
8029
+ buffer_id?: string | null;
7101
8030
  created_at?: string;
7102
8031
  custom_fields?: Json;
7103
8032
  customer_id?: string | null;
7104
8033
  customer_name?: string;
7105
8034
  deleted_at?: string | null;
7106
- delivery_date: string;
8035
+ delivery_date?: string | null;
8036
+ floriday_sales_order_id?: string | null;
7107
8037
  id?: string;
8038
+ is_reservation?: boolean;
7108
8039
  notes?: string | null;
7109
8040
  order_date?: string;
7110
8041
  order_number: string;
@@ -7116,13 +8047,16 @@ export type Database = {
7116
8047
  updated_at?: string;
7117
8048
  };
7118
8049
  Update: {
8050
+ buffer_id?: string | null;
7119
8051
  created_at?: string;
7120
8052
  custom_fields?: Json;
7121
8053
  customer_id?: string | null;
7122
8054
  customer_name?: string;
7123
8055
  deleted_at?: string | null;
7124
- delivery_date?: string;
8056
+ delivery_date?: string | null;
8057
+ floriday_sales_order_id?: string | null;
7125
8058
  id?: string;
8059
+ is_reservation?: boolean;
7126
8060
  notes?: string | null;
7127
8061
  order_date?: string;
7128
8062
  order_number?: string;
@@ -7134,6 +8068,13 @@ export type Database = {
7134
8068
  updated_at?: string;
7135
8069
  };
7136
8070
  Relationships: [
8071
+ {
8072
+ foreignKeyName: "orders_buffer_id_fkey";
8073
+ columns: ["buffer_id"];
8074
+ isOneToOne: false;
8075
+ referencedRelation: "order_buffers";
8076
+ referencedColumns: ["id"];
8077
+ },
7137
8078
  {
7138
8079
  foreignKeyName: "orders_customer_id_fkey";
7139
8080
  columns: ["customer_id"];
@@ -7266,6 +8207,69 @@ export type Database = {
7266
8207
  };
7267
8208
  Relationships: [];
7268
8209
  };
8210
+ product_bom_items: {
8211
+ Row: {
8212
+ component_product_id: string | null;
8213
+ component_trade_item_floriday_id: string | null;
8214
+ created_at: string;
8215
+ id: string;
8216
+ notes: string | null;
8217
+ packing_configuration_id: string | null;
8218
+ parent_product_id: string | null;
8219
+ parent_trade_item_floriday_id: string | null;
8220
+ quantity: number;
8221
+ sort_order: number;
8222
+ tenant_id: string;
8223
+ unit: string;
8224
+ updated_at: string;
8225
+ };
8226
+ Insert: {
8227
+ component_product_id?: string | null;
8228
+ component_trade_item_floriday_id?: string | null;
8229
+ created_at?: string;
8230
+ id?: string;
8231
+ notes?: string | null;
8232
+ packing_configuration_id?: string | null;
8233
+ parent_product_id?: string | null;
8234
+ parent_trade_item_floriday_id?: string | null;
8235
+ quantity?: number;
8236
+ sort_order?: number;
8237
+ tenant_id: string;
8238
+ unit?: string;
8239
+ updated_at?: string;
8240
+ };
8241
+ Update: {
8242
+ component_product_id?: string | null;
8243
+ component_trade_item_floriday_id?: string | null;
8244
+ created_at?: string;
8245
+ id?: string;
8246
+ notes?: string | null;
8247
+ packing_configuration_id?: string | null;
8248
+ parent_product_id?: string | null;
8249
+ parent_trade_item_floriday_id?: string | null;
8250
+ quantity?: number;
8251
+ sort_order?: number;
8252
+ tenant_id?: string;
8253
+ unit?: string;
8254
+ updated_at?: string;
8255
+ };
8256
+ Relationships: [
8257
+ {
8258
+ foreignKeyName: "product_bom_items_component_product_id_fkey";
8259
+ columns: ["component_product_id"];
8260
+ isOneToOne: false;
8261
+ referencedRelation: "products";
8262
+ referencedColumns: ["id"];
8263
+ },
8264
+ {
8265
+ foreignKeyName: "product_bom_items_parent_product_id_fkey";
8266
+ columns: ["parent_product_id"];
8267
+ isOneToOne: false;
8268
+ referencedRelation: "products";
8269
+ referencedColumns: ["id"];
8270
+ }
8271
+ ];
8272
+ };
7269
8273
  product_categories: {
7270
8274
  Row: {
7271
8275
  color: string;
@@ -7373,6 +8377,7 @@ export type Database = {
7373
8377
  id: string;
7374
8378
  product_group_id: string;
7375
8379
  quantity: number;
8380
+ sort_order: number;
7376
8381
  trade_item_id: string;
7377
8382
  };
7378
8383
  Insert: {
@@ -7380,6 +8385,7 @@ export type Database = {
7380
8385
  id?: string;
7381
8386
  product_group_id: string;
7382
8387
  quantity?: number;
8388
+ sort_order?: number;
7383
8389
  trade_item_id: string;
7384
8390
  };
7385
8391
  Update: {
@@ -7387,58 +8393,180 @@ export type Database = {
7387
8393
  id?: string;
7388
8394
  product_group_id?: string;
7389
8395
  quantity?: number;
8396
+ sort_order?: number;
7390
8397
  trade_item_id?: string;
7391
8398
  };
7392
8399
  Relationships: [
7393
8400
  {
7394
- foreignKeyName: "product_group_items_product_group_id_fkey";
7395
- columns: ["product_group_id"];
8401
+ foreignKeyName: "product_group_items_product_group_id_fkey";
8402
+ columns: ["product_group_id"];
8403
+ isOneToOne: false;
8404
+ referencedRelation: "product_groups";
8405
+ referencedColumns: ["id"];
8406
+ }
8407
+ ];
8408
+ };
8409
+ product_groups: {
8410
+ Row: {
8411
+ created_at: string;
8412
+ description: string | null;
8413
+ head_product_id: string | null;
8414
+ head_trade_item_floriday_id: string | null;
8415
+ id: string;
8416
+ is_active: boolean;
8417
+ name: string;
8418
+ tenant_id: string;
8419
+ updated_at: string;
8420
+ };
8421
+ Insert: {
8422
+ created_at?: string;
8423
+ description?: string | null;
8424
+ head_product_id?: string | null;
8425
+ head_trade_item_floriday_id?: string | null;
8426
+ id?: string;
8427
+ is_active?: boolean;
8428
+ name: string;
8429
+ tenant_id: string;
8430
+ updated_at?: string;
8431
+ };
8432
+ Update: {
8433
+ created_at?: string;
8434
+ description?: string | null;
8435
+ head_product_id?: string | null;
8436
+ head_trade_item_floriday_id?: string | null;
8437
+ id?: string;
8438
+ is_active?: boolean;
8439
+ name?: string;
8440
+ tenant_id?: string;
8441
+ updated_at?: string;
8442
+ };
8443
+ Relationships: [
8444
+ {
8445
+ foreignKeyName: "product_groups_head_product_id_fkey";
8446
+ columns: ["head_product_id"];
7396
8447
  isOneToOne: false;
7397
- referencedRelation: "product_groups";
8448
+ referencedRelation: "products";
7398
8449
  referencedColumns: ["id"];
7399
8450
  }
7400
8451
  ];
7401
8452
  };
7402
- product_groups: {
8453
+ product_load_settings: {
7403
8454
  Row: {
7404
8455
  created_at: string;
7405
- description: string | null;
7406
8456
  id: string;
7407
- is_active: boolean;
7408
- name: string;
8457
+ is_package: boolean;
8458
+ label: string | null;
8459
+ layers_per_load_carrier: number | null;
8460
+ load_carrier: string | null;
8461
+ package_id: string | null;
8462
+ package_label: string | null;
8463
+ packages_per_layer: number | null;
8464
+ packing_configuration_id: string;
8465
+ product_id: string | null;
7409
8466
  tenant_id: string;
8467
+ trade_item_floriday_id: string | null;
8468
+ units_per_package: number | null;
7410
8469
  updated_at: string;
7411
8470
  };
7412
8471
  Insert: {
7413
8472
  created_at?: string;
7414
- description?: string | null;
7415
8473
  id?: string;
7416
- is_active?: boolean;
7417
- name: string;
8474
+ is_package?: boolean;
8475
+ label?: string | null;
8476
+ layers_per_load_carrier?: number | null;
8477
+ load_carrier?: string | null;
8478
+ package_id?: string | null;
8479
+ package_label?: string | null;
8480
+ packages_per_layer?: number | null;
8481
+ packing_configuration_id?: string;
8482
+ product_id?: string | null;
7418
8483
  tenant_id: string;
8484
+ trade_item_floriday_id?: string | null;
8485
+ units_per_package?: number | null;
7419
8486
  updated_at?: string;
7420
8487
  };
7421
8488
  Update: {
7422
8489
  created_at?: string;
7423
- description?: string | null;
7424
8490
  id?: string;
7425
- is_active?: boolean;
7426
- name?: string;
8491
+ is_package?: boolean;
8492
+ label?: string | null;
8493
+ layers_per_load_carrier?: number | null;
8494
+ load_carrier?: string | null;
8495
+ package_id?: string | null;
8496
+ package_label?: string | null;
8497
+ packages_per_layer?: number | null;
8498
+ packing_configuration_id?: string;
8499
+ product_id?: string | null;
7427
8500
  tenant_id?: string;
8501
+ trade_item_floriday_id?: string | null;
8502
+ units_per_package?: number | null;
7428
8503
  updated_at?: string;
7429
8504
  };
8505
+ Relationships: [
8506
+ {
8507
+ foreignKeyName: "product_load_settings_package_id_fkey";
8508
+ columns: ["package_id"];
8509
+ isOneToOne: false;
8510
+ referencedRelation: "packages";
8511
+ referencedColumns: ["id"];
8512
+ },
8513
+ {
8514
+ foreignKeyName: "product_load_settings_product_id_fkey";
8515
+ columns: ["product_id"];
8516
+ isOneToOne: false;
8517
+ referencedRelation: "products";
8518
+ referencedColumns: ["id"];
8519
+ }
8520
+ ];
8521
+ };
8522
+ product_merge_log: {
8523
+ Row: {
8524
+ canonical_product_id: string | null;
8525
+ id: string;
8526
+ merged_at: string;
8527
+ merged_from_id: string;
8528
+ notes: string | null;
8529
+ snapshot: Json;
8530
+ source_table: string;
8531
+ status: string;
8532
+ };
8533
+ Insert: {
8534
+ canonical_product_id?: string | null;
8535
+ id?: string;
8536
+ merged_at?: string;
8537
+ merged_from_id: string;
8538
+ notes?: string | null;
8539
+ snapshot?: Json;
8540
+ source_table: string;
8541
+ status?: string;
8542
+ };
8543
+ Update: {
8544
+ canonical_product_id?: string | null;
8545
+ id?: string;
8546
+ merged_at?: string;
8547
+ merged_from_id?: string;
8548
+ notes?: string | null;
8549
+ snapshot?: Json;
8550
+ source_table?: string;
8551
+ status?: string;
8552
+ };
7430
8553
  Relationships: [];
7431
8554
  };
7432
8555
  products: {
7433
8556
  Row: {
8557
+ article_number: string | null;
7434
8558
  barcode: string | null;
7435
8559
  batch: string;
7436
8560
  crates_per_layer: number;
7437
8561
  created_at: string;
7438
8562
  custom_fields: Json;
8563
+ floriday_active: boolean;
8564
+ floriday_payload: Json;
8565
+ floriday_trade_item_id: string | null;
7439
8566
  id: string;
7440
8567
  image_url: string | null;
7441
8568
  incoming_quantity: number;
8569
+ is_layer: boolean;
7442
8570
  layers_per_cart: number;
7443
8571
  location: string;
7444
8572
  min_quantity: number;
@@ -7451,17 +8579,24 @@ export type Database = {
7451
8579
  trade_item_key: string | null;
7452
8580
  unit: string;
7453
8581
  updated_at: string;
8582
+ vat_code: string | null;
8583
+ vat_rate: number | null;
7454
8584
  weight: string | null;
7455
8585
  };
7456
8586
  Insert: {
8587
+ article_number?: string | null;
7457
8588
  barcode?: string | null;
7458
8589
  batch: string;
7459
8590
  crates_per_layer?: number;
7460
8591
  created_at?: string;
7461
8592
  custom_fields?: Json;
8593
+ floriday_active?: boolean;
8594
+ floriday_payload?: Json;
8595
+ floriday_trade_item_id?: string | null;
7462
8596
  id?: string;
7463
8597
  image_url?: string | null;
7464
8598
  incoming_quantity?: number;
8599
+ is_layer?: boolean;
7465
8600
  layers_per_cart?: number;
7466
8601
  location: string;
7467
8602
  min_quantity?: number;
@@ -7474,17 +8609,24 @@ export type Database = {
7474
8609
  trade_item_key?: string | null;
7475
8610
  unit?: string;
7476
8611
  updated_at?: string;
8612
+ vat_code?: string | null;
8613
+ vat_rate?: number | null;
7477
8614
  weight?: string | null;
7478
8615
  };
7479
8616
  Update: {
8617
+ article_number?: string | null;
7480
8618
  barcode?: string | null;
7481
8619
  batch?: string;
7482
8620
  crates_per_layer?: number;
7483
8621
  created_at?: string;
7484
8622
  custom_fields?: Json;
8623
+ floriday_active?: boolean;
8624
+ floriday_payload?: Json;
8625
+ floriday_trade_item_id?: string | null;
7485
8626
  id?: string;
7486
8627
  image_url?: string | null;
7487
8628
  incoming_quantity?: number;
8629
+ is_layer?: boolean;
7488
8630
  layers_per_cart?: number;
7489
8631
  location?: string;
7490
8632
  min_quantity?: number;
@@ -7497,12 +8639,15 @@ export type Database = {
7497
8639
  trade_item_key?: string | null;
7498
8640
  unit?: string;
7499
8641
  updated_at?: string;
8642
+ vat_code?: string | null;
8643
+ vat_rate?: number | null;
7500
8644
  weight?: string | null;
7501
8645
  };
7502
8646
  Relationships: [];
7503
8647
  };
7504
8648
  profiles: {
7505
8649
  Row: {
8650
+ address: string | null;
7506
8651
  created_at: string;
7507
8652
  display_name: string | null;
7508
8653
  email: string | null;
@@ -7513,6 +8658,7 @@ export type Database = {
7513
8658
  updated_at: string;
7514
8659
  };
7515
8660
  Insert: {
8661
+ address?: string | null;
7516
8662
  created_at?: string;
7517
8663
  display_name?: string | null;
7518
8664
  email?: string | null;
@@ -7523,6 +8669,7 @@ export type Database = {
7523
8669
  updated_at?: string;
7524
8670
  };
7525
8671
  Update: {
8672
+ address?: string | null;
7526
8673
  created_at?: string;
7527
8674
  display_name?: string | null;
7528
8675
  email?: string | null;
@@ -8419,8 +9566,10 @@ export type Database = {
8419
9566
  order_id: string | null;
8420
9567
  order_item_id: string | null;
8421
9568
  order_source: string | null;
9569
+ parent_trade_item_key: string | null;
8422
9570
  physical_after: number | null;
8423
9571
  physical_before: number | null;
9572
+ production_batch_id: string | null;
8424
9573
  qty_delta: number;
8425
9574
  reason: string | null;
8426
9575
  reserved_after: number | null;
@@ -8436,8 +9585,10 @@ export type Database = {
8436
9585
  order_id?: string | null;
8437
9586
  order_item_id?: string | null;
8438
9587
  order_source?: string | null;
9588
+ parent_trade_item_key?: string | null;
8439
9589
  physical_after?: number | null;
8440
9590
  physical_before?: number | null;
9591
+ production_batch_id?: string | null;
8441
9592
  qty_delta: number;
8442
9593
  reason?: string | null;
8443
9594
  reserved_after?: number | null;
@@ -8453,8 +9604,10 @@ export type Database = {
8453
9604
  order_id?: string | null;
8454
9605
  order_item_id?: string | null;
8455
9606
  order_source?: string | null;
9607
+ parent_trade_item_key?: string | null;
8456
9608
  physical_after?: number | null;
8457
9609
  physical_before?: number | null;
9610
+ production_batch_id?: string | null;
8458
9611
  qty_delta?: number;
8459
9612
  reason?: string | null;
8460
9613
  reserved_after?: number | null;
@@ -8768,6 +9921,48 @@ export type Database = {
8768
9921
  };
8769
9922
  Relationships: [];
8770
9923
  };
9924
+ trade_item_prices: {
9925
+ Row: {
9926
+ created_at: string;
9927
+ currency: string;
9928
+ id: string;
9929
+ last_push_error: string | null;
9930
+ last_pushed_at: string | null;
9931
+ price_group_id: string | null;
9932
+ price_per_piece: number;
9933
+ supply_line_id: string | null;
9934
+ trade_item_key: string;
9935
+ updated_at: string;
9936
+ user_id: string;
9937
+ };
9938
+ Insert: {
9939
+ created_at?: string;
9940
+ currency?: string;
9941
+ id?: string;
9942
+ last_push_error?: string | null;
9943
+ last_pushed_at?: string | null;
9944
+ price_group_id?: string | null;
9945
+ price_per_piece: number;
9946
+ supply_line_id?: string | null;
9947
+ trade_item_key: string;
9948
+ updated_at?: string;
9949
+ user_id: string;
9950
+ };
9951
+ Update: {
9952
+ created_at?: string;
9953
+ currency?: string;
9954
+ id?: string;
9955
+ last_push_error?: string | null;
9956
+ last_pushed_at?: string | null;
9957
+ price_group_id?: string | null;
9958
+ price_per_piece?: number;
9959
+ supply_line_id?: string | null;
9960
+ trade_item_key?: string;
9961
+ updated_at?: string;
9962
+ user_id?: string;
9963
+ };
9964
+ Relationships: [];
9965
+ };
8771
9966
  trade_item_stock: {
8772
9967
  Row: {
8773
9968
  connection_id: string;
@@ -8923,7 +10118,7 @@ export type Database = {
8923
10118
  twinfield_connections: {
8924
10119
  Row: {
8925
10120
  access_token: string | null;
8926
- client_id: string;
10121
+ client_id: string | null;
8927
10122
  client_secret: string | null;
8928
10123
  cluster_uri: string | null;
8929
10124
  company_code: string | null;
@@ -8935,7 +10130,7 @@ export type Database = {
8935
10130
  is_active: boolean;
8936
10131
  label: string | null;
8937
10132
  office_code: string | null;
8938
- redirect_uri: string;
10133
+ redirect_uri: string | null;
8939
10134
  refresh_token: string | null;
8940
10135
  token_expires_at: string | null;
8941
10136
  updated_at: string;
@@ -8943,7 +10138,7 @@ export type Database = {
8943
10138
  };
8944
10139
  Insert: {
8945
10140
  access_token?: string | null;
8946
- client_id: string;
10141
+ client_id?: string | null;
8947
10142
  client_secret?: string | null;
8948
10143
  cluster_uri?: string | null;
8949
10144
  company_code?: string | null;
@@ -8955,7 +10150,7 @@ export type Database = {
8955
10150
  is_active?: boolean;
8956
10151
  label?: string | null;
8957
10152
  office_code?: string | null;
8958
- redirect_uri: string;
10153
+ redirect_uri?: string | null;
8959
10154
  refresh_token?: string | null;
8960
10155
  token_expires_at?: string | null;
8961
10156
  updated_at?: string;
@@ -8963,7 +10158,7 @@ export type Database = {
8963
10158
  };
8964
10159
  Update: {
8965
10160
  access_token?: string | null;
8966
- client_id?: string;
10161
+ client_id?: string | null;
8967
10162
  client_secret?: string | null;
8968
10163
  cluster_uri?: string | null;
8969
10164
  company_code?: string | null;
@@ -8975,7 +10170,7 @@ export type Database = {
8975
10170
  is_active?: boolean;
8976
10171
  label?: string | null;
8977
10172
  office_code?: string | null;
8978
- redirect_uri?: string;
10173
+ redirect_uri?: string | null;
8979
10174
  refresh_token?: string | null;
8980
10175
  token_expires_at?: string | null;
8981
10176
  updated_at?: string;
@@ -10192,25 +11387,6 @@ export type Database = {
10192
11387
  };
10193
11388
  Relationships: [];
10194
11389
  };
10195
- floriday_customer_discounts: {
10196
- Row: {
10197
- base_price: number | null;
10198
- buyer_organization_id: string | null;
10199
- currency: string | null;
10200
- discount_type: string | null;
10201
- discount_value: number | null;
10202
- min_quantity: number | null;
10203
- net_price: number | null;
10204
- product_group_id: string | null;
10205
- raw: Json | null;
10206
- source: string | null;
10207
- source_id: string | null;
10208
- trade_item_id: string | null;
10209
- valid_from: string | null;
10210
- valid_until: string | null;
10211
- };
10212
- Relationships: [];
10213
- };
10214
11390
  local_customer_discounts: {
10215
11391
  Row: {
10216
11392
  base_price: number | null;
@@ -10526,6 +11702,13 @@ export type Database = {
10526
11702
  };
10527
11703
  Returns: number;
10528
11704
  };
11705
+ _migrate_rewrite_stock_key: {
11706
+ Args: {
11707
+ _from_key: string;
11708
+ _to_key: string;
11709
+ };
11710
+ Returns: undefined;
11711
+ };
10529
11712
  afh_city_code: {
10530
11713
  Args: {
10531
11714
  _city: string;
@@ -10609,6 +11792,12 @@ export type Database = {
10609
11792
  processed_items: number;
10610
11793
  }[];
10611
11794
  };
11795
+ calculate_layer_stock: {
11796
+ Args: {
11797
+ p_product_id: string;
11798
+ };
11799
+ Returns: number;
11800
+ };
10612
11801
  call_exact_route: {
10613
11802
  Args: {
10614
11803
  path: string;
@@ -10639,7 +11828,29 @@ export type Database = {
10639
11828
  };
10640
11829
  cleanup_old_bookings: {
10641
11830
  Args: never;
10642
- Returns: number;
11831
+ Returns: undefined;
11832
+ };
11833
+ consume_bom_for_production: {
11834
+ Args: {
11835
+ p_connection_id: string;
11836
+ p_parent_id: string;
11837
+ p_parent_key: string;
11838
+ p_parent_kind: string;
11839
+ p_quantity: number;
11840
+ p_user_id: string;
11841
+ };
11842
+ Returns: Json;
11843
+ } | {
11844
+ Args: {
11845
+ p_batch_id?: string;
11846
+ p_connection_id: string;
11847
+ p_parent_id: string;
11848
+ p_parent_key: string;
11849
+ p_parent_kind: string;
11850
+ p_quantity: number;
11851
+ p_user_id: string;
11852
+ };
11853
+ Returns: Json;
10643
11854
  };
10644
11855
  consume_floriday_rate_limit: {
10645
11856
  Args: {
@@ -10692,6 +11903,13 @@ export type Database = {
10692
11903
  table_name: string;
10693
11904
  }[];
10694
11905
  };
11906
+ delete_samenstelling: {
11907
+ Args: {
11908
+ p_parent_id: string;
11909
+ p_parent_kind: string;
11910
+ };
11911
+ Returns: Json;
11912
+ };
10695
11913
  dispatch_carrier_signups_sql: {
10696
11914
  Args: {
10697
11915
  _catchup?: string;
@@ -10733,6 +11951,16 @@ export type Database = {
10733
11951
  status: string;
10734
11952
  }[];
10735
11953
  };
11954
+ email_auth_upsert_connection: {
11955
+ Args: {
11956
+ _account_email: string;
11957
+ _created_by: string;
11958
+ _is_active: boolean;
11959
+ _provider: string;
11960
+ _status: string;
11961
+ };
11962
+ Returns: string;
11963
+ };
10736
11964
  enqueue_cart_replan_if_unlocked: {
10737
11965
  Args: {
10738
11966
  p_order_id: string;
@@ -10852,19 +12080,6 @@ export type Database = {
10852
12080
  resource: string;
10853
12081
  }[];
10854
12082
  };
10855
- get_floriday_agreements_active: {
10856
- Args: {
10857
- p_on_date?: string;
10858
- };
10859
- Returns: {
10860
- buyer_organization_id: string;
10861
- data: Json;
10862
- floriday_id: string;
10863
- status: string;
10864
- valid_from: string;
10865
- valid_until: string;
10866
- }[];
10867
- };
10868
12083
  get_floriday_clock_supplies_window: {
10869
12084
  Args: {
10870
12085
  p_from: string;
@@ -10937,6 +12152,27 @@ export type Database = {
10937
12152
  minutes_since_success: number;
10938
12153
  }[];
10939
12154
  };
12155
+ get_group_allocation_keys: {
12156
+ Args: {
12157
+ p_product_id: string;
12158
+ };
12159
+ Returns: {
12160
+ k: string;
12161
+ ord: number;
12162
+ }[];
12163
+ };
12164
+ get_group_head_key: {
12165
+ Args: {
12166
+ p_group_id: string;
12167
+ };
12168
+ Returns: string;
12169
+ };
12170
+ get_inventory_stock_for_key: {
12171
+ Args: {
12172
+ p_key: string;
12173
+ };
12174
+ Returns: number;
12175
+ };
10940
12176
  get_offer_by_link_code: {
10941
12177
  Args: {
10942
12178
  p_code: string;
@@ -10967,6 +12203,12 @@ export type Database = {
10967
12203
  };
10968
12204
  Returns: string;
10969
12205
  };
12206
+ get_product_group_available_stock: {
12207
+ Args: {
12208
+ p_group_id: string;
12209
+ };
12210
+ Returns: number;
12211
+ };
10970
12212
  get_room_busy_windows: {
10971
12213
  Args: {
10972
12214
  p_from: string;
@@ -11047,6 +12289,32 @@ export type Database = {
11047
12289
  };
11048
12290
  Returns: undefined;
11049
12291
  };
12292
+ mark_salesorder_controlled: {
12293
+ Args: {
12294
+ p_controlled: boolean;
12295
+ p_floriday_id: string;
12296
+ };
12297
+ Returns: undefined;
12298
+ };
12299
+ mark_shipment_shipped: {
12300
+ Args: {
12301
+ p_shipment_id: string;
12302
+ };
12303
+ Returns: undefined;
12304
+ };
12305
+ merge_products: {
12306
+ Args: {
12307
+ _canonical: string;
12308
+ _loser: string;
12309
+ };
12310
+ Returns: undefined;
12311
+ };
12312
+ next_manufacture_partij: {
12313
+ Args: {
12314
+ _tenant_id: string;
12315
+ };
12316
+ Returns: string;
12317
+ };
11050
12318
  next_order_number: {
11051
12319
  Args: {
11052
12320
  p_prefix: string;
@@ -11116,6 +12384,15 @@ export type Database = {
11116
12384
  };
11117
12385
  Returns: undefined;
11118
12386
  };
12387
+ pickstation_resolve_delivery_orders: {
12388
+ Args: {
12389
+ p_sales_order_ids: string[];
12390
+ };
12391
+ Returns: {
12392
+ delivery_order_id: string;
12393
+ sales_order_id: string;
12394
+ }[];
12395
+ };
11119
12396
  pickstation_set_cart_status: {
11120
12397
  Args: {
11121
12398
  p_cart_index: number;
@@ -11125,6 +12402,14 @@ export type Database = {
11125
12402
  };
11126
12403
  Returns: undefined;
11127
12404
  };
12405
+ produce_designed_product: {
12406
+ Args: {
12407
+ p_parent_id: string;
12408
+ p_parent_kind: string;
12409
+ p_quantity: number;
12410
+ };
12411
+ Returns: Json;
12412
+ };
11128
12413
  promote_trade_item_key: {
11129
12414
  Args: {
11130
12415
  p_new: string;
@@ -11132,6 +12417,10 @@ export type Database = {
11132
12417
  };
11133
12418
  Returns: undefined;
11134
12419
  };
12420
+ recompute_all_reserved_stock: {
12421
+ Args: never;
12422
+ Returns: undefined;
12423
+ };
11135
12424
  recompute_order_status: {
11136
12425
  Args: {
11137
12426
  p_order_id: string;
@@ -11181,27 +12470,45 @@ export type Database = {
11181
12470
  };
11182
12471
  Returns: undefined;
11183
12472
  };
12473
+ resolve_group_allocation: {
12474
+ Args: {
12475
+ _needed: number;
12476
+ _product_group_id: string;
12477
+ };
12478
+ Returns: {
12479
+ allocated: number;
12480
+ trade_item_id: string;
12481
+ }[];
12482
+ };
12483
+ resolve_group_member_stock_key: {
12484
+ Args: {
12485
+ p_trade_item_id: string;
12486
+ };
12487
+ Returns: string;
12488
+ };
11184
12489
  resolve_product_id_for_item: {
11185
12490
  Args: {
11186
12491
  p_product_name: string;
11187
12492
  };
11188
12493
  Returns: string;
11189
12494
  };
11190
- schedule_floriday_additional_services_sync: {
12495
+ resolve_stock_trade_item_key: {
11191
12496
  Args: {
11192
- p_apikey: string;
11193
- p_url: string;
12497
+ p_product_id: string;
11194
12498
  };
11195
- Returns: number;
12499
+ Returns: string;
11196
12500
  };
11197
- schedule_floriday_agreement_calloffs_sync: {
12501
+ reverse_production: {
11198
12502
  Args: {
11199
- p_apikey: string;
11200
- p_url: string;
12503
+ p_connection_id?: string;
12504
+ p_parent_key: string;
12505
+ p_quantity: number;
12506
+ p_reason?: string;
12507
+ p_user_id?: string;
11201
12508
  };
11202
- Returns: number;
12509
+ Returns: Json;
11203
12510
  };
11204
- schedule_floriday_agreements_sync: {
12511
+ schedule_floriday_additional_services_sync: {
11205
12512
  Args: {
11206
12513
  p_apikey: string;
11207
12514
  p_url: string;
@@ -11454,6 +12761,10 @@ export type Database = {
11454
12761
  };
11455
12762
  Returns: number;
11456
12763
  };
12764
+ self_heal_floriday_links: {
12765
+ Args: never;
12766
+ Returns: number;
12767
+ };
11457
12768
  show_limit: {
11458
12769
  Args: never;
11459
12770
  Returns: number;
@@ -11464,18 +12775,34 @@ export type Database = {
11464
12775
  };
11465
12776
  Returns: string[];
11466
12777
  };
12778
+ sync_all_layer_stocks: {
12779
+ Args: never;
12780
+ Returns: undefined;
12781
+ };
11467
12782
  sync_cached_packing_from_product: {
11468
12783
  Args: {
11469
12784
  p_product_id: string;
11470
12785
  };
11471
12786
  Returns: undefined;
11472
12787
  };
12788
+ sync_layer_stock: {
12789
+ Args: {
12790
+ p_product_id: string;
12791
+ };
12792
+ Returns: undefined;
12793
+ };
11473
12794
  sync_order_cart_item_packing_from_product: {
11474
12795
  Args: {
11475
12796
  p_product_id: string;
11476
12797
  };
11477
12798
  Returns: undefined;
11478
12799
  };
12800
+ sync_product_group_belading: {
12801
+ Args: {
12802
+ _group_id: string;
12803
+ };
12804
+ Returns: undefined;
12805
+ };
11479
12806
  sync_product_packing_from_floriday_cache: {
11480
12807
  Args: {
11481
12808
  p_floriday_id: string;