@flowselections/floriday-verkoop-module 1.0.11 → 1.0.12

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 (29) hide show
  1. package/dist-lib/components/verkoop/CreateOrderPage.d.ts.map +1 -1
  2. package/dist-lib/components/verkoop/CreateOrderPage.js +217 -189
  3. package/dist-lib/components/verkoop/SalesOrdersTable.d.ts.map +1 -1
  4. package/dist-lib/components/verkoop/SalesOrdersTable.js +3 -4
  5. package/dist-lib/components/verkoop/SearchableSelect.d.ts +19 -0
  6. package/dist-lib/components/verkoop/SearchableSelect.d.ts.map +1 -0
  7. package/dist-lib/components/verkoop/SearchableSelect.js +21 -0
  8. package/dist-lib/integrations/supabase/auth-middleware.d.ts +885 -60
  9. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  10. package/dist-lib/integrations/supabase/client.d.ts +885 -60
  11. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  12. package/dist-lib/integrations/supabase/client.server.d.ts +885 -60
  13. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  14. package/dist-lib/integrations/supabase/types.d.ts +907 -62
  15. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  16. package/dist-lib/lib/create-order.functions.d.ts +75223 -0
  17. package/dist-lib/lib/create-order.functions.d.ts.map +1 -0
  18. package/dist-lib/lib/create-order.functions.js +188 -0
  19. package/dist-lib/lib/floriday-public.functions.d.ts +5775 -0
  20. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  21. package/dist-lib/lib/floriday-writes.functions.d.ts +4125 -0
  22. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  23. package/dist-lib/lib/salesorders.functions.d.ts +2760 -285
  24. package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/tradeitems.functions.d.ts +885 -60
  26. package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/useSalesOrdersQuery.d.ts.map +1 -1
  28. package/dist-lib/lib/useSalesOrdersQuery.js +9 -2
  29. package/package.json +1 -1
@@ -718,6 +718,7 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
718
718
  notes: string | null;
719
719
  performed_at: string;
720
720
  rescheduled_count: number;
721
+ stock_consumed_at: string | null;
721
722
  total_carts: number;
722
723
  updated_at: string;
723
724
  user_id: string;
@@ -731,6 +732,7 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
731
732
  notes?: string | null;
732
733
  performed_at?: string;
733
734
  rescheduled_count?: number;
735
+ stock_consumed_at?: string | null;
734
736
  total_carts?: number;
735
737
  updated_at?: string;
736
738
  user_id: string;
@@ -744,6 +746,7 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
744
746
  notes?: string | null;
745
747
  performed_at?: string;
746
748
  rescheduled_count?: number;
749
+ stock_consumed_at?: string | null;
747
750
  total_carts?: number;
748
751
  updated_at?: string;
749
752
  user_id?: string;
@@ -3624,6 +3627,51 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
3624
3627
  referencedColumns: ["id"];
3625
3628
  }];
3626
3629
  };
3630
+ floriday_continuous_stock_queue: {
3631
+ Row: {
3632
+ attempts: number;
3633
+ connection_id: string;
3634
+ created_at: string;
3635
+ gateway_attempt_id: string | null;
3636
+ id: string;
3637
+ last_error: string | null;
3638
+ number_of_pieces: number;
3639
+ sent_at: string | null;
3640
+ status: string;
3641
+ trade_item_id: string;
3642
+ updated_at: string;
3643
+ user_id: string;
3644
+ };
3645
+ Insert: {
3646
+ attempts?: number;
3647
+ connection_id: string;
3648
+ created_at?: string;
3649
+ gateway_attempt_id?: string | null;
3650
+ id?: string;
3651
+ last_error?: string | null;
3652
+ number_of_pieces?: number;
3653
+ sent_at?: string | null;
3654
+ status?: string;
3655
+ trade_item_id: string;
3656
+ updated_at?: string;
3657
+ user_id: string;
3658
+ };
3659
+ Update: {
3660
+ attempts?: number;
3661
+ connection_id?: string;
3662
+ created_at?: string;
3663
+ gateway_attempt_id?: string | null;
3664
+ id?: string;
3665
+ last_error?: string | null;
3666
+ number_of_pieces?: number;
3667
+ sent_at?: string | null;
3668
+ status?: string;
3669
+ trade_item_id?: string;
3670
+ updated_at?: string;
3671
+ user_id?: string;
3672
+ };
3673
+ Relationships: [];
3674
+ };
3627
3675
  floriday_contract_trade_item_groups_cache: {
3628
3676
  Row: {
3629
3677
  connection_id: string;
@@ -5013,6 +5061,204 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
5013
5061
  };
5014
5062
  Relationships: [];
5015
5063
  };
