@flowselections/floriday-voorraad 1.0.19 → 1.0.21

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 (64) hide show
  1. package/dist-lib/components/voorraad/ArtikelCompositionCard.d.ts +7 -0
  2. package/dist-lib/components/voorraad/ArtikelCompositionCard.d.ts.map +1 -0
  3. package/dist-lib/components/voorraad/ArtikelCompositionCard.js +196 -0
  4. package/dist-lib/components/voorraad/ArtikelWizard.d.ts +2 -1
  5. package/dist-lib/components/voorraad/ArtikelWizard.d.ts.map +1 -1
  6. package/dist-lib/components/voorraad/ArtikelWizard.js +259 -26
  7. package/dist-lib/components/voorraad/EditArtikelPage.d.ts.map +1 -1
  8. package/dist-lib/components/voorraad/EditArtikelPage.js +28 -85
  9. package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts +4 -0
  10. package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts.map +1 -0
  11. package/dist-lib/components/voorraad/FloridayStatusBadge.js +8 -0
  12. package/dist-lib/components/voorraad/StockBulkButtons.js +7 -6
  13. package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts +5 -0
  14. package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts.map +1 -1
  15. package/dist-lib/components/voorraad/ValidationOverviewTable.js +26 -56
  16. package/dist-lib/components/voorraad/VoorraadDashboard.d.ts +4 -0
  17. package/dist-lib/components/voorraad/VoorraadDashboard.d.ts.map +1 -1
  18. package/dist-lib/components/voorraad/VoorraadDashboard.js +14 -6
  19. package/dist-lib/components/voorraad/VoorraadStockCard.d.ts.map +1 -1
  20. package/dist-lib/components/voorraad/VoorraadStockCard.js +11 -0
  21. package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
  22. package/dist-lib/components/voorraad/VoorraadTable.js +5 -12
  23. package/dist-lib/hooks/useFloridayContinuousStock.d.ts +13 -0
  24. package/dist-lib/hooks/useFloridayContinuousStock.d.ts.map +1 -0
  25. package/dist-lib/hooks/useFloridayContinuousStock.js +109 -0
  26. package/dist-lib/hooks/useFlorydayCustomers.d.ts +11 -4
  27. package/dist-lib/hooks/useFlorydayCustomers.d.ts.map +1 -1
  28. package/dist-lib/hooks/useFlorydayCustomers.js +85 -38
  29. package/dist-lib/hooks/useLocalTradeItems.d.ts +26 -2
  30. package/dist-lib/hooks/useLocalTradeItems.d.ts.map +1 -1
  31. package/dist-lib/hooks/useLocalTradeItems.js +119 -79
  32. package/dist-lib/hooks/useVoorraadData.d.ts +5 -5
  33. package/dist-lib/hooks/useVoorraadData.d.ts.map +1 -1
  34. package/dist-lib/hooks/useVoorraadData.js +127 -50
  35. package/dist-lib/integrations/supabase/auth-middleware.d.ts +662 -168
  36. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  37. package/dist-lib/integrations/supabase/client.d.ts +662 -168
  38. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  39. package/dist-lib/integrations/supabase/client.server.d.ts +662 -168
  40. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  41. package/dist-lib/integrations/supabase/types.d.ts +678 -163
  42. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  43. package/dist-lib/lib/floricode-required-features.functions.d.ts +662 -168
  44. package/dist-lib/lib/floricode-required-features.functions.d.ts.map +1 -1
  45. package/dist-lib/lib/floriday-client.d.ts +29 -12
  46. package/dist-lib/lib/floriday-client.d.ts.map +1 -1
  47. package/dist-lib/lib/floriday-client.js +36 -0
  48. package/dist-lib/lib/floriday-customer-offer.functions.d.ts +662 -168
  49. package/dist-lib/lib/floriday-customer-offer.functions.d.ts.map +1 -1
  50. package/dist-lib/lib/floriday-gateway.functions.d.ts +3220 -750
  51. package/dist-lib/lib/floriday-gateway.functions.d.ts.map +1 -1
  52. package/dist-lib/lib/floriday-gateway.server.d.ts +14 -0
  53. package/dist-lib/lib/floriday-gateway.server.d.ts.map +1 -1
  54. package/dist-lib/lib/floriday-gateway.server.js +3 -0
  55. package/dist-lib/lib/floriday-payload.d.ts.map +1 -1
  56. package/dist-lib/lib/floriday-payload.js +32 -8
  57. package/dist-lib/lib/floriday-warehouse.functions.d.ts +1932 -450
  58. package/dist-lib/lib/floriday-warehouse.functions.d.ts.map +1 -1
  59. package/dist-lib/lib/floriday-writes.functions.d.ts +1333 -345
  60. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  61. package/dist-lib/lib/merge-products.d.ts +8 -0
  62. package/dist-lib/lib/merge-products.d.ts.map +1 -0
  63. package/dist-lib/lib/merge-products.js +17 -0
  64. package/package.json +3 -3
