@flowselections/floriday-afhandeling-module 1.0.12 → 1.0.14

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 (80) hide show
  1. package/dist-lib/components/afhandeling/AutoProcessStatus.d.ts +12 -0
  2. package/dist-lib/components/afhandeling/AutoProcessStatus.d.ts.map +1 -0
  3. package/dist-lib/components/afhandeling/AutoProcessStatus.js +103 -0
  4. package/dist-lib/components/afhandeling/ControleLijstPrint.d.ts +3 -1
  5. package/dist-lib/components/afhandeling/ControleLijstPrint.d.ts.map +1 -1
  6. package/dist-lib/components/afhandeling/ControleLijstPrint.js +56 -17
  7. package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
  8. package/dist-lib/components/afhandeling/DagDetailDialog.js +96 -4
  9. package/dist-lib/components/afhandeling/LeveringenPage.js +1 -1
  10. package/dist-lib/components/afhandeling/VervoerdersPage.d.ts.map +1 -1
  11. package/dist-lib/components/afhandeling/VervoerdersPage.js +2 -1
  12. package/dist-lib/components/afhandeling/WeekAgendaView.d.ts +3 -1
  13. package/dist-lib/components/afhandeling/WeekAgendaView.d.ts.map +1 -1
  14. package/dist-lib/components/afhandeling/WeekAgendaView.js +58 -17
  15. package/dist-lib/components/pickstation/KioskControle.d.ts +2 -0
  16. package/dist-lib/components/pickstation/KioskControle.d.ts.map +1 -0
  17. package/dist-lib/components/pickstation/KioskControle.js +7 -0
  18. package/dist-lib/components/pickstation/PakbonTemplate.d.ts +2 -1
  19. package/dist-lib/components/pickstation/PakbonTemplate.d.ts.map +1 -1
  20. package/dist-lib/components/pickstation/PakbonTemplate.js +20 -17
  21. package/dist-lib/components/pickstation/PickstationPage.d.ts +2 -0
  22. package/dist-lib/components/pickstation/PickstationPage.d.ts.map +1 -0
  23. package/dist-lib/components/pickstation/PickstationPage.js +266 -0
  24. package/dist-lib/components/settings/AfhandelingSettingsCard.d.ts.map +1 -1
  25. package/dist-lib/components/settings/AfhandelingSettingsCard.js +14 -2
  26. package/dist-lib/hooks/useOrderPlanning.d.ts.map +1 -1
  27. package/dist-lib/hooks/useOrderPlanning.js +28 -11
  28. package/dist-lib/index.d.ts +4 -0
  29. package/dist-lib/index.d.ts.map +1 -1
  30. package/dist-lib/index.js +4 -0
  31. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1243 -63
  32. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  33. package/dist-lib/integrations/supabase/client.d.ts +1243 -63
  34. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  35. package/dist-lib/integrations/supabase/client.server.d.ts +1243 -63
  36. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  37. package/dist-lib/integrations/supabase/types.d.ts +1264 -56
  38. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  39. package/dist-lib/lib/afhandelingSettings.functions.d.ts +2483 -111
  40. package/dist-lib/lib/afhandelingSettings.functions.d.ts.map +1 -1
  41. package/dist-lib/lib/afhandelingSettings.functions.js +28 -1
  42. package/dist-lib/lib/carrierPlanning.d.ts +25 -0
  43. package/dist-lib/lib/carrierPlanning.d.ts.map +1 -0
  44. package/dist-lib/lib/carrierPlanning.js +65 -0
  45. package/dist-lib/lib/carrierSignupMail.server.d.ts +0 -2
  46. package/dist-lib/lib/carrierSignupMail.server.d.ts.map +1 -1
  47. package/dist-lib/lib/carrierSignupMail.server.js +53 -216
  48. package/dist-lib/lib/carriers.functions.d.ts +5920 -20
  49. package/dist-lib/lib/carriers.functions.d.ts.map +1 -1
  50. package/dist-lib/lib/carriers.functions.js +5 -0
  51. package/dist-lib/lib/cartAssignments.functions.d.ts +5920 -20
  52. package/dist-lib/lib/cartAssignments.functions.d.ts.map +1 -1
  53. package/dist-lib/lib/cartControl.functions.d.ts +11843 -40
  54. package/dist-lib/lib/cartControl.functions.d.ts.map +1 -1
  55. package/dist-lib/lib/cartControl.functions.js +4 -1
  56. package/dist-lib/lib/cartRescheduling.d.ts.map +1 -1
  57. package/dist-lib/lib/cartRescheduling.js +8 -6
  58. package/dist-lib/lib/countries.d.ts +2 -0
  59. package/dist-lib/lib/countries.d.ts.map +1 -1
  60. package/dist-lib/lib/countries.js +51 -0
  61. package/dist-lib/lib/deliveryNotePrint.d.ts +26 -0
  62. package/dist-lib/lib/deliveryNotePrint.d.ts.map +1 -0
  63. package/dist-lib/lib/deliveryNotePrint.js +172 -0
  64. package/dist-lib/lib/floriday.functions.d.ts +1251 -63
  65. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  66. package/dist-lib/lib/floriday.functions.js +126 -8
  67. package/dist-lib/lib/floridayAutoProcess.d.ts +30 -0
  68. package/dist-lib/lib/floridayAutoProcess.d.ts.map +1 -0
  69. package/dist-lib/lib/floridayAutoProcess.js +70 -0
  70. package/dist-lib/lib/pickstationI18n.d.ts +46 -0
  71. package/dist-lib/lib/pickstationI18n.d.ts.map +1 -1
  72. package/dist-lib/lib/pickstationI18n.js +251 -0
  73. package/dist-lib/lib/pickstationOrders.server.d.ts.map +1 -1
  74. package/dist-lib/lib/pickstationOrders.server.js +56 -19
  75. package/dist-lib/lib/pickstationTypes.d.ts +2 -0
  76. package/dist-lib/lib/pickstationTypes.d.ts.map +1 -1
  77. package/dist-lib/lib/planning.d.ts +34 -0
  78. package/dist-lib/lib/planning.d.ts.map +1 -1
  79. package/dist-lib/lib/planning.js +84 -0
  80. package/package.json +15 -1
