@flowselections/floriday-voorraad 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 (64) hide show
  1. package/dist-lib/components/voorraad/AdditionalPackagingDialog.d.ts +9 -0
  2. package/dist-lib/components/voorraad/AdditionalPackagingDialog.d.ts.map +1 -0
  3. package/dist-lib/components/voorraad/AdditionalPackagingDialog.js +51 -0
  4. package/dist-lib/components/voorraad/ArtikelWizard.d.ts.map +1 -1
  5. package/dist-lib/components/voorraad/ArtikelWizard.js +372 -30
  6. package/dist-lib/components/voorraad/EditArtikelPage.d.ts.map +1 -1
  7. package/dist-lib/components/voorraad/EditArtikelPage.js +78 -4
  8. package/dist-lib/components/voorraad/OrderHistoryCard.d.ts +8 -0
  9. package/dist-lib/components/voorraad/OrderHistoryCard.d.ts.map +1 -0
  10. package/dist-lib/components/voorraad/OrderHistoryCard.js +133 -0
  11. package/dist-lib/components/voorraad/PriceStatusBadge.d.ts +7 -0
  12. package/dist-lib/components/voorraad/PriceStatusBadge.d.ts.map +1 -0
  13. package/dist-lib/components/voorraad/PriceStatusBadge.js +67 -0
  14. package/dist-lib/components/voorraad/VoorraadStockCard.d.ts +2 -1
  15. package/dist-lib/components/voorraad/VoorraadStockCard.d.ts.map +1 -1
  16. package/dist-lib/components/voorraad/VoorraadStockCard.js +5 -4
  17. package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
  18. package/dist-lib/components/voorraad/VoorraadTable.js +6 -1
  19. package/dist-lib/hooks/useLocalTradeItems.d.ts.map +1 -1
  20. package/dist-lib/hooks/useLocalTradeItems.js +4 -0
  21. package/dist-lib/hooks/useTradeItemStock.d.ts +14 -1
  22. package/dist-lib/hooks/useTradeItemStock.d.ts.map +1 -1
  23. package/dist-lib/hooks/useTradeItemStock.js +76 -17
  24. package/dist-lib/hooks/useTradeItemSupplyLine.d.ts +21 -0
  25. package/dist-lib/hooks/useTradeItemSupplyLine.d.ts.map +1 -0
  26. package/dist-lib/hooks/useTradeItemSupplyLine.js +49 -0
  27. package/dist-lib/hooks/useVoorraadData.d.ts.map +1 -1
  28. package/dist-lib/hooks/useVoorraadData.js +35 -3
  29. package/dist-lib/integrations/supabase/auth-middleware.d.ts +490 -3
  30. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  31. package/dist-lib/integrations/supabase/client.d.ts +490 -3
  32. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  33. package/dist-lib/integrations/supabase/client.server.d.ts +490 -3
  34. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  35. package/dist-lib/integrations/supabase/types.d.ts +498 -3
  36. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  37. package/dist-lib/lib/floricode-required-features.functions.d.ts +497 -4
  38. package/dist-lib/lib/floricode-required-features.functions.d.ts.map +1 -1
  39. package/dist-lib/lib/floricode-required-features.functions.js +20 -2
  40. package/dist-lib/lib/floriday-customer-offer.functions.d.ts +11281 -0
  41. package/dist-lib/lib/floriday-customer-offer.functions.d.ts.map +1 -0
  42. package/dist-lib/lib/floriday-customer-offer.functions.js +175 -0
  43. package/dist-lib/lib/floriday-gateway.functions.d.ts +13240 -15
  44. package/dist-lib/lib/floriday-gateway.functions.d.ts.map +1 -1
  45. package/dist-lib/lib/floriday-gateway.functions.js +150 -0
  46. package/dist-lib/lib/floriday-gateway.server.d.ts +22 -0
  47. package/dist-lib/lib/floriday-gateway.server.d.ts.map +1 -1
  48. package/dist-lib/lib/floriday-gateway.server.js +3 -0
  49. package/dist-lib/lib/floriday-payload.d.ts +60 -6
  50. package/dist-lib/lib/floriday-payload.d.ts.map +1 -1
  51. package/dist-lib/lib/floriday-payload.js +104 -7
  52. package/dist-lib/lib/floriday-supply-line.d.ts +53 -0
  53. package/dist-lib/lib/floriday-supply-line.d.ts.map +1 -0
  54. package/dist-lib/lib/floriday-supply-line.js +109 -0
  55. package/dist-lib/lib/floriday-warehouse.functions.d.ts +1509 -48
  56. package/dist-lib/lib/floriday-warehouse.functions.d.ts.map +1 -1
  57. package/dist-lib/lib/floriday-writes.functions.d.ts +983 -9
  58. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  59. package/dist-lib/lib/floriday-writes.functions.js +6 -1
  60. package/dist-lib/lib/vrs-catalog.d.ts +27 -0
  61. package/dist-lib/lib/vrs-catalog.d.ts.map +1 -0
  62. package/dist-lib/lib/vrs-catalog.js +98 -0
  63. package/package.json +3 -2
  64. package/public/flowselections-assets/Voorraad/floriday-logo.png +0 -0
