@flowselections/floriday-afhandeling-module 1.0.15 → 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 (91) 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 +252 -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.map +1 -1
  27. package/dist-lib/index.js +2 -1
  28. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1496 -272
  29. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  30. package/dist-lib/integrations/supabase/client.d.ts +1496 -272
  31. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  32. package/dist-lib/integrations/supabase/client.server.d.ts +1496 -272
  33. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  34. package/dist-lib/integrations/supabase/types.d.ts +1523 -266
  35. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  36. package/dist-lib/lib/afhandelingSettings.functions.d.ts +2944 -496
  37. package/dist-lib/lib/afhandelingSettings.functions.d.ts.map +1 -1
  38. package/dist-lib/lib/ai-gateway.server.d.ts +2 -0
  39. package/dist-lib/lib/ai-gateway.server.d.ts.map +1 -0
  40. package/dist-lib/lib/ai-gateway.server.js +11 -0
  41. package/dist-lib/lib/authGateway.server.d.ts +16 -0
  42. package/dist-lib/lib/authGateway.server.d.ts.map +1 -0
  43. package/dist-lib/lib/authGateway.server.js +200 -0
  44. package/dist-lib/lib/carriers.functions.d.ts +7100 -980
  45. package/dist-lib/lib/carriers.functions.d.ts.map +1 -1
  46. package/dist-lib/lib/cartAssignments.functions.d.ts +7100 -980
  47. package/dist-lib/lib/cartAssignments.functions.d.ts.map +1 -1
  48. package/dist-lib/lib/cartControl.functions.d.ts +14630 -2390
  49. package/dist-lib/lib/cartControl.functions.d.ts.map +1 -1
  50. package/dist-lib/lib/floriday.functions.d.ts +1496 -272
  51. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  52. package/dist-lib/lib/floriday.functions.js +41 -8
  53. package/dist-lib/lib/logisticsEngine/capacity.functions.d.ts +50282 -0
  54. package/dist-lib/lib/logisticsEngine/capacity.functions.d.ts.map +1 -0
  55. package/dist-lib/lib/logisticsEngine/capacity.functions.js +90 -0
  56. package/dist-lib/lib/logisticsEngine/config.d.ts +140 -0
  57. package/dist-lib/lib/logisticsEngine/config.d.ts.map +1 -0
  58. package/dist-lib/lib/logisticsEngine/config.js +488 -0
  59. package/dist-lib/lib/logisticsEngine/enginePickTime.d.ts +29 -0
  60. package/dist-lib/lib/logisticsEngine/enginePickTime.d.ts.map +1 -0
  61. package/dist-lib/lib/logisticsEngine/enginePickTime.js +136 -0
  62. package/dist-lib/lib/logisticsEngine/evaluate.functions.d.ts +12604 -0
  63. package/dist-lib/lib/logisticsEngine/evaluate.functions.d.ts.map +1 -0
  64. package/dist-lib/lib/logisticsEngine/evaluate.functions.js +104 -0
  65. package/dist-lib/lib/logisticsEngine/expression.d.ts +21 -0
  66. package/dist-lib/lib/logisticsEngine/expression.d.ts.map +1 -0
  67. package/dist-lib/lib/logisticsEngine/expression.js +263 -0
  68. package/dist-lib/lib/logisticsEngine/formulas.functions.d.ts +25164 -0
  69. package/dist-lib/lib/logisticsEngine/formulas.functions.d.ts.map +1 -0
  70. package/dist-lib/lib/logisticsEngine/formulas.functions.js +58 -0
  71. package/dist-lib/lib/logisticsEngine/safetyLayer.d.ts +83 -0
  72. package/dist-lib/lib/logisticsEngine/safetyLayer.d.ts.map +1 -0
  73. package/dist-lib/lib/logisticsEngine/safetyLayer.js +182 -0
  74. package/dist-lib/lib/logisticsEngine/strategies.functions.d.ts +100569 -0
  75. package/dist-lib/lib/logisticsEngine/strategies.functions.d.ts.map +1 -0
  76. package/dist-lib/lib/logisticsEngine/strategies.functions.js +176 -0
  77. package/dist-lib/lib/logisticsEngine/variables.d.ts +29 -0
  78. package/dist-lib/lib/logisticsEngine/variables.d.ts.map +1 -0
  79. package/dist-lib/lib/logisticsEngine/variables.js +144 -0
  80. package/dist-lib/lib/logisticsEngine/wizard.functions.d.ts +50288 -0
  81. package/dist-lib/lib/logisticsEngine/wizard.functions.d.ts.map +1 -0
  82. package/dist-lib/lib/logisticsEngine/wizard.functions.js +175 -0
  83. package/dist-lib/lib/pickstationI18n.d.ts +2 -0
  84. package/dist-lib/lib/pickstationI18n.d.ts.map +1 -1
  85. package/dist-lib/lib/pickstationI18n.js +12 -0
  86. package/dist-lib/lib/pickstationOrders.server.d.ts +5 -0
  87. package/dist-lib/lib/pickstationOrders.server.d.ts.map +1 -1
  88. package/dist-lib/lib/pickstationOrders.server.js +29 -0
  89. package/dist-lib/lib/pickstationTypes.d.ts +4 -0
  90. package/dist-lib/lib/pickstationTypes.d.ts.map +1 -1
  91. package/package.json +24 -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;
@@ -885,6 +1051,143 @@ export type Database = {
885
1051
  };
886
1052
  Relationships: [];
887
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_day: number;
1133
+ plants_per_hour: number;
1134
+ require_same_carrier: boolean;
1135
+ require_same_crate_type: boolean;
1136
+ require_same_delivery_date: boolean;
1137
+ require_same_delivery_location: boolean;
1138
+ updated_at: string;
1139
+ updated_by: string | null;
1140
+ };
1141
+ Insert: {
1142
+ allow_editing_after_pickstation_send?: boolean;
1143
+ buffer_grouping_mode?: string;
1144
+ combine_floriday_orders?: boolean;
1145
+ combine_floriday_orders_window?: string;
1146
+ combine_orders_scope?: string;
1147
+ default_workers?: number;
1148
+ id?: number;
1149
+ max_beladingen_per_layer?: number;
1150
+ max_customers_per_cart?: number;
1151
+ max_one_customer_per_layer?: boolean;
1152
+ max_party_share_per_layer_pct?: number;
1153
+ optimization_strategy?: string;
1154
+ own_cart_from_layers?: number;
1155
+ pick_time_mode?: string;
1156
+ plants_per_day?: number;
1157
+ plants_per_hour?: number;
1158
+ require_same_carrier?: boolean;
1159
+ require_same_crate_type?: boolean;
1160
+ require_same_delivery_date?: boolean;
1161
+ require_same_delivery_location?: boolean;
1162
+ updated_at?: string;
1163
+ updated_by?: string | null;
1164
+ };
1165
+ Update: {
1166
+ allow_editing_after_pickstation_send?: boolean;
1167
+ buffer_grouping_mode?: string;
1168
+ combine_floriday_orders?: boolean;
1169
+ combine_floriday_orders_window?: string;
1170
+ combine_orders_scope?: string;
1171
+ default_workers?: number;
1172
+ id?: number;
1173
+ max_beladingen_per_layer?: number;
1174
+ max_customers_per_cart?: number;
1175
+ max_one_customer_per_layer?: boolean;
1176
+ max_party_share_per_layer_pct?: number;
1177
+ optimization_strategy?: string;
1178
+ own_cart_from_layers?: number;
1179
+ pick_time_mode?: string;
1180
+ plants_per_day?: number;
1181
+ plants_per_hour?: number;
1182
+ require_same_carrier?: boolean;
1183
+ require_same_crate_type?: boolean;
1184
+ require_same_delivery_date?: boolean;
1185
+ require_same_delivery_location?: boolean;
1186
+ updated_at?: string;
1187
+ updated_by?: string | null;
1188
+ };
1189
+ Relationships: [];
1190
+ };
888
1191
  cart_replan_queue: {
889
1192
  Row: {
890
1193
  attempts: number;
@@ -917,6 +1220,39 @@ export type Database = {
917
1220
  }
918
1221
  ];
919
1222
  };