5064
+ local_customer_agreements: {
5065
+ Row: {
5066
+ base_price: number | null;
5067
+ created_at: string;
5068
+ currency: string;
5069
+ customer_id: string;
5070
+ id: string;
5071
+ min_quantity: number;
5072
+ net_price: number;
5073
+ notes: string | null;
5074
+ product_category_id: string | null;
5075
+ product_id: string | null;
5076
+ updated_at: string;
5077
+ valid_from: string | null;
5078
+ valid_until: string | null;
5079
+ };
5080
+ Insert: {
5081
+ base_price?: number | null;
5082
+ created_at?: string;
5083
+ currency?: string;
5084
+ customer_id: string;
5085
+ id?: string;
5086
+ min_quantity?: number;
5087
+ net_price: number;
5088
+ notes?: string | null;
5089
+ product_category_id?: string | null;
5090
+ product_id?: string | null;
5091
+ updated_at?: string;
5092
+ valid_from?: string | null;
5093
+ valid_until?: string | null;
5094
+ };
5095
+ Update: {
5096
+ base_price?: number | null;
5097
+ created_at?: string;
5098
+ currency?: string;
5099
+ customer_id?: string;
5100
+ id?: string;
5101
+ min_quantity?: number;
5102
+ net_price?: number;
5103
+ notes?: string | null;
5104
+ product_category_id?: string | null;
5105
+ product_id?: string | null;
5106
+ updated_at?: string;
5107
+ valid_from?: string | null;
5108
+ valid_until?: string | null;
5109
+ };
5110
+ Relationships: [{
5111
+ foreignKeyName: "local_customer_agreements_customer_id_fkey";
5112
+ columns: ["customer_id"];
5113
+ isOneToOne: false;
5114
+ referencedRelation: "customers";
5115
+ referencedColumns: ["id"];
5116
+ }, {
5117
+ foreignKeyName: "local_customer_agreements_product_category_id_fkey";
5118
+ columns: ["product_category_id"];
5119
+ isOneToOne: false;
5120
+ referencedRelation: "product_categories";
5121
+ referencedColumns: ["id"];
5122
+ }, {
5123
+ foreignKeyName: "local_customer_agreements_product_id_fkey";
5124
+ columns: ["product_id"];
5125
+ isOneToOne: false;
5126
+ referencedRelation: "products";
5127
+ referencedColumns: ["id"];
5128
+ }];
5129
+ };
5130
+ local_customer_price_groups: {
5131
+ Row: {
5132
+ created_at: string;
5133
+ currency: string;
5134
+ customer_id: string;
5135
+ discount_type: string;
5136
+ discount_value: number;
5137
+ id: string;
5138
+ min_quantity: number;
5139
+ notes: string | null;
5140
+ product_category_id: string | null;
5141
+ product_id: string | null;
5142
+ updated_at: string;
5143
+ valid_from: string | null;
5144
+ valid_until: string | null;
5145
+ };
5146
+ Insert: {
5147
+ created_at?: string;
5148
+ currency?: string;
5149
+ customer_id: string;
5150
+ discount_type: string;
5151
+ discount_value: number;
5152
+ id?: string;
5153
+ min_quantity?: number;
5154
+ notes?: string | null;
5155
+ product_category_id?: string | null;
5156
+ product_id?: string | null;
5157
+ updated_at?: string;
5158
+ valid_from?: string | null;
5159
+ valid_until?: string | null;
5160
+ };
5161
+ Update: {
5162
+ created_at?: string;
5163
+ currency?: string;
5164
+ customer_id?: string;
5165
+ discount_type?: string;
5166
+ discount_value?: number;
5167
+ id?: string;
5168
+ min_quantity?: number;
5169
+ notes?: string | null;
5170
+ product_category_id?: string | null;
5171
+ product_id?: string | null;
5172
+ updated_at?: string;
5173
+ valid_from?: string | null;
5174
+ valid_until?: string | null;
5175
+ };
5176
+ Relationships: [{
5177
+ foreignKeyName: "local_customer_price_groups_customer_id_fkey";
5178
+ columns: ["customer_id"];
5179
+ isOneToOne: false;
5180
+ referencedRelation: "customers";
5181
+ referencedColumns: ["id"];
5182
+ }, {
5183
+ foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
5184
+ columns: ["product_category_id"];
5185
+ isOneToOne: false;
5186
+ referencedRelation: "product_categories";
5187
+ referencedColumns: ["id"];
5188
+ }, {
5189
+ foreignKeyName: "local_customer_price_groups_product_id_fkey";
5190
+ columns: ["product_id"];
5191
+ isOneToOne: false;
5192
+ referencedRelation: "products";
5193
+ referencedColumns: ["id"];
5194
+ }];
5195
+ };
5196
+ local_customer_sales_strategies: {
5197
+ Row: {
5198
+ created_at: string;
5199
+ currency: string;
5200
+ customer_id: string;
5201
+ discount_type: string;
5202
+ discount_value: number;
5203
+ id: string;
5204
+ min_quantity: number;
5205
+ notes: string | null;
5206
+ product_category_id: string | null;
5207
+ product_id: string | null;
5208
+ updated_at: string;
5209
+ valid_from: string | null;
5210
+ valid_until: string | null;
5211
+ };
5212
+ Insert: {
5213
+ created_at?: string;
5214
+ currency?: string;
5215
+ customer_id: string;
5216
+ discount_type: string;
5217
+ discount_value: number;
5218
+ id?: string;
5219
+ min_quantity?: number;
5220
+ notes?: string | null;
5221
+ product_category_id?: string | null;
5222
+ product_id?: string | null;
5223
+ updated_at?: string;
5224
+ valid_from?: string | null;
5225
+ valid_until?: string | null;
5226
+ };
5227
+ Update: {
5228
+ created_at?: string;
5229
+ currency?: string;
5230
+ customer_id?: string;
5231
+ discount_type?: string;
5232
+ discount_value?: number;
5233
+ id?: string;
5234
+ min_quantity?: number;
5235
+ notes?: string | null;
5236
+ product_category_id?: string | null;
5237
+ product_id?: string | null;
5238
+ updated_at?: string;
5239
+ valid_from?: string | null;
5240
+ valid_until?: string | null;
5241
+ };
5242
+ Relationships: [{
5243
+ foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
5244
+ columns: ["customer_id"];
5245
+ isOneToOne: false;
5246
+ referencedRelation: "customers";
5247
+ referencedColumns: ["id"];
5248
+ }, {
5249
+ foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
5250
+ columns: ["product_category_id"];
5251
+ isOneToOne: false;
5252
+ referencedRelation: "product_categories";
5253
+ referencedColumns: ["id"];
5254
+ }, {
5255
+ foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
5256
+ columns: ["product_id"];
5257
+ isOneToOne: false;
5258
+ referencedRelation: "products";
5259
+ referencedColumns: ["id"];
5260
+ }];
5261
+ };
5016
5262
  locations: {
5017
5263
  Row: {
5018
5264
  created_at: string;
@@ -5427,98 +5673,365 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
5427
5673
  referencedColumns: ["id"];
5428
5674
  }];