@@ -9,7 +9,10 @@ export type Database = {
9
9
  Tables: {
10
10
  afhandeling_settings: {
11
11
  Row: {
12
+ auto_print_delivery_note: boolean;
13
+ auto_process_paused: boolean;
12
14
  created_at: string;
15
+ extra_pick_days_with_stickers: number;
13
16
  id: string;
14
17
  max_workdays_earlier_pick: number;
15
18
  pick_days_before_transport: number;
@@ -23,7 +26,10 @@ export type Database = {
23
26
  user_id: string;
24
27
  };
25
28
  Insert: {
29
+ auto_print_delivery_note?: boolean;
30
+ auto_process_paused?: boolean;
26
31
  created_at?: string;
32
+ extra_pick_days_with_stickers?: number;
27
33
  id?: string;
28
34
  max_workdays_earlier_pick?: number;
29
35
  pick_days_before_transport?: number;
@@ -37,7 +43,10 @@ export type Database = {
37
43
  user_id: string;
38
44
  };
39
45
  Update: {
46
+ auto_print_delivery_note?: boolean;
47
+ auto_process_paused?: boolean;
40
48
  created_at?: string;
49
+ extra_pick_days_with_stickers?: number;
41
50
  id?: string;
42
51
  max_workdays_earlier_pick?: number;
43
52
  pick_days_before_transport?: number;
@@ -314,6 +323,7 @@ export type Database = {
314
323
  conflict_reason: string | null;
315
324
  created_at: string;
316
325
  created_by_role: string | null;
326
+ customer_address: string | null;
317
327
  customer_email: string | null;
318
328
  customer_name: string | null;
319
329
  end_time: string;
@@ -339,6 +349,7 @@ export type Database = {
339
349
  conflict_reason?: string | null;
340
350
  created_at?: string;
341
351
  created_by_role?: string | null;
352
+ customer_address?: string | null;
342
353
  customer_email?: string | null;
343
354
  customer_name?: string | null;
344
355
  end_time: string;
@@ -364,6 +375,7 @@ export type Database = {
364
375
  conflict_reason?: string | null;
365
376
  created_at?: string;
366
377
  created_by_role?: string | null;
378
+ customer_address?: string | null;
367
379
  customer_email?: string | null;
368
380
  customer_name?: string | null;
369
381
  end_time?: string;
@@ -840,6 +852,38 @@ export type Database = {
840
852
  };
841
853
  Relationships: [];
842
854
  };
855
+ cart_replan_queue: {
856
+ Row: {
857
+ attempts: number;
858
+ last_error: string | null;
859
+ order_id: string;
860
+ processed_at: string | null;
861
+ requested_at: string;
862
+ };
863
+ Insert: {
864
+ attempts?: number;
865
+ last_error?: string | null;
866
+ order_id: string;
867
+ processed_at?: string | null;
868
+ requested_at?: string;
869
+ };
870
+ Update: {
871
+ attempts?: number;
872
+ last_error?: string | null;
873
+ order_id?: string;
874
+ processed_at?: string | null;
875
+ requested_at?: string;
876
+ };
877
+ Relationships: [
878
+ {
879
+ foreignKeyName: "cart_replan_queue_order_id_fkey";
880
+ columns: ["order_id"];
881
+ isOneToOne: true;
882
+ referencedRelation: "orders";
883
+ referencedColumns: ["id"];
884
+ }
885
+ ];
886
+ };
843
887
  collections: {
844
888
  Row: {
845
889
  created_at: string;
@@ -3021,34 +3065,52 @@ export type Database = {
3021
3065
  Row: {
3022
3066
  catalog_key: string | null;
3023
3067
  catalog_url: string;
3068
+ client_id: string | null;
3069
+ client_secret_ciphertext: string | null;
3070
+ client_secret_last4: string | null;
3024
3071
  created_at: string;
3025
3072
  id: number;
3026
3073
  last_meta: Json | null;
3027
3074
  last_test_at: string | null;
3028
3075
  last_test_error: string | null;
3029
3076
  last_test_ok: boolean | null;
3077
+ last_token_test_at: string | null;
3078
+ last_token_test_error: string | null;
3079
+ last_token_test_ok: boolean | null;
3030
3080
  updated_at: string;
3031
3081
  };
3032
3082
  Insert: {
3033
3083
  catalog_key?: string | null;
3034
3084
  catalog_url?: string;
3085
+ client_id?: string | null;
3086
+ client_secret_ciphertext?: string | null;
3087
+ client_secret_last4?: string | null;
3035
3088
  created_at?: string;
3036
3089
  id?: number;
3037
3090
  last_meta?: Json | null;
3038
3091
  last_test_at?: string | null;
3039
3092
  last_test_error?: string | null;
3040
3093
  last_test_ok?: boolean | null;
3094
+ last_token_test_at?: string | null;
3095
+ last_token_test_error?: string | null;
3096
+ last_token_test_ok?: boolean | null;
3041
3097
  updated_at?: string;
3042
3098
  };
3043
3099
  Update: {
3044
3100
  catalog_key?: string | null;
3045
3101
  catalog_url?: string;
3102
+ client_id?: string | null;
3103
+ client_secret_ciphertext?: string | null;
3104
+ client_secret_last4?: string | null;
3046
3105
  created_at?: string;
3047
3106
  id?: number;
3048
3107
  last_meta?: Json | null;
3049
3108
  last_test_at?: string | null;
3050
3109
  last_test_error?: string | null;
3051
3110
  last_test_ok?: boolean | null;
3111
+ last_token_test_at?: string | null;
3112
+ last_token_test_error?: string | null;
3113
+ last_token_test_ok?: boolean | null;
3052
3114
  updated_at?: string;
3053
3115
  };
3054
3116
  Relationships: [];
@@ -3289,6 +3351,56 @@ export type Database = {
3289
3351
  }
3290
3352
  ];
3291
3353
  };
3354
+ floriday_auto_fulfillment_log: {
3355
+ Row: {
3356
+ attempts: number;
3357
+ connection_id: string;
3358
+ created_at: string;
3359
+ error: string | null;
3360
+ fulfillment_order_id: string | null;
3361
+ id: string;
3362
+ last_attempt_at: string | null;
3363
+ reason: string | null;
3364
+ sales_order_id: string;
3365
+ status: string;
3366
+ updated_at: string;
3367
+ };
3368
+ Insert: {
3369
+ attempts?: number;
3370
+ connection_id: string;
3371
+ created_at?: string;
3372
+ error?: string | null;
3373
+ fulfillment_order_id?: string | null;
3374
+ id?: string;
3375
+ last_attempt_at?: string | null;
3376
+ reason?: string | null;
3377
+ sales_order_id: string;
3378
+ status?: string;
3379
+ updated_at?: string;
3380
+ };
3381
+ Update: {
3382
+ attempts?: number;
3383
+ connection_id?: string;
3384
+ created_at?: string;
3385
+ error?: string | null;
3386
+ fulfillment_order_id?: string | null;
3387
+ id?: string;
3388
+ last_attempt_at?: string | null;
3389
+ reason?: string | null;
3390
+ sales_order_id?: string;
3391
+ status?: string;
3392
+ updated_at?: string;
3393
+ };
3394
+ Relationships: [
3395
+ {
3396
+ foreignKeyName: "floriday_auto_fulfillment_log_connection_id_fkey";
3397
+ columns: ["connection_id"];
3398
+ isOneToOne: false;
3399
+ referencedRelation: "floriday_connections";
3400
+ referencedColumns: ["id"];
3401
+ }
3402
+ ];
3403
+ };
3292
3404
  floriday_base_items_cache: {
3293
3405
  Row: {
3294
3406
  connection_id: string;
@@ -4435,6 +4547,24 @@ export type Database = {
4435
4547
  }
4436
4548
  ];
4437
4549
  };
4550
+ floriday_rate_limit_state: {
4551
+ Row: {
4552
+ bucket: string;
4553
+ last_refill_at: string;
4554
+ tokens: number;
4555
+ };
4556
+ Insert: {
4557
+ bucket: string;
4558
+ last_refill_at?: string;
4559
+ tokens: number;
4560
+ };
4561
+ Update: {
4562
+ bucket?: string;
4563
+ last_refill_at?: string;
4564
+ tokens?: number;
4565
+ };
4566
+ Relationships: [];
4567
+ };
4438
4568
  floriday_resource_schemas: {
4439
4569
  Row: {
4440
4570
  enums: Json;
@@ -4876,6 +5006,62 @@ export type Database = {
4876
5006
  }
4877
5007
  ];
4878
5008
  };
5009
+ flow_role_assignments: {
5010
+ Row: {
5011
+ created_at: string;
5012
+ id: string;
5013
+ role_id: string;
5014
+ user_id: string;
5015
+ };
5016
+ Insert: {
5017
+ created_at?: string;
5018
+ id?: string;
5019
+ role_id: string;
5020
+ user_id: string;
5021
+ };
5022
+ Update: {
5023
+ created_at?: string;
5024
+ id?: string;
5025
+ role_id?: string;
5026
+ user_id?: string;
5027
+ };
5028
+ Relationships: [
5029
+ {
5030
+ foreignKeyName: "flow_role_assignments_role_id_fkey";
5031
+ columns: ["role_id"];
5032
+ isOneToOne: false;
5033
+ referencedRelation: "flow_roles";
5034
+ referencedColumns: ["id"];
5035
+ }
5036
+ ];
5037
+ };
5038
+ flow_roles: {
5039
+ Row: {
5040
+ created_at: string;
5041
+ description: string | null;
5042
+ id: string;
5043
+ module_access: string[];
5044
+ name: string;
5045
+ updated_at: string;
5046
+ };
5047
+ Insert: {
5048
+ created_at?: string;
5049
+ description?: string | null;
5050
+ id?: string;
5051
+ module_access?: string[];
5052
+ name: string;
5053
+ updated_at?: string;
5054
+ };
5055
+ Update: {
5056
+ created_at?: string;
5057
+ description?: string | null;
5058
+ id?: string;
5059
+ module_access?: string[];
5060
+ name?: string;
5061
+ updated_at?: string;
5062
+ };
5063
+ Relationships: [];
5064
+ };
4879
5065
  imap_accounts: {
4880
5066
  Row: {
4881
5067
  created_at: string;
@@ -5533,6 +5719,7 @@ export type Database = {
5533
5719
  matched_customer_id: string | null;
5534
5720
  message_id: string;
5535
5721
  notes: string | null;
5722
+ order_number: string | null;
5536
5723
  parsed_payload: Json | null;
5537
5724
  reviewed_at: string | null;
5538
5725
  reviewed_by: string | null;
@@ -5548,6 +5735,7 @@ export type Database = {
5548
5735
  matched_customer_id?: string | null;
5549
5736
  message_id: string;
5550
5737
  notes?: string | null;
5738
+ order_number?: string | null;
5551
5739
  parsed_payload?: Json | null;
5552
5740
  reviewed_at?: string | null;
5553
5741
  reviewed_by?: string | null;
@@ -5563,6 +5751,7 @@ export type Database = {
5563
5751
  matched_customer_id?: string | null;
5564
5752
  message_id?: string;
5565
5753
  notes?: string | null;
5754
+ order_number?: string | null;
5566
5755
  parsed_payload?: Json | null;
5567
5756
  reviewed_at?: string | null;
5568
5757
  reviewed_by?: string | null;
@@ -6449,6 +6638,7 @@ export type Database = {
6449
6638
  id: string;
6450
6639
  items: Json;
6451
6640
  notes: string | null;
6641
+ order_number: string | null;
6452
6642
  recipient_id: string;
6453
6643
  total_amount: number;
6454
6644
  };
@@ -6462,6 +6652,7 @@ export type Database = {
6462
6652
  id?: string;
6463
6653
  items?: Json;
6464
6654
  notes?: string | null;
6655
+ order_number?: string | null;
6465
6656
  recipient_id: string;
6466
6657
  total_amount?: number;
6467
6658
  };
@@ -6475,6 +6666,7 @@ export type Database = {
6475
6666
  id?: string;
6476
6667
  items?: Json;
6477
6668
  notes?: string | null;
6669
+ order_number?: string | null;
6478
6670
  recipient_id?: string;
6479
6671
  total_amount?: number;
6480
6672
  };
@@ -6642,6 +6834,9 @@ export type Database = {
6642
6834
  crates_per_layer: number;
6643
6835
  created_at: string;
6644
6836
  id: string;
6837
+ layer_fraction: number;
6838
+ layer_share_pct: number;
6839
+ layers_per_cart: number;
6645
6840
  order_item_id: string | null;
6646
6841
  plants_per_crate: number;
6647
6842
  product_id: string | null;
@@ -6653,6 +6848,9 @@ export type Database = {
6653
6848
  crates_per_layer?: number;
6654
6849
  created_at?: string;
6655
6850
  id?: string;
6851
+ layer_fraction?: number;
6852
+ layer_share_pct?: number;
6853
+ layers_per_cart?: number;
6656
6854
  order_item_id?: string | null;
6657
6855
  plants_per_crate?: number;
6658
6856
  product_id?: string | null;
@@ -6664,6 +6862,9 @@ export type Database = {
6664
6862
  crates_per_layer?: number;
6665
6863
  created_at?: string;
6666
6864
  id?: string;
6865
+ layer_fraction?: number;
6866
+ layer_share_pct?: number;
6867
+ layers_per_cart?: number;
6667
6868
  order_item_id?: string | null;
6668
6869
  plants_per_crate?: number;
6669
6870
  product_id?: string | null;
@@ -6695,33 +6896,45 @@ export type Database = {
6695
6896
  };
6696
6897
  order_carts: {
6697
6898
  Row: {
6899
+ algorithm_version: number;
6698
6900
  cart_number: number;
6699
6901
  created_at: string;
6700
6902
  id: string;
6701
6903
  is_auto: boolean;
6702
6904
  is_complete: boolean;
6703
6905
  notes: string | null;
6906
+ occupancy_pct: number;
6704
6907
  order_id: string;
6908
+ source: string;
6909
+ total_layers_used: number;
6705
6910
  updated_at: string;
6706
6911
  };
6707
6912
  Insert: {
6913
+ algorithm_version?: number;
6708
6914
  cart_number: number;
6709
6915
  created_at?: string;
6710
6916
  id?: string;
6711
6917
  is_auto?: boolean;
6712
6918
  is_complete?: boolean;
6713
6919
  notes?: string | null;
6920
+ occupancy_pct?: number;
6714
6921
  order_id: string;
6922
+ source?: string;
6923
+ total_layers_used?: number;
6715
6924
  updated_at?: string;
6716
6925
  };
6717
6926
  Update: {
6927
+ algorithm_version?: number;
6718
6928
  cart_number?: number;
6719
6929
  created_at?: string;
6720
6930
  id?: string;
6721
6931
  is_auto?: boolean;
6722
6932
  is_complete?: boolean;
6723
6933
  notes?: string | null;
6934
+ occupancy_pct?: number;
6724
6935
  order_id?: string;
6936
+ source?: string;
6937
+ total_layers_used?: number;
6725
6938
  updated_at?: string;
6726
6939
  };
6727
6940
  Relationships: [
@@ -6881,6 +7094,8 @@ export type Database = {
6881
7094
  order_date: string;
6882
7095
  order_number: string;
6883
7096
  order_source: string;
7097
+ plan_locked_at: string | null;
7098
+ plan_locked_ref: string | null;
6884
7099
  status: string;
6885
7100
  total: string;
6886
7101
  updated_at: string;
@@ -6897,6 +7112,8 @@ export type Database = {
6897
7112
  order_date?: string;
6898
7113
  order_number: string;
6899
7114
  order_source?: string;
7115
+ plan_locked_at?: string | null;
7116
+ plan_locked_ref?: string | null;
6900
7117
  status?: string;
6901
7118
  total?: string;
6902
7119
  updated_at?: string;
@@ -6913,6 +7130,8 @@ export type Database = {
6913
7130
  order_date?: string;
6914
7131
  order_number?: string;
6915
7132
  order_source?: string;
7133
+ plan_locked_at?: string | null;
7134
+ plan_locked_ref?: string | null;
6916
7135
  status?: string;
6917
7136
  total?: string;
6918
7137
  updated_at?: string;
@@ -7287,28 +7506,34 @@ export type Database = {
7287
7506
  };
7288
7507
  profiles: {
7289
7508
  Row: {
7509
+ address: string | null;
7290
7510
  created_at: string;
7291
7511
  display_name: string | null;
7292
7512
  email: string | null;
7293
7513
  id: string;
7514
+ is_superadmin: boolean;
7294
7515
  notification_preferences: Json;
7295
7516
  tenant_id: string | null;
7296
7517
  updated_at: string;
7297
7518
  };
7298
7519
  Insert: {
7520
+ address?: string | null;
7299
7521
  created_at?: string;
7300
7522
  display_name?: string | null;
7301
7523
  email?: string | null;
7302
7524
  id: string;
7525
+ is_superadmin?: boolean;
7303
7526
  notification_preferences?: Json;
7304
7527
  tenant_id?: string | null;
7305
7528
  updated_at?: string;
7306
7529
  };
7307
7530
  Update: {
7531
+ address?: string | null;
7308
7532
  created_at?: string;
7309
7533
  display_name?: string | null;
7310
7534
  email?: string | null;
7311
7535
  id?: string;
7536
+ is_superadmin?: boolean;
7312
7537
  notification_preferences?: Json;
7313
7538
  tenant_id?: string | null;
7314
7539
  updated_at?: string;
@@ -8130,6 +8355,24 @@ export type Database = {
8130
8355
  };
8131
8356
  Relationships: [];
8132
8357
  };
8358
+ sidebar_config: {
8359
+ Row: {
8360
+ id: string;
8361
+ module_order: string[];
8362
+ updated_at: string;
8363
+ };
8364
+ Insert: {
8365
+ id?: string;
8366
+ module_order?: string[];
8367
+ updated_at?: string;
8368
+ };
8369
+ Update: {
8370
+ id?: string;
8371
+ module_order?: string[];
8372
+ updated_at?: string;
8373
+ };
8374
+ Relationships: [];
8375
+ };
8133
8376
  stock_import_runs: {
8134
8377
  Row: {
8135
8378
  connection_id: string | null;
@@ -8188,7 +8431,7 @@ export type Database = {
8188
8431
  reason: string | null;
8189
8432
  reserved_after: number | null;
8190
8433
  reserved_before: number | null;
8191
- trade_item_key: string;
8434
+ trade_item_key: string | null;
8192
8435
  };
8193
8436
  Insert: {
8194
8437
  connection_id?: string | null;
@@ -8205,7 +8448,7 @@ export type Database = {
8205
8448
  reason?: string | null;
8206
8449
  reserved_after?: number | null;
8207
8450
  reserved_before?: number | null;
8208
- trade_item_key: string;
8451
+ trade_item_key?: string | null;
8209
8452
  };
8210
8453
  Update: {
8211
8454
  connection_id?: string | null;
@@ -8222,7 +8465,7 @@ export type Database = {
8222
8465
  reason?: string | null;
8223
8466
  reserved_after?: number | null;
8224
8467
  reserved_before?: number | null;
8225
- trade_item_key?: string;
8468
+ trade_item_key?: string | null;
8226
8469
  };
8227
8470
  Relationships: [];
8228
8471
  };
@@ -8573,6 +8816,116 @@ export type Database = {
8573
8816
  };
8574
8817
  Relationships: [];
8575
8818
  };
8819
+ trade_item_supply_lines: {
8820
+ Row: {
8821
+ available_quantity: number | null;
8822
+ connection_id: string;
8823
+ created_at: string;
8824
+ currency: string | null;
8825
+ endpoint_family: string | null;
8826
+ environment: string | null;
8827
+ id: string;
8828
+ last_error: string | null;
8829
+ last_status: number | null;
8830
+ packing_configuration_id: string | null;
8831
+ period_end: string | null;
8832
+ period_start: string | null;
8833
+ price_per_piece: number | null;
8834
+ sales_unit: string | null;
8835
+ supply_line_id: string | null;
8836
+ supply_type: string;
8837
+ trade_item_id: string;
8838
+ updated_at: string;
8839
+ user_id: string;
8840
+ week: number | null;
8841
+ year: number | null;
8842
+ };
8843
+ Insert: {
8844
+ available_quantity?: number | null;
8845
+ connection_id: string;
8846
+ created_at?: string;
8847
+ currency?: string | null;
8848
+ endpoint_family?: string | null;
8849
+ environment?: string | null;
8850
+ id?: string;
8851
+ last_error?: string | null;
8852
+ last_status?: number | null;
8853
+ packing_configuration_id?: string | null;
8854
+ period_end?: string | null;
8855
+ period_start?: string | null;
8856
+ price_per_piece?: number | null;
8857
+ sales_unit?: string | null;
8858
+ supply_line_id?: string | null;
8859
+ supply_type?: string;
8860
+ trade_item_id: string;
8861
+ updated_at?: string;
8862
+ user_id: string;
8863
+ week?: number | null;
8864
+ year?: number | null;
8865
+ };
8866
+ Update: {
8867
+ available_quantity?: number | null;
8868
+ connection_id?: string;
8869
+ created_at?: string;
8870
+ currency?: string | null;
8871
+ endpoint_family?: string | null;
8872
+ environment?: string | null;
8873
+ id?: string;
8874
+ last_error?: string | null;
8875
+ last_status?: number | null;
8876
+ packing_configuration_id?: string | null;
8877
+ period_end?: string | null;
8878
+ period_start?: string | null;
8879
+ price_per_piece?: number | null;
8880
+ sales_unit?: string | null;
8881
+ supply_line_id?: string | null;
8882
+ supply_type?: string;
8883
+ trade_item_id?: string;
8884
+ updated_at?: string;
8885
+ user_id?: string;
8886
+ week?: number | null;
8887
+ year?: number | null;
8888
+ };
8889
+ Relationships: [];
8890
+ };
8891
+ trade_item_warehouse_preferences: {
8892
+ Row: {
8893
+ connection_id: string;
8894
+ created_at: string;
8895
+ id: string;
8896
+ trade_item_id: string;
8897
+ updated_at: string;
8898
+ warehouse_id: string;
8899
+ warehouse_name: string | null;
8900
+ };
8901
+ Insert: {
8902
+ connection_id: string;
8903
+ created_at?: string;
8904
+ id?: string;
8905
+ trade_item_id: string;
8906
+ updated_at?: string;
8907
+ warehouse_id: string;
8908
+ warehouse_name?: string | null;
8909
+ };
8910
+ Update: {
8911
+ connection_id?: string;
8912
+ created_at?: string;
8913
+ id?: string;
8914
+ trade_item_id?: string;
8915
+ updated_at?: string;
8916
+ warehouse_id?: string;
8917
+ warehouse_name?: string | null;
8918
+ };
8919
+ Relationships: [
8920
+ {
8921
+ foreignKeyName: "trade_item_warehouse_preferences_connection_id_fkey";
8922
+ columns: ["connection_id"];
8923
+ isOneToOne: false;
8924
+ referencedRelation: "floriday_connections";
8925
+ referencedColumns: ["id"];
8926
+ }
8927
+ ];
8928
+ };
8576
8929
  twinfield_connections: {
8577
8930
  Row: {
8578
8931
  access_token: string | null;
@@ -8898,6 +9251,10 @@ export type Database = {
8898
9251
  default_invoice_type: string;
8899
9252
  default_payment_term_days: number;
8900
9253
  default_vat_code: string;
9254
+ invoice_enabled_ao: boolean;
9255
+ invoice_enabled_fo: boolean;
9256
+ invoice_enabled_ho: boolean;
9257
+ invoice_enabled_mo: boolean;
8901
9258
  updated_at: string;
8902
9259
  user_id: string;
8903
9260
  };
@@ -8907,6 +9264,10 @@ export type Database = {
8907
9264
  default_invoice_type?: string;
8908
9265
  default_payment_term_days?: number;
8909
9266
  default_vat_code?: string;
9267
+ invoice_enabled_ao?: boolean;
9268
+ invoice_enabled_fo?: boolean;
9269
+ invoice_enabled_ho?: boolean;
9270
+ invoice_enabled_mo?: boolean;
8910
9271
  updated_at?: string;
8911
9272
  user_id: string;
8912
9273
  };
@@ -8916,6 +9277,10 @@ export type Database = {
8916
9277
  default_invoice_type?: string;
8917
9278
  default_payment_term_days?: number;
8918
9279
  default_vat_code?: string;
9280
+ invoice_enabled_ao?: boolean;
9281
+ invoice_enabled_fo?: boolean;
9282
+ invoice_enabled_ho?: boolean;
9283
+ invoice_enabled_mo?: boolean;
8919
9284
  updated_at?: string;
8920
9285
  user_id?: string;
8921
9286
  };
@@ -10238,6 +10603,12 @@ export type Database = {
10238
10603
  order_number: string;
10239
10604
  }[];
10240
10605
  };
10606
+ autolink_product_to_floriday: {
10607
+ Args: {
10608
+ p_product_id: string;
10609
+ };
10610
+ Returns: string;
10611
+ };
10241
10612
  backfill_open_order_reservations: {
10242
10613
  Args: never;
10243
10614
  Returns: {
@@ -10276,6 +10647,18 @@ export type Database = {
10276
10647
  Args: never;
10277
10648
  Returns: number;
10278
10649
  };
10650
+ consume_floriday_rate_limit: {
10651
+ Args: {
10652
+ p_bucket: string;
10653
+ p_capacity: number;
10654
+ p_cost?: number;
10655
+ p_refill_per_sec: number;
10656
+ };
10657
+ Returns: {
10658
+ granted: boolean;
10659
+ wait_ms: number;
10660
+ }[];
10661
+ };
10279
10662
  control_get_todays_carts: {
10280
10663
  Args: never;
10281
10664
  Returns: {
@@ -10356,6 +10739,12 @@ export type Database = {
10356
10739
  status: string;
10357
10740
  }[];
10358
10741
  };
10742
+ enqueue_cart_replan_if_unlocked: {
10743
+ Args: {
10744
+ p_order_id: string;
10745
+ };
10746
+ Returns: undefined;
10747
+ };
10359
10748
  ensure_trade_item_stock_row: {
10360
10749
  Args: {
10361
10750
  p_key: string;
@@ -10462,6 +10851,13 @@ export type Database = {
10462
10851
  office_code: string;
10463
10852
  }[];
10464
10853
  };
10854
+ get_floricode_record_counts: {
10855
+ Args: never;
10856
+ Returns: {
10857
+ count: number;
10858
+ resource: string;
10859
+ }[];
10860
+ };
10465
10861
  get_floriday_agreements_active: {
10466
10862
  Args: {
10467
10863
  p_on_date?: string;
@@ -10553,6 +10949,12 @@ export type Database = {
10553
10949
  };
10554
10950
  Returns: Json;
10555
10951
  };
10952
+ get_offer_delivery_options: {
10953
+ Args: {
10954
+ p_code: string;
10955
+ };
10956
+ Returns: Json;
10957
+ };
10556
10958
  get_offer_recipient_by_code: {
10557
10959
  Args: {
10558
10960
  p_code: string;
@@ -10617,6 +11019,12 @@ export type Database = {
10617
11019
  Args: never;
10618
11020
  Returns: boolean;
10619
11021
  };
11022
+ is_superadmin: {
11023
+ Args: {
11024
+ _user_id: string;
11025
+ };
11026
+ Returns: boolean;
11027
+ };
10620
11028
  local_effective_price: {
10621
11029
  Args: {
10622
11030
  _customer_id: string;
@@ -10651,6 +11059,13 @@ export type Database = {
10651
11059
  };
10652
11060
  Returns: string;
10653
11061
  };
11062
+ next_order_number_for_date: {
11063
+ Args: {
11064
+ p_created_at?: string;
11065
+ p_prefix: string;
11066
+ };
11067
+ Returns: string;
11068
+ };
10654
11069
  next_work_order_number: {
10655
11070
  Args: {
10656
11071
  p_parent_work_order_id?: string;
@@ -10658,6 +11073,12 @@ export type Database = {
10658
11073
  };
10659
11074
  Returns: string;
10660
11075
  };
11076
+ normalize_order_source: {
11077
+ Args: {
11078
+ p_src: string;
11079
+ };
11080
+ Returns: string;
11081
+ };
10661
11082
  normalize_vat: {
10662
11083
  Args: {
10663
11084
  v: string;
@@ -10672,10 +11093,21 @@ export type Database = {
10672
11093
  };
10673
11094
  Returns: boolean;
10674
11095
  };
11096
+ order_number_prefix: {
11097
+ Args: {
11098
+ p_custom_fields?: Json;
11099
+ p_order_source: string;
11100
+ };
11101
+ Returns: string;
11102
+ };
10675
11103
  pickstation_get_orders_raw: {
10676
11104
  Args: never;
10677
11105
  Returns: Json;
10678
11106
  };
11107
+ pickstation_get_planning_context: {
11108
+ Args: never;
11109
+ Returns: Json;
11110
+ };
10679
11111
  pickstation_get_settings: {
10680
11112
  Args: never;
10681
11113
  Returns: Json;
@@ -10706,6 +11138,28 @@ export type Database = {
10706
11138
  };
10707
11139
  Returns: undefined;
10708
11140
  };
11141
+ recompute_order_status: {
11142
+ Args: {
11143
+ p_order_id: string;
11144
+ };
11145
+ Returns: undefined;
11146
+ };
11147
+ recompute_reserved_for_order: {
11148
+ Args: {
11149
+ p_order_id: string;
11150
+ };
11151
+ Returns: undefined;
11152
+ };
11153
+ recompute_reserved_stock: {
11154
+ Args: {
11155
+ p_trade_item_key: string;
11156
+ };
11157
+ Returns: undefined;
11158
+ };
11159
+ refresh_external_customers_grouped: {
11160
+ Args: never;
11161
+ Returns: undefined;
11162
+ };
10709
11163
  refresh_floricode_derived_code_lists: {
10710
11164
  Args: never;
10711
11165
  Returns: {
@@ -10720,6 +11174,12 @@ export type Database = {
10720
11174
  };
10721
11175
  Returns: number;
10722
11176
  };
11177
+ refresh_floricode_derived_for_products: {
11178
+ Args: {
11179
+ _product_ids: string[];
11180
+ };
11181
+ Returns: number;
11182
+ };
10723
11183
  reset_floriday_sync_cursor: {
10724
11184
  Args: {
10725
11185
  p_connection_id: string;
@@ -10727,6 +11187,12 @@ export type Database = {
10727
11187
  };
10728
11188
  Returns: undefined;
10729
11189
  };
11190
+ resolve_product_id_for_item: {
11191
+ Args: {
11192
+ p_product_name: string;
11193
+ };
11194
+ Returns: string;
11195
+ };
10730
11196
  schedule_floriday_additional_services_sync: {
10731
11197
  Args: {
10732
11198
  p_apikey: string;
@@ -11004,6 +11470,24 @@ export type Database = {
11004
11470
  };
11005
11471
  Returns: string[];
11006
11472
  };
11473
+ sync_cached_packing_from_product: {
11474
+ Args: {
11475
+ p_product_id: string;
11476
+ };
11477
+ Returns: undefined;
11478
+ };
11479
+ sync_order_cart_item_packing_from_product: {
11480
+ Args: {
11481
+ p_product_id: string;
11482
+ };
11483
+ Returns: undefined;
11484
+ };
11485
+ sync_product_packing_from_floriday_cache: {
11486
+ Args: {
11487
+ p_floriday_id: string;
11488
+ };
11489
+ Returns: undefined;
11490
+ };
11007
11491
  twinfield_decrypt: {
11008
11492
  Args: {
11009
11493
  cipher: string;
@@ -11016,6 +11500,17 @@ export type Database = {
11016
11500
  };
11017
11501
  Returns: string;
11018
11502
  };
11503
+ upsert_auto_fulfillment_log: {
11504
+ Args: {
11505
+ p_connection_id: string;
11506
+ p_error?: string;
11507
+ p_fulfillment_order_id?: string;
11508
+ p_reason?: string;
11509
+ p_sales_order_id: string;
11510
+ p_status: string;
11511
+ };
11512
+ Returns: undefined;
11513
+ };
11019
11514
  };
11020
11515
  Enums: {
11021
11516
  app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";