1223
+ cart_types: {
1224
+ Row: {
1225
+ created_at: string;
1226
+ id: string;
1227
+ is_default: boolean;
1228
+ layer_length_cm: number;
1229
+ layer_width_cm: number;
1230
+ layers_per_cart: number;
1231
+ name: string;
1232
+ updated_at: string;
1233
+ };
1234
+ Insert: {
1235
+ created_at?: string;
1236
+ id?: string;
1237
+ is_default?: boolean;
1238
+ layer_length_cm: number;
1239
+ layer_width_cm: number;
1240
+ layers_per_cart?: number;
1241
+ name: string;
1242
+ updated_at?: string;
1243
+ };
1244
+ Update: {
1245
+ created_at?: string;
1246
+ id?: string;
1247
+ is_default?: boolean;
1248
+ layer_length_cm?: number;
1249
+ layer_width_cm?: number;
1250
+ layers_per_cart?: number;
1251
+ name?: string;
1252
+ updated_at?: string;
1253
+ };
1254
+ Relationships: [];
1255
+ };
920
1256
  collections: {
921
1257
  Row: {
922
1258
  created_at: string;
@@ -941,6 +1277,36 @@ export type Database = {
941
1277
  };
942
1278
  Relationships: [];
943
1279
  };
1280
+ crate_types: {
1281
+ Row: {
1282
+ created_at: string;
1283
+ id: string;
1284
+ length_cm: number;
1285
+ name: string;
1286
+ plants_per_crate: number;
1287
+ updated_at: string;
1288
+ width_cm: number;
1289
+ };
1290
+ Insert: {
1291
+ created_at?: string;
1292
+ id?: string;
1293
+ length_cm: number;
1294
+ name: string;
1295
+ plants_per_crate?: number;
1296
+ updated_at?: string;
1297
+ width_cm: number;
1298
+ };
1299
+ Update: {
1300
+ created_at?: string;
1301
+ id?: string;
1302
+ length_cm?: number;
1303
+ name?: string;
1304
+ plants_per_crate?: number;
1305
+ updated_at?: string;
1306
+ width_cm?: number;
1307
+ };
1308
+ Relationships: [];
1309
+ };
944
1310
  customer_audit_log: {
945
1311
  Row: {
946
1312
  action: string;
@@ -3324,122 +3690,19 @@ export type Database = {
3324
3690
  }
3325
3691
  ];
3326
3692
  };
3327
- floriday_agreement_calloffs_cache: {
3693
+ floriday_auction_letters_cache: {
3328
3694
  Row: {
3329
- agreement_id: string | null;
3695
+ auction_letter_code: string;
3696
+ clock_supply_id: string;
3330
3697
  connection_id: string;
3331
- data: Json;
3332
- delivery_date: string | null;
3698
+ content_type: string;
3333
3699
  fetched_at: string;
3334
- floriday_id: string;
3335
3700
  id: string;
3336
- is_deleted: boolean;
3337
- sequence_number: number;
3338
- status: string | null;
3339
- updated_at: string;
3701
+ storage_path: string;
3340
3702
  };
3341
3703
  Insert: {
3342
- agreement_id?: string | null;
3343
- connection_id: string;
3344
- data?: Json;
3345
- delivery_date?: string | null;
3346
- fetched_at?: string;
3347
- floriday_id: string;
3348
- id?: string;
3349
- is_deleted?: boolean;
3350
- sequence_number?: number;
3351
- status?: string | null;
3352
- updated_at?: string;
3353
- };
3354
- Update: {
3355
- agreement_id?: string | null;
3356
- connection_id?: string;
3357
- data?: Json;
3358
- delivery_date?: string | null;
3359
- fetched_at?: string;
3360
- floriday_id?: string;
3361
- id?: string;
3362
- is_deleted?: boolean;
3363
- sequence_number?: number;
3364
- status?: string | null;
3365
- updated_at?: string;
3366
- };
3367
- Relationships: [
3368
- {
3369
- foreignKeyName: "floriday_agreement_calloffs_cache_connection_id_fkey";
3370
- columns: ["connection_id"];
3371
- isOneToOne: false;
3372
- referencedRelation: "floriday_connections";
3373
- referencedColumns: ["id"];
3374
- }
3375
- ];
3376
- };
3377
- floriday_agreements_cache: {
3378
- Row: {
3379
- buyer_organization_id: string | null;
3380
- connection_id: string;
3381
- data: Json;
3382
- fetched_at: string;
3383
- floriday_id: string;
3384
- id: string;
3385
- is_deleted: boolean;
3386
- sequence_number: number;
3387
- status: string | null;
3388
- updated_at: string;
3389
- valid_from: string | null;
3390
- valid_until: string | null;
3391
- };
3392
- Insert: {
3393
- buyer_organization_id?: string | null;
3394
- connection_id: string;
3395
- data?: Json;
3396
- fetched_at?: string;
3397
- floriday_id: string;
3398
- id?: string;
3399
- is_deleted?: boolean;
3400
- sequence_number?: number;
3401
- status?: string | null;
3402
- updated_at?: string;
3403
- valid_from?: string | null;
3404
- valid_until?: string | null;
3405
- };
3406
- Update: {
3407
- buyer_organization_id?: string | null;
3408
- connection_id?: string;
3409
- data?: Json;
3410
- fetched_at?: string;
3411
- floriday_id?: string;
3412
- id?: string;
3413
- is_deleted?: boolean;
3414
- sequence_number?: number;
3415
- status?: string | null;
3416
- updated_at?: string;
3417
- valid_from?: string | null;
3418
- valid_until?: string | null;
3419
- };
3420
- Relationships: [
3421
- {
3422
- foreignKeyName: "floriday_agreements_cache_connection_id_fkey";
3423
- columns: ["connection_id"];
3424
- isOneToOne: false;
3425
- referencedRelation: "floriday_connections";
3426
- referencedColumns: ["id"];
3427
- }
3428
- ];
3429
- };
3430
- floriday_auction_letters_cache: {
3431
- Row: {
3432
- auction_letter_code: string;
3433
- clock_supply_id: string;
3434
- connection_id: string;
3435
- content_type: string;
3436
- fetched_at: string;
3437
- id: string;
3438
- storage_path: string;
3439
- };
3440
- Insert: {
3441
- auction_letter_code: string;
3442
- clock_supply_id: string;
3704
+ auction_letter_code: string;
3705
+ clock_supply_id: string;
3443
3706
  connection_id: string;
3444
3707
  content_type?: string;
3445
3708
  fetched_at?: string;
@@ -3945,6 +4208,27 @@ export type Database = {
3945
4208
  }
3946
4209
  ];
3947
4210
  };
4211
+ floriday_continuous_stock_cache: {
4212
+ Row: {
4213
+ connection_id: string;
4214
+ fetched_at: string;
4215
+ number_of_pieces: number;
4216
+ trade_item_id: string;
4217
+ };
4218
+ Insert: {
4219
+ connection_id: string;
4220
+ fetched_at?: string;
4221
+ number_of_pieces?: number;
4222
+ trade_item_id: string;
4223
+ };
4224
+ Update: {
4225
+ connection_id?: string;
4226
+ fetched_at?: string;
4227
+ number_of_pieces?: number;
4228
+ trade_item_id?: string;
4229
+ };
4230
+ Relationships: [];
4231
+ };
3948
4232
  floriday_continuous_stock_queue: {
3949
4233
  Row: {
3950
4234
  attempts: number;
@@ -4748,6 +5032,8 @@ export type Database = {
4748
5032
  Row: {
4749
5033
  buyer_organization_id: string | null;
4750
5034
  connection_id: string;
5035
+ controlled_at: string | null;
5036
+ controlled_by: string | null;
4751
5037
  created_at: string;
4752
5038
  data: Json;
4753
5039
  floriday_id: string;
@@ -4759,6 +5045,8 @@ export type Database = {
4759
5045
  Insert: {
4760
5046
  buyer_organization_id?: string | null;
4761
5047
  connection_id: string;
5048
+ controlled_at?: string | null;
5049
+ controlled_by?: string | null;
4762
5050
  created_at?: string;
4763
5051
  data: Json;
4764
5052
  floriday_id: string;
@@ -4770,6 +5058,8 @@ export type Database = {
4770
5058
  Update: {
4771
5059
  buyer_organization_id?: string | null;
4772
5060
  connection_id?: string;
5061
+ controlled_at?: string | null;
5062
+ controlled_by?: string | null;
4773
5063
  created_at?: string;
4774
5064
  data?: Json;
4775
5065
  floriday_id?: string;
@@ -4961,6 +5251,47 @@ export type Database = {
4961
5251
  }
4962
5252
  ];
4963
5253
  };
5254
+ floriday_trade_settings_customers_cache: {
5255
+ Row: {
5256
+ connection_id: string;
5257
+ data: Json;
5258
+ fetched_at: string;
5259
+ floriday_id: string;
5260
+ id: string;
5261
+ is_deleted: boolean;
5262
+ sequence_number: number;
5263
+ updated_at: string;
5264
+ };
5265
+ Insert: {
5266
+ connection_id: string;
5267
+ data: Json;
5268
+ fetched_at?: string;
5269
+ floriday_id: string;
5270
+ id?: string;
5271
+ is_deleted?: boolean;
5272
+ sequence_number?: number;
5273
+ updated_at?: string;
5274
+ };
5275
+ Update: {
5276
+ connection_id?: string;
5277
+ data?: Json;
5278
+ fetched_at?: string;
5279
+ floriday_id?: string;
5280
+ id?: string;
5281
+ is_deleted?: boolean;
5282
+ sequence_number?: number;
5283
+ updated_at?: string;
5284
+ };
5285
+ Relationships: [
5286
+ {
5287
+ foreignKeyName: "floriday_trade_settings_customers_cache_connection_id_fkey";
5288
+ columns: ["connection_id"];
5289
+ isOneToOne: false;
5290
+ referencedRelation: "floriday_connections";
5291
+ referencedColumns: ["id"];
5292
+ }
5293
+ ];
5294
+ };
4964
5295
  floriday_trips_cache: {
4965
5296
  Row: {
4966
5297
  carrier_organization_id: string | null;
@@ -5011,6 +5342,27 @@ export type Database = {
5011
5342
  }
5012
5343
  ];
5013
5344
  };
5345
+ floriday_vbn_required_characteristics: {
5346
+ Row: {
5347
+ required_codes: string[];
5348
+ updated_at: string;
5349
+ updated_by: string | null;
5350
+ vbn_code: string;
5351
+ };
5352
+ Insert: {
5353
+ required_codes?: string[];
5354
+ updated_at?: string;
5355
+ updated_by?: string | null;
5356
+ vbn_code: string;
5357
+ };
5358
+ Update: {
5359
+ required_codes?: string[];
5360
+ updated_at?: string;
5361
+ updated_by?: string | null;
5362
+ vbn_code?: string;
5363
+ };
5364
+ Relationships: [];
5365
+ };
5014
5366
  floriday_warehouses_cache: {
5015
5367
  Row: {
5016
5368
  connection_id: string;
@@ -5741,109 +6093,394 @@ export type Database = {
5741
6093
  };
5742
6094
  Relationships: [];
5743
6095
  };
5744
- mailbox_messages: {
6096
+ logistics_capacity_events: {
5745
6097
  Row: {
5746
- body_html: string | null;
5747
- body_text: string | null;
5748
- connection_id: string | null;
6098
+ available_carts: number;
5749
6099
  created_at: string;
5750
- error_message: string | null;
5751
- external_id: string | null;
5752
- from_email: string | null;
5753
- from_name: string | null;
5754
6100
  id: string;
5755
- message_id: string | null;
5756
- profile_id: string | null;
5757
- raw_size: number | null;
5758
- received_at: string | null;
6101
+ measures: Json;
6102
+ note: string | null;
6103
+ outcome: string;
6104
+ required_carts: number;
6105
+ reserve_minutes: number;
6106
+ shortage_carts: number;
5759
6107
  status: string;
5760
- subject: string | null;
5761
- uid: number | null;
5762
- updated_at: string;
6108
+ user_id: string;
5763
6109
  };
5764
6110
  Insert: {
5765
- body_html?: string | null;
5766
- body_text?: string | null;
5767
- connection_id?: string | null;
6111
+ available_carts?: number;
5768
6112
  created_at?: string;
5769
- error_message?: string | null;
5770
- external_id?: string | null;
5771
- from_email?: string | null;
5772
- from_name?: string | null;
5773
6113
  id?: string;
5774
- message_id?: string | null;
5775
- profile_id?: string | null;
5776
- raw_size?: number | null;
5777
- received_at?: string | null;
5778
- status?: string;
5779
- subject?: string | null;
5780
- uid?: number | null;
5781
- updated_at?: string;
6114
+ measures?: Json;
6115
+ note?: string | null;
6116
+ outcome?: string;
6117
+ required_carts?: number;
6118
+ reserve_minutes?: number;
6119
+ shortage_carts?: number;
6120
+ status: string;
6121
+ user_id: string;
5782
6122
  };
5783
6123
  Update: {
5784
- body_html?: string | null;
5785
- body_text?: string | null;
5786
- connection_id?: string | null;
6124
+ available_carts?: number;
5787
6125
  created_at?: string;
5788
- error_message?: string | null;
5789
- external_id?: string | null;
5790
- from_email?: string | null;
5791
- from_name?: string | null;
5792
6126
  id?: string;
5793
- message_id?: string | null;
5794
- profile_id?: string | null;
5795
- raw_size?: number | null;
5796
- received_at?: string | null;
6127
+ measures?: Json;
6128
+ note?: string | null;
6129
+ outcome?: string;
6130
+ required_carts?: number;
6131
+ reserve_minutes?: number;
6132
+ shortage_carts?: number;
5797
6133
  status?: string;
5798
- subject?: string | null;
5799
- uid?: number | null;
5800
- updated_at?: string;
6134
+ user_id?: string;
5801
6135
  };
5802
- Relationships: [
5803
- {
5804
- foreignKeyName: "mailbox_messages_connection_id_fkey";
5805
- columns: ["connection_id"];
5806
- isOneToOne: false;
5807
- referencedRelation: "email_auth_connections";
5808
- referencedColumns: ["id"];
5809
- },
5810
- {
5811
- foreignKeyName: "mailbox_messages_connection_id_fkey";
5812
- columns: ["connection_id"];
5813
- isOneToOne: false;
5814
- referencedRelation: "email_auth_connections_safe";
5815
- referencedColumns: ["id"];
5816
- },
5817
- {
5818
- foreignKeyName: "mailbox_messages_profile_id_fkey";
5819
- columns: ["profile_id"];
5820
- isOneToOne: false;
5821
- referencedRelation: "imap_profiles";
5822
- referencedColumns: ["id"];
5823
- }
5824
- ];
6136
+ Relationships: [];
5825
6137
  };
5826
- mailbox_order_proposals: {
6138
+ logistics_capacity_settings: {
5827
6139
  Row: {
5828
- confidence: number | null;
5829
6140
  created_at: string;
5830
- created_order_id: string | null;
5831
- delivery_date: string | null;
5832
- id: string;
5833
- matched_customer_id: string | null;
5834
- message_id: string;
5835
- notes: string | null;
5836
- order_number: string | null;
5837
- parsed_payload: Json | null;
5838
- reviewed_at: string | null;
5839
- reviewed_by: string | null;
5840
- status: string;
6141
+ settings: Json;
5841
6142
  updated_at: string;
6143
+ user_id: string;
5842
6144
  };
5843
6145
  Insert: {
5844
- confidence?: number | null;
5845
6146
  created_at?: string;
5846
- created_order_id?: string | null;
6147
+ settings?: Json;
6148
+ updated_at?: string;
6149
+ user_id: string;
6150
+ };
6151
+ Update: {
6152
+ created_at?: string;
6153
+ settings?: Json;
6154
+ updated_at?: string;
6155
+ user_id?: string;
6156
+ };
6157
+ Relationships: [];
6158
+ };
6159
+ logistics_decisions: {
6160
+ Row: {
6161
+ created_at: string;
6162
+ explanation: string | null;
6163
+ id: string;
6164
+ input_snapshot: Json;
6165
+ result: Json;
6166
+ slot: string;
6167
+ strategy_id: string | null;
6168
+ subject_id: string;
6169
+ subject_type: string;
6170
+ user_id: string;
6171
+ };
6172
+ Insert: {
6173
+ created_at?: string;
6174
+ explanation?: string | null;
6175
+ id?: string;
6176
+ input_snapshot?: Json;
6177
+ result?: Json;
6178
+ slot: string;
6179
+ strategy_id?: string | null;
6180
+ subject_id: string;
6181
+ subject_type: string;
6182
+ user_id: string;
6183
+ };
6184
+ Update: {
6185
+ created_at?: string;
6186
+ explanation?: string | null;
6187
+ id?: string;
6188
+ input_snapshot?: Json;
6189
+ result?: Json;
6190
+ slot?: string;
6191
+ strategy_id?: string | null;
6192
+ subject_id?: string;
6193
+ subject_type?: string;
6194
+ user_id?: string;
6195
+ };
6196
+ Relationships: [
6197
+ {
6198
+ foreignKeyName: "logistics_decisions_strategy_id_fkey";
6199
+ columns: ["strategy_id"];
6200
+ isOneToOne: false;
6201
+ referencedRelation: "logistics_strategies";
6202
+ referencedColumns: ["id"];
6203
+ }
6204
+ ];
6205
+ };
6206
+ logistics_formulas: {
6207
+ Row: {
6208
+ created_at: string;
6209
+ expression: string;
6210
+ id: string;
6211
+ notes: string | null;
6212
+ slot: string;
6213
+ strategy_id: string;
6214
+ updated_at: string;
6215
+ user_id: string;
6216
+ version: number;
6217
+ };
6218
+ Insert: {
6219
+ created_at?: string;
6220
+ expression?: string;
6221
+ id?: string;
6222
+ notes?: string | null;
6223
+ slot: string;
6224
+ strategy_id: string;
6225
+ updated_at?: string;
6226
+ user_id: string;
6227
+ version?: number;
6228
+ };
6229
+ Update: {
6230
+ created_at?: string;
6231
+ expression?: string;
6232
+ id?: string;
6233
+ notes?: string | null;
6234
+ slot?: string;
6235
+ strategy_id?: string;
6236
+ updated_at?: string;
6237
+ user_id?: string;
6238
+ version?: number;
6239
+ };
6240
+ Relationships: [
6241
+ {
6242
+ foreignKeyName: "logistics_formulas_strategy_id_fkey";
6243
+ columns: ["strategy_id"];
6244
+ isOneToOne: false;
6245
+ referencedRelation: "logistics_strategies";
6246
+ referencedColumns: ["id"];
6247
+ }
6248
+ ];
6249
+ };
6250
+ logistics_strategies: {
6251
+ Row: {
6252
+ color: string;
6253
+ created_at: string;
6254
+ description: string | null;
6255
+ id: string;
6256
+ is_active: boolean;
6257
+ name: string;
6258
+ priority: number;
6259
+ updated_at: string;
6260
+ updated_by: string | null;
6261
+ user_id: string;
6262
+ version: number;
6263
+ };
6264
+ Insert: {
6265
+ color?: string;
6266
+ created_at?: string;
6267
+ description?: string | null;
6268
+ id?: string;
6269
+ is_active?: boolean;
6270
+ name: string;
6271
+ priority?: number;
6272
+ updated_at?: string;
6273
+ updated_by?: string | null;
6274
+ user_id: string;
6275
+ version?: number;
6276
+ };
6277
+ Update: {
6278
+ color?: string;
6279
+ created_at?: string;
6280
+ description?: string | null;
6281
+ id?: string;
6282
+ is_active?: boolean;
6283
+ name?: string;
6284
+ priority?: number;
6285
+ updated_at?: string;
6286
+ updated_by?: string | null;
6287
+ user_id?: string;
6288
+ version?: number;
6289
+ };
6290
+ Relationships: [];
6291
+ };
6292
+ logistics_strategy_schedules: {
6293
+ Row: {
6294
+ condition_expression: string | null;
6295
+ created_at: string;
6296
+ end_date: string | null;
6297
+ id: string;
6298
+ is_enabled: boolean;
6299
+ priority: number;
6300
+ rule_type: string;
6301
+ start_date: string | null;
6302
+ strategy_id: string;
6303
+ updated_at: string;
6304
+ user_id: string;
6305
+ };
6306
+ Insert: {
6307
+ condition_expression?: string | null;
6308
+ created_at?: string;
6309
+ end_date?: string | null;
6310
+ id?: string;
6311
+ is_enabled?: boolean;
6312
+ priority?: number;
6313
+ rule_type: string;
6314
+ start_date?: string | null;
6315
+ strategy_id: string;
6316
+ updated_at?: string;
6317
+ user_id: string;
6318
+ };
6319
+ Update: {
6320
+ condition_expression?: string | null;
6321
+ created_at?: string;
6322
+ end_date?: string | null;
6323
+ id?: string;
6324
+ is_enabled?: boolean;
6325
+ priority?: number;
6326
+ rule_type?: string;
6327
+ start_date?: string | null;
6328
+ strategy_id?: string;
6329
+ updated_at?: string;
6330
+ user_id?: string;
6331
+ };
6332
+ Relationships: [
6333
+ {
6334
+ foreignKeyName: "logistics_strategy_schedules_strategy_id_fkey";
6335
+ columns: ["strategy_id"];
6336
+ isOneToOne: false;
6337
+ referencedRelation: "logistics_strategies";
6338
+ referencedColumns: ["id"];
6339
+ }
6340
+ ];
6341
+ };
6342
+ logistics_variables: {
6343
+ Row: {
6344
+ created_at: string;
6345
+ default_value: string | null;
6346
+ description: string | null;
6347
+ id: string;
6348
+ is_builtin: boolean;
6349
+ key: string;
6350
+ label: string;
6351
+ updated_at: string;
6352
+ user_id: string;
6353
+ value_type: string;
6354
+ };
6355
+ Insert: {
6356
+ created_at?: string;
6357
+ default_value?: string | null;
6358
+ description?: string | null;
6359
+ id?: string;
6360
+ is_builtin?: boolean;
6361
+ key: string;
6362
+ label: string;
6363
+ updated_at?: string;
6364
+ user_id: string;
6365
+ value_type: string;
6366
+ };
6367
+ Update: {
6368
+ created_at?: string;
6369
+ default_value?: string | null;
6370
+ description?: string | null;
6371
+ id?: string;
6372
+ is_builtin?: boolean;
6373
+ key?: string;
6374
+ label?: string;
6375
+ updated_at?: string;
6376
+ user_id?: string;
6377
+ value_type?: string;
6378
+ };
6379
+ Relationships: [];
6380
+ };
6381
+ mailbox_messages: {
6382
+ Row: {
6383
+ body_html: string | null;
6384
+ body_text: string | null;
6385
+ connection_id: string | null;
6386
+ created_at: string;
6387
+ error_message: string | null;
6388
+ external_id: string | null;
6389
+ from_email: string | null;
6390
+ from_name: string | null;
6391
+ id: string;
6392
+ message_id: string | null;
6393
+ profile_id: string | null;
6394
+ raw_size: number | null;
6395
+ received_at: string | null;
6396
+ status: string;
6397
+ subject: string | null;
6398
+ uid: number | null;
6399
+ updated_at: string;
6400
+ };
6401
+ Insert: {
6402
+ body_html?: string | null;
6403
+ body_text?: string | null;
6404
+ connection_id?: string | null;
6405
+ created_at?: string;
6406
+ error_message?: string | null;
6407
+ external_id?: string | null;
6408
+ from_email?: string | null;
6409
+ from_name?: string | null;
6410
+ id?: string;
6411
+ message_id?: string | null;
6412
+ profile_id?: string | null;
6413
+ raw_size?: number | null;
6414
+ received_at?: string | null;
6415
+ status?: string;
6416
+ subject?: string | null;
6417
+ uid?: number | null;
6418
+ updated_at?: string;
6419
+ };
6420
+ Update: {
6421
+ body_html?: string | null;
6422
+ body_text?: string | null;
6423
+ connection_id?: string | null;
6424
+ created_at?: string;
6425
+ error_message?: string | null;
6426
+ external_id?: string | null;
6427
+ from_email?: string | null;
6428
+ from_name?: string | null;
6429
+ id?: string;
6430
+ message_id?: string | null;
6431
+ profile_id?: string | null;
6432
+ raw_size?: number | null;
6433
+ received_at?: string | null;
6434
+ status?: string;
6435
+ subject?: string | null;
6436
+ uid?: number | null;
6437
+ updated_at?: string;
6438
+ };
6439
+ Relationships: [
6440
+ {
6441
+ foreignKeyName: "mailbox_messages_connection_id_fkey";
6442
+ columns: ["connection_id"];
6443
+ isOneToOne: false;
6444
+ referencedRelation: "email_auth_connections";
6445
+ referencedColumns: ["id"];
6446
+ },
6447
+ {
6448
+ foreignKeyName: "mailbox_messages_connection_id_fkey";
6449
+ columns: ["connection_id"];
6450
+ isOneToOne: false;
6451
+ referencedRelation: "email_auth_connections_safe";
6452
+ referencedColumns: ["id"];
6453
+ },
6454
+ {
6455
+ foreignKeyName: "mailbox_messages_profile_id_fkey";
6456
+ columns: ["profile_id"];
6457
+ isOneToOne: false;
6458
+ referencedRelation: "imap_profiles";
6459
+ referencedColumns: ["id"];
6460
+ }
6461
+ ];
6462
+ };
6463
+ mailbox_order_proposals: {
6464
+ Row: {
6465
+ confidence: number | null;
6466
+ created_at: string;
6467
+ created_order_id: string | null;
6468
+ delivery_date: string | null;
6469
+ id: string;
6470
+ matched_customer_id: string | null;
6471
+ message_id: string;
6472
+ notes: string | null;
6473
+ order_number: string | null;
6474
+ parsed_payload: Json | null;
6475
+ reviewed_at: string | null;
6476
+ reviewed_by: string | null;
6477
+ status: string;
6478
+ updated_at: string;
6479
+ };
6480
+ Insert: {
6481
+ confidence?: number | null;
6482
+ created_at?: string;
6483
+ created_order_id?: string | null;
5847
6484
  delivery_date?: string | null;
5848
6485
  id?: string;
5849
6486
  matched_customer_id?: string | null;
@@ -6153,39 +6790,62 @@ export type Database = {
6153
6790
  };
6154
6791
  manufacture_products: {
6155
6792
  Row: {
6793
+ aantal_te_produceren: number;
6156
6794
  created_at: string;
6157
6795
  description: string | null;
6158
6796
  id: string;
6159
6797
  is_active: boolean;
6798
+ location_id: string | null;
6160
6799
  name: string;
6800
+ partij_nummer: string | null;
6801
+ photos: Json;
6161
6802
  produced_stock: number;
6162
6803
  product_code: string;
6163
6804
  tenant_id: string;
6805
+ unit: string;
6164
6806
  updated_at: string;
6165
6807
  };
6166
6808
  Insert: {
6809
+ aantal_te_produceren?: number;
6167
6810
  created_at?: string;
6168
6811
  description?: string | null;
6169
6812
  id?: string;
6170
6813
  is_active?: boolean;
6814
+ location_id?: string | null;
6171
6815
  name: string;
6816
+ partij_nummer?: string | null;
6817
+ photos?: Json;
6172
6818
  produced_stock?: number;
6173
6819
  product_code: string;
6174
6820
  tenant_id: string;
6821
+ unit?: string;
6175
6822
  updated_at?: string;
6176
6823
  };
6177
6824
  Update: {
6825
+ aantal_te_produceren?: number;
6178
6826
  created_at?: string;
6179
6827
  description?: string | null;
6180
6828
  id?: string;
6181
6829
  is_active?: boolean;
6830
+ location_id?: string | null;
6182
6831
  name?: string;
6832
+ partij_nummer?: string | null;
6833
+ photos?: Json;
6183
6834
  produced_stock?: number;
6184
6835
  product_code?: string;
6185
6836
  tenant_id?: string;
6837
+ unit?: string;
6186
6838
  updated_at?: string;
6187
6839
  };
6188
- Relationships: [];
6840
+ Relationships: [
6841
+ {
6842
+ foreignKeyName: "manufacture_products_location_id_fkey";
6843
+ columns: ["location_id"];
6844
+ isOneToOne: false;
6845
+ referencedRelation: "locations";
6846
+ referencedColumns: ["id"];
6847
+ }
6848
+ ];
6189
6849
  };
6190
6850
  monteurs: {
6191
6851
  Row: {
@@ -6941,6 +7601,42 @@ export type Database = {
6941
7601
  };
6942
7602
  Relationships: [];
6943
7603
  };
7604
+ order_buffers: {
7605
+ Row: {
7606
+ buffer_key: string;
7607
+ created_at: string;
7608
+ customer_id: string | null;
7609
+ grouping_mode: string;
7610
+ id: string;
7611
+ pickup_date: string | null;
7612
+ pickup_location: string | null;
7613
+ plan_locked_at: string | null;
7614
+ updated_at: string;
7615
+ };
7616
+ Insert: {
7617
+ buffer_key: string;
7618
+ created_at?: string;
7619
+ customer_id?: string | null;
7620
+ grouping_mode: string;
7621
+ id?: string;
7622
+ pickup_date?: string | null;
7623
+ pickup_location?: string | null;
7624
+ plan_locked_at?: string | null;
7625
+ updated_at?: string;
7626
+ };
7627
+ Update: {
7628
+ buffer_key?: string;
7629
+ created_at?: string;
7630
+ customer_id?: string | null;
7631
+ grouping_mode?: string;
7632
+ id?: string;
7633
+ pickup_date?: string | null;
7634
+ pickup_location?: string | null;
7635
+ plan_locked_at?: string | null;
7636
+ updated_at?: string;
7637
+ };
7638
+ Relationships: [];
7639
+ };
6944
7640
  order_cart_items: {
6945
7641
  Row: {
6946
7642
  cart_id: string;
@@ -7011,6 +7707,7 @@ export type Database = {
7011
7707
  order_carts: {
7012
7708
  Row: {
7013
7709
  algorithm_version: number;
7710
+ buffer_id: string | null;
7014
7711
  cart_number: number;
7015
7712
  created_at: string;
7016
7713
  id: string;
@@ -7018,13 +7715,14 @@ export type Database = {
7018
7715
  is_complete: boolean;
7019
7716
  notes: string | null;
7020
7717
  occupancy_pct: number;
7021
- order_id: string;
7718
+ order_id: string | null;
7022
7719
  source: string;
7023
7720
  total_layers_used: number;
7024
7721
  updated_at: string;
7025
7722
  };
7026
7723
  Insert: {
7027
7724
  algorithm_version?: number;
7725
+ buffer_id?: string | null;
7028
7726
  cart_number: number;
7029
7727
  created_at?: string;
7030
7728
  id?: string;
@@ -7032,13 +7730,14 @@ export type Database = {
7032
7730
  is_complete?: boolean;
7033
7731
  notes?: string | null;
7034
7732
  occupancy_pct?: number;
7035
- order_id: string;
7733
+ order_id?: string | null;
7036
7734
  source?: string;
7037
7735
  total_layers_used?: number;
7038
7736
  updated_at?: string;
7039
7737
  };
7040
7738
  Update: {
7041
7739
  algorithm_version?: number;
7740
+ buffer_id?: string | null;
7042
7741
  cart_number?: number;
7043
7742
  created_at?: string;
7044
7743
  id?: string;
@@ -7046,12 +7745,19 @@ export type Database = {
7046
7745
  is_complete?: boolean;
7047
7746
  notes?: string | null;
7048
7747
  occupancy_pct?: number;
7049
- order_id?: string;
7748
+ order_id?: string | null;
7050
7749
  source?: string;
7051
7750
  total_layers_used?: number;
7052
7751
  updated_at?: string;
7053
7752
  };
7054
7753
  Relationships: [
7754
+ {
7755
+ foreignKeyName: "order_carts_buffer_id_fkey";
7756
+ columns: ["buffer_id"];
7757
+ isOneToOne: false;
7758
+ referencedRelation: "order_buffers";
7759
+ referencedColumns: ["id"];
7760
+ },
7055
7761
  {
7056
7762
  foreignKeyName: "order_carts_order_id_fkey";
7057
7763
  columns: ["order_id"];
@@ -7195,15 +7901,123 @@ export type Database = {
7195
7901
  };
7196
7902
  Relationships: [];
7197
7903
  };
7904
+ order_shipment_items: {
7905
+ Row: {
7906
+ created_at: string;
7907
+ id: string;
7908
+ order_item_id: string;
7909
+ product_id: string | null;
7910
+ product_name: string;
7911
+ quantity: number;
7912
+ shipment_id: string;
7913
+ updated_at: string;
7914
+ };
7915
+ Insert: {
7916
+ created_at?: string;
7917
+ id?: string;
7918
+ order_item_id: string;
7919
+ product_id?: string | null;
7920
+ product_name: string;
7921
+ quantity: number;
7922
+ shipment_id: string;
7923
+ updated_at?: string;
7924
+ };
7925
+ Update: {
7926
+ created_at?: string;
7927
+ id?: string;
7928
+ order_item_id?: string;
7929
+ product_id?: string | null;
7930
+ product_name?: string;
7931
+ quantity?: number;
7932
+ shipment_id?: string;
7933
+ updated_at?: string;
7934
+ };
7935
+ Relationships: [
7936
+ {
7937
+ foreignKeyName: "order_shipment_items_order_item_id_fkey";
7938
+ columns: ["order_item_id"];
7939
+ isOneToOne: false;
7940
+ referencedRelation: "order_items";
7941
+ referencedColumns: ["id"];
7942
+ },
7943
+ {
7944
+ foreignKeyName: "order_shipment_items_shipment_id_fkey";
7945
+ columns: ["shipment_id"];
7946
+ isOneToOne: false;
7947
+ referencedRelation: "order_shipments";
7948
+ referencedColumns: ["id"];
7949
+ }
7950
+ ];
7951
+ };
7952
+ order_shipments: {
7953
+ Row: {
7954
+ carrier_id: string | null;
7955
+ created_at: string;
7956
+ delivery_date: string | null;
7957
+ delivery_location_id: string | null;
7958
+ id: string;
7959
+ notes: string | null;
7960
+ order_id: string;
7961
+ shipment_number: number;
7962
+ shipped_at: string | null;
7963
+ status: string;
7964
+ updated_at: string;
7965
+ };
7966
+ Insert: {
7967
+ carrier_id?: string | null;
7968
+ created_at?: string;
7969
+ delivery_date?: string | null;
7970
+ delivery_location_id?: string | null;
7971
+ id?: string;
7972
+ notes?: string | null;
7973
+ order_id: string;
7974
+ shipment_number: number;
7975
+ shipped_at?: string | null;
7976
+ status?: string;
7977
+ updated_at?: string;
7978
+ };
7979
+ Update: {
7980
+ carrier_id?: string | null;
7981
+ created_at?: string;
7982
+ delivery_date?: string | null;
7983
+ delivery_location_id?: string | null;
7984
+ id?: string;
7985
+ notes?: string | null;
7986
+ order_id?: string;
7987
+ shipment_number?: number;
7988
+ shipped_at?: string | null;
7989
+ status?: string;
7990
+ updated_at?: string;
7991
+ };
7992
+ Relationships: [
7993
+ {
7994
+ foreignKeyName: "order_shipments_carrier_id_fkey";
7995
+ columns: ["carrier_id"];
7996
+ isOneToOne: false;
7997
+ referencedRelation: "carriers";
7998
+ referencedColumns: ["id"];
7999
+ },
8000
+ {
8001
+ foreignKeyName: "order_shipments_order_id_fkey";
8002
+ columns: ["order_id"];
8003
+ isOneToOne: false;
8004
+ referencedRelation: "orders";
8005
+ referencedColumns: ["id"];
8006
+ }
8007
+ ];
8008
+ };
7198
8009
  orders: {
7199
8010
  Row: {
8011
+ buffer_id: string | null;
7200
8012
  created_at: string;
7201
8013
  custom_fields: Json;
7202
8014
  customer_id: string | null;
7203
8015
  customer_name: string;
7204
8016
  deleted_at: string | null;
7205
- delivery_date: string;
8017
+ delivery_date: string | null;
8018
+ floriday_sales_order_id: string | null;
7206
8019
  id: string;
8020
+ is_reservation: boolean;
7207
8021
  notes: string | null;
7208
8022
  order_date: string;
7209
8023
  order_number: string;
@@ -7215,13 +8029,16 @@ export type Database = {
7215
8029
  updated_at: string;
7216
8030
  };
7217
8031
  Insert: {
8032
+ buffer_id?: string | null;
7218
8033
  created_at?: string;
7219
8034
  custom_fields?: Json;
7220
8035
  customer_id?: string | null;
7221
8036
  customer_name?: string;
7222
8037
  deleted_at?: string | null;
7223
- delivery_date: string;
8038
+ delivery_date?: string | null;
8039
+ floriday_sales_order_id?: string | null;
7224
8040
  id?: string;
8041
+ is_reservation?: boolean;
7225
8042
  notes?: string | null;
7226
8043
  order_date?: string;
7227
8044
  order_number: string;
@@ -7233,13 +8050,16 @@ export type Database = {
7233
8050
  updated_at?: string;
7234
8051
  };
7235
8052
  Update: {
8053
+ buffer_id?: string | null;
7236
8054
  created_at?: string;
7237
8055
  custom_fields?: Json;
7238
8056
  customer_id?: string | null;
7239
8057
  customer_name?: string;
7240
8058
  deleted_at?: string | null;
7241
- delivery_date?: string;
8059
+ delivery_date?: string | null;
8060
+ floriday_sales_order_id?: string | null;
7242
8061
  id?: string;
8062
+ is_reservation?: boolean;
7243
8063
  notes?: string | null;
7244
8064
  order_date?: string;
7245
8065
  order_number?: string;
@@ -7251,6 +8071,13 @@ export type Database = {
7251
8071
  updated_at?: string;
7252
8072
  };
7253
8073
  Relationships: [
8074
+ {
8075
+ foreignKeyName: "orders_buffer_id_fkey";
8076
+ columns: ["buffer_id"];
8077
+ isOneToOne: false;
8078
+ referencedRelation: "order_buffers";
8079
+ referencedColumns: ["id"];
8080
+ },
7254
8081
  {
7255
8082
  foreignKeyName: "orders_customer_id_fkey";
7256
8083
  columns: ["customer_id"];
@@ -7383,6 +8210,69 @@ export type Database = {
7383
8210
  };
7384
8211
  Relationships: [];
7385
8212
  };
8213
+ product_bom_items: {
8214
+ Row: {
8215
+ component_product_id: string | null;
8216
+ component_trade_item_floriday_id: string | null;
8217
+ created_at: string;
8218
+ id: string;
8219
+ notes: string | null;
8220
+ packing_configuration_id: string | null;
8221
+ parent_product_id: string | null;
8222
+ parent_trade_item_floriday_id: string | null;
8223
+ quantity: number;
8224
+ sort_order: number;
8225
+ tenant_id: string;
8226
+ unit: string;
8227
+ updated_at: string;
8228
+ };
8229
+ Insert: {
8230
+ component_product_id?: string | null;
8231
+ component_trade_item_floriday_id?: string | null;
8232
+ created_at?: string;
8233
+ id?: string;
8234
+ notes?: string | null;
8235
+ packing_configuration_id?: string | null;
8236
+ parent_product_id?: string | null;
8237
+ parent_trade_item_floriday_id?: string | null;
8238
+ quantity?: number;
8239
+ sort_order?: number;
8240
+ tenant_id: string;
8241
+ unit?: string;
8242
+ updated_at?: string;
8243
+ };
8244
+ Update: {
8245
+ component_product_id?: string | null;
8246
+ component_trade_item_floriday_id?: string | null;
8247
+ created_at?: string;
8248
+ id?: string;
8249
+ notes?: string | null;
8250
+ packing_configuration_id?: string | null;
8251
+ parent_product_id?: string | null;
8252
+ parent_trade_item_floriday_id?: string | null;
8253
+ quantity?: number;
8254
+ sort_order?: number;
8255
+ tenant_id?: string;
8256
+ unit?: string;
8257
+ updated_at?: string;
8258
+ };
8259
+ Relationships: [
8260
+ {
8261
+ foreignKeyName: "product_bom_items_component_product_id_fkey";
8262
+ columns: ["component_product_id"];
8263
+ isOneToOne: false;
8264
+ referencedRelation: "products";
8265
+ referencedColumns: ["id"];
8266
+ },
8267
+ {
8268
+ foreignKeyName: "product_bom_items_parent_product_id_fkey";
8269
+ columns: ["parent_product_id"];
8270
+ isOneToOne: false;
8271
+ referencedRelation: "products";
8272
+ referencedColumns: ["id"];
8273
+ }
8274
+ ];
8275
+ };
7386
8276
  product_categories: {
7387
8277
  Row: {
7388
8278
  color: string;
@@ -7490,6 +8380,7 @@ export type Database = {
7490
8380
  id: string;
7491
8381
  product_group_id: string;
7492
8382
  quantity: number;
8383
+ sort_order: number;
7493
8384
  trade_item_id: string;
7494
8385
  };
7495
8386
  Insert: {
@@ -7497,6 +8388,7 @@ export type Database = {
7497
8388
  id?: string;
7498
8389
  product_group_id: string;
7499
8390
  quantity?: number;
8391
+ sort_order?: number;
7500
8392
  trade_item_id: string;
7501
8393
  };
7502
8394
  Update: {
@@ -7504,6 +8396,7 @@ export type Database = {
7504
8396
  id?: string;
7505
8397
  product_group_id?: string;
7506
8398
  quantity?: number;
8399
+ sort_order?: number;
7507
8400
  trade_item_id?: string;
7508
8401
  };
7509
8402
  Relationships: [
@@ -7511,51 +8404,172 @@ export type Database = {
7511
8404
  foreignKeyName: "product_group_items_product_group_id_fkey";
7512
8405
  columns: ["product_group_id"];
7513
8406
  isOneToOne: false;
7514
- referencedRelation: "product_groups";
8407
+ referencedRelation: "product_groups";
8408
+ referencedColumns: ["id"];
8409
+ }
8410
+ ];
8411
+ };
8412
+ product_groups: {
8413
+ Row: {
8414
+ created_at: string;
8415
+ description: string | null;
8416
+ head_product_id: string | null;
8417
+ head_trade_item_floriday_id: string | null;
8418
+ id: string;
8419
+ is_active: boolean;
8420
+ name: string;
8421
+ tenant_id: string;
8422
+ updated_at: string;
8423
+ };
8424
+ Insert: {
8425
+ created_at?: string;
8426
+ description?: string | null;
8427
+ head_product_id?: string | null;
8428
+ head_trade_item_floriday_id?: string | null;
8429
+ id?: string;
8430
+ is_active?: boolean;
8431
+ name: string;
8432
+ tenant_id: string;
8433
+ updated_at?: string;
8434
+ };
8435
+ Update: {
8436
+ created_at?: string;
8437
+ description?: string | null;
8438
+ head_product_id?: string | null;
8439
+ head_trade_item_floriday_id?: string | null;
8440
+ id?: string;
8441
+ is_active?: boolean;
8442
+ name?: string;
8443
+ tenant_id?: string;
8444
+ updated_at?: string;
8445
+ };
8446
+ Relationships: [
8447
+ {
8448
+ foreignKeyName: "product_groups_head_product_id_fkey";
8449
+ columns: ["head_product_id"];
8450
+ isOneToOne: false;
8451
+ referencedRelation: "products";
8452
+ referencedColumns: ["id"];
8453
+ }
8454
+ ];
8455
+ };
8456
+ product_load_settings: {
8457
+ Row: {
8458
+ created_at: string;
8459
+ id: string;
8460
+ is_package: boolean;
8461
+ label: string | null;
8462
+ layers_per_load_carrier: number | null;
8463
+ load_carrier: string | null;
8464
+ package_id: string | null;
8465
+ package_label: string | null;
8466
+ packages_per_layer: number | null;
8467
+ packing_configuration_id: string;
8468
+ product_id: string | null;
8469
+ tenant_id: string;
8470
+ trade_item_floriday_id: string | null;
8471
+ units_per_package: number | null;
8472
+ updated_at: string;
8473
+ };
8474
+ Insert: {
8475
+ created_at?: string;
8476
+ id?: string;
8477
+ is_package?: boolean;
8478
+ label?: string | null;
8479
+ layers_per_load_carrier?: number | null;
8480
+ load_carrier?: string | null;
8481
+ package_id?: string | null;
8482
+ package_label?: string | null;
8483
+ packages_per_layer?: number | null;
8484
+ packing_configuration_id?: string;
8485
+ product_id?: string | null;
8486
+ tenant_id: string;
8487
+ trade_item_floriday_id?: string | null;
8488
+ units_per_package?: number | null;
8489
+ updated_at?: string;
8490
+ };
8491
+ Update: {
8492
+ created_at?: string;
8493
+ id?: string;
8494
+ is_package?: boolean;
8495
+ label?: string | null;
8496
+ layers_per_load_carrier?: number | null;
8497
+ load_carrier?: string | null;
8498
+ package_id?: string | null;
8499
+ package_label?: string | null;
8500
+ packages_per_layer?: number | null;
8501
+ packing_configuration_id?: string;
8502
+ product_id?: string | null;
8503
+ tenant_id?: string;
8504
+ trade_item_floriday_id?: string | null;
8505
+ units_per_package?: number | null;
8506
+ updated_at?: string;
8507
+ };
8508
+ Relationships: [
8509
+ {
8510
+ foreignKeyName: "product_load_settings_package_id_fkey";
8511
+ columns: ["package_id"];
8512
+ isOneToOne: false;
8513
+ referencedRelation: "packages";
8514
+ referencedColumns: ["id"];
8515
+ },
8516
+ {
8517
+ foreignKeyName: "product_load_settings_product_id_fkey";
8518
+ columns: ["product_id"];
8519
+ isOneToOne: false;
8520
+ referencedRelation: "products";
7515
8521
  referencedColumns: ["id"];
7516
8522
  }
7517
8523
  ];
7518
8524
  };
7519
- product_groups: {
8525
+ product_merge_log: {
7520
8526
  Row: {
7521
- created_at: string;
7522
- description: string | null;
8527
+ canonical_product_id: string | null;
7523
8528
  id: string;
7524
- is_active: boolean;
7525
- name: string;
7526
- tenant_id: string;
7527
- updated_at: string;
8529
+ merged_at: string;
8530
+ merged_from_id: string;
8531
+ notes: string | null;
8532
+ snapshot: Json;
8533
+ source_table: string;
8534
+ status: string;
7528
8535
  };
7529
8536
  Insert: {
7530
- created_at?: string;
7531
- description?: string | null;
8537
+ canonical_product_id?: string | null;
7532
8538
  id?: string;
7533
- is_active?: boolean;
7534
- name: string;
7535
- tenant_id: string;
7536
- updated_at?: string;
8539
+ merged_at?: string;
8540
+ merged_from_id: string;
8541
+ notes?: string | null;
8542
+ snapshot?: Json;
8543
+ source_table: string;
8544
+ status?: string;
7537
8545
  };
7538
8546
  Update: {
7539
- created_at?: string;
7540
- description?: string | null;
8547
+ canonical_product_id?: string | null;
7541
8548
  id?: string;
7542
- is_active?: boolean;
7543
- name?: string;
7544
- tenant_id?: string;
7545
- updated_at?: string;
8549
+ merged_at?: string;
8550
+ merged_from_id?: string;
8551
+ notes?: string | null;
8552
+ snapshot?: Json;
8553
+ source_table?: string;
8554
+ status?: string;
7546
8555
  };
7547
8556
  Relationships: [];
7548
8557
  };
7549
8558
  products: {
7550
8559
  Row: {
8560
+ article_number: string | null;
7551
8561
  barcode: string | null;
7552
8562
  batch: string;
7553
8563
  crates_per_layer: number;
7554
8564
  created_at: string;
7555
8565
  custom_fields: Json;
8566
+ floriday_active: boolean;
8567
+ floriday_payload: Json;
8568
+ floriday_trade_item_id: string | null;
7556
8569
  id: string;
7557
8570
  image_url: string | null;
7558
8571
  incoming_quantity: number;
8572
+ is_layer: boolean;
7559
8573
  layers_per_cart: number;
7560
8574
  location: string;
7561
8575
  min_quantity: number;
@@ -7568,17 +8582,24 @@ export type Database = {
7568
8582
  trade_item_key: string | null;
7569
8583
  unit: string;
7570
8584
  updated_at: string;
8585
+ vat_code: string | null;
8586
+ vat_rate: number | null;
7571
8587
  weight: string | null;
7572
8588
  };
7573
8589
  Insert: {
8590
+ article_number?: string | null;
7574
8591
  barcode?: string | null;
7575
8592
  batch: string;
7576
8593
  crates_per_layer?: number;
7577
8594
  created_at?: string;
7578
8595
  custom_fields?: Json;
8596
+ floriday_active?: boolean;
8597
+ floriday_payload?: Json;
8598
+ floriday_trade_item_id?: string | null;
7579
8599
  id?: string;
7580
8600
  image_url?: string | null;
7581
8601
  incoming_quantity?: number;
8602
+ is_layer?: boolean;
7582
8603
  layers_per_cart?: number;
7583
8604
  location: string;
7584
8605
  min_quantity?: number;
@@ -7591,17 +8612,24 @@ export type Database = {
7591
8612
  trade_item_key?: string | null;
7592
8613
  unit?: string;
7593
8614
  updated_at?: string;
8615
+ vat_code?: string | null;
8616
+ vat_rate?: number | null;
7594
8617
  weight?: string | null;
7595
8618
  };
7596
8619
  Update: {
8620
+ article_number?: string | null;
7597
8621
  barcode?: string | null;
7598
8622
  batch?: string;
7599
8623
  crates_per_layer?: number;
7600
8624
  created_at?: string;
7601
8625
  custom_fields?: Json;
8626
+ floriday_active?: boolean;
8627
+ floriday_payload?: Json;
8628
+ floriday_trade_item_id?: string | null;
7602
8629
  id?: string;
7603
8630
  image_url?: string | null;
7604
8631
  incoming_quantity?: number;
8632
+ is_layer?: boolean;
7605
8633
  layers_per_cart?: number;
7606
8634
  location?: string;
7607
8635
  min_quantity?: number;
@@ -7614,6 +8642,8 @@ export type Database = {
7614
8642
  trade_item_key?: string | null;
7615
8643
  unit?: string;
7616
8644
  updated_at?: string;
8645
+ vat_code?: string | null;
8646
+ vat_rate?: number | null;
7617
8647
  weight?: string | null;
7618
8648
  };
7619
8649
  Relationships: [];
@@ -8539,8 +9569,10 @@ export type Database = {
8539
9569
  order_id: string | null;
8540
9570
  order_item_id: string | null;
8541
9571
  order_source: string | null;
9572
+ parent_trade_item_key: string | null;
8542
9573
  physical_after: number | null;
8543
9574
  physical_before: number | null;
9575
+ production_batch_id: string | null;
8544
9576
  qty_delta: number;
8545
9577
  reason: string | null;
8546
9578
  reserved_after: number | null;
@@ -8556,8 +9588,10 @@ export type Database = {
8556
9588
  order_id?: string | null;
8557
9589
  order_item_id?: string | null;
8558
9590
  order_source?: string | null;
9591
+ parent_trade_item_key?: string | null;
8559
9592
  physical_after?: number | null;
8560
9593
  physical_before?: number | null;
9594
+ production_batch_id?: string | null;
8561
9595
  qty_delta: number;
8562
9596
  reason?: string | null;
8563
9597
  reserved_after?: number | null;
@@ -8573,8 +9607,10 @@ export type Database = {
8573
9607
  order_id?: string | null;
8574
9608
  order_item_id?: string | null;
8575
9609
  order_source?: string | null;
9610
+ parent_trade_item_key?: string | null;
8576
9611
  physical_after?: number | null;
8577
9612
  physical_before?: number | null;
9613
+ production_batch_id?: string | null;
8578
9614
  qty_delta?: number;
8579
9615
  reason?: string | null;
8580
9616
  reserved_after?: number | null;
@@ -8888,6 +9924,48 @@ export type Database = {
8888
9924
  };
8889
9925
  Relationships: [];
8890
9926
  };
9927
+ trade_item_prices: {
9928
+ Row: {
9929
+ created_at: string;
9930
+ currency: string;
9931
+ id: string;
9932
+ last_push_error: string | null;
9933
+ last_pushed_at: string | null;
9934
+ price_group_id: string | null;
9935
+ price_per_piece: number;
9936
+ supply_line_id: string | null;
9937
+ trade_item_key: string;
9938
+ updated_at: string;
9939
+ user_id: string;
9940
+ };
9941
+ Insert: {
9942
+ created_at?: string;
9943
+ currency?: string;
9944
+ id?: string;
9945
+ last_push_error?: string | null;
9946
+ last_pushed_at?: string | null;
9947
+ price_group_id?: string | null;
9948
+ price_per_piece: number;
9949
+ supply_line_id?: string | null;
9950
+ trade_item_key: string;
9951
+ updated_at?: string;
9952
+ user_id: string;
9953
+ };
9954
+ Update: {
9955
+ created_at?: string;
9956
+ currency?: string;
9957
+ id?: string;
9958
+ last_push_error?: string | null;
9959
+ last_pushed_at?: string | null;
9960
+ price_group_id?: string | null;
9961
+ price_per_piece?: number;
9962
+ supply_line_id?: string | null;
9963
+ trade_item_key?: string;
9964
+ updated_at?: string;
9965
+ user_id?: string;
9966
+ };
9967
+ Relationships: [];
9968
+ };
8891
9969
  trade_item_stock: {
8892
9970
  Row: {
8893
9971
  connection_id: string;
@@ -9043,7 +10121,7 @@ export type Database = {
9043
10121
  twinfield_connections: {
9044
10122
  Row: {
9045
10123
  access_token: string | null;
9046
- client_id: string;
10124
+ client_id: string | null;
9047
10125
  client_secret: string | null;
9048
10126
  cluster_uri: string | null;
9049
10127
  company_code: string | null;
@@ -9055,7 +10133,7 @@ export type Database = {
9055
10133
  is_active: boolean;
9056
10134
  label: string | null;
9057
10135
  office_code: string | null;
9058
- redirect_uri: string;
10136
+ redirect_uri: string | null;
9059
10137
  refresh_token: string | null;
9060
10138
  token_expires_at: string | null;
9061
10139
  updated_at: string;
@@ -9063,7 +10141,7 @@ export type Database = {
9063
10141
  };
9064
10142
  Insert: {
9065
10143
  access_token?: string | null;
9066
- client_id: string;
10144
+ client_id?: string | null;
9067
10145
  client_secret?: string | null;
9068
10146
  cluster_uri?: string | null;
9069
10147
  company_code?: string | null;
@@ -9075,7 +10153,7 @@ export type Database = {
9075
10153
  is_active?: boolean;
9076
10154
  label?: string | null;
9077
10155
  office_code?: string | null;
9078
- redirect_uri: string;
10156
+ redirect_uri?: string | null;
9079
10157
  refresh_token?: string | null;
9080
10158
  token_expires_at?: string | null;
9081
10159
  updated_at?: string;
@@ -9083,7 +10161,7 @@ export type Database = {
9083
10161
  };
9084
10162
  Update: {
9085
10163
  access_token?: string | null;
9086
- client_id?: string;
10164
+ client_id?: string | null;
9087
10165
  client_secret?: string | null;
9088
10166
  cluster_uri?: string | null;
9089
10167
  company_code?: string | null;
@@ -9095,7 +10173,7 @@ export type Database = {
9095
10173
  is_active?: boolean;
9096
10174
  label?: string | null;
9097
10175
  office_code?: string | null;
9098
- redirect_uri?: string;
10176
+ redirect_uri?: string | null;
9099
10177
  refresh_token?: string | null;
9100
10178
  token_expires_at?: string | null;
9101
10179
  updated_at?: string;
@@ -9358,6 +10436,53 @@ export type Database = {
9358
10436
  }
9359
10437
  ];
9360
10438
  };
10439
+ twinfield_invoice_pdf_cache: {
10440
+ Row: {
10441
+ connection_id: string;
10442
+ created_at: string;
10443
+ fetched_at: string;
10444
+ id: string;
10445
+ invoice_number: string;
10446
+ last_accessed_at: string;
10447
+ object_path: string;
10448
+ office_code: string;
10449
+ size_bytes: number;
10450
+ updated_at: string;
10451
+ };
10452
+ Insert: {
10453
+ connection_id: string;
10454
+ created_at?: string;
10455
+ fetched_at?: string;
10456
+ id?: string;
10457
+ invoice_number: string;
10458
+ last_accessed_at?: string;
10459
+ object_path: string;
10460
+ office_code: string;
10461
+ size_bytes?: number;
10462
+ updated_at?: string;
10463
+ };
10464
+ Update: {
10465
+ connection_id?: string;
10466
+ created_at?: string;
10467
+ fetched_at?: string;
10468
+ id?: string;
10469
+ invoice_number?: string;
10470
+ last_accessed_at?: string;
10471
+ object_path?: string;
10472
+ office_code?: string;
10473
+ size_bytes?: number;
10474
+ updated_at?: string;
10475
+ };
10476
+ Relationships: [
10477
+ {
10478
+ foreignKeyName: "twinfield_invoice_pdf_cache_connection_id_fkey";
10479
+ columns: ["connection_id"];
10480
+ isOneToOne: false;
10481
+ referencedRelation: "twinfield_connections";
10482
+ referencedColumns: ["id"];
10483
+ }
10484
+ ];
10485
+ };
9361
10486
  twinfield_invoice_settings: {
9362
10487
  Row: {
9363
10488
  created_at: string;
@@ -10312,25 +11437,6 @@ export type Database = {
10312
11437
  };
10313
11438
  Relationships: [];
10314
11439
  };
10315
- floriday_customer_discounts: {
10316
- Row: {
10317
- base_price: number | null;
10318
- buyer_organization_id: string | null;
10319
- currency: string | null;
10320
- discount_type: string | null;
10321
- discount_value: number | null;
10322
- min_quantity: number | null;
10323
- net_price: number | null;
10324
- product_group_id: string | null;
10325
- raw: Json | null;
10326
- source: string | null;
10327
- source_id: string | null;
10328
- trade_item_id: string | null;
10329
- valid_from: string | null;
10330
- valid_until: string | null;
10331
- };
10332
- Relationships: [];
10333
- };
10334
11440
  local_customer_discounts: {
10335
11441
  Row: {
10336
11442
  base_price: number | null;
@@ -10646,6 +11752,13 @@ export type Database = {
10646
11752
  };
10647
11753
  Returns: number;
10648
11754
  };
11755
+ _migrate_rewrite_stock_key: {
11756
+ Args: {
11757
+ _from_key: string;
11758
+ _to_key: string;
11759
+ };
11760
+ Returns: undefined;
11761
+ };
10649
11762
  afh_city_code: {
10650
11763
  Args: {
10651
11764
  _city: string;
@@ -10729,6 +11842,12 @@ export type Database = {
10729
11842
  processed_items: number;
10730
11843
  }[];
10731
11844
  };
11845
+ calculate_layer_stock: {
11846
+ Args: {
11847
+ p_product_id: string;
11848
+ };
11849
+ Returns: number;
11850
+ };
10732
11851
  call_exact_route: {
10733
11852
  Args: {
10734
11853
  path: string;
@@ -10761,6 +11880,28 @@ export type Database = {
10761
11880
  Args: never;
10762
11881
  Returns: undefined;
10763
11882
  };
11883
+ consume_bom_for_production: {
11884
+ Args: {
11885
+ p_connection_id: string;
11886
+ p_parent_id: string;
11887
+ p_parent_key: string;
11888
+ p_parent_kind: string;
11889
+ p_quantity: number;
11890
+ p_user_id: string;
11891
+ };
11892
+ Returns: Json;
11893
+ } | {
11894
+ Args: {
11895
+ p_batch_id?: string;
11896
+ p_connection_id: string;
11897
+ p_parent_id: string;
11898
+ p_parent_key: string;
11899
+ p_parent_kind: string;
11900
+ p_quantity: number;
11901
+ p_user_id: string;
11902
+ };
11903
+ Returns: Json;
11904
+ };
10764
11905
  consume_floriday_rate_limit: {
10765
11906
  Args: {
10766
11907
  p_bucket: string;
@@ -10812,6 +11953,13 @@ export type Database = {
10812
11953
  table_name: string;
10813
11954
  }[];
10814
11955
  };
11956
+ delete_samenstelling: {
11957
+ Args: {
11958
+ p_parent_id: string;
11959
+ p_parent_kind: string;
11960
+ };
11961
+ Returns: Json;
11962
+ };
10815
11963
  dispatch_carrier_signups_sql: {
10816
11964
  Args: {
10817
11965
  _catchup?: string;
@@ -10853,6 +12001,16 @@ export type Database = {
10853
12001
  status: string;
10854
12002
  }[];
10855
12003
  };
12004
+ email_auth_upsert_connection: {
12005
+ Args: {
12006
+ _account_email: string;
12007
+ _created_by: string;
12008
+ _is_active: boolean;
12009
+ _provider: string;
12010
+ _status: string;
12011
+ };
12012
+ Returns: string;
12013
+ };
10856
12014
  enqueue_cart_replan_if_unlocked: {
10857
12015
  Args: {
10858
12016
  p_order_id: string;
@@ -10972,19 +12130,6 @@ export type Database = {
10972
12130
  resource: string;
10973
12131
  }[];
10974
12132
  };
10975
- get_floriday_agreements_active: {
10976
- Args: {
10977
- p_on_date?: string;
10978
- };
10979
- Returns: {
10980
- buyer_organization_id: string;
10981
- data: Json;
10982
- floriday_id: string;
10983
- status: string;
10984
- valid_from: string;
10985
- valid_until: string;
10986
- }[];
10987
- };
10988
12133
  get_floriday_clock_supplies_window: {
10989
12134
  Args: {
10990
12135
  p_from: string;
@@ -11057,6 +12202,27 @@ export type Database = {
11057
12202
  minutes_since_success: number;
11058
12203
  }[];
11059
12204
  };
12205
+ get_group_allocation_keys: {
12206
+ Args: {
12207
+ p_product_id: string;
12208
+ };
12209
+ Returns: {
12210
+ k: string;
12211
+ ord: number;
12212
+ }[];
12213
+ };
12214
+ get_group_head_key: {
12215
+ Args: {
12216
+ p_group_id: string;
12217
+ };
12218
+ Returns: string;
12219
+ };
12220
+ get_inventory_stock_for_key: {
12221
+ Args: {
12222
+ p_key: string;
12223
+ };
12224
+ Returns: number;
12225
+ };
11060
12226
  get_offer_by_link_code: {
11061
12227
  Args: {
11062
12228
  p_code: string;
@@ -11087,6 +12253,12 @@ export type Database = {
11087
12253
  };
11088
12254
  Returns: string;
11089
12255
  };
12256
+ get_product_group_available_stock: {
12257
+ Args: {
12258
+ p_group_id: string;
12259
+ };
12260
+ Returns: number;
12261
+ };
11090
12262
  get_room_busy_windows: {
11091
12263
  Args: {
11092
12264
  p_from: string;
@@ -11167,6 +12339,32 @@ export type Database = {
11167
12339
  };
11168
12340
  Returns: undefined;
11169
12341
  };
12342
+ mark_salesorder_controlled: {
12343
+ Args: {
12344
+ p_controlled: boolean;
12345
+ p_floriday_id: string;
12346
+ };
12347
+ Returns: undefined;
12348
+ };
12349
+ mark_shipment_shipped: {
12350
+ Args: {
12351
+ p_shipment_id: string;
12352
+ };
12353
+ Returns: undefined;
12354
+ };
12355
+ merge_products: {
12356
+ Args: {
12357
+ _canonical: string;
12358
+ _loser: string;
12359
+ };
12360
+ Returns: undefined;
12361
+ };
12362
+ next_manufacture_partij: {
12363
+ Args: {
12364
+ _tenant_id: string;
12365
+ };
12366
+ Returns: string;
12367
+ };
11170
12368
  next_order_number: {
11171
12369
  Args: {
11172
12370
  p_prefix: string;
@@ -11236,6 +12434,15 @@ export type Database = {
11236
12434
  };
11237
12435
  Returns: undefined;
11238
12436
  };
12437
+ pickstation_resolve_delivery_orders: {
12438
+ Args: {
12439
+ p_sales_order_ids: string[];
12440
+ };
12441
+ Returns: {
12442
+ delivery_order_id: string;
12443
+ sales_order_id: string;
12444
+ }[];
12445
+ };
11239
12446
  pickstation_set_cart_status: {
11240
12447
  Args: {
11241
12448
  p_cart_index: number;
@@ -11245,6 +12452,14 @@ export type Database = {
11245
12452
  };
11246
12453
  Returns: undefined;
11247
12454
  };
12455
+ produce_designed_product: {
12456
+ Args: {
12457
+ p_parent_id: string;
12458
+ p_parent_kind: string;
12459
+ p_quantity: number;
12460
+ };
12461
+ Returns: Json;
12462
+ };
11248
12463
  promote_trade_item_key: {
11249
12464
  Args: {
11250
12465
  p_new: string;
@@ -11252,6 +12467,10 @@ export type Database = {
11252
12467
  };
11253
12468
  Returns: undefined;
11254
12469
  };
12470
+ recompute_all_reserved_stock: {
12471
+ Args: never;
12472
+ Returns: undefined;
12473
+ };
11255
12474
  recompute_order_status: {
11256
12475
  Args: {
11257
12476
  p_order_id: string;
@@ -11301,27 +12520,45 @@ export type Database = {
11301
12520
  };
11302
12521
  Returns: undefined;
11303
12522
  };
12523
+ resolve_group_allocation: {
12524
+ Args: {
12525
+ _needed: number;
12526
+ _product_group_id: string;
12527
+ };
12528
+ Returns: {
12529
+ allocated: number;
12530
+ trade_item_id: string;
12531
+ }[];
12532
+ };
12533
+ resolve_group_member_stock_key: {
12534
+ Args: {
12535
+ p_trade_item_id: string;
12536
+ };
12537
+ Returns: string;
12538
+ };
11304
12539
  resolve_product_id_for_item: {
11305
12540
  Args: {
11306
12541
  p_product_name: string;
11307
12542
  };
11308
12543
  Returns: string;
11309
12544
  };
11310
- schedule_floriday_additional_services_sync: {
12545
+ resolve_stock_trade_item_key: {
11311
12546
  Args: {
11312
- p_apikey: string;
11313
- p_url: string;
12547
+ p_product_id: string;
11314
12548
  };
11315
- Returns: number;
12549
+ Returns: string;
11316
12550
  };
11317
- schedule_floriday_agreement_calloffs_sync: {
12551
+ reverse_production: {
11318
12552
  Args: {
11319
- p_apikey: string;
11320
- p_url: string;
12553
+ p_connection_id?: string;
12554
+ p_parent_key: string;
12555
+ p_quantity: number;
12556
+ p_reason?: string;
12557
+ p_user_id?: string;
11321
12558
  };
11322
- Returns: number;
12559
+ Returns: Json;
11323
12560
  };
11324
- schedule_floriday_agreements_sync: {
12561
+ schedule_floriday_additional_services_sync: {
11325
12562
  Args: {
11326
12563
  p_apikey: string;
11327
12564
  p_url: string;
@@ -11574,6 +12811,10 @@ export type Database = {
11574
12811
  };
11575
12812
  Returns: number;
11576
12813
  };
12814
+ self_heal_floriday_links: {
12815
+ Args: never;
12816
+ Returns: number;
12817
+ };
11577
12818
  show_limit: {
11578
12819
  Args: never;
11579
12820
  Returns: number;
@@ -11584,18 +12825,34 @@ export type Database = {
11584
12825
  };
11585
12826
  Returns: string[];
11586
12827
  };
12828
+ sync_all_layer_stocks: {
12829
+ Args: never;
12830
+ Returns: undefined;
12831
+ };
11587
12832
  sync_cached_packing_from_product: {
11588
12833
  Args: {
11589
12834
  p_product_id: string;
11590
12835
  };
11591
12836
  Returns: undefined;
11592
12837
  };
12838
+ sync_layer_stock: {
12839
+ Args: {
12840
+ p_product_id: string;
12841
+ };
12842
+ Returns: undefined;
12843
+ };
11593
12844
  sync_order_cart_item_packing_from_product: {
11594
12845
  Args: {
11595
12846
  p_product_id: string;
11596
12847
  };
11597
12848
  Returns: undefined;
11598
12849
  };
12850
+ sync_product_group_belading: {
12851
+ Args: {
12852
+ _group_id: string;
12853
+ };
12854
+ Returns: undefined;
12855
+ };
11599
12856
  sync_product_packing_from_floriday_cache: {
11600
12857
  Args: {
11601
12858
  p_floriday_id: string;