@flowselections/floriday-verkoop-module 1.0.16 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist-lib/components/verkoop/CreateOrderPage.d.ts.map +1 -1
  2. package/dist-lib/components/verkoop/CreateOrderPage.js +12 -12
  3. package/dist-lib/components/verkoop/EditLocalOrderDialog.d.ts +6 -0
  4. package/dist-lib/components/verkoop/EditLocalOrderDialog.d.ts.map +1 -0
  5. package/dist-lib/components/verkoop/EditLocalOrderDialog.js +102 -0
  6. package/dist-lib/components/verkoop/OrderKarindelingCard.d.ts.map +1 -1
  7. package/dist-lib/components/verkoop/OrderKarindelingCard.js +26 -28
  8. package/dist-lib/components/verkoop/OrderShipmentsCard.d.ts +5 -0
  9. package/dist-lib/components/verkoop/OrderShipmentsCard.d.ts.map +1 -0
  10. package/dist-lib/components/verkoop/OrderShipmentsCard.js +137 -0
  11. package/dist-lib/components/verkoop/SalesOrderDetailPage.d.ts.map +1 -1
  12. package/dist-lib/components/verkoop/SalesOrderDetailPage.js +8 -2
  13. package/dist-lib/components/verkoop/SalesOrderDetailView.d.ts.map +1 -1
  14. package/dist-lib/components/verkoop/SalesOrderDetailView.js +2 -1
  15. package/dist-lib/components/verkoop/SalesOrdersFilters.d.ts.map +1 -1
  16. package/dist-lib/components/verkoop/SalesOrdersFilters.js +2 -8
  17. package/dist-lib/components/verkoop/SalesOrdersTable.d.ts +4 -1
  18. package/dist-lib/components/verkoop/SalesOrdersTable.d.ts.map +1 -1
  19. package/dist-lib/components/verkoop/SalesOrdersTable.js +2 -2
  20. package/dist-lib/components/verkoop/VerkoopOrdersPage.d.ts.map +1 -1
  21. package/dist-lib/components/verkoop/VerkoopOrdersPage.js +43 -1
  22. package/dist-lib/index.js +2 -2
  23. package/dist-lib/integrations/supabase/auth-middleware.d.ts +607 -169
  24. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  25. package/dist-lib/integrations/supabase/client.d.ts +607 -169
  26. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  27. package/dist-lib/integrations/supabase/client.server.d.ts +607 -169
  28. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  29. package/dist-lib/integrations/supabase/types.d.ts +623 -164
  30. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  31. package/dist-lib/lib/cart-lock.functions.d.ts +607 -169
  32. package/dist-lib/lib/cart-lock.functions.d.ts.map +1 -1
  33. package/dist-lib/lib/cart-replan.functions.d.ts +1221 -345
  34. package/dist-lib/lib/cart-replan.functions.d.ts.map +1 -1
  35. package/dist-lib/lib/create-order.functions.d.ts +40700 -1397
  36. package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
  37. package/dist-lib/lib/create-order.functions.js +792 -52
  38. package/dist-lib/lib/expand-group-order-items.d.ts +13 -0
  39. package/dist-lib/lib/expand-group-order-items.d.ts.map +1 -0
  40. package/dist-lib/lib/expand-group-order-items.js +216 -0
  41. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts +1767 -453
  42. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts.map +1 -1
  43. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts +607 -169
  44. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts.map +1 -1
  45. package/dist-lib/lib/floriday-public.functions.d.ts +4123 -1057
  46. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  47. package/dist-lib/lib/floriday-writes.functions.d.ts +2945 -755
  48. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  49. package/dist-lib/lib/order-shipments.functions.d.ts +47158 -0
  50. package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -0
  51. package/dist-lib/lib/order-shipments.functions.js +178 -0
  52. package/dist-lib/lib/salesorders-mapping.d.ts +1 -0
  53. package/dist-lib/lib/salesorders-mapping.d.ts.map +1 -1
  54. package/dist-lib/lib/salesorders.functions.d.ts +1767 -453
  55. package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
  56. package/dist-lib/lib/tradeitems.functions.d.ts +607 -169
  57. package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
  58. package/dist-lib/lib/useSalesOrdersQuery.d.ts.map +1 -1
  59. package/dist-lib/lib/useSalesOrdersQuery.js +39 -2
  60. package/package.json +2 -2
@@ -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;
@@ -3324,109 +3490,6 @@ export type Database = {
3324
3490
  }
3325
3491
  ];
3326
3492
  };
3327
- floriday_agreement_calloffs_cache: {
3328
- Row: {
3329
- agreement_id: string | null;
3330
- connection_id: string;
3331
- data: Json;
3332
- delivery_date: string | null;
3333
- fetched_at: string;
3334
- floriday_id: string;
3335
- id: string;
3336
- is_deleted: boolean;
3337
- sequence_number: number;
3338
- status: string | null;
3339
- updated_at: string;
3340
- };
3341
- 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
3493
  floriday_auction_letters_cache: {
3431
3494
  Row: {
3432
3495
  auction_letter_code: string;
@@ -3945,6 +4008,27 @@ export type Database = {
3945
4008
  }
3946
4009
  ];
3947
4010
  };
4011
+ floriday_continuous_stock_cache: {
4012
+ Row: {
4013
+ connection_id: string;
4014
+ fetched_at: string;
4015
+ number_of_pieces: number;
4016
+ trade_item_id: string;
4017
+ };
4018
+ Insert: {
4019
+ connection_id: string;
4020
+ fetched_at?: string;
4021
+ number_of_pieces?: number;
4022
+ trade_item_id: string;
4023
+ };
4024
+ Update: {
4025
+ connection_id?: string;
4026
+ fetched_at?: string;
4027
+ number_of_pieces?: number;
4028
+ trade_item_id?: string;
4029
+ };
4030
+ Relationships: [];
4031
+ };
3948
4032
  floriday_continuous_stock_queue: {
3949
4033
  Row: {
3950
4034
  attempts: number;
@@ -4961,9 +5045,8 @@ export type Database = {
4961
5045
  }
4962
5046
  ];
4963
5047
  };
4964
- floriday_trips_cache: {
5048
+ floriday_trade_settings_customers_cache: {
4965
5049
  Row: {
4966
- carrier_organization_id: string | null;
4967
5050
  connection_id: string;
4968
5051
  data: Json;
4969
5052
  fetched_at: string;
@@ -4971,25 +5054,67 @@ export type Database = {
4971
5054
  id: string;
4972
5055
  is_deleted: boolean;
4973
5056
  sequence_number: number;
4974
- status: string | null;
4975
- trip_date: string | null;
4976
5057
  updated_at: string;
4977
5058
  };
4978
5059
  Insert: {
4979
- carrier_organization_id?: string | null;
4980
5060
  connection_id: string;
4981
- data?: Json;
5061
+ data: Json;
4982
5062
  fetched_at?: string;
4983
5063
  floriday_id: string;
4984
5064
  id?: string;
4985
5065
  is_deleted?: boolean;
4986
5066
  sequence_number?: number;
4987
- status?: string | null;
4988
- trip_date?: string | null;
4989
5067
  updated_at?: string;
4990
5068
  };
4991
5069
  Update: {
4992
- carrier_organization_id?: string | null;
5070
+ connection_id?: string;
5071
+ data?: Json;
5072
+ fetched_at?: string;
5073
+ floriday_id?: string;
5074
+ id?: string;
5075
+ is_deleted?: boolean;
5076
+ sequence_number?: number;
5077
+ updated_at?: string;
5078
+ };
5079
+ Relationships: [
5080
+ {
5081
+ foreignKeyName: "floriday_trade_settings_customers_cache_connection_id_fkey";
5082
+ columns: ["connection_id"];
5083
+ isOneToOne: false;
5084
+ referencedRelation: "floriday_connections";
5085
+ referencedColumns: ["id"];
5086
+ }
5087
+ ];
5088
+ };
5089
+ floriday_trips_cache: {
5090
+ Row: {
5091
+ carrier_organization_id: string | null;
5092
+ connection_id: string;
5093
+ data: Json;
5094
+ fetched_at: string;
5095
+ floriday_id: string;
5096
+ id: string;
5097
+ is_deleted: boolean;
5098
+ sequence_number: number;
5099
+ status: string | null;
5100
+ trip_date: string | null;
5101
+ updated_at: string;
5102
+ };
5103
+ Insert: {
5104
+ carrier_organization_id?: string | null;
5105
+ connection_id: string;
5106
+ data?: Json;
5107
+ fetched_at?: string;
5108
+ floriday_id: string;
5109
+ id?: string;
5110
+ is_deleted?: boolean;
5111
+ sequence_number?: number;
5112
+ status?: string | null;
5113
+ trip_date?: string | null;
5114
+ updated_at?: string;
5115
+ };
5116
+ Update: {
5117
+ carrier_organization_id?: string | null;
4993
5118
  connection_id?: string;
4994
5119
  data?: Json;
4995
5120
  fetched_at?: string;
@@ -6153,39 +6278,62 @@ export type Database = {
6153
6278
  };
6154
6279
  manufacture_products: {
6155
6280
  Row: {
6281
+ aantal_te_produceren: number;
6156
6282
  created_at: string;
6157
6283
  description: string | null;
6158
6284
  id: string;
6159
6285
  is_active: boolean;
6286
+ location_id: string | null;
6160
6287
  name: string;
6288
+ partij_nummer: string | null;
6289
+ photos: Json;
6161
6290
  produced_stock: number;
6162
6291
  product_code: string;
6163
6292
  tenant_id: string;
6293
+ unit: string;
6164
6294
  updated_at: string;
6165
6295
  };
6166
6296
  Insert: {
6297
+ aantal_te_produceren?: number;
6167
6298
  created_at?: string;
6168
6299
  description?: string | null;
6169
6300
  id?: string;
6170
6301
  is_active?: boolean;
6302
+ location_id?: string | null;
6171
6303
  name: string;
6304
+ partij_nummer?: string | null;
6305
+ photos?: Json;
6172
6306
  produced_stock?: number;
6173
6307
  product_code: string;
6174
6308
  tenant_id: string;
6309
+ unit?: string;
6175
6310
  updated_at?: string;
6176
6311
  };
6177
6312
  Update: {
6313
+ aantal_te_produceren?: number;
6178
6314
  created_at?: string;
6179
6315
  description?: string | null;
6180
6316
  id?: string;
6181
6317
  is_active?: boolean;
6318
+ location_id?: string | null;
6182
6319
  name?: string;
6320
+ partij_nummer?: string | null;
6321
+ photos?: Json;
6183
6322
  produced_stock?: number;
6184
6323
  product_code?: string;
6185
6324
  tenant_id?: string;
6325
+ unit?: string;
6186
6326
  updated_at?: string;
6187
6327
  };
6188
- Relationships: [];
6328
+ Relationships: [
6329
+ {
6330
+ foreignKeyName: "manufacture_products_location_id_fkey";
6331
+ columns: ["location_id"];
6332
+ isOneToOne: false;
6333
+ referencedRelation: "locations";
6334
+ referencedColumns: ["id"];
6335
+ }
6336
+ ];
6189
6337
  };
6190
6338
  monteurs: {
6191
6339
  Row: {
@@ -7195,6 +7343,111 @@ export type Database = {
7195
7343
  };
7196
7344
  Relationships: [];
7197
7345
  };
7346
+ order_shipment_items: {
7347
+ Row: {
7348
+ created_at: string;
7349
+ id: string;
7350
+ order_item_id: string;
7351
+ product_id: string | null;
7352
+ product_name: string;
7353
+ quantity: number;
7354
+ shipment_id: string;
7355
+ updated_at: string;
7356
+ };
7357
+ Insert: {
7358
+ created_at?: string;
7359
+ id?: string;
7360
+ order_item_id: string;
7361
+ product_id?: string | null;
7362
+ product_name: string;
7363
+ quantity: number;
7364
+ shipment_id: string;
7365
+ updated_at?: string;
7366
+ };
7367
+ Update: {
7368
+ created_at?: string;
7369
+ id?: string;
7370
+ order_item_id?: string;
7371
+ product_id?: string | null;
7372
+ product_name?: string;
7373
+ quantity?: number;
7374
+ shipment_id?: string;
7375
+ updated_at?: string;
7376
+ };
7377
+ Relationships: [
7378
+ {
7379
+ foreignKeyName: "order_shipment_items_order_item_id_fkey";
7380
+ columns: ["order_item_id"];
7381
+ isOneToOne: false;
7382
+ referencedRelation: "order_items";
7383
+ referencedColumns: ["id"];
7384
+ },
7385
+ {
7386
+ foreignKeyName: "order_shipment_items_shipment_id_fkey";
7387
+ columns: ["shipment_id"];
7388
+ isOneToOne: false;
7389
+ referencedRelation: "order_shipments";
7390
+ referencedColumns: ["id"];
7391
+ }
7392
+ ];
7393
+ };
7394
+ order_shipments: {
7395
+ Row: {
7396
+ carrier_id: string | null;
7397
+ created_at: string;
7398
+ delivery_date: string | null;
7399
+ delivery_location_id: string | null;
7400
+ id: string;
7401
+ notes: string | null;
7402
+ order_id: string;
7403
+ shipment_number: number;
7404
+ shipped_at: string | null;
7405
+ status: string;
7406
+ updated_at: string;
7407
+ };
7408
+ Insert: {
7409
+ carrier_id?: string | null;
7410
+ created_at?: string;
7411
+ delivery_date?: string | null;
7412
+ delivery_location_id?: string | null;
7413
+ id?: string;
7414
+ notes?: string | null;
7415
+ order_id: string;
7416
+ shipment_number: number;
7417
+ shipped_at?: string | null;
7418
+ status?: string;
7419
+ updated_at?: string;
7420
+ };
7421
+ Update: {
7422
+ carrier_id?: string | null;
7423
+ created_at?: string;
7424
+ delivery_date?: string | null;
7425
+ delivery_location_id?: string | null;
7426
+ id?: string;
7427
+ notes?: string | null;
7428
+ order_id?: string;
7429
+ shipment_number?: number;
7430
+ shipped_at?: string | null;
7431
+ status?: string;
7432
+ updated_at?: string;
7433
+ };
7434
+ Relationships: [
7435
+ {
7436
+ foreignKeyName: "order_shipments_carrier_id_fkey";
7437
+ columns: ["carrier_id"];
7438
+ isOneToOne: false;
7439
+ referencedRelation: "carriers";
7440
+ referencedColumns: ["id"];
7441
+ },
7442
+ {
7443
+ foreignKeyName: "order_shipments_order_id_fkey";
7444
+ columns: ["order_id"];
7445
+ isOneToOne: false;
7446
+ referencedRelation: "orders";
7447
+ referencedColumns: ["id"];
7448
+ }
7449
+ ];
7450
+ };
7198
7451
  orders: {
7199
7452
  Row: {
7200
7453
  created_at: string;
@@ -7202,8 +7455,9 @@ export type Database = {
7202
7455
  customer_id: string | null;
7203
7456
  customer_name: string;
7204
7457
  deleted_at: string | null;
7205
- delivery_date: string;
7458
+ delivery_date: string | null;
7206
7459
  id: string;
7460
+ is_reservation: boolean;
7207
7461
  notes: string | null;
7208
7462
  order_date: string;
7209
7463
  order_number: string;
@@ -7220,8 +7474,9 @@ export type Database = {
7220
7474
  customer_id?: string | null;
7221
7475
  customer_name?: string;
7222
7476
  deleted_at?: string | null;
7223
- delivery_date: string;
7477
+ delivery_date?: string | null;
7224
7478
  id?: string;
7479
+ is_reservation?: boolean;
7225
7480
  notes?: string | null;
7226
7481
  order_date?: string;
7227
7482
  order_number: string;
@@ -7238,8 +7493,9 @@ export type Database = {
7238
7493
  customer_id?: string | null;
7239
7494
  customer_name?: string;
7240
7495
  deleted_at?: string | null;
7241
- delivery_date?: string;
7496
+ delivery_date?: string | null;
7242
7497
  id?: string;
7498
+ is_reservation?: boolean;
7243
7499
  notes?: string | null;
7244
7500
  order_date?: string;
7245
7501
  order_number?: string;
@@ -7383,6 +7639,66 @@ export type Database = {
7383
7639
  };
7384
7640
  Relationships: [];
7385
7641
  };
7642
+ product_bom_items: {
7643
+ Row: {
7644
+ component_product_id: string | null;
7645
+ component_trade_item_floriday_id: string | null;
7646
+ created_at: string;
7647
+ id: string;
7648
+ notes: string | null;
7649
+ parent_product_id: string | null;
7650
+ parent_trade_item_floriday_id: string | null;
7651
+ quantity: number;
7652
+ sort_order: number;
7653
+ tenant_id: string;
7654
+ unit: string;
7655
+ updated_at: string;
7656
+ };
7657
+ Insert: {
7658
+ component_product_id?: string | null;
7659
+ component_trade_item_floriday_id?: string | null;
7660
+ created_at?: string;
7661
+ id?: string;
7662
+ notes?: string | null;
7663
+ parent_product_id?: string | null;
7664
+ parent_trade_item_floriday_id?: string | null;
7665
+ quantity?: number;
7666
+ sort_order?: number;
7667
+ tenant_id: string;
7668
+ unit?: string;
7669
+ updated_at?: string;
7670
+ };
7671
+ Update: {
7672
+ component_product_id?: string | null;
7673
+ component_trade_item_floriday_id?: string | null;
7674
+ created_at?: string;
7675
+ id?: string;
7676
+ notes?: string | null;
7677
+ parent_product_id?: string | null;
7678
+ parent_trade_item_floriday_id?: string | null;
7679
+ quantity?: number;
7680
+ sort_order?: number;
7681
+ tenant_id?: string;
7682
+ unit?: string;
7683
+ updated_at?: string;
7684
+ };
7685
+ Relationships: [
7686
+ {
7687
+ foreignKeyName: "product_bom_items_component_product_id_fkey";
7688
+ columns: ["component_product_id"];
7689
+ isOneToOne: false;
7690
+ referencedRelation: "products";
7691
+ referencedColumns: ["id"];
7692
+ },
7693
+ {
7694
+ foreignKeyName: "product_bom_items_parent_product_id_fkey";
7695
+ columns: ["parent_product_id"];
7696
+ isOneToOne: false;
7697
+ referencedRelation: "products";
7698
+ referencedColumns: ["id"];
7699
+ }
7700
+ ];
7701
+ };
7386
7702
  product_categories: {
7387
7703
  Row: {
7388
7704
  color: string;
@@ -7490,6 +7806,7 @@ export type Database = {
7490
7806
  id: string;
7491
7807
  product_group_id: string;
7492
7808
  quantity: number;
7809
+ sort_order: number;
7493
7810
  trade_item_id: string;
7494
7811
  };
7495
7812
  Insert: {
@@ -7497,6 +7814,7 @@ export type Database = {
7497
7814
  id?: string;
7498
7815
  product_group_id: string;
7499
7816
  quantity?: number;
7817
+ sort_order?: number;
7500
7818
  trade_item_id: string;
7501
7819
  };
7502
7820
  Update: {
@@ -7504,6 +7822,7 @@ export type Database = {
7504
7822
  id?: string;
7505
7823
  product_group_id?: string;
7506
7824
  quantity?: number;
7825
+ sort_order?: number;
7507
7826
  trade_item_id?: string;
7508
7827
  };
7509
7828
  Relationships: [
@@ -7520,6 +7839,8 @@ export type Database = {
7520
7839
  Row: {
7521
7840
  created_at: string;
7522
7841
  description: string | null;
7842
+ head_product_id: string | null;
7843
+ head_trade_item_floriday_id: string | null;
7523
7844
  id: string;
7524
7845
  is_active: boolean;
7525
7846
  name: string;
@@ -7529,6 +7850,8 @@ export type Database = {
7529
7850
  Insert: {
7530
7851
  created_at?: string;
7531
7852
  description?: string | null;
7853
+ head_product_id?: string | null;
7854
+ head_trade_item_floriday_id?: string | null;
7532
7855
  id?: string;
7533
7856
  is_active?: boolean;
7534
7857
  name: string;
@@ -7538,16 +7861,90 @@ export type Database = {
7538
7861
  Update: {
7539
7862
  created_at?: string;
7540
7863
  description?: string | null;
7864
+ head_product_id?: string | null;
7865
+ head_trade_item_floriday_id?: string | null;
7541
7866
  id?: string;
7542
7867
  is_active?: boolean;
7543
7868
  name?: string;
7544
7869
  tenant_id?: string;
7545
7870
  updated_at?: string;
7546
7871
  };
7547
- Relationships: [];
7872
+ Relationships: [
7873
+ {
7874
+ foreignKeyName: "product_groups_head_product_id_fkey";
7875
+ columns: ["head_product_id"];
7876
+ isOneToOne: false;
7877
+ referencedRelation: "products";
7878
+ referencedColumns: ["id"];
7879
+ }
7880
+ ];
7881
+ };
7882
+ product_load_settings: {
7883
+ Row: {
7884
+ created_at: string;
7885
+ id: string;
7886
+ is_package: boolean;
7887
+ layers_per_load_carrier: number | null;
7888
+ load_carrier: string | null;
7889
+ package_id: string | null;
7890
+ package_label: string | null;
7891
+ packages_per_layer: number | null;
7892
+ product_id: string | null;
7893
+ tenant_id: string;
7894
+ trade_item_floriday_id: string | null;
7895
+ units_per_package: number | null;
7896
+ updated_at: string;
7897
+ };
7898
+ Insert: {
7899
+ created_at?: string;
7900
+ id?: string;
7901
+ is_package?: boolean;
7902
+ layers_per_load_carrier?: number | null;
7903
+ load_carrier?: string | null;
7904
+ package_id?: string | null;
7905
+ package_label?: string | null;
7906
+ packages_per_layer?: number | null;
7907
+ product_id?: string | null;
7908
+ tenant_id: string;
7909
+ trade_item_floriday_id?: string | null;
7910
+ units_per_package?: number | null;
7911
+ updated_at?: string;
7912
+ };
7913
+ Update: {
7914
+ created_at?: string;
7915
+ id?: string;
7916
+ is_package?: boolean;
7917
+ layers_per_load_carrier?: number | null;
7918
+ load_carrier?: string | null;
7919
+ package_id?: string | null;
7920
+ package_label?: string | null;
7921
+ packages_per_layer?: number | null;
7922
+ product_id?: string | null;
7923
+ tenant_id?: string;
7924
+ trade_item_floriday_id?: string | null;
7925
+ units_per_package?: number | null;
7926
+ updated_at?: string;
7927
+ };
7928
+ Relationships: [
7929
+ {
7930
+ foreignKeyName: "product_load_settings_package_id_fkey";
7931
+ columns: ["package_id"];
7932
+ isOneToOne: false;
7933
+ referencedRelation: "packages";
7934
+ referencedColumns: ["id"];
7935
+ },
7936
+ {
7937
+ foreignKeyName: "product_load_settings_product_id_fkey";
7938
+ columns: ["product_id"];
7939
+ isOneToOne: false;
7940
+ referencedRelation: "products";
7941
+ referencedColumns: ["id"];
7942
+ }
7943
+ ];
7548
7944
  };
7549
7945
  products: {
7550
7946
  Row: {
7947
+ article_number: string | null;
7551
7948
  barcode: string | null;
7552
7949
  batch: string;
7553
7950
  crates_per_layer: number;
@@ -7571,6 +7968,7 @@ export type Database = {
7571
7968
  weight: string | null;
7572
7969
  };
7573
7970
  Insert: {
7971
+ article_number?: string | null;
7574
7972
  barcode?: string | null;
7575
7973
  batch: string;
7576
7974
  crates_per_layer?: number;
@@ -7594,6 +7992,7 @@ export type Database = {
7594
7992
  weight?: string | null;
7595
7993
  };
7596
7994
  Update: {
7995
+ article_number?: string | null;
7597
7996
  barcode?: string | null;
7598
7997
  batch?: string;
7599
7998
  crates_per_layer?: number;
@@ -8539,8 +8938,10 @@ export type Database = {
8539
8938
  order_id: string | null;
8540
8939
  order_item_id: string | null;
8541
8940
  order_source: string | null;
8941
+ parent_trade_item_key: string | null;
8542
8942
  physical_after: number | null;
8543
8943
  physical_before: number | null;
8944
+ production_batch_id: string | null;
8544
8945
  qty_delta: number;
8545
8946
  reason: string | null;
8546
8947
  reserved_after: number | null;
@@ -8556,8 +8957,10 @@ export type Database = {
8556
8957
  order_id?: string | null;
8557
8958
  order_item_id?: string | null;
8558
8959
  order_source?: string | null;
8960
+ parent_trade_item_key?: string | null;
8559
8961
  physical_after?: number | null;
8560
8962
  physical_before?: number | null;
8963
+ production_batch_id?: string | null;
8561
8964
  qty_delta: number;
8562
8965
  reason?: string | null;
8563
8966
  reserved_after?: number | null;
@@ -8573,8 +8976,10 @@ export type Database = {
8573
8976
  order_id?: string | null;
8574
8977
  order_item_id?: string | null;
8575
8978
  order_source?: string | null;
8979
+ parent_trade_item_key?: string | null;
8576
8980
  physical_after?: number | null;
8577
8981
  physical_before?: number | null;
8982
+ production_batch_id?: string | null;
8578
8983
  qty_delta?: number;
8579
8984
  reason?: string | null;
8580
8985
  reserved_after?: number | null;
@@ -9043,7 +9448,7 @@ export type Database = {
9043
9448
  twinfield_connections: {
9044
9449
  Row: {
9045
9450
  access_token: string | null;
9046
- client_id: string;
9451
+ client_id: string | null;
9047
9452
  client_secret: string | null;
9048
9453
  cluster_uri: string | null;
9049
9454
  company_code: string | null;
@@ -9055,7 +9460,7 @@ export type Database = {
9055
9460
  is_active: boolean;
9056
9461
  label: string | null;
9057
9462
  office_code: string | null;
9058
- redirect_uri: string;
9463
+ redirect_uri: string | null;
9059
9464
  refresh_token: string | null;
9060
9465
  token_expires_at: string | null;
9061
9466
  updated_at: string;
@@ -9063,7 +9468,7 @@ export type Database = {
9063
9468
  };
9064
9469
  Insert: {
9065
9470
  access_token?: string | null;
9066
- client_id: string;
9471
+ client_id?: string | null;
9067
9472
  client_secret?: string | null;
9068
9473
  cluster_uri?: string | null;
9069
9474
  company_code?: string | null;
@@ -9075,7 +9480,7 @@ export type Database = {
9075
9480
  is_active?: boolean;
9076
9481
  label?: string | null;
9077
9482
  office_code?: string | null;
9078
- redirect_uri: string;
9483
+ redirect_uri?: string | null;
9079
9484
  refresh_token?: string | null;
9080
9485
  token_expires_at?: string | null;
9081
9486
  updated_at?: string;
@@ -9083,7 +9488,7 @@ export type Database = {
9083
9488
  };
9084
9489
  Update: {
9085
9490
  access_token?: string | null;
9086
- client_id?: string;
9491
+ client_id?: string | null;
9087
9492
  client_secret?: string | null;
9088
9493
  cluster_uri?: string | null;
9089
9494
  company_code?: string | null;
@@ -9095,7 +9500,7 @@ export type Database = {
9095
9500
  is_active?: boolean;
9096
9501
  label?: string | null;
9097
9502
  office_code?: string | null;
9098
- redirect_uri?: string;
9503
+ redirect_uri?: string | null;
9099
9504
  refresh_token?: string | null;
9100
9505
  token_expires_at?: string | null;
9101
9506
  updated_at?: string;
@@ -10312,25 +10717,6 @@ export type Database = {
10312
10717
  };
10313
10718
  Relationships: [];
10314
10719
  };
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
10720
  local_customer_discounts: {
10335
10721
  Row: {
10336
10722
  base_price: number | null;
@@ -10761,6 +11147,28 @@ export type Database = {
10761
11147
  Args: never;
10762
11148
  Returns: undefined;
10763
11149
  };
11150
+ consume_bom_for_production: {
11151
+ Args: {
11152
+ p_connection_id: string;
11153
+ p_parent_id: string;
11154
+ p_parent_key: string;
11155
+ p_parent_kind: string;
11156
+ p_quantity: number;
11157
+ p_user_id: string;
11158
+ };
11159
+ Returns: Json;
11160
+ } | {
11161
+ Args: {
11162
+ p_batch_id?: string;
11163
+ p_connection_id: string;
11164
+ p_parent_id: string;
11165
+ p_parent_key: string;
11166
+ p_parent_kind: string;
11167
+ p_quantity: number;
11168
+ p_user_id: string;
11169
+ };
11170
+ Returns: Json;
11171
+ };
10764
11172
  consume_floriday_rate_limit: {
10765
11173
  Args: {
10766
11174
  p_bucket: string;
@@ -10812,6 +11220,13 @@ export type Database = {
10812
11220
  table_name: string;
10813
11221
  }[];
10814
11222
  };
11223
+ delete_samenstelling: {
11224
+ Args: {
11225
+ p_parent_id: string;
11226
+ p_parent_kind: string;
11227
+ };
11228
+ Returns: Json;
11229
+ };
10815
11230
  dispatch_carrier_signups_sql: {
10816
11231
  Args: {
10817
11232
  _catchup?: string;
@@ -10972,19 +11387,6 @@ export type Database = {
10972
11387
  resource: string;
10973
11388
  }[];
10974
11389
  };
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
11390
  get_floriday_clock_supplies_window: {
10989
11391
  Args: {
10990
11392
  p_from: string;
@@ -11057,6 +11459,21 @@ export type Database = {
11057
11459
  minutes_since_success: number;
11058
11460
  }[];
11059
11461
  };
11462
+ get_group_allocation_keys: {
11463
+ Args: {
11464
+ p_product_id: string;
11465
+ };
11466
+ Returns: {
11467
+ k: string;
11468
+ ord: number;
11469
+ }[];
11470
+ };
11471
+ get_group_head_key: {
11472
+ Args: {
11473
+ p_group_id: string;
11474
+ };
11475
+ Returns: string;
11476
+ };
11060
11477
  get_offer_by_link_code: {
11061
11478
  Args: {
11062
11479
  p_code: string;
@@ -11167,6 +11584,18 @@ export type Database = {
11167
11584
  };
11168
11585
  Returns: undefined;
11169
11586
  };
11587
+ mark_shipment_shipped: {
11588
+ Args: {
11589
+ p_shipment_id: string;
11590
+ };
11591
+ Returns: undefined;
11592
+ };
11593
+ next_manufacture_partij: {
11594
+ Args: {
11595
+ _tenant_id: string;
11596
+ };
11597
+ Returns: string;
11598
+ };
11170
11599
  next_order_number: {
11171
11600
  Args: {
11172
11601
  p_prefix: string;
@@ -11245,6 +11674,14 @@ export type Database = {
11245
11674
  };
11246
11675
  Returns: undefined;
11247
11676
  };
11677
+ produce_designed_product: {
11678
+ Args: {
11679
+ p_parent_id: string;
11680
+ p_parent_kind: string;
11681
+ p_quantity: number;
11682
+ };
11683
+ Returns: Json;
11684
+ };
11248
11685
  promote_trade_item_key: {
11249
11686
  Args: {
11250
11687
  p_new: string;
@@ -11252,6 +11689,10 @@ export type Database = {
11252
11689
  };
11253
11690
  Returns: undefined;
11254
11691
  };
11692
+ recompute_all_reserved_stock: {
11693
+ Args: never;
11694
+ Returns: undefined;
11695
+ };
11255
11696
  recompute_order_status: {
11256
11697
  Args: {
11257
11698
  p_order_id: string;
@@ -11301,27 +11742,45 @@ export type Database = {
11301
11742
  };
11302
11743
  Returns: undefined;
11303
11744
  };
11745
+ resolve_group_allocation: {
11746
+ Args: {
11747
+ _needed: number;
11748
+ _product_group_id: string;
11749
+ };
11750
+ Returns: {
11751
+ allocated: number;
11752
+ trade_item_id: string;
11753
+ }[];
11754
+ };
11755
+ resolve_group_member_stock_key: {
11756
+ Args: {
11757
+ p_trade_item_id: string;
11758
+ };
11759
+ Returns: string;
11760
+ };
11304
11761
  resolve_product_id_for_item: {
11305
11762
  Args: {
11306
11763
  p_product_name: string;
11307
11764
  };
11308
11765
  Returns: string;
11309
11766
  };
11310
- schedule_floriday_additional_services_sync: {
11767
+ resolve_stock_trade_item_key: {
11311
11768
  Args: {
11312
- p_apikey: string;
11313
- p_url: string;
11769
+ p_product_id: string;
11314
11770
  };
11315
- Returns: number;
11771
+ Returns: string;
11316
11772
  };
11317
- schedule_floriday_agreement_calloffs_sync: {
11773
+ reverse_production: {
11318
11774
  Args: {
11319
- p_apikey: string;
11320
- p_url: string;
11775
+ p_connection_id?: string;
11776
+ p_parent_key: string;
11777
+ p_quantity: number;
11778
+ p_reason?: string;
11779
+ p_user_id?: string;
11321
11780
  };
11322
- Returns: number;
11781
+ Returns: Json;
11323
11782
  };
11324
- schedule_floriday_agreements_sync: {
11783
+ schedule_floriday_additional_services_sync: {
11325
11784
  Args: {
11326
11785
  p_apikey: string;
11327
11786
  p_url: string;