@@ -3,7 +3,10 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
3
3
  Tables: {
4
4
  afhandeling_settings: {
5
5
  Row: {
6
+ auto_print_delivery_note: boolean;
7
+ auto_process_paused: boolean;
6
8
  created_at: string;
9
+ extra_pick_days_with_stickers: number;
7
10
  id: string;
8
11
  max_workdays_earlier_pick: number;
9
12
  pick_days_before_transport: number;
@@ -17,7 +20,10 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
17
20
  user_id: string;
18
21
  };
19
22
  Insert: {
23
+ auto_print_delivery_note?: boolean;
24
+ auto_process_paused?: boolean;
20
25
  created_at?: string;
26
+ extra_pick_days_with_stickers?: number;
21
27
  id?: string;
22
28
  max_workdays_earlier_pick?: number;
23
29
  pick_days_before_transport?: number;
@@ -31,7 +37,10 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
31
37
  user_id: string;
32
38
  };
33
39
  Update: {
40
+ auto_print_delivery_note?: boolean;
41
+ auto_process_paused?: boolean;
34
42
  created_at?: string;
43
+ extra_pick_days_with_stickers?: number;
35
44
  id?: string;
36
45
  max_workdays_earlier_pick?: number;
37
46
  pick_days_before_transport?: number;
@@ -823,6 +832,36 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
823
832
  };
824
833
  Relationships: [];
825
834
  };
835
+ cart_replan_queue: {
836
+ Row: {
837
+ attempts: number;
838
+ last_error: string | null;
839
+ order_id: string;
840
+ processed_at: string | null;
841
+ requested_at: string;
842
+ };
843
+ Insert: {
844
+ attempts?: number;
845
+ last_error?: string | null;
846
+ order_id: string;
847
+ processed_at?: string | null;
848
+ requested_at?: string;
849
+ };
850
+ Update: {
851
+ attempts?: number;
852
+ last_error?: string | null;
853
+ order_id?: string;
854
+ processed_at?: string | null;
855
+ requested_at?: string;
856
+ };
857
+ Relationships: [{
858
+ foreignKeyName: "cart_replan_queue_order_id_fkey";
859
+ columns: ["order_id"];
860
+ isOneToOne: true;
861
+ referencedRelation: "orders";
862
+ referencedColumns: ["id"];
863
+ }];
864
+ };
826
865
  collections: {
827
866
  Row: {
828
867
  created_at: string;
@@ -2948,34 +2987,52 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
2948
2987
  Row: {
2949
2988
  catalog_key: string | null;
2950
2989
  catalog_url: string;
2990
+ client_id: string | null;
2991
+ client_secret_ciphertext: string | null;
2992
+ client_secret_last4: string | null;
2951
2993
  created_at: string;
2952
2994
  id: number;
2953
2995
  last_meta: import("./types").Json | null;
2954
2996
  last_test_at: string | null;
2955
2997
  last_test_error: string | null;
2956
2998
  last_test_ok: boolean | null;
2999
+ last_token_test_at: string | null;
3000
+ last_token_test_error: string | null;
3001
+ last_token_test_ok: boolean | null;
2957
3002
  updated_at: string;
2958
3003
  };
2959
3004
  Insert: {
2960
3005
  catalog_key?: string | null;
2961
3006
  catalog_url?: string;
3007
+ client_id?: string | null;
3008
+ client_secret_ciphertext?: string | null;
3009
+ client_secret_last4?: string | null;
2962
3010
  created_at?: string;
2963
3011
  id?: number;
2964
3012
  last_meta?: import("./types").Json | null;
2965
3013
  last_test_at?: string | null;
2966
3014
  last_test_error?: string | null;
2967
3015
  last_test_ok?: boolean | null;
3016
+ last_token_test_at?: string | null;
3017
+ last_token_test_error?: string | null;
3018
+ last_token_test_ok?: boolean | null;
2968
3019
  updated_at?: string;
2969
3020
  };
2970
3021
  Update: {
2971
3022
  catalog_key?: string | null;
2972
3023
  catalog_url?: string;
3024
+ client_id?: string | null;
3025
+ client_secret_ciphertext?: string | null;
3026
+ client_secret_last4?: string | null;
2973
3027
  created_at?: string;
2974
3028
  id?: number;
2975
3029
  last_meta?: import("./types").Json | null;
2976
3030
  last_test_at?: string | null;
2977
3031
  last_test_error?: string | null;
2978
3032
  last_test_ok?: boolean | null;
3033
+ last_token_test_at?: string | null;
3034
+ last_token_test_error?: string | null;
3035
+ last_token_test_ok?: boolean | null;
2979
3036
  updated_at?: string;
2980
3037
  };
2981
3038
  Relationships: [];
@@ -3208,6 +3265,54 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
3208
3265
  referencedColumns: ["id"];
3209
3266
  }];
3210
3267
  };
3268
+ floriday_auto_fulfillment_log: {
3269
+ Row: {
3270
+ attempts: number;
3271
+ connection_id: string;
3272
+ created_at: string;
3273
+ error: string | null;
3274
+ fulfillment_order_id: string | null;
3275
+ id: string;
3276
+ last_attempt_at: string | null;
3277
+ reason: string | null;
3278
+ sales_order_id: string;
3279
+ status: string;
3280
+ updated_at: string;
3281
+ };
3282
+ Insert: {
3283
+ attempts?: number;
3284
+ connection_id: string;
3285
+ created_at?: string;
3286
+ error?: string | null;
3287
+ fulfillment_order_id?: string | null;
3288
+ id?: string;
3289
+ last_attempt_at?: string | null;
3290
+ reason?: string | null;
3291
+ sales_order_id: string;
3292
+ status?: string;
3293
+ updated_at?: string;
3294
+ };
3295
+ Update: {
3296
+ attempts?: number;
3297
+ connection_id?: string;
3298
+ created_at?: string;
3299
+ error?: string | null;
3300
+ fulfillment_order_id?: string | null;
3301
+ id?: string;
3302
+ last_attempt_at?: string | null;
3303
+ reason?: string | null;
3304
+ sales_order_id?: string;
3305
+ status?: string;
3306
+ updated_at?: string;
3307
+ };
3308
+ Relationships: [{
3309
+ foreignKeyName: "floriday_auto_fulfillment_log_connection_id_fkey";
3310
+ columns: ["connection_id"];
3311
+ isOneToOne: false;
3312
+ referencedRelation: "floriday_connections";
3313
+ referencedColumns: ["id"];
3314
+ }];
3315
+ };
3211
3316
  floriday_base_items_cache: {
3212
3317
  Row: {
3213
3318
  connection_id: string;
@@ -3622,6 +3727,51 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
3622
3727
  referencedColumns: ["id"];
3623
3728
  }];
3624
3729
  };
3730
+ floriday_continuous_stock_queue: {
3731
+ Row: {
3732
+ attempts: number;
3733
+ connection_id: string;
3734
+ created_at: string;
3735
+ gateway_attempt_id: string | null;
3736
+ id: string;
3737
+ last_error: string | null;
3738
+ number_of_pieces: number;
3739
+ sent_at: string | null;
3740
+ status: string;
3741
+ trade_item_id: string;
3742
+ updated_at: string;
3743
+ user_id: string;
3744
+ };
3745
+ Insert: {
3746
+ attempts?: number;
3747
+ connection_id: string;
3748
+ created_at?: string;
3749
+ gateway_attempt_id?: string | null;
3750
+ id?: string;
3751
+ last_error?: string | null;
3752
+ number_of_pieces?: number;
3753
+ sent_at?: string | null;
3754
+ status?: string;
3755
+ trade_item_id: string;
3756
+ updated_at?: string;
3757
+ user_id: string;
3758
+ };
3759
+ Update: {
3760
+ attempts?: number;
3761
+ connection_id?: string;
3762
+ created_at?: string;
3763
+ gateway_attempt_id?: string | null;
3764
+ id?: string;
3765
+ last_error?: string | null;
3766
+ number_of_pieces?: number;
3767
+ sent_at?: string | null;
3768
+ status?: string;
3769
+ trade_item_id?: string;
3770
+ updated_at?: string;
3771
+ user_id?: string;
3772
+ };
3773
+ Relationships: [];
3774
+ };
3625
3775
  floriday_contract_trade_item_groups_cache: {
3626
3776
  Row: {
3627
3777
  connection_id: string;
@@ -4267,6 +4417,24 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
4267
4417
  referencedColumns: ["id"];
4268
4418
  }];
4269
4419
  };
4420
+ floriday_rate_limit_state: {
4421
+ Row: {
4422
+ bucket: string;
4423
+ last_refill_at: string;
4424
+ tokens: number;
4425
+ };
4426
+ Insert: {
4427
+ bucket: string;
4428
+ last_refill_at?: string;
4429
+ tokens: number;
4430
+ };
4431
+ Update: {
4432
+ bucket?: string;
4433
+ last_refill_at?: string;
4434
+ tokens?: number;
4435
+ };
4436
+ Relationships: [];
4437
+ };
4270
4438
  floriday_resource_schemas: {
4271
4439
  Row: {
4272
4440
  enums: import("./types").Json;
@@ -4690,6 +4858,60 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
4690
4858
  referencedColumns: ["id"];
4691
4859
  }];
4692
4860
  };
4861
+ flow_role_assignments: {
4862
+ Row: {
4863
+ created_at: string;
4864
+ id: string;
4865
+ role_id: string;
4866
+ user_id: string;
4867
+ };
4868
+ Insert: {
4869
+ created_at?: string;
4870
+ id?: string;
4871
+ role_id: string;
4872
+ user_id: string;
4873
+ };
4874
+ Update: {
4875
+ created_at?: string;
4876
+ id?: string;
4877
+ role_id?: string;
4878
+ user_id?: string;
4879
+ };
4880
+ Relationships: [{
4881
+ foreignKeyName: "flow_role_assignments_role_id_fkey";
4882
+ columns: ["role_id"];
4883
+ isOneToOne: false;
4884
+ referencedRelation: "flow_roles";
4885
+ referencedColumns: ["id"];
4886
+ }];
4887
+ };
4888
+ flow_roles: {
4889
+ Row: {
4890
+ created_at: string;
4891
+ description: string | null;
4892
+ id: string;
4893
+ module_access: string[];
4894
+ name: string;
4895
+ updated_at: string;
4896
+ };
4897
+ Insert: {
4898
+ created_at?: string;
4899
+ description?: string | null;
4900
+ id?: string;
4901
+ module_access?: string[];
4902
+ name: string;
4903
+ updated_at?: string;
4904
+ };
4905
+ Update: {
4906
+ created_at?: string;
4907
+ description?: string | null;
4908
+ id?: string;
4909
+ module_access?: string[];
4910
+ name?: string;
4911
+ updated_at?: string;
4912
+ };
4913
+ Relationships: [];
4914
+ };
4693
4915
  imap_accounts: {
4694
4916
  Row: {
4695
4917
  created_at: string;
@@ -5011,88 +5233,286 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5011
5233
  };
5012
5234
  Relationships: [];
5013
5235
  };