5429
5675
  };
5430
- manufacture_products: {
5676
+ manufacture_products: {
5677
+ Row: {
5678
+ created_at: string;
5679
+ description: string | null;
5680
+ id: string;
5681
+ is_active: boolean;
5682
+ name: string;
5683
+ produced_stock: number;
5684
+ product_code: string;
5685
+ tenant_id: string;
5686
+ updated_at: string;
5687
+ };
5688
+ Insert: {
5689
+ created_at?: string;
5690
+ description?: string | null;
5691
+ id?: string;
5692
+ is_active?: boolean;
5693
+ name: string;
5694
+ produced_stock?: number;
5695
+ product_code: string;
5696
+ tenant_id: string;
5697
+ updated_at?: string;
5698
+ };
5699
+ Update: {
5700
+ created_at?: string;
5701
+ description?: string | null;
5702
+ id?: string;
5703
+ is_active?: boolean;
5704
+ name?: string;
5705
+ produced_stock?: number;
5706
+ product_code?: string;
5707
+ tenant_id?: string;
5708
+ updated_at?: string;
5709
+ };
5710
+ Relationships: [];
5711
+ };
5712
+ monteurs: {
5713
+ Row: {
5714
+ avatar_url: string | null;
5715
+ color: string | null;
5716
+ created_at: string;
5717
+ email: string | null;
5718
+ id: string;
5719
+ is_active: boolean;
5720
+ leave_balance_hours: number;
5721
+ name: string;
5722
+ persnr: number | null;
5723
+ phone: string | null;
5724
+ role: string;
5725
+ tenant_id: string;
5726
+ updated_at: string;
5727
+ user_id: string | null;
5728
+ };
5729
+ Insert: {
5730
+ avatar_url?: string | null;
5731
+ color?: string | null;
5732
+ created_at?: string;
5733
+ email?: string | null;
5734
+ id?: string;
5735
+ is_active?: boolean;
5736
+ leave_balance_hours?: number;
5737
+ name: string;
5738
+ persnr?: number | null;
5739
+ phone?: string | null;
5740
+ role?: string;
5741
+ tenant_id: string;
5742
+ updated_at?: string;
5743
+ user_id?: string | null;
5744
+ };
5745
+ Update: {
5746
+ avatar_url?: string | null;
5747
+ color?: string | null;
5748
+ created_at?: string;
5749
+ email?: string | null;
5750
+ id?: string;
5751
+ is_active?: boolean;
5752
+ leave_balance_hours?: number;
5753
+ name?: string;
5754
+ persnr?: number | null;
5755
+ phone?: string | null;
5756
+ role?: string;
5757
+ tenant_id?: string;
5758
+ updated_at?: string;
5759
+ user_id?: string | null;
5760
+ };
5761
+ Relationships: [{
5762
+ foreignKeyName: "monteurs_tenant_id_fkey";
5763
+ columns: ["tenant_id"];
5764
+ isOneToOne: false;
5765
+ referencedRelation: "tenants";
5766
+ referencedColumns: ["id"];
5767
+ }];
5768
+ };
5769
+ nmbrs_component_mapping: {
5770
+ Row: {
5771
+ created_at: string;
5772
+ id: string;
5773
+ source_kind: string;
5774
+ source_value: string | null;
5775
+ updated_at: string;
5776
+ wage_code: string;
5777
+ };
5778
+ Insert: {
5779
+ created_at?: string;
5780
+ id?: string;
5781
+ source_kind: string;
5782
+ source_value?: string | null;
5783
+ updated_at?: string;
5784
+ wage_code: string;
5785
+ };
5786
+ Update: {
5787
+ created_at?: string;
5788
+ id?: string;
5789
+ source_kind?: string;
5790
+ source_value?: string | null;
5791
+ updated_at?: string;
5792
+ wage_code?: string;
5793
+ };
5794
+ Relationships: [{
5795
+ foreignKeyName: "nmbrs_component_mapping_wage_code_fkey";
5796
+ columns: ["wage_code"];
5797
+ isOneToOne: false;
5798
+ referencedRelation: "nmbrs_wage_components";
5799
+ referencedColumns: ["code"];
5800
+ }];
5801
+ };
5802
+ nmbrs_employee_mapping: {
5803
+ Row: {
5804
+ active_from: string | null;
5805
+ active_to: string | null;
5806
+ contract_hours_per_week: number | null;
5807
+ created_at: string;
5808
+ hourly_wage: number | null;
5809
+ id: string;
5810
+ monteur_id: string;
5811
+ nmbrs_company_code: string | null;
5812
+ nmbrs_employee_number: string;
5813
+ updated_at: string;
5814
+ };
5815
+ Insert: {
5816
+ active_from?: string | null;
5817
+ active_to?: string | null;
5818
+ contract_hours_per_week?: number | null;
5819
+ created_at?: string;
5820
+ hourly_wage?: number | null;
5821
+ id?: string;
5822
+ monteur_id: string;
5823
+ nmbrs_company_code?: string | null;
5824
+ nmbrs_employee_number: string;
5825
+ updated_at?: string;
5826
+ };
5827
+ Update: {
5828
+ active_from?: string | null;
5829
+ active_to?: string | null;
5830
+ contract_hours_per_week?: number | null;
5831
+ created_at?: string;
5832
+ hourly_wage?: number | null;
5833
+ id?: string;
5834
+ monteur_id?: string;
5835
+ nmbrs_company_code?: string | null;
5836
+ nmbrs_employee_number?: string;
5837
+ updated_at?: string;
5838
+ };
5839
+ Relationships: [{
5840
+ foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
5841
+ columns: ["monteur_id"];
5842
+ isOneToOne: true;
5843
+ referencedRelation: "monteurs";
5844
+ referencedColumns: ["id"];
5845
+ }];
5846
+ };
5847
+ nmbrs_export_lines: {
5848
+ Row: {
5849
+ amount: number;
5850
+ created_at: string;
5851
+ entry_date: string;
5852
+ hours: number;
5853
+ id: string;
5854
+ monteur_id: string;
5855
+ nmbrs_employee_number: string | null;
5856
+ notes: string | null;
5857
+ run_id: string;
5858
+ source_kind: string | null;
5859
+ source_ref_id: string | null;
5860
+ updated_at: string;
5861
+ wage_code: string;
5862
+ };
5863
+ Insert: {
5864
+ amount?: number;
5865
+ created_at?: string;
5866
+ entry_date: string;
5867
+ hours?: number;
5868
+ id?: string;
5869
+ monteur_id: string;
5870
+ nmbrs_employee_number?: string | null;
5871
+ notes?: string | null;
5872
+ run_id: string;
5873
+ source_kind?: string | null;
5874
+ source_ref_id?: string | null;
5875
+ updated_at?: string;
5876
+ wage_code: string;
5877
+ };
5878
+ Update: {
5879
+ amount?: number;
5880
+ created_at?: string;
5881
+ entry_date?: string;
5882
+ hours?: number;
5883
+ id?: string;
5884
+ monteur_id?: string;
5885
+ nmbrs_employee_number?: string | null;
5886
+ notes?: string | null;
5887
+ run_id?: string;
5888
+ source_kind?: string | null;
5889
+ source_ref_id?: string | null;
5890
+ updated_at?: string;
5891
+ wage_code?: string;
5892
+ };
5893
+ Relationships: [{
5894
+ foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
5895
+ columns: ["monteur_id"];
5896
+ isOneToOne: false;
5897
+ referencedRelation: "monteurs";
5898
+ referencedColumns: ["id"];
5899
+ }, {
5900
+ foreignKeyName: "nmbrs_export_lines_run_id_fkey";
5901
+ columns: ["run_id"];
5902
+ isOneToOne: false;
5903
+ referencedRelation: "nmbrs_export_runs";
5904
+ referencedColumns: ["id"];
5905
+ }, {
5906
+ foreignKeyName: "nmbrs_export_lines_wage_code_fkey";
5907
+ columns: ["wage_code"];
5908
+ isOneToOne: false;
5909
+ referencedRelation: "nmbrs_wage_components";
5910
+ referencedColumns: ["code"];
5911
+ }];
5912
+ };
5913
+ nmbrs_export_runs: {
5914
+ Row: {
5915
+ created_at: string;
5916
+ file_name: string | null;
5917
+ generated_at: string;
5918
+ generated_by: string | null;
5919
+ id: string;
5920
+ notes: string | null;
5921
+ period_end: string;
5922
+ period_label: string;
5923
+ period_start: string;
5924
+ status: string;
5925
+ total_hours: number;
5926
+ total_lines: number;
5927
+ updated_at: string;
5928
+ };
5929
+ Insert: {
5930
+ created_at?: string;
5931
+ file_name?: string | null;
5932
+ generated_at?: string;
5933
+ generated_by?: string | null;
5934
+ id?: string;
5935
+ notes?: string | null;
5936
+ period_end: string;
5937
+ period_label: string;
5938
+ period_start: string;
5939
+ status?: string;
5940
+ total_hours?: number;
5941
+ total_lines?: number;
5942
+ updated_at?: string;
5943
+ };
5944
+ Update: {
5945
+ created_at?: string;
5946
+ file_name?: string | null;
5947
+ generated_at?: string;
5948
+ generated_by?: string | null;
5949
+ id?: string;
5950
+ notes?: string | null;
5951
+ period_end?: string;
5952
+ period_label?: string;
5953
+ period_start?: string;
5954
+ status?: string;
5955
+ total_hours?: number;
5956
+ total_lines?: number;
5957
+ updated_at?: string;
5958
+ };
5959
+ Relationships: [];
5960
+ };
5961
+ nmbrs_settings: {
5431
5962
  Row: {
5432
5963
  created_at: string;
5433
- description: string | null;
5434
- id: string;
5435
- is_active: boolean;
5436
- name: string;
5437
- produced_stock: number;
5438
- product_code: string;
5439
- tenant_id: string;
5964
+ default_company_code: string | null;
5965
+ id: boolean;
5966
+ include_travel: boolean;
5967
+ overtime_threshold_daily: number;
5968
+ overtime_threshold_weekly: number;
5969
+ period_type: string;
5440
5970
  updated_at: string;
5971
+ updated_by: string | null;
5972
+ week_start_day: number;
5441
5973
  };
5442
5974
  Insert: {
5443
5975
  created_at?: string;
5444
- description?: string | null;
5445
- id?: string;
5446
- is_active?: boolean;
5447
- name: string;
5448
- produced_stock?: number;
5449
- product_code: string;
5450
- tenant_id: string;
5976
+ default_company_code?: string | null;
5977
+ id?: boolean;
5978
+ include_travel?: boolean;
5979
+ overtime_threshold_daily?: number;
5980
+ overtime_threshold_weekly?: number;
5981
+ period_type?: string;
5451
5982
  updated_at?: string;
5983
+ updated_by?: string | null;
5984
+ week_start_day?: number;
5452
5985
  };
5453
5986
  Update: {
5454
5987
  created_at?: string;
5455
- description?: string | null;
5456
- id?: string;
5457
- is_active?: boolean;
5458
- name?: string;
5459
- produced_stock?: number;
5460
- product_code?: string;
5461
- tenant_id?: string;
5988
+ default_company_code?: string | null;
5989
+ id?: boolean;
5990
+ include_travel?: boolean;
5991
+ overtime_threshold_daily?: number;
5992
+ overtime_threshold_weekly?: number;
5993
+ period_type?: string;
5462
5994
  updated_at?: string;
5995
+ updated_by?: string | null;
5996
+ week_start_day?: number;
5463
5997
  };
5464
5998
  Relationships: [];
5465
5999
  };
5466
- monteurs: {
6000
+ nmbrs_wage_components: {
5467
6001
  Row: {
5468
- avatar_url: string | null;
5469
- color: string | null;
6002
+ category: string;
6003
+ code: string;
5470
6004
  created_at: string;
5471
- email: string | null;
5472
6005
  id: string;
5473
6006
  is_active: boolean;
5474
- leave_balance_hours: number;
5475
- name: string;
5476
- persnr: number | null;
5477
- phone: string | null;
5478
- role: string;
5479
- tenant_id: string;
6007
+ label: string;
6008
+ sort_order: number;
6009
+ unit: string;
5480
6010
  updated_at: string;
5481
- user_id: string | null;
5482
6011
  };
5483
6012
  Insert: {
5484
- avatar_url?: string | null;
5485
- color?: string | null;
6013
+ category: string;
6014
+ code: string;
5486
6015
  created_at?: string;
5487
- email?: string | null;
5488
6016
  id?: string;
5489
6017
  is_active?: boolean;
5490
- leave_balance_hours?: number;
5491
- name: string;
5492
- persnr?: number | null;
5493
- phone?: string | null;
5494
- role?: string;
5495
- tenant_id: string;
6018
+ label: string;
6019
+ sort_order?: number;
6020
+ unit: string;
5496
6021
  updated_at?: string;
5497
- user_id?: string | null;
5498
6022
  };
5499
6023
  Update: {
5500
- avatar_url?: string | null;
5501
- color?: string | null;
6024
+ category?: string;
6025
+ code?: string;
5502
6026
  created_at?: string;
5503
- email?: string | null;
5504
6027
  id?: string;
5505
6028
  is_active?: boolean;
5506
- leave_balance_hours?: number;
5507
- name?: string;
5508
- persnr?: number | null;
5509
- phone?: string | null;
5510
- role?: string;
5511
- tenant_id?: string;
6029
+ label?: string;
6030
+ sort_order?: number;
6031
+ unit?: string;
5512
6032
  updated_at?: string;
5513
- user_id?: string | null;
5514
6033
  };
5515
- Relationships: [{
5516
- foreignKeyName: "monteurs_tenant_id_fkey";
5517
- columns: ["tenant_id"];
5518
- isOneToOne: false;
5519
- referencedRelation: "tenants";
5520
- referencedColumns: ["id"];
5521
- }];
6034
+ Relationships: [];
5522
6035
  };
5523
6036
  notifications: {
5524
6037
  Row: {
@@ -6502,6 +7015,7 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
6502
7015
  purchase_price: number | null;
6503
7016
  quantity: number;
6504
7017
  sale_price: number | null;
7018
+ trade_item_key: string | null;
6505
7019
  unit: string;
6506
7020
  updated_at: string;
6507
7021
  weight: string | null;
@@ -6524,6 +7038,7 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
6524
7038
  purchase_price?: number | null;
6525
7039
  quantity?: number;
6526
7040
  sale_price?: number | null;
7041
+ trade_item_key?: string | null;
6527
7042
  unit?: string;
6528
7043
  updated_at?: string;
6529
7044
  weight?: string | null;
@@ -6546,6 +7061,7 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
6546
7061
  purchase_price?: number | null;
6547
7062
  quantity?: number;
6548
7063
  sale_price?: number | null;
7064
+ trade_item_key?: string | null;
6549
7065
  unit?: string;
6550
7066
  updated_at?: string;
6551
7067
  weight?: string | null;
@@ -7365,6 +7881,102 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
7365
7881
  };
7366
7882
  Relationships: [];
7367
7883
  };
7884
+ stock_import_runs: {
7885
+ Row: {
7886
+ connection_id: string | null;
7887
+ created_at: string;
7888
+ created_rows: number;
7889
+ errors: import("../integrations/supabase/types").Json;
7890
+ filename: string | null;
7891
+ id: string;
7892
+ mutations: import("../integrations/supabase/types").Json;
7893
+ skipped_rows: number;
7894
+ total_rows: number;
7895
+ updated_rows: number;
7896
+ user_id: string;
7897
+ };
7898
+ Insert: {
7899
+ connection_id?: string | null;
7900
+ created_at?: string;
7901
+ created_rows?: number;
7902
+ errors?: import("../integrations/supabase/types").Json;
7903
+ filename?: string | null;
7904
+ id?: string;
7905
+ mutations?: import("../integrations/supabase/types").Json;
7906
+ skipped_rows?: number;
7907
+ total_rows?: number;
7908
+ updated_rows?: number;
7909
+ user_id: string;
7910
+ };
7911
+ Update: {
7912
+ connection_id?: string | null;
7913
+ created_at?: string;
7914
+ created_rows?: number;
7915
+ errors?: import("../integrations/supabase/types").Json;
7916
+ filename?: string | null;
7917
+ id?: string;
7918
+ mutations?: import("../integrations/supabase/types").Json;
7919
+ skipped_rows?: number;
7920
+ total_rows?: number;
7921
+ updated_rows?: number;
7922
+ user_id?: string;
7923
+ };
7924
+ Relationships: [];
7925
+ };
7926
+ stock_mutation_log: {
7927
+ Row: {
7928
+ connection_id: string | null;
7929
+ created_at: string;
7930
+ created_by: string | null;
7931
+ id: string;
7932
+ mutation_type: string;
7933
+ order_id: string | null;
7934
+ order_item_id: string | null;
7935
+ order_source: string | null;
7936
+ physical_after: number | null;
7937
+ physical_before: number | null;
7938
+ qty_delta: number;
7939
+ reason: string | null;
7940
+ reserved_after: number | null;
7941
+ reserved_before: number | null;
7942
+ trade_item_key: string;
7943
+ };
7944
+ Insert: {
7945
+ connection_id?: string | null;
7946
+ created_at?: string;
7947
+ created_by?: string | null;
7948
+ id?: string;
7949
+ mutation_type: string;
7950
+ order_id?: string | null;
7951
+ order_item_id?: string | null;
7952
+ order_source?: string | null;
7953
+ physical_after?: number | null;
7954
+ physical_before?: number | null;
7955
+ qty_delta: number;
7956
+ reason?: string | null;
7957
+ reserved_after?: number | null;
7958
+ reserved_before?: number | null;
7959
+ trade_item_key: string;
7960
+ };
7961
+ Update: {
7962
+ connection_id?: string | null;
7963
+ created_at?: string;
7964
+ created_by?: string | null;
7965
+ id?: string;
7966
+ mutation_type?: string;
7967
+ order_id?: string | null;
7968
+ order_item_id?: string | null;
7969
+ order_source?: string | null;
7970
+ physical_after?: number | null;
7971
+ physical_before?: number | null;
7972
+ qty_delta?: number;
7973
+ reason?: string | null;
7974
+ reserved_after?: number | null;
7975
+ reserved_before?: number | null;
7976
+ trade_item_key?: string;
7977
+ };
7978
+ Relationships: [];
7979
+ };
7368
7980
  supplier_products: {
7369
7981
  Row: {
7370
7982
  article_number: string | null;
@@ -8942,6 +9554,44 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
8942
9554
  };
8943
9555
  Relationships: [];
8944
9556
  };
9557
+ floriday_customer_discounts: {
9558
+ Row: {
9559
+ base_price: number | null;
9560
+ buyer_organization_id: string | null;
9561
+ currency: string | null;
9562
+ discount_type: string | null;
9563
+ discount_value: number | null;
9564
+ min_quantity: number | null;
9565
+ net_price: number | null;
9566
+ product_group_id: string | null;
9567
+ raw: import("../integrations/supabase/types").Json | null;
9568
+ source: string | null;
9569
+ source_id: string | null;
9570
+ trade_item_id: string | null;
9571
+ valid_from: string | null;
9572
+ valid_until: string | null;
9573
+ };
9574
+ Relationships: [];
9575
+ };
9576
+ local_customer_discounts: {
9577
+ Row: {
9578
+ base_price: number | null;
9579
+ currency: string | null;
9580
+ customer_id: string | null;
9581
+ discount_type: string | null;
9582
+ discount_value: number | null;
9583
+ min_quantity: number | null;
9584
+ net_price: number | null;
9585
+ product_category_id: string | null;
9586
+ product_id: string | null;
9587
+ product_name: string | null;
9588
+ source: string | null;
9589
+ source_id: string | null;
9590
+ valid_from: string | null;
9591
+ valid_until: string | null;
9592
+ };
9593
+ Relationships: [];
9594
+ };
8945
9595
  manufacture_product_possible_stock_view: {
8946
9596
  Row: {
8947
9597
  component_count: number | null;
@@ -9226,6 +9876,54 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9226
9876
  };
9227
9877
  Returns: number;
9228
9878
  };
9879
+ afh_city_code: {
9880
+ Args: {
9881
+ _city: string;
9882
+ _country: string;
9883
+ };
9884
+ Returns: string;
9885
+ };
9886
+ afh_normalize_country: {
9887
+ Args: {
9888
+ _raw: string;
9889
+ };
9890
+ Returns: string;
9891
+ };
9892
+ afh_normalize_nl_province: {
9893
+ Args: {
9894
+ _raw: string;
9895
+ };
9896
+ Returns: string;
9897
+ };
9898
+ afh_subtract_workdays: {
9899
+ Args: {
9900
+ _date: string;
9901
+ _days: number;
9902
+ };
9903
+ Returns: string;
9904
+ };
9905
+ apply_stock_consumption: {
9906
+ Args: {
9907
+ p_order_id: string;
9908
+ p_order_item_id: string;
9909
+ p_qty: number;
9910
+ p_reason: string;
9911
+ p_source: string;
9912
+ p_trade_item_key: string;
9913
+ };
9914
+ Returns: undefined;
9915
+ };
9916
+ apply_stock_reservation: {
9917
+ Args: {
9918
+ p_order_id: string;
9919
+ p_order_item_id: string;
9920
+ p_qty: number;
9921
+ p_reason: string;
9922
+ p_source: string;
9923
+ p_trade_item_key: string;
9924
+ };
9925
+ Returns: undefined;
9926
+ };
9229
9927
  assign_cart_numbers: {
9230
9928
  Args: {
9231
9929
  p_carts: import("../integrations/supabase/types").Json;
@@ -9249,12 +9947,40 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9249
9947
  order_number: string;
9250
9948
  }[];
9251
9949
  };
9950
+ backfill_open_order_reservations: {
9951
+ Args: never;
9952
+ Returns: {
9953
+ processed_items: number;
9954
+ }[];
9955
+ };
9252
9956
  call_exact_route: {
9253
9957
  Args: {
9254
9958
  path: string;
9255
9959
  };
9256
9960
  Returns: number;
9257
9961
  };
9962
+ check_offer_product_available_stock: {
9963
+ Args: {
9964
+ p_campaign_product_id: string;
9965
+ p_code: string;
9966
+ p_needed_qty?: number;
9967
+ p_product_name?: string;
9968
+ };
9969
+ Returns: import("../integrations/supabase/types").Json;
9970
+ };
9971
+ check_trade_item_available_stock: {
9972
+ Args: {
9973
+ p_connection_id?: string;
9974
+ p_context?: string;
9975
+ p_needed_qty?: number;
9976
+ p_order_id?: string;
9977
+ p_order_item_id?: string;
9978
+ p_owner_id?: string;
9979
+ p_product_name?: string;
9980
+ p_trade_item_key: string;
9981
+ };
9982
+ Returns: import("../integrations/supabase/types").Json;
9983
+ };
9258
9984
  cleanup_old_bookings: {
9259
9985
  Args: never;
9260
9986
  Returns: number;
@@ -9298,6 +10024,12 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9298
10024
  table_name: string;
9299
10025
  }[];
9300
10026
  };
10027
+ dispatch_carrier_signups_sql: {
10028
+ Args: {
10029
+ _catchup?: string;
10030
+ };
10031
+ Returns: import("../integrations/supabase/types").Json;
10032
+ };
9301
10033
  email_auth_decrypt: {
9302
10034
  Args: {
9303
10035
  cipher: string;
@@ -9333,6 +10065,12 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9333
10065
  status: string;
9334
10066
  }[];
9335
10067
  };
10068
+ ensure_trade_item_stock_row: {
10069
+ Args: {
10070
+ p_key: string;
10071
+ };
10072
+ Returns: undefined;
10073
+ };
9336
10074
  ensure_user_tenant: {
9337
10075
  Args: never;
9338
10076
  Returns: string;
@@ -9370,6 +10108,31 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9370
10108
  };
9371
10109
  Returns: boolean;
9372
10110
  };