@@ -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,21 +7861,131 @@ 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
  };
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
+ ];
7944
+ };
7945
+ product_merge_log: {
7946
+ Row: {
7947
+ canonical_product_id: string | null;
7948
+ id: string;
7949
+ merged_at: string;
7950
+ merged_from_id: string;
7951
+ notes: string | null;
7952
+ snapshot: Json;
7953
+ source_table: string;
7954
+ status: string;
7955
+ };
7956
+ Insert: {
7957
+ canonical_product_id?: string | null;
7958
+ id?: string;
7959
+ merged_at?: string;
7960
+ merged_from_id: string;
7961
+ notes?: string | null;
7962
+ snapshot?: Json;
7963
+ source_table: string;
7964
+ status?: string;
7965
+ };
7966
+ Update: {
7967
+ canonical_product_id?: string | null;
7968
+ id?: string;
7969
+ merged_at?: string;
7970
+ merged_from_id?: string;
7971
+ notes?: string | null;
7972
+ snapshot?: Json;
7973
+ source_table?: string;
7974
+ status?: string;
7975
+ };
7547
7976
  Relationships: [];
7548
7977
  };
7549
7978
  products: {
7550
7979
  Row: {
7980
+ article_number: string | null;
7551
7981
  barcode: string | null;
7552
7982
  batch: string;
7553
7983
  crates_per_layer: number;
7554
7984
  created_at: string;
7555
7985
  custom_fields: Json;
7986
+ floriday_active: boolean;
7987
+ floriday_payload: Json;
7988
+ floriday_trade_item_id: string | null;
7556
7989
  id: string;
7557
7990
  image_url: string | null;
7558
7991
  incoming_quantity: number;
@@ -7571,11 +8004,15 @@ export type Database = {
7571
8004
  weight: string | null;
7572
8005
  };
7573
8006
  Insert: {
8007
+ article_number?: string | null;
7574
8008
  barcode?: string | null;
7575
8009
  batch: string;
7576
8010
  crates_per_layer?: number;
7577
8011
  created_at?: string;
7578
8012
  custom_fields?: Json;
8013
+ floriday_active?: boolean;
8014
+ floriday_payload?: Json;
8015
+ floriday_trade_item_id?: string | null;
7579
8016
  id?: string;
7580
8017
  image_url?: string | null;
7581
8018
  incoming_quantity?: number;
@@ -7594,11 +8031,15 @@ export type Database = {
7594
8031
  weight?: string | null;
7595
8032
  };
7596
8033
  Update: {
8034
+ article_number?: string | null;
7597
8035
  barcode?: string | null;
7598
8036
  batch?: string;
7599
8037
  crates_per_layer?: number;
7600
8038
  created_at?: string;
7601
8039
  custom_fields?: Json;
8040
+ floriday_active?: boolean;
8041
+ floriday_payload?: Json;
8042
+ floriday_trade_item_id?: string | null;
7602
8043
  id?: string;
7603
8044
  image_url?: string | null;
7604
8045
  incoming_quantity?: number;
@@ -8539,8 +8980,10 @@ export type Database = {
8539
8980
  order_id: string | null;
8540
8981
  order_item_id: string | null;
8541
8982
  order_source: string | null;
8983
+ parent_trade_item_key: string | null;
8542
8984
  physical_after: number | null;
8543
8985
  physical_before: number | null;
8986
+ production_batch_id: string | null;
8544
8987
  qty_delta: number;
8545
8988
  reason: string | null;
8546
8989
  reserved_after: number | null;
@@ -8556,8 +8999,10 @@ export type Database = {
8556
8999
  order_id?: string | null;
8557
9000
  order_item_id?: string | null;
8558
9001
  order_source?: string | null;
9002
+ parent_trade_item_key?: string | null;
8559
9003
  physical_after?: number | null;
8560
9004
  physical_before?: number | null;
9005
+ production_batch_id?: string | null;
8561
9006
  qty_delta: number;
8562
9007
  reason?: string | null;
8563
9008
  reserved_after?: number | null;
@@ -8573,8 +9018,10 @@ export type Database = {
8573
9018
  order_id?: string | null;
8574
9019
  order_item_id?: string | null;
8575
9020
  order_source?: string | null;
9021
+ parent_trade_item_key?: string | null;
8576
9022
  physical_after?: number | null;
8577
9023
  physical_before?: number | null;
9024
+ production_batch_id?: string | null;
8578
9025
  qty_delta?: number;
8579
9026
  reason?: string | null;
8580
9027
  reserved_after?: number | null;
@@ -9043,7 +9490,7 @@ export type Database = {
9043
9490
  twinfield_connections: {
9044
9491
  Row: {
9045
9492
  access_token: string | null;
9046
- client_id: string;
9493
+ client_id: string | null;
9047
9494
  client_secret: string | null;
9048
9495
  cluster_uri: string | null;
9049
9496
  company_code: string | null;
@@ -9055,7 +9502,7 @@ export type Database = {
9055
9502
  is_active: boolean;
9056
9503
  label: string | null;
9057
9504
  office_code: string | null;
9058
- redirect_uri: string;
9505
+ redirect_uri: string | null;
9059
9506
  refresh_token: string | null;
9060
9507
  token_expires_at: string | null;
9061
9508
  updated_at: string;
@@ -9063,7 +9510,7 @@ export type Database = {
9063
9510
  };
9064
9511
  Insert: {
9065
9512
  access_token?: string | null;
9066
- client_id: string;
9513
+ client_id?: string | null;
9067
9514
  client_secret?: string | null;
9068
9515
  cluster_uri?: string | null;
9069
9516
  company_code?: string | null;
@@ -9075,7 +9522,7 @@ export type Database = {
9075
9522
  is_active?: boolean;
9076
9523
  label?: string | null;
9077
9524
  office_code?: string | null;
9078
- redirect_uri: string;
9525
+ redirect_uri?: string | null;
9079
9526
  refresh_token?: string | null;
9080
9527
  token_expires_at?: string | null;
9081
9528
  updated_at?: string;
@@ -9083,7 +9530,7 @@ export type Database = {
9083
9530
  };
9084
9531
  Update: {
9085
9532
  access_token?: string | null;
9086
- client_id?: string;
9533
+ client_id?: string | null;
9087
9534
  client_secret?: string | null;
9088
9535
  cluster_uri?: string | null;
9089
9536
  company_code?: string | null;
@@ -9095,7 +9542,7 @@ export type Database = {
9095
9542
  is_active?: boolean;
9096
9543
  label?: string | null;
9097
9544
  office_code?: string | null;
9098
- redirect_uri?: string;
9545
+ redirect_uri?: string | null;
9099
9546
  refresh_token?: string | null;
9100
9547
  token_expires_at?: string | null;
9101
9548
  updated_at?: string;
@@ -10312,25 +10759,6 @@ export type Database = {
10312
10759
  };
10313
10760
  Relationships: [];
10314
10761
  };
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
10762
  local_customer_discounts: {
10335
10763
  Row: {
10336
10764
  base_price: number | null;
@@ -10646,6 +11074,13 @@ export type Database = {
10646
11074
  };
10647
11075
  Returns: number;
10648
11076
  };
11077
+ _migrate_rewrite_stock_key: {
11078
+ Args: {
11079
+ _from_key: string;
11080
+ _to_key: string;
11081
+ };
11082
+ Returns: undefined;
11083
+ };
10649
11084
  afh_city_code: {
10650
11085
  Args: {
10651
11086
  _city: string;
@@ -10761,6 +11196,28 @@ export type Database = {
10761
11196
  Args: never;
10762
11197
  Returns: undefined;
10763
11198
  };
11199
+ consume_bom_for_production: {
11200
+ Args: {
11201
+ p_connection_id: string;
11202
+ p_parent_id: string;
11203
+ p_parent_key: string;
11204
+ p_parent_kind: string;
11205
+ p_quantity: number;
11206
+ p_user_id: string;
11207
+ };
11208
+ Returns: Json;
11209
+ } | {
11210
+ Args: {
11211
+ p_batch_id?: string;
11212
+ p_connection_id: string;
11213
+ p_parent_id: string;
11214
+ p_parent_key: string;
11215
+ p_parent_kind: string;
11216
+ p_quantity: number;
11217
+ p_user_id: string;
11218
+ };
11219
+ Returns: Json;
11220
+ };
10764
11221
  consume_floriday_rate_limit: {
10765
11222
  Args: {
10766
11223
  p_bucket: string;
@@ -10812,6 +11269,13 @@ export type Database = {
10812
11269
  table_name: string;
10813
11270
  }[];
10814
11271
  };
11272
+ delete_samenstelling: {
11273
+ Args: {
11274
+ p_parent_id: string;
11275
+ p_parent_kind: string;
11276
+ };
11277
+ Returns: Json;
11278
+ };
10815
11279
  dispatch_carrier_signups_sql: {
10816
11280
  Args: {
10817
11281
  _catchup?: string;
@@ -10972,19 +11436,6 @@ export type Database = {
10972
11436
  resource: string;
10973
11437
  }[];
10974
11438
  };
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
11439
  get_floriday_clock_supplies_window: {
10989
11440
  Args: {
10990
11441
  p_from: string;
@@ -11057,6 +11508,21 @@ export type Database = {
11057
11508
  minutes_since_success: number;
11058
11509
  }[];
11059
11510
  };
11511
+ get_group_allocation_keys: {
11512
+ Args: {
11513
+ p_product_id: string;
11514
+ };
11515
+ Returns: {
11516
+ k: string;
11517
+ ord: number;
11518
+ }[];
11519
+ };
11520
+ get_group_head_key: {
11521
+ Args: {
11522
+ p_group_id: string;
11523
+ };
11524
+ Returns: string;
11525
+ };
11060
11526
  get_offer_by_link_code: {
11061
11527
  Args: {
11062
11528
  p_code: string;
@@ -11167,6 +11633,25 @@ export type Database = {
11167
11633
  };
11168
11634
  Returns: undefined;
11169
11635
  };
11636
+ mark_shipment_shipped: {
11637
+ Args: {
11638
+ p_shipment_id: string;
11639
+ };
11640
+ Returns: undefined;
11641
+ };
11642
+ merge_products: {
11643
+ Args: {
11644
+ _canonical: string;
11645
+ _loser: string;
11646
+ };
11647
+ Returns: undefined;
11648
+ };
11649
+ next_manufacture_partij: {
11650
+ Args: {
11651
+ _tenant_id: string;
11652
+ };
11653
+ Returns: string;
11654
+ };
11170
11655
  next_order_number: {
11171
11656
  Args: {
11172
11657
  p_prefix: string;
@@ -11245,6 +11730,14 @@ export type Database = {
11245
11730
  };
11246
11731
  Returns: undefined;
11247
11732
  };
11733
+ produce_designed_product: {
11734
+ Args: {
11735
+ p_parent_id: string;
11736
+ p_parent_kind: string;
11737
+ p_quantity: number;
11738
+ };
11739
+ Returns: Json;
11740
+ };
11248
11741
  promote_trade_item_key: {
11249
11742
  Args: {
11250
11743
  p_new: string;
@@ -11252,6 +11745,10 @@ export type Database = {
11252
11745
  };
11253
11746
  Returns: undefined;
11254
11747
  };
11748
+ recompute_all_reserved_stock: {
11749
+ Args: never;
11750
+ Returns: undefined;
11751
+ };
11255
11752
  recompute_order_status: {
11256
11753
  Args: {
11257
11754
  p_order_id: string;
@@ -11301,27 +11798,45 @@ export type Database = {
11301
11798
  };
11302
11799
  Returns: undefined;
11303
11800
  };
11801
+ resolve_group_allocation: {
11802
+ Args: {
11803
+ _needed: number;
11804
+ _product_group_id: string;
11805
+ };
11806
+ Returns: {
11807
+ allocated: number;
11808
+ trade_item_id: string;
11809
+ }[];
11810
+ };
11811
+ resolve_group_member_stock_key: {
11812
+ Args: {
11813
+ p_trade_item_id: string;
11814
+ };
11815
+ Returns: string;
11816
+ };
11304
11817
  resolve_product_id_for_item: {
11305
11818
  Args: {
11306
11819
  p_product_name: string;
11307
11820
  };
11308
11821
  Returns: string;
11309
11822
  };
11310
- schedule_floriday_additional_services_sync: {
11823
+ resolve_stock_trade_item_key: {
11311
11824
  Args: {
11312
- p_apikey: string;
11313
- p_url: string;
11825
+ p_product_id: string;
11314
11826
  };
11315
- Returns: number;
11827
+ Returns: string;
11316
11828
  };
11317
- schedule_floriday_agreement_calloffs_sync: {
11829
+ reverse_production: {
11318
11830
  Args: {
11319
- p_apikey: string;
11320
- p_url: string;
11831
+ p_connection_id?: string;
11832
+ p_parent_key: string;
11833
+ p_quantity: number;
11834
+ p_reason?: string;
11835
+ p_user_id?: string;
11321
11836
  };
11322
- Returns: number;
11837
+ Returns: Json;
11323
11838
  };
11324
- schedule_floriday_agreements_sync: {
11839
+ schedule_floriday_additional_services_sync: {
11325
11840
  Args: {
11326
11841
  p_apikey: string;
11327
11842
  p_url: string;