5014
- locations: {
5236
+ local_customer_agreements: {
5015
5237
  Row: {
5238
+ base_price: number | null;
5016
5239
  created_at: string;
5240
+ currency: string;
5241
+ customer_id: string;
5017
5242
  id: string;
5018
- name: string;
5019
- sort_order: number;
5243
+ min_quantity: number;
5244
+ net_price: number;
5245
+ notes: string | null;
5246
+ product_category_id: string | null;
5247
+ product_id: string | null;
5020
5248
  updated_at: string;
5249
+ valid_from: string | null;
5250
+ valid_until: string | null;
5021
5251
  };
5022
5252
  Insert: {
5253
+ base_price?: number | null;
5023
5254
  created_at?: string;
5255
+ currency?: string;
5256
+ customer_id: string;
5024
5257
  id?: string;
5025
- name: string;
5026
- sort_order?: number;
5258
+ min_quantity?: number;
5259
+ net_price: number;
5260
+ notes?: string | null;
5261
+ product_category_id?: string | null;
5262
+ product_id?: string | null;
5027
5263
  updated_at?: string;
5264
+ valid_from?: string | null;
5265
+ valid_until?: string | null;
5028
5266
  };
5029
5267
  Update: {
5268
+ base_price?: number | null;
5030
5269
  created_at?: string;
5270
+ currency?: string;
5271
+ customer_id?: string;
5031
5272
  id?: string;
5032
- name?: string;
5033
- sort_order?: number;
5273
+ min_quantity?: number;
5274
+ net_price?: number;
5275
+ notes?: string | null;
5276
+ product_category_id?: string | null;
5277
+ product_id?: string | null;
5034
5278
  updated_at?: string;
5279
+ valid_from?: string | null;
5280
+ valid_until?: string | null;
5035
5281
  };
5036
- Relationships: [];
5282
+ Relationships: [{
5283
+ foreignKeyName: "local_customer_agreements_customer_id_fkey";
5284
+ columns: ["customer_id"];
5285
+ isOneToOne: false;
5286
+ referencedRelation: "customers";
5287
+ referencedColumns: ["id"];
5288
+ }, {
5289
+ foreignKeyName: "local_customer_agreements_product_category_id_fkey";
5290
+ columns: ["product_category_id"];
5291
+ isOneToOne: false;
5292
+ referencedRelation: "product_categories";
5293
+ referencedColumns: ["id"];
5294
+ }, {
5295
+ foreignKeyName: "local_customer_agreements_product_id_fkey";
5296
+ columns: ["product_id"];
5297
+ isOneToOne: false;
5298
+ referencedRelation: "products";
5299
+ referencedColumns: ["id"];
5300
+ }];
5037
5301
  };
5038
- mailbox_messages: {
5302
+ local_customer_price_groups: {
5039
5303
  Row: {
5040
- body_html: string | null;
5041
- body_text: string | null;
5042
- connection_id: string | null;
5043
5304
  created_at: string;
5044
- error_message: string | null;
5045
- external_id: string | null;
5046
- from_email: string | null;
5047
- from_name: string | null;
5305
+ currency: string;
5306
+ customer_id: string;
5307
+ discount_type: string;
5308
+ discount_value: number;
5048
5309
  id: string;
5049
- message_id: string | null;
5050
- profile_id: string | null;
5051
- raw_size: number | null;
5052
- received_at: string | null;
5053
- status: string;
5054
- subject: string | null;
5055
- uid: number | null;
5310
+ min_quantity: number;
5311
+ notes: string | null;
5312
+ product_category_id: string | null;
5313
+ product_id: string | null;
5056
5314
  updated_at: string;
5315
+ valid_from: string | null;
5316
+ valid_until: string | null;
5057
5317
  };
5058
5318
  Insert: {
5059
- body_html?: string | null;
5060
- body_text?: string | null;
5061
- connection_id?: string | null;
5062
5319
  created_at?: string;
5063
- error_message?: string | null;
5064
- external_id?: string | null;
5065
- from_email?: string | null;
5066
- from_name?: string | null;
5320
+ currency?: string;
5321
+ customer_id: string;
5322
+ discount_type: string;
5323
+ discount_value: number;
5067
5324
  id?: string;
5068
- message_id?: string | null;
5069
- profile_id?: string | null;
5070
- raw_size?: number | null;
5071
- received_at?: string | null;
5072
- status?: string;
5073
- subject?: string | null;
5074
- uid?: number | null;
5325
+ min_quantity?: number;
5326
+ notes?: string | null;
5327
+ product_category_id?: string | null;
5328
+ product_id?: string | null;
5075
5329
  updated_at?: string;
5330
+ valid_from?: string | null;
5331
+ valid_until?: string | null;
5076
5332
  };
5077
5333
  Update: {
5078
- body_html?: string | null;
5079
- body_text?: string | null;
5080
- connection_id?: string | null;
5081
5334
  created_at?: string;
5082
- error_message?: string | null;
5083
- external_id?: string | null;
5084
- from_email?: string | null;
5085
- from_name?: string | null;
5335
+ currency?: string;
5336
+ customer_id?: string;
5337
+ discount_type?: string;
5338
+ discount_value?: number;
5086
5339
  id?: string;
5087
- message_id?: string | null;
5088
- profile_id?: string | null;
5089
- raw_size?: number | null;
5090
- received_at?: string | null;
5091
- status?: string;
5092
- subject?: string | null;
5093
- uid?: number | null;
5340
+ min_quantity?: number;
5341
+ notes?: string | null;
5342
+ product_category_id?: string | null;
5343
+ product_id?: string | null;
5094
5344
  updated_at?: string;
5095
- };
5345
+ valid_from?: string | null;
5346
+ valid_until?: string | null;
5347
+ };
5348
+ Relationships: [{
5349
+ foreignKeyName: "local_customer_price_groups_customer_id_fkey";
5350
+ columns: ["customer_id"];
5351
+ isOneToOne: false;
5352
+ referencedRelation: "customers";
5353
+ referencedColumns: ["id"];
5354
+ }, {
5355
+ foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
5356
+ columns: ["product_category_id"];
5357
+ isOneToOne: false;
5358
+ referencedRelation: "product_categories";
5359
+ referencedColumns: ["id"];
5360
+ }, {
5361
+ foreignKeyName: "local_customer_price_groups_product_id_fkey";
5362
+ columns: ["product_id"];
5363
+ isOneToOne: false;
5364
+ referencedRelation: "products";
5365
+ referencedColumns: ["id"];
5366
+ }];
5367
+ };
5368
+ local_customer_sales_strategies: {
5369
+ Row: {
5370
+ created_at: string;
5371
+ currency: string;
5372
+ customer_id: string;
5373
+ discount_type: string;
5374
+ discount_value: number;
5375
+ id: string;
5376
+ min_quantity: number;
5377
+ notes: string | null;
5378
+ product_category_id: string | null;
5379
+ product_id: string | null;
5380
+ updated_at: string;
5381
+ valid_from: string | null;
5382
+ valid_until: string | null;
5383
+ };
5384
+ Insert: {
5385
+ created_at?: string;
5386
+ currency?: string;
5387
+ customer_id: string;
5388
+ discount_type: string;
5389
+ discount_value: number;
5390
+ id?: string;
5391
+ min_quantity?: number;
5392
+ notes?: string | null;
5393
+ product_category_id?: string | null;
5394
+ product_id?: string | null;
5395
+ updated_at?: string;
5396
+ valid_from?: string | null;
5397
+ valid_until?: string | null;
5398
+ };
5399
+ Update: {
5400
+ created_at?: string;
5401
+ currency?: string;
5402
+ customer_id?: string;
5403
+ discount_type?: string;
5404
+ discount_value?: number;
5405
+ id?: string;
5406
+ min_quantity?: number;
5407
+ notes?: string | null;
5408
+ product_category_id?: string | null;
5409
+ product_id?: string | null;
5410
+ updated_at?: string;
5411
+ valid_from?: string | null;
5412
+ valid_until?: string | null;
5413
+ };
5414
+ Relationships: [{
5415
+ foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
5416
+ columns: ["customer_id"];
5417
+ isOneToOne: false;
5418
+ referencedRelation: "customers";
5419
+ referencedColumns: ["id"];
5420
+ }, {
5421
+ foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
5422
+ columns: ["product_category_id"];
5423
+ isOneToOne: false;
5424
+ referencedRelation: "product_categories";
5425
+ referencedColumns: ["id"];
5426
+ }, {
5427
+ foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
5428
+ columns: ["product_id"];
5429
+ isOneToOne: false;
5430
+ referencedRelation: "products";
5431
+ referencedColumns: ["id"];
5432
+ }];
5433
+ };
5434
+ locations: {
5435
+ Row: {
5436
+ created_at: string;
5437
+ id: string;
5438
+ name: string;
5439
+ sort_order: number;
5440
+ updated_at: string;
5441
+ };
5442
+ Insert: {
5443
+ created_at?: string;
5444
+ id?: string;
5445
+ name: string;
5446
+ sort_order?: number;
5447
+ updated_at?: string;
5448
+ };
5449
+ Update: {
5450
+ created_at?: string;
5451
+ id?: string;
5452
+ name?: string;
5453
+ sort_order?: number;
5454
+ updated_at?: string;
5455
+ };
5456
+ Relationships: [];
5457
+ };
5458
+ mailbox_messages: {
5459
+ Row: {
5460
+ body_html: string | null;
5461
+ body_text: string | null;
5462
+ connection_id: string | null;
5463
+ created_at: string;
5464
+ error_message: string | null;
5465
+ external_id: string | null;
5466
+ from_email: string | null;
5467
+ from_name: string | null;
5468
+ id: string;
5469
+ message_id: string | null;
5470
+ profile_id: string | null;
5471
+ raw_size: number | null;
5472
+ received_at: string | null;
5473
+ status: string;
5474
+ subject: string | null;
5475
+ uid: number | null;
5476
+ updated_at: string;
5477
+ };
5478
+ Insert: {
5479
+ body_html?: string | null;
5480
+ body_text?: string | null;
5481
+ connection_id?: string | null;
5482
+ created_at?: string;
5483
+ error_message?: string | null;
5484
+ external_id?: string | null;
5485
+ from_email?: string | null;
5486
+ from_name?: string | null;
5487
+ id?: string;
5488
+ message_id?: string | null;
5489
+ profile_id?: string | null;
5490
+ raw_size?: number | null;
5491
+ received_at?: string | null;
5492
+ status?: string;
5493
+ subject?: string | null;
5494
+ uid?: number | null;
5495
+ updated_at?: string;
5496
+ };
5497
+ Update: {
5498
+ body_html?: string | null;
5499
+ body_text?: string | null;
5500
+ connection_id?: string | null;
5501
+ created_at?: string;
5502
+ error_message?: string | null;
5503
+ external_id?: string | null;
5504
+ from_email?: string | null;
5505
+ from_name?: string | null;
5506
+ id?: string;
5507
+ message_id?: string | null;
5508
+ profile_id?: string | null;
5509
+ raw_size?: number | null;
5510
+ received_at?: string | null;
5511
+ status?: string;
5512
+ subject?: string | null;
5513
+ uid?: number | null;
5514
+ updated_at?: string;
5515
+ };
5096
5516
  Relationships: [{
5097
5517
  foreignKeyName: "mailbox_messages_connection_id_fkey";
5098
5518
  columns: ["connection_id"];
@@ -5123,6 +5543,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5123
5543
  matched_customer_id: string | null;
5124
5544
  message_id: string;
5125
5545
  notes: string | null;
5546
+ order_number: string | null;
5126
5547
  parsed_payload: import("./types").Json | null;
5127
5548
  reviewed_at: string | null;
5128
5549
  reviewed_by: string | null;
@@ -5138,6 +5559,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5138
5559
  matched_customer_id?: string | null;
5139
5560
  message_id: string;
5140
5561
  notes?: string | null;
5562
+ order_number?: string | null;
5141
5563
  parsed_payload?: import("./types").Json | null;
5142
5564
  reviewed_at?: string | null;
5143
5565
  reviewed_by?: string | null;
@@ -5153,6 +5575,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5153
5575
  matched_customer_id?: string | null;
5154
5576
  message_id?: string;
5155
5577
  notes?: string | null;
5578
+ order_number?: string | null;
5156
5579
  parsed_payload?: import("./types").Json | null;
5157
5580
  reviewed_at?: string | null;
5158
5581
  reviewed_by?: string | null;
@@ -5518,6 +5941,273 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5518
5941
  referencedColumns: ["id"];
5519
5942
  }];
5520
5943
  };
5944
+ nmbrs_component_mapping: {
5945
+ Row: {
5946
+ created_at: string;
5947
+ id: string;
5948
+ source_kind: string;
5949
+ source_value: string | null;
5950
+ updated_at: string;
5951
+ wage_code: string;
5952
+ };
5953
+ Insert: {
5954
+ created_at?: string;
5955
+ id?: string;
5956
+ source_kind: string;
5957
+ source_value?: string | null;
5958
+ updated_at?: string;
5959
+ wage_code: string;
5960
+ };
5961
+ Update: {
5962
+ created_at?: string;
5963
+ id?: string;
5964
+ source_kind?: string;
5965
+ source_value?: string | null;
5966
+ updated_at?: string;
5967
+ wage_code?: string;
5968
+ };
5969
+ Relationships: [{
5970
+ foreignKeyName: "nmbrs_component_mapping_wage_code_fkey";
5971
+ columns: ["wage_code"];
5972
+ isOneToOne: false;
5973
+ referencedRelation: "nmbrs_wage_components";
5974
+ referencedColumns: ["code"];
5975
+ }];
5976
+ };
5977
+ nmbrs_employee_mapping: {
5978
+ Row: {
5979
+ active_from: string | null;
5980
+ active_to: string | null;
5981
+ contract_hours_per_week: number | null;
5982
+ created_at: string;
5983
+ hourly_wage: number | null;
5984
+ id: string;
5985
+ monteur_id: string;
5986
+ nmbrs_company_code: string | null;
5987
+ nmbrs_employee_number: string;
5988
+ updated_at: string;
5989
+ };
5990
+ Insert: {
5991
+ active_from?: string | null;
5992
+ active_to?: string | null;
5993
+ contract_hours_per_week?: number | null;
5994
+ created_at?: string;
5995
+ hourly_wage?: number | null;
5996
+ id?: string;
5997
+ monteur_id: string;
5998
+ nmbrs_company_code?: string | null;
5999
+ nmbrs_employee_number: string;
6000
+ updated_at?: string;
6001
+ };
6002
+ Update: {
6003
+ active_from?: string | null;
6004
+ active_to?: string | null;
6005
+ contract_hours_per_week?: number | null;
6006
+ created_at?: string;
6007
+ hourly_wage?: number | null;
6008
+ id?: string;
6009
+ monteur_id?: string;
6010
+ nmbrs_company_code?: string | null;
6011
+ nmbrs_employee_number?: string;
6012
+ updated_at?: string;
6013
+ };
6014
+ Relationships: [{
6015
+ foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
6016
+ columns: ["monteur_id"];
6017
+ isOneToOne: true;
6018
+ referencedRelation: "monteurs";
6019
+ referencedColumns: ["id"];
6020
+ }];
6021
+ };
6022
+ nmbrs_export_lines: {
6023
+ Row: {
6024
+ amount: number;
6025
+ created_at: string;
6026
+ entry_date: string;
6027
+ hours: number;
6028
+ id: string;
6029
+ monteur_id: string;
6030
+ nmbrs_employee_number: string | null;
6031
+ notes: string | null;
6032
+ run_id: string;
6033
+ source_kind: string | null;
6034
+ source_ref_id: string | null;
6035
+ updated_at: string;
6036
+ wage_code: string;
6037
+ };
6038
+ Insert: {
6039
+ amount?: number;
6040
+ created_at?: string;
6041
+ entry_date: string;
6042
+ hours?: number;
6043
+ id?: string;
6044
+ monteur_id: string;
6045
+ nmbrs_employee_number?: string | null;
6046
+ notes?: string | null;
6047
+ run_id: string;
6048
+ source_kind?: string | null;
6049
+ source_ref_id?: string | null;
6050
+ updated_at?: string;
6051
+ wage_code: string;
6052
+ };
6053
+ Update: {
6054
+ amount?: number;
6055
+ created_at?: string;
6056
+ entry_date?: string;
6057
+ hours?: number;
6058
+ id?: string;
6059
+ monteur_id?: string;
6060
+ nmbrs_employee_number?: string | null;
6061
+ notes?: string | null;
6062
+ run_id?: string;
6063
+ source_kind?: string | null;
6064
+ source_ref_id?: string | null;
6065
+ updated_at?: string;
6066
+ wage_code?: string;
6067
+ };
6068
+ Relationships: [{
6069
+ foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
6070
+ columns: ["monteur_id"];
6071
+ isOneToOne: false;
6072
+ referencedRelation: "monteurs";
6073
+ referencedColumns: ["id"];
6074
+ }, {
6075
+ foreignKeyName: "nmbrs_export_lines_run_id_fkey";
6076
+ columns: ["run_id"];
6077
+ isOneToOne: false;
6078
+ referencedRelation: "nmbrs_export_runs";
6079
+ referencedColumns: ["id"];
6080
+ }, {
6081
+ foreignKeyName: "nmbrs_export_lines_wage_code_fkey";
6082
+ columns: ["wage_code"];
6083
+ isOneToOne: false;
6084
+ referencedRelation: "nmbrs_wage_components";
6085
+ referencedColumns: ["code"];
6086
+ }];
6087
+ };
6088
+ nmbrs_export_runs: {
6089
+ Row: {
6090
+ created_at: string;
6091
+ file_name: string | null;
6092
+ generated_at: string;
6093
+ generated_by: string | null;
6094
+ id: string;
6095
+ notes: string | null;
6096
+ period_end: string;
6097
+ period_label: string;
6098
+ period_start: string;
6099
+ status: string;
6100
+ total_hours: number;
6101
+ total_lines: number;
6102
+ updated_at: string;
6103
+ };
6104
+ Insert: {
6105
+ created_at?: string;
6106
+ file_name?: string | null;
6107
+ generated_at?: string;
6108
+ generated_by?: string | null;
6109
+ id?: string;
6110
+ notes?: string | null;
6111
+ period_end: string;
6112
+ period_label: string;
6113
+ period_start: string;
6114
+ status?: string;
6115
+ total_hours?: number;
6116
+ total_lines?: number;
6117
+ updated_at?: string;
6118
+ };
6119
+ Update: {
6120
+ created_at?: string;
6121
+ file_name?: string | null;
6122
+ generated_at?: string;
6123
+ generated_by?: string | null;
6124
+ id?: string;
6125
+ notes?: string | null;
6126
+ period_end?: string;
6127
+ period_label?: string;
6128
+ period_start?: string;
6129
+ status?: string;
6130
+ total_hours?: number;
6131
+ total_lines?: number;
6132
+ updated_at?: string;
6133
+ };
6134
+ Relationships: [];
6135
+ };
6136
+ nmbrs_settings: {
6137
+ Row: {
6138
+ created_at: string;
6139
+ default_company_code: string | null;
6140
+ id: boolean;
6141
+ include_travel: boolean;
6142
+ overtime_threshold_daily: number;
6143
+ overtime_threshold_weekly: number;
6144
+ period_type: string;
6145
+ updated_at: string;
6146
+ updated_by: string | null;
6147
+ week_start_day: number;
6148
+ };
6149
+ Insert: {
6150
+ created_at?: string;
6151
+ default_company_code?: string | null;
6152
+ id?: boolean;
6153
+ include_travel?: boolean;
6154
+ overtime_threshold_daily?: number;
6155
+ overtime_threshold_weekly?: number;
6156
+ period_type?: string;
6157
+ updated_at?: string;
6158
+ updated_by?: string | null;
6159
+ week_start_day?: number;
6160
+ };
6161
+ Update: {
6162
+ created_at?: string;
6163
+ default_company_code?: string | null;
6164
+ id?: boolean;
6165
+ include_travel?: boolean;
6166
+ overtime_threshold_daily?: number;
6167
+ overtime_threshold_weekly?: number;
6168
+ period_type?: string;
6169
+ updated_at?: string;
6170
+ updated_by?: string | null;
6171
+ week_start_day?: number;
6172
+ };
6173
+ Relationships: [];
6174
+ };
6175
+ nmbrs_wage_components: {
6176
+ Row: {
6177
+ category: string;
6178
+ code: string;
6179
+ created_at: string;
6180
+ id: string;
6181
+ is_active: boolean;
6182
+ label: string;
6183
+ sort_order: number;
6184
+ unit: string;
6185
+ updated_at: string;
6186
+ };
6187
+ Insert: {
6188
+ category: string;
6189
+ code: string;
6190
+ created_at?: string;
6191
+ id?: string;
6192
+ is_active?: boolean;
6193
+ label: string;
6194
+ sort_order?: number;
6195
+ unit: string;
6196
+ updated_at?: string;
6197
+ };
6198
+ Update: {
6199
+ category?: string;
6200
+ code?: string;
6201
+ created_at?: string;
6202
+ id?: string;
6203
+ is_active?: boolean;
6204
+ label?: string;
6205
+ sort_order?: number;
6206
+ unit?: string;
6207
+ updated_at?: string;
6208
+ };
6209
+ Relationships: [];
6210
+ };
5521
6211
  notifications: {
5522
6212
  Row: {
5523
6213
  created_at: string;
@@ -5742,6 +6432,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5742
6432
  id: string;
5743
6433
  items: import("./types").Json;
5744
6434
  notes: string | null;
6435
+ order_number: string | null;
5745
6436
  recipient_id: string;
5746
6437
  total_amount: number;
5747
6438
  };
@@ -5755,6 +6446,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5755
6446
  id?: string;
5756
6447
  items?: import("./types").Json;
5757
6448
  notes?: string | null;
6449
+ order_number?: string | null;
5758
6450
  recipient_id: string;
5759
6451
  total_amount?: number;
5760
6452
  };
@@ -5768,6 +6460,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5768
6460
  id?: string;
5769
6461
  items?: import("./types").Json;
5770
6462
  notes?: string | null;
6463
+ order_number?: string | null;
5771
6464
  recipient_id?: string;
5772
6465
  total_amount?: number;
5773
6466
  };