10111
+ find_trade_item_key: {
10112
+ Args: {
10113
+ p_barcode: string;
10114
+ p_name: string;
10115
+ p_product_id: string;
10116
+ };
10117
+ Returns: string;
10118
+ };
10119
+ floriday_effective_price: {
10120
+ Args: {
10121
+ _buyer_id: string;
10122
+ _on_date?: string;
10123
+ _quantity?: number;
10124
+ _trade_item_id: string;
10125
+ };
10126
+ Returns: {
10127
+ base_price: number;
10128
+ currency: string;
10129
+ discount_type: string;
10130
+ discount_value: number;
10131
+ net_price: number;
10132
+ source: string;
10133
+ source_id: string;
10134
+ }[];
10135
+ };
9373
10136
  format_cart_number: {
9374
10137
  Args: {
9375
10138
  p_pick_date: string;
@@ -9390,6 +10153,13 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9390
10153
  preferred_warehouse_name: string;
9391
10154
  }[];
9392
10155
  };
10156
+ get_active_floriday_context: {
10157
+ Args: never;
10158
+ Returns: {
10159
+ connection_id: string;
10160
+ user_id: string;
10161
+ }[];
10162
+ };
9393
10163
  get_active_twinfield_public: {
9394
10164
  Args: never;
9395
10165
  Returns: {
@@ -9492,6 +10262,18 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9492
10262
  };
9493
10263
  Returns: import("../integrations/supabase/types").Json;
9494
10264
  };