@@ -5927,6 +6620,9 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5927
6620
  crates_per_layer: number;
5928
6621
  created_at: string;
5929
6622
  id: string;
6623
+ layer_fraction: number;
6624
+ layer_share_pct: number;
6625
+ layers_per_cart: number;
5930
6626
  order_item_id: string | null;
5931
6627
  plants_per_crate: number;
5932
6628
  product_id: string | null;
@@ -5938,6 +6634,9 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5938
6634
  crates_per_layer?: number;
5939
6635
  created_at?: string;
5940
6636
  id?: string;
6637
+ layer_fraction?: number;
6638
+ layer_share_pct?: number;
6639
+ layers_per_cart?: number;
5941
6640
  order_item_id?: string | null;
5942
6641
  plants_per_crate?: number;
5943
6642
  product_id?: string | null;
@@ -5949,6 +6648,9 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5949
6648
  crates_per_layer?: number;
5950
6649
  created_at?: string;
5951
6650
  id?: string;
6651
+ layer_fraction?: number;
6652
+ layer_share_pct?: number;
6653
+ layers_per_cart?: number;
5952
6654
  order_item_id?: string | null;
5953
6655
  plants_per_crate?: number;
5954
6656
  product_id?: string | null;
@@ -5976,33 +6678,45 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
5976
6678
  };
5977
6679
  order_carts: {
5978
6680
  Row: {
6681
+ algorithm_version: number;
5979
6682
  cart_number: number;
5980
6683
  created_at: string;
5981
6684
  id: string;
5982
6685
  is_auto: boolean;
5983
6686
  is_complete: boolean;
5984
6687
  notes: string | null;
6688
+ occupancy_pct: number;
5985
6689
  order_id: string;
6690
+ source: string;
6691
+ total_layers_used: number;
5986
6692
  updated_at: string;
5987
6693
  };
5988
6694
  Insert: {
6695
+ algorithm_version?: number;
5989
6696
  cart_number: number;
5990
6697
  created_at?: string;
5991
6698
  id?: string;
5992
6699
  is_auto?: boolean;
5993
6700
  is_complete?: boolean;
5994
6701
  notes?: string | null;
6702
+ occupancy_pct?: number;
5995
6703
  order_id: string;
6704
+ source?: string;
6705
+ total_layers_used?: number;
5996
6706
  updated_at?: string;
5997
6707
  };
5998
6708
  Update: {
6709
+ algorithm_version?: number;
5999
6710
  cart_number?: number;
6000
6711
  created_at?: string;
6001
6712
  id?: string;
6002
6713
  is_auto?: boolean;
6003
6714
  is_complete?: boolean;
6004
6715
  notes?: string | null;
6716
+ occupancy_pct?: number;
6005
6717
  order_id?: string;
6718
+ source?: string;
6719
+ total_layers_used?: number;
6006
6720
  updated_at?: string;
6007
6721
  };
6008
6722
  Relationships: [{
@@ -6155,6 +6869,8 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
6155
6869
  order_date: string;
6156
6870
  order_number: string;
6157
6871
  order_source: string;
6872
+ plan_locked_at: string | null;
6873
+ plan_locked_ref: string | null;
6158
6874
  status: string;
6159
6875
  total: string;
6160
6876
  updated_at: string;
@@ -6171,6 +6887,8 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
6171
6887
  order_date?: string;
6172
6888
  order_number: string;
6173
6889
  order_source?: string;
6890
+ plan_locked_at?: string | null;
6891
+ plan_locked_ref?: string | null;
6174
6892
  status?: string;
6175
6893
  total?: string;
6176
6894
  updated_at?: string;
@@ -6187,6 +6905,8 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
6187
6905
  order_date?: string;
6188
6906
  order_number?: string;
6189
6907
  order_source?: string;
6908
+ plan_locked_at?: string | null;
6909
+ plan_locked_ref?: string | null;
6190
6910
  status?: string;
6191
6911
  total?: string;
6192
6912
  updated_at?: string;
@@ -6559,6 +7279,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
6559
7279
  display_name: string | null;
6560
7280
  email: string | null;
6561
7281
  id: string;
7282
+ is_superadmin: boolean;
6562
7283
  notification_preferences: import("./types").Json;
6563
7284
  tenant_id: string | null;
6564
7285
  updated_at: string;
@@ -6568,6 +7289,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
6568
7289
  display_name?: string | null;
6569
7290
  email?: string | null;
6570
7291
  id: string;
7292
+ is_superadmin?: boolean;
6571
7293
  notification_preferences?: import("./types").Json;
6572
7294
  tenant_id?: string | null;
6573
7295
  updated_at?: string;
@@ -6577,6 +7299,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
6577
7299
  display_name?: string | null;
6578
7300
  email?: string | null;
6579
7301
  id?: string;
7302
+ is_superadmin?: boolean;
6580
7303
  notification_preferences?: import("./types").Json;
6581
7304
  tenant_id?: string | null;
6582
7305
  updated_at?: string;
@@ -7354,15 +8077,75 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7354
8077
  name: string;
7355
8078
  };
7356
8079
  Update: {
7357
- capacity?: number;
7358
- color_code?: string | null;
8080
+ capacity?: number;
8081
+ color_code?: string | null;
8082
+ created_at?: string;
8083
+ description?: string | null;
8084
+ hourly_rate?: number;
8085
+ id?: string;
8086
+ image_url?: string | null;
8087
+ is_active?: boolean;
8088
+ name?: string;
8089
+ };
8090
+ Relationships: [];
8091
+ };
8092
+ sidebar_config: {
8093
+ Row: {
8094
+ id: string;
8095
+ module_order: string[];
8096
+ updated_at: string;
8097
+ };
8098
+ Insert: {
8099
+ id?: string;
8100
+ module_order?: string[];
8101
+ updated_at?: string;
8102
+ };
8103
+ Update: {
8104
+ id?: string;
8105
+ module_order?: string[];
8106
+ updated_at?: string;
8107
+ };
8108
+ Relationships: [];
8109
+ };
8110
+ stock_import_runs: {
8111
+ Row: {
8112
+ connection_id: string | null;
8113
+ created_at: string;
8114
+ created_rows: number;
8115
+ errors: import("./types").Json;
8116
+ filename: string | null;
8117
+ id: string;
8118
+ mutations: import("./types").Json;
8119
+ skipped_rows: number;
8120
+ total_rows: number;
8121
+ updated_rows: number;
8122
+ user_id: string;
8123
+ };
8124
+ Insert: {
8125
+ connection_id?: string | null;
8126
+ created_at?: string;
8127
+ created_rows?: number;
8128
+ errors?: import("./types").Json;
8129
+ filename?: string | null;
8130
+ id?: string;
8131
+ mutations?: import("./types").Json;
8132
+ skipped_rows?: number;
8133
+ total_rows?: number;
8134
+ updated_rows?: number;
8135
+ user_id: string;
8136
+ };
8137
+ Update: {
8138
+ connection_id?: string | null;
7359
8139
  created_at?: string;
7360
- description?: string | null;
7361
- hourly_rate?: number;
8140
+ created_rows?: number;
8141
+ errors?: import("./types").Json;
8142
+ filename?: string | null;
7362
8143
  id?: string;
7363
- image_url?: string | null;
7364
- is_active?: boolean;
7365
- name?: string;
8144
+ mutations?: import("./types").Json;
8145
+ skipped_rows?: number;
8146
+ total_rows?: number;
8147
+ updated_rows?: number;
8148
+ user_id?: string;
7366
8149
  };
7367
8150
  Relationships: [];
7368
8151
  };
@@ -7382,7 +8165,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7382
8165
  reason: string | null;
7383
8166
  reserved_after: number | null;
7384
8167
  reserved_before: number | null;
7385
- trade_item_key: string;
8168
+ trade_item_key: string | null;
7386
8169
  };
7387
8170
  Insert: {
7388
8171
  connection_id?: string | null;
@@ -7399,7 +8182,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7399
8182
  reason?: string | null;
7400
8183
  reserved_after?: number | null;
7401
8184
  reserved_before?: number | null;
7402
- trade_item_key: string;
8185
+ trade_item_key?: string | null;
7403
8186
  };
7404
8187
  Update: {
7405
8188
  connection_id?: string | null;
@@ -7416,7 +8199,7 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7416
8199
  reason?: string | null;
7417
8200
  reserved_after?: number | null;
7418
8201
  reserved_before?: number | null;
7419
- trade_item_key?: string;
8202
+ trade_item_key?: string | null;
7420
8203
  };
7421
8204
  Relationships: [];
7422
8205
  };
@@ -7759,6 +8542,114 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
7759
8542
  };
7760
8543
  Relationships: [];
7761
8544
  };
8545
+ trade_item_supply_lines: {
8546
+ Row: {
8547
+ available_quantity: number | null;
8548
+ connection_id: string;
8549
+ created_at: string;
8550
+ currency: string | null;
8551
+ endpoint_family: string | null;
8552
+ environment: string | null;
8553
+ id: string;
8554
+ last_error: string | null;
8555
+ last_status: number | null;
8556
+ packing_configuration_id: string | null;
8557
+ period_end: string | null;
8558
+ period_start: string | null;
8559
+ price_per_piece: number | null;
8560
+ sales_unit: string | null;
8561
+ supply_line_id: string | null;
8562
+ supply_type: string;
8563
+ trade_item_id: string;
8564
+ updated_at: string;
8565
+ user_id: string;
8566
+ week: number | null;
8567
+ year: number | null;
8568
+ };
8569
+ Insert: {
8570
+ available_quantity?: number | null;
8571
+ connection_id: string;
8572
+ created_at?: string;
8573
+ currency?: string | null;
8574
+ endpoint_family?: string | null;
8575
+ environment?: string | null;
8576
+ id?: string;
8577
+ last_error?: string | null;
8578
+ last_status?: number | null;
8579
+ packing_configuration_id?: string | null;
8580
+ period_end?: string | null;
8581
+ period_start?: string | null;
8582
+ price_per_piece?: number | null;
8583
+ sales_unit?: string | null;
8584
+ supply_line_id?: string | null;
8585
+ supply_type?: string;
8586
+ trade_item_id: string;
8587
+ updated_at?: string;
8588
+ user_id: string;
8589
+ week?: number | null;
8590
+ year?: number | null;
8591
+ };
8592
+ Update: {
8593
+ available_quantity?: number | null;
8594
+ connection_id?: string;
8595
+ created_at?: string;
8596
+ currency?: string | null;
8597
+ endpoint_family?: string | null;
8598
+ environment?: string | null;
8599
+ id?: string;
8600
+ last_error?: string | null;
8601
+ last_status?: number | null;
8602
+ packing_configuration_id?: string | null;
8603
+ period_end?: string | null;
8604
+ period_start?: string | null;
8605
+ price_per_piece?: number | null;
8606
+ sales_unit?: string | null;
8607
+ supply_line_id?: string | null;
8608
+ supply_type?: string;
8609
+ trade_item_id?: string;
8610
+ updated_at?: string;
8611
+ user_id?: string;
8612
+ week?: number | null;
8613
+ year?: number | null;
8614
+ };
8615
+ Relationships: [];
8616
+ };
8617
+ trade_item_warehouse_preferences: {
8618
+ Row: {
8619
+ connection_id: string;
8620
+ created_at: string;
8621
+ id: string;
8622
+ trade_item_id: string;
8623
+ updated_at: string;
8624
+ warehouse_id: string;
8625
+ warehouse_name: string | null;
8626
+ };
8627
+ Insert: {
8628
+ connection_id: string;
8629
+ created_at?: string;
8630
+ id?: string;
8631
+ trade_item_id: string;
8632
+ updated_at?: string;
8633
+ warehouse_id: string;
8634
+ warehouse_name?: string | null;
8635
+ };
8636
+ Update: {
8637
+ connection_id?: string;
8638
+ created_at?: string;
8639
+ id?: string;
8640
+ trade_item_id?: string;
8641
+ updated_at?: string;
8642
+ warehouse_id?: string;
8643
+ warehouse_name?: string | null;
8644
+ };
8645
+ Relationships: [{
8646
+ foreignKeyName: "trade_item_warehouse_preferences_connection_id_fkey";
8647
+ columns: ["connection_id"];
8648
+ isOneToOne: false;
8649
+ referencedRelation: "floriday_connections";
8650
+ referencedColumns: ["id"];
8651
+ }];
8652
+ };
7762
8653
  twinfield_connections: {
7763
8654
  Row: {
7764
8655
  access_token: string | null;
@@ -8078,6 +8969,10 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
8078
8969
  default_invoice_type: string;
8079
8970
  default_payment_term_days: number;
8080
8971
  default_vat_code: string;
8972
+ invoice_enabled_ao: boolean;
8973
+ invoice_enabled_fo: boolean;
8974
+ invoice_enabled_ho: boolean;
8975
+ invoice_enabled_mo: boolean;
8081
8976
  updated_at: string;
8082
8977
  user_id: string;
8083
8978
  };
@@ -8087,6 +8982,10 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
8087
8982
  default_invoice_type?: string;
8088
8983
  default_payment_term_days?: number;
8089
8984
  default_vat_code?: string;
8985
+ invoice_enabled_ao?: boolean;
8986
+ invoice_enabled_fo?: boolean;
8987
+ invoice_enabled_ho?: boolean;
8988
+ invoice_enabled_mo?: boolean;
8090
8989
  updated_at?: string;
8091
8990
  user_id: string;
8092
8991
  };
@@ -8096,6 +8995,10 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
8096
8995
  default_invoice_type?: string;
8097
8996
  default_payment_term_days?: number;
8098
8997
  default_vat_code?: string;
8998
+ invoice_enabled_ao?: boolean;
8999
+ invoice_enabled_fo?: boolean;
9000
+ invoice_enabled_ho?: boolean;
9001
+ invoice_enabled_mo?: boolean;
8099
9002
  updated_at?: string;
8100
9003
  user_id?: string;
8101
9004
  };
@@ -8997,6 +9900,44 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
8997
9900
  };
8998
9901
  Relationships: [];
8999
9902
  };
9903
+ floriday_customer_discounts: {
9904
+ Row: {
9905
+ base_price: number | null;
9906
+ buyer_organization_id: string | null;
9907
+ currency: string | null;
9908
+ discount_type: string | null;
9909
+ discount_value: number | null;
9910
+ min_quantity: number | null;
9911
+ net_price: number | null;
9912
+ product_group_id: string | null;
9913
+ raw: import("./types").Json | null;
9914
+ source: string | null;
9915
+ source_id: string | null;
9916
+ trade_item_id: string | null;
9917
+ valid_from: string | null;
9918
+ valid_until: string | null;
9919
+ };
9920
+ Relationships: [];
9921
+ };
9922
+ local_customer_discounts: {
9923
+ Row: {
9924
+ base_price: number | null;
9925
+ currency: string | null;
9926
+ customer_id: string | null;
9927
+ discount_type: string | null;
9928
+ discount_value: number | null;
9929
+ min_quantity: number | null;
9930
+ net_price: number | null;
9931
+ product_category_id: string | null;
9932
+ product_id: string | null;
9933
+ product_name: string | null;
9934
+ source: string | null;
9935
+ source_id: string | null;
9936
+ valid_from: string | null;
9937
+ valid_until: string | null;
9938
+ };
9939
+ Relationships: [];
9940
+ };
9000
9941
  manufacture_product_possible_stock_view: {
9001
9942
  Row: {
9002
9943
  component_count: number | null;
@@ -9352,6 +10293,12 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9352
10293
  order_number: string;
9353
10294
  }[];
9354
10295
  };
10296
+ autolink_product_to_floriday: {
10297
+ Args: {
10298
+ p_product_id: string;
10299
+ };
10300
+ Returns: string;
10301
+ };
9355
10302
  backfill_open_order_reservations: {
9356
10303
  Args: never;
9357
10304
  Returns: {
@@ -9364,10 +10311,44 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9364
10311
  };
9365
10312
  Returns: number;
9366
10313
  };
10314
+ check_offer_product_available_stock: {
10315
+ Args: {
10316
+ p_campaign_product_id: string;
10317
+ p_code: string;
10318
+ p_needed_qty?: number;
10319
+ p_product_name?: string;
10320
+ };
10321
+ Returns: import("./types").Json;
10322
+ };
10323
+ check_trade_item_available_stock: {
10324
+ Args: {
10325
+ p_connection_id?: string;
10326
+ p_context?: string;
10327
+ p_needed_qty?: number;
10328
+ p_order_id?: string;
10329
+ p_order_item_id?: string;
10330
+ p_owner_id?: string;
10331
+ p_product_name?: string;
10332
+ p_trade_item_key: string;
10333
+ };
10334
+ Returns: import("./types").Json;
10335
+ };
9367
10336
  cleanup_old_bookings: {
9368
10337
  Args: never;
9369
10338
  Returns: number;
9370
10339
  };
10340
+ consume_floriday_rate_limit: {
10341
+ Args: {
10342
+ p_bucket: string;
10343
+ p_capacity: number;
10344
+ p_cost?: number;
10345
+ p_refill_per_sec: number;
10346
+ };
10347
+ Returns: {
10348
+ granted: boolean;
10349
+ wait_ms: number;
10350
+ }[];
10351
+ };
9371
10352
  control_get_todays_carts: {
9372
10353
  Args: never;
9373
10354
  Returns: {
@@ -9448,6 +10429,18 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9448
10429
  status: string;
9449
10430
  }[];
9450
10431
  };
10432
+ enqueue_cart_replan_if_unlocked: {
10433
+ Args: {
10434
+ p_order_id: string;
10435
+ };
10436
+ Returns: undefined;
10437
+ };
10438
+ ensure_trade_item_stock_row: {
10439
+ Args: {
10440
+ p_key: string;
10441
+ };
10442
+ Returns: undefined;
10443
+ };
9451
10444
  ensure_user_tenant: {
9452
10445
  Args: never;
9453
10446
  Returns: string;
@@ -9485,12 +10478,31 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9485
10478
  };
9486
10479
  Returns: boolean;
9487
10480
  };
9488
- find_trade_item_key_by_name: {
10481
+ find_trade_item_key: {
9489
10482
  Args: {
10483
+ p_barcode: string;
9490
10484
  p_name: string;
10485
+ p_product_id: string;
9491
10486
  };
9492
10487
  Returns: string;
9493
10488
  };
10489
+ floriday_effective_price: {
10490
+ Args: {
10491
+ _buyer_id: string;
10492
+ _on_date?: string;
10493
+ _quantity?: number;
10494
+ _trade_item_id: string;
10495
+ };
10496
+ Returns: {
10497
+ base_price: number;
10498
+ currency: string;
10499
+ discount_type: string;
10500
+ discount_value: number;
10501
+ net_price: number;
10502
+ source: string;
10503
+ source_id: string;
10504
+ }[];
10505
+ };
9494
10506
  format_cart_number: {
9495
10507
  Args: {
9496
10508
  p_pick_date: string;
@@ -9511,6 +10523,13 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9511
10523
  preferred_warehouse_name: string;
9512
10524
  }[];
9513
10525
  };
10526
+ get_active_floriday_context: {
10527
+ Args: never;
10528
+ Returns: {
10529
+ connection_id: string;
10530
+ user_id: string;
10531
+ }[];
10532
+ };
9514
10533
  get_active_twinfield_public: {
9515
10534
  Args: never;
9516
10535
  Returns: {
@@ -9522,6 +10541,13 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9522
10541
  office_code: string;
9523
10542
  }[];
9524
10543
  };
10544
+ get_floricode_record_counts: {
10545
+ Args: never;
10546
+ Returns: {
10547
+ count: number;
10548
+ resource: string;
10549
+ }[];
10550
+ };
9525
10551
  get_floriday_agreements_active: {
9526
10552
  Args: {
9527
10553
  p_on_date?: string;
@@ -9613,6 +10639,24 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9613
10639
  };
9614
10640
  Returns: import("./types").Json;
9615
10641
  };
10642
+ get_offer_delivery_options: {
10643
+ Args: {
10644
+ p_code: string;
10645
+ };
10646
+ Returns: import("./types").Json;
10647
+ };
10648
+ get_offer_recipient_by_code: {
10649
+ Args: {
10650
+ p_code: string;
10651
+ };
10652
+ Returns: {
10653
+ campaign_id: string;
10654
+ clicked_at: string;
10655
+ customer_id: string;
10656
+ id: string;
10657
+ ordered_at: string;
10658
+ }[];
10659
+ };
9616
10660
  get_or_assign_floriday_order_number: {
9617
10661
  Args: {
9618
10662
  p_floriday_id: string;
@@ -9665,12 +10709,53 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9665
10709
  Args: never;
9666
10710
  Returns: boolean;
9667
10711
  };
10712
+ is_superadmin: {
10713
+ Args: {
10714
+ _user_id: string;
10715
+ };
10716
+ Returns: boolean;
10717
+ };
10718
+ local_effective_price: {
10719
+ Args: {
10720
+ _customer_id: string;
10721
+ _on_date?: string;
10722
+ _product_id: string;
10723
+ _quantity?: number;
10724
+ };
10725
+ Returns: {
10726
+ currency: string;
10727
+ discount_type: string;
10728
+ discount_value: number;
10729
+ net_price: number;
10730
+ source: string;
10731
+ source_id: string;
10732
+ }[];
10733
+ };
10734
+ mark_offer_clicked: {
10735
+ Args: {
10736
+ p_code: string;
10737
+ };
10738
+ Returns: undefined;
10739
+ };
10740
+ mark_offer_ordered: {
10741
+ Args: {
10742
+ p_code: string;
10743
+ };
10744
+ Returns: undefined;
10745
+ };
9668
10746
  next_order_number: {
9669
10747
  Args: {
9670
10748
  p_prefix: string;
9671
10749
  };
9672
10750
  Returns: string;
9673
10751
  };
10752
+ next_order_number_for_date: {
10753
+ Args: {
10754
+ p_created_at?: string;
10755
+ p_prefix: string;
10756
+ };
10757
+ Returns: string;
10758
+ };
9674
10759
  next_work_order_number: {
9675
10760
  Args: {
9676
10761
  p_parent_work_order_id?: string;
@@ -9678,16 +10763,41 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9678
10763
  };
9679
10764
  Returns: string;
9680
10765
  };
10766
+ normalize_order_source: {
10767
+ Args: {
10768
+ p_src: string;
10769
+ };
10770
+ Returns: string;
10771
+ };
9681
10772
  normalize_vat: {
9682
10773
  Args: {
9683
10774
  v: string;
9684
10775
  };
9685
10776
  Returns: string;
9686
10777
  };
10778
+ offer_recipient_matches: {
10779
+ Args: {
10780
+ _campaign_id: string;
10781
+ _customer_id: string;
10782
+ _recipient_id: string;
10783
+ };
10784
+ Returns: boolean;
10785
+ };
10786
+ order_number_prefix: {
10787
+ Args: {
10788
+ p_custom_fields?: import("./types").Json;
10789
+ p_order_source: string;
10790
+ };
10791
+ Returns: string;
10792
+ };
9687
10793
  pickstation_get_orders_raw: {
9688
10794
  Args: never;
9689
10795
  Returns: import("./types").Json;
9690
10796
  };
10797
+ pickstation_get_planning_context: {
10798
+ Args: never;
10799
+ Returns: import("./types").Json;
10800
+ };
9691
10801
  pickstation_get_settings: {
9692
10802
  Args: never;
9693
10803
  Returns: import("./types").Json;
@@ -9711,6 +10821,35 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9711
10821
  };
9712
10822
  Returns: undefined;
9713
10823
  };
10824
+ promote_trade_item_key: {
10825
+ Args: {
10826
+ p_new: string;
10827
+ p_old: string;
10828
+ };
10829
+ Returns: undefined;
10830
+ };
10831
+ recompute_order_status: {
10832
+ Args: {
10833
+ p_order_id: string;
10834
+ };
10835
+ Returns: undefined;
10836
+ };
10837
+ recompute_reserved_for_order: {
10838
+ Args: {
10839
+ p_order_id: string;
10840
+ };
10841
+ Returns: undefined;
10842
+ };
10843
+ recompute_reserved_stock: {
10844
+ Args: {
10845
+ p_trade_item_key: string;
10846
+ };
10847
+ Returns: undefined;
10848
+ };
10849
+ refresh_external_customers_grouped: {
10850
+ Args: never;
10851
+ Returns: undefined;
10852
+ };
9714
10853
  refresh_floricode_derived_code_lists: {
9715
10854
  Args: never;
9716
10855
  Returns: {
@@ -9725,6 +10864,12 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9725
10864
  };
9726
10865
  Returns: number;
9727
10866
  };
10867
+ refresh_floricode_derived_for_products: {
10868
+ Args: {
10869
+ _product_ids: string[];
10870
+ };
10871
+ Returns: number;
10872
+ };
9728
10873
  reset_floriday_sync_cursor: {
9729
10874
  Args: {
9730
10875
  p_connection_id: string;
@@ -9732,6 +10877,12 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
9732
10877
  };
9733
10878
  Returns: undefined;
9734
10879
  };
10880
+ resolve_product_id_for_item: {
10881
+ Args: {
10882
+ p_product_name: string;
10883
+ };
10884
+ Returns: string;
10885
+ };
9735
10886
  schedule_floriday_additional_services_sync: {
9736
10887
  Args: {
9737
10888
  p_apikey: string;
@@ -10009,6 +11160,24 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
10009
11160
  };
10010
11161
  Returns: string[];
10011
11162
  };
11163
+ sync_cached_packing_from_product: {
11164
+ Args: {
11165
+ p_product_id: string;
11166
+ };
11167
+ Returns: undefined;
11168
+ };
11169
+ sync_order_cart_item_packing_from_product: {
11170
+ Args: {
11171
+ p_product_id: string;
11172
+ };
11173
+ Returns: undefined;
11174
+ };
11175
+ sync_product_packing_from_floriday_cache: {
11176
+ Args: {
11177
+ p_floriday_id: string;
11178
+ };
11179
+ Returns: undefined;
11180
+ };
10012
11181
  twinfield_decrypt: {
10013
11182
  Args: {
10014
11183
  cipher: string;
@@ -10021,6 +11190,17 @@ export declare const supabaseAdmin: import("@supabase/supabase-js").SupabaseClie
10021
11190
  };
10022
11191
  Returns: string;
10023
11192
  };
11193
+ upsert_auto_fulfillment_log: {
11194
+ Args: {
11195
+ p_connection_id: string;
11196
+ p_error?: string;
11197
+ p_fulfillment_order_id?: string;
11198
+ p_reason?: string;
11199
+ p_sales_order_id: string;
11200
+ p_status: string;
11201
+ };
11202
+ Returns: undefined;
11203
+ };
10024
11204
  };
10025
11205
  Enums: {
10026
11206
  app_role: "admin" | "manager" | "warehouse" | "sales" | "developer" | "receptie" | "monteur";