10265
+ get_offer_recipient_by_code: {
10266
+ Args: {
10267
+ p_code: string;
10268
+ };
10269
+ Returns: {
10270
+ campaign_id: string;
10271
+ clicked_at: string;
10272
+ customer_id: string;
10273
+ id: string;
10274
+ ordered_at: string;
10275
+ }[];
10276
+ };
9495
10277
  get_or_assign_floriday_order_number: {
9496
10278
  Args: {
9497
10279
  p_floriday_id: string;
@@ -9544,6 +10326,34 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9544
10326
  Args: never;
9545
10327
  Returns: boolean;
9546
10328
  };
10329
+ local_effective_price: {
10330
+ Args: {
10331
+ _customer_id: string;
10332
+ _on_date?: string;
10333
+ _product_id: string;
10334
+ _quantity?: number;
10335
+ };
10336
+ Returns: {
10337
+ currency: string;
10338
+ discount_type: string;
10339
+ discount_value: number;
10340
+ net_price: number;
10341
+ source: string;
10342
+ source_id: string;
10343
+ }[];
10344
+ };
10345
+ mark_offer_clicked: {
10346
+ Args: {
10347
+ p_code: string;
10348
+ };
10349
+ Returns: undefined;
10350
+ };
10351
+ mark_offer_ordered: {
10352
+ Args: {
10353
+ p_code: string;
10354
+ };
10355
+ Returns: undefined;
10356
+ };
9547
10357
  next_order_number: {
9548
10358
  Args: {
9549
10359
  p_prefix: string;
@@ -9563,6 +10373,14 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9563
10373
  };
9564
10374
  Returns: string;
9565
10375
  };
10376
+ offer_recipient_matches: {
10377
+ Args: {
10378
+ _campaign_id: string;
10379
+ _customer_id: string;
10380
+ _recipient_id: string;
10381
+ };
10382
+ Returns: boolean;
10383
+ };
9566
10384
  pickstation_get_orders_raw: {
9567
10385
  Args: never;
9568
10386
  Returns: import("../integrations/supabase/types").Json;
@@ -9590,6 +10408,13 @@ export declare const runTradeItemsSync: import("@tanstack/start-client-core").Op
9590
10408
  };
9591
10409
  Returns: undefined;
9592
10410
  };
10411
+ promote_trade_item_key: {
10412
+ Args: {
10413
+ p_new: string;
10414
+ p_old: string;
10415
+ };
10416
+ Returns: undefined;
10417
+ };
9593
10418
  refresh_floricode_derived_code_lists: {
9594
10419
  Args: never;
9595
10420
  Returns: {