@flowselections/floriday-klanten-module 1.0.11 → 1.0.13

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 (43) hide show
  1. package/dist-lib/components/klanten/DiscountsTab.d.ts +4 -0
  2. package/dist-lib/components/klanten/DiscountsTab.d.ts.map +1 -0
  3. package/dist-lib/components/klanten/DiscountsTab.js +92 -0
  4. package/dist-lib/components/klanten/GroupedKlantDetail.d.ts.map +1 -1
  5. package/dist-lib/components/klanten/GroupedKlantDetail.js +5 -2
  6. package/dist-lib/components/klanten/KlantDetail.d.ts.map +1 -1
  7. package/dist-lib/components/klanten/KlantDetail.js +3 -2
  8. package/dist-lib/components/klanten/KlantenOverzicht.d.ts.map +1 -1
  9. package/dist-lib/components/klanten/KlantenOverzicht.js +83 -23
  10. package/dist-lib/components/klanten/LocalDiscountFormDialog.d.ts +10 -0
  11. package/dist-lib/components/klanten/LocalDiscountFormDialog.d.ts.map +1 -0
  12. package/dist-lib/components/klanten/LocalDiscountFormDialog.js +107 -0
  13. package/dist-lib/components/klanten/LocalDiscountsTab.d.ts +4 -0
  14. package/dist-lib/components/klanten/LocalDiscountsTab.d.ts.map +1 -0
  15. package/dist-lib/components/klanten/LocalDiscountsTab.js +101 -0
  16. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1788 -107
  17. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  18. package/dist-lib/integrations/supabase/client.d.ts +1788 -107
  19. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  20. package/dist-lib/integrations/supabase/client.server.d.ts +1788 -107
  21. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  22. package/dist-lib/integrations/supabase/types.d.ts +1819 -104
  23. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  24. package/dist-lib/lib/accounting.functions.d.ts +5362 -319
  25. package/dist-lib/lib/accounting.functions.d.ts.map +1 -1
  26. package/dist-lib/lib/customer-analytics.functions.d.ts +1788 -107
  27. package/dist-lib/lib/customer-analytics.functions.d.ts.map +1 -1
  28. package/dist-lib/lib/customers.functions.d.ts +11767 -0
  29. package/dist-lib/lib/customers.functions.d.ts.map +1 -1
  30. package/dist-lib/lib/delivery-locations.functions.d.ts +6724 -0
  31. package/dist-lib/lib/delivery-locations.functions.d.ts.map +1 -1
  32. package/dist-lib/lib/external-customers.functions.d.ts +6724 -0
  33. package/dist-lib/lib/external-customers.functions.d.ts.map +1 -1
  34. package/dist-lib/lib/floriday-discounts.functions.d.ts +21974 -0
  35. package/dist-lib/lib/floriday-discounts.functions.d.ts.map +1 -0
  36. package/dist-lib/lib/floriday-discounts.functions.js +83 -0
  37. package/dist-lib/lib/local-discounts.functions.d.ts +76898 -0
  38. package/dist-lib/lib/local-discounts.functions.d.ts.map +1 -0
  39. package/dist-lib/lib/local-discounts.functions.js +185 -0
  40. package/dist-lib/lib/overdue-invoices.functions.d.ts +10984 -0
  41. package/dist-lib/lib/overdue-invoices.functions.d.ts.map +1 -0
  42. package/dist-lib/lib/overdue-invoices.functions.js +72 -0
  43. package/package.json +1 -1
@@ -57,10 +57,12 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
57
57
  afhandeling_settings: {
58
58
  Row: {
59
59
  created_at: string;
60
+ extra_pick_days_with_stickers: number;
60
61
  id: string;
61
62
  max_workdays_earlier_pick: number;
62
63
  pick_days_before_transport: number;
63
64
  pick_distribution_enabled: boolean;
65
+ pick_weekdays: number[];
64
66
  signup_mail_enabled: boolean;
65
67
  signup_mail_lead_minutes: number;
66
68
  signup_mail_purpose: string;
@@ -70,10 +72,12 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
70
72
  };
71
73
  Insert: {
72
74
  created_at?: string;
75
+ extra_pick_days_with_stickers?: number;
73
76
  id?: string;
74
77
  max_workdays_earlier_pick?: number;
75
78
  pick_days_before_transport?: number;
76
79
  pick_distribution_enabled?: boolean;
80
+ pick_weekdays?: number[];
77
81
  signup_mail_enabled?: boolean;
78
82
  signup_mail_lead_minutes?: number;
79
83
  signup_mail_purpose?: string;
@@ -83,10 +87,12 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
83
87
  };
84
88
  Update: {
85
89
  created_at?: string;
90
+ extra_pick_days_with_stickers?: number;
86
91
  id?: string;
87
92
  max_workdays_earlier_pick?: number;
88
93
  pick_days_before_transport?: number;
89
94
  pick_distribution_enabled?: boolean;
95
+ pick_weekdays?: number[];
90
96
  signup_mail_enabled?: boolean;
91
97
  signup_mail_lead_minutes?: number;
92
98
  signup_mail_purpose?: string;
@@ -498,6 +504,48 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
498
504
  referencedColumns: ["id"];
499
505
  }];
500
506
  };
507
+ carrier_signup_dispatch_runs: {
508
+ Row: {
509
+ detail: import("../integrations/supabase/types").Json | null;
510
+ error: string | null;
511
+ finished_at: string | null;
512
+ groups: number;
513
+ id: string;
514
+ ok: boolean;
515
+ reason: string | null;
516
+ sent: number;
517
+ skipped: import("../integrations/supabase/types").Json;
518
+ started_at: string;
519
+ unassigned: import("../integrations/supabase/types").Json;
520
+ };
521
+ Insert: {
522
+ detail?: import("../integrations/supabase/types").Json | null;
523
+ error?: string | null;
524
+ finished_at?: string | null;
525
+ groups?: number;
526
+ id?: string;
527
+ ok?: boolean;
528
+ reason?: string | null;
529
+ sent?: number;
530
+ skipped?: import("../integrations/supabase/types").Json;
531
+ started_at?: string;
532
+ unassigned?: import("../integrations/supabase/types").Json;
533
+ };
534
+ Update: {
535
+ detail?: import("../integrations/supabase/types").Json | null;
536
+ error?: string | null;
537
+ finished_at?: string | null;
538
+ groups?: number;
539
+ id?: string;
540
+ ok?: boolean;
541
+ reason?: string | null;
542
+ sent?: number;
543
+ skipped?: import("../integrations/supabase/types").Json;
544
+ started_at?: string;
545
+ unassigned?: import("../integrations/supabase/types").Json;
546
+ };
547
+ Relationships: [];
548
+ };
501
549
  carrier_signup_dispatches: {
502
550
  Row: {
503
551
  carrier_id: string;
@@ -549,6 +597,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
549
597
  contact_person: string | null;
550
598
  created_at: string;
551
599
  delivery_days: number | null;
600
+ delivery_weekdays: number[];
552
601
  email: string | null;
553
602
  id: string;
554
603
  is_default: boolean;
@@ -556,6 +605,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
556
605
  notes: string | null;
557
606
  phone: string | null;
558
607
  pickup_moments: import("../integrations/supabase/types").Json;
608
+ pickup_weekdays: number[];
559
609
  service_cities: string[];
560
610
  service_countries: string[];
561
611
  service_provinces: string[];
@@ -571,6 +621,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
571
621
  contact_person?: string | null;
572
622
  created_at?: string;
573
623
  delivery_days?: number | null;
624
+ delivery_weekdays?: number[];
574
625
  email?: string | null;
575
626
  id?: string;
576
627
  is_default?: boolean;
@@ -578,6 +629,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
578
629
  notes?: string | null;
579
630
  phone?: string | null;
580
631
  pickup_moments?: import("../integrations/supabase/types").Json;
632
+ pickup_weekdays?: number[];
581
633
  service_cities?: string[];
582
634
  service_countries?: string[];
583
635
  service_provinces?: string[];
@@ -593,6 +645,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
593
645
  contact_person?: string | null;
594
646
  created_at?: string;
595
647
  delivery_days?: number | null;
648
+ delivery_weekdays?: number[];
596
649
  email?: string | null;
597
650
  id?: string;
598
651
  is_default?: boolean;
@@ -600,6 +653,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
600
653
  notes?: string | null;
601
654
  phone?: string | null;
602
655
  pickup_moments?: import("../integrations/supabase/types").Json;
656
+ pickup_weekdays?: number[];
603
657
  service_cities?: string[];
604
658
  service_countries?: string[];
605
659
  service_provinces?: string[];
@@ -612,6 +666,180 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
612
666
  };
613
667
  Relationships: [];
614
668
  };
669
+ cart_control_draft: {
670
+ Row: {
671
+ cart_states: import("../integrations/supabase/types").Json;
672
+ checked_keys: import("../integrations/supabase/types").Json;
673
+ draft_date: string;
674
+ form_state: import("../integrations/supabase/types").Json;
675
+ notes: string;
676
+ updated_at: string;
677
+ user_id: string;
678
+ };
679
+ Insert: {
680
+ cart_states?: import("../integrations/supabase/types").Json;
681
+ checked_keys?: import("../integrations/supabase/types").Json;
682
+ draft_date: string;
683
+ form_state?: import("../integrations/supabase/types").Json;
684
+ notes?: string;
685
+ updated_at?: string;
686
+ user_id: string;
687
+ };
688
+ Update: {
689
+ cart_states?: import("../integrations/supabase/types").Json;
690
+ checked_keys?: import("../integrations/supabase/types").Json;
691
+ draft_date?: string;
692
+ form_state?: import("../integrations/supabase/types").Json;
693
+ notes?: string;
694
+ updated_at?: string;
695
+ user_id?: string;
696
+ };
697
+ Relationships: [];
698
+ };
699
+ cart_control_items: {
700
+ Row: {
701
+ action: string;
702
+ block_reason: string | null;
703
+ carrier_name: string | null;
704
+ cart_index: number;
705
+ cart_number_id: string | null;
706
+ cart_number_label: string | null;
707
+ created_at: string;
708
+ customer_name: string | null;
709
+ delivery_date: string | null;
710
+ id: string;
711
+ new_pick_date: string | null;
712
+ order_id: string;
713
+ order_number: string | null;
714
+ order_source: string;
715
+ pickup_date: string | null;
716
+ session_id: string;
717
+ };
718
+ Insert: {
719
+ action: string;
720
+ block_reason?: string | null;
721
+ carrier_name?: string | null;
722
+ cart_index: number;
723
+ cart_number_id?: string | null;
724
+ cart_number_label?: string | null;
725
+ created_at?: string;
726
+ customer_name?: string | null;
727
+ delivery_date?: string | null;
728
+ id?: string;
729
+ new_pick_date?: string | null;
730
+ order_id: string;
731
+ order_number?: string | null;
732
+ order_source: string;
733
+ pickup_date?: string | null;
734
+ session_id: string;
735
+ };
736
+ Update: {
737
+ action?: string;
738
+ block_reason?: string | null;
739
+ carrier_name?: string | null;
740
+ cart_index?: number;
741
+ cart_number_id?: string | null;
742
+ cart_number_label?: string | null;
743
+ created_at?: string;
744
+ customer_name?: string | null;
745
+ delivery_date?: string | null;
746
+ id?: string;
747
+ new_pick_date?: string | null;
748
+ order_id?: string;
749
+ order_number?: string | null;
750
+ order_source?: string;
751
+ pickup_date?: string | null;
752
+ session_id?: string;
753
+ };
754
+ Relationships: [{
755
+ foreignKeyName: "cart_control_items_session_id_fkey";
756
+ columns: ["session_id"];
757
+ isOneToOne: false;
758
+ referencedRelation: "cart_control_sessions";
759
+ referencedColumns: ["id"];
760
+ }];
761
+ };
762
+ cart_control_sessions: {
763
+ Row: {
764
+ blocked_count: number;
765
+ checked_count: number;
766
+ control_date: string;
767
+ created_at: string;
768
+ id: string;
769
+ notes: string | null;
770
+ performed_at: string;
771
+ rescheduled_count: number;
772
+ stock_consumed_at: string | null;
773
+ total_carts: number;
774
+ updated_at: string;
775
+ user_id: string;
776
+ };
777
+ Insert: {
778
+ blocked_count?: number;
779
+ checked_count?: number;
780
+ control_date?: string;
781
+ created_at?: string;
782
+ id?: string;
783
+ notes?: string | null;
784
+ performed_at?: string;
785
+ rescheduled_count?: number;
786
+ stock_consumed_at?: string | null;
787
+ total_carts?: number;
788
+ updated_at?: string;
789
+ user_id: string;
790
+ };
791
+ Update: {
792
+ blocked_count?: number;
793
+ checked_count?: number;
794
+ control_date?: string;
795
+ created_at?: string;
796
+ id?: string;
797
+ notes?: string | null;
798
+ performed_at?: string;
799
+ rescheduled_count?: number;
800
+ stock_consumed_at?: string | null;
801
+ total_carts?: number;
802
+ updated_at?: string;
803
+ user_id?: string;
804
+ };
805
+ Relationships: [];
806
+ };
807
+ cart_numbers: {
808
+ Row: {
809
+ assigned_at: string;
810
+ cart_index: number;
811
+ cart_number: string;
812
+ day_seq: number;
813
+ id: string;
814
+ order_id: string;
815
+ order_source: string;
816
+ pick_date: string;
817
+ status: string;
818
+ };
819
+ Insert: {
820
+ assigned_at?: string;
821
+ cart_index: number;
822
+ cart_number: string;
823
+ day_seq: number;
824
+ id?: string;
825
+ order_id: string;
826
+ order_source: string;
827
+ pick_date: string;
828
+ status?: string;
829
+ };
830
+ Update: {
831
+ assigned_at?: string;
832
+ cart_index?: number;
833
+ cart_number?: string;
834
+ day_seq?: number;
835
+ id?: string;
836
+ order_id?: string;
837
+ order_source?: string;
838
+ pick_date?: string;
839
+ status?: string;
840
+ };
841
+ Relationships: [];
842
+ };
615
843
  cart_pick_overrides: {
616
844
  Row: {
617
845
  cart_index: number;
@@ -651,6 +879,36 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
651
879
  };
652
880
  Relationships: [];
653
881
  };
882
+ cart_replan_queue: {
883
+ Row: {
884
+ attempts: number;
885
+ last_error: string | null;
886
+ order_id: string;
887
+ processed_at: string | null;
888
+ requested_at: string;
889
+ };
890
+ Insert: {
891
+ attempts?: number;
892
+ last_error?: string | null;
893
+ order_id: string;
894
+ processed_at?: string | null;
895
+ requested_at?: string;
896
+ };
897
+ Update: {
898
+ attempts?: number;
899
+ last_error?: string | null;
900
+ order_id?: string;
901
+ processed_at?: string | null;
902
+ requested_at?: string;
903
+ };
904
+ Relationships: [{
905
+ foreignKeyName: "cart_replan_queue_order_id_fkey";
906
+ columns: ["order_id"];
907
+ isOneToOne: true;
908
+ referencedRelation: "orders";
909
+ referencedColumns: ["id"];
910
+ }];
911
+ };
654
912
  collections: {
655
913
  Row: {
656
914
  created_at: string;
@@ -1284,6 +1542,54 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
1284
1542
  referencedColumns: ["id"];
1285
1543
  }];
1286
1544
  };
1545
+ dashboard_critical_alerts: {
1546
+ Row: {
1547
+ alert_key: string;
1548
+ alert_type: string;
1549
+ created_at: string;
1550
+ description: string | null;
1551
+ id: string;
1552
+ metadata: import("../integrations/supabase/types").Json | null;
1553
+ priority: string;
1554
+ raised_at: string;
1555
+ related_cart_ids: string[] | null;
1556
+ resolved_at: string | null;
1557
+ title: string;
1558
+ updated_at: string;
1559
+ user_id: string;
1560
+ };
1561
+ Insert: {
1562
+ alert_key: string;
1563
+ alert_type: string;
1564
+ created_at?: string;
1565
+ description?: string | null;
1566
+ id?: string;
1567
+ metadata?: import("../integrations/supabase/types").Json | null;
1568
+ priority?: string;
1569
+ raised_at?: string;
1570
+ related_cart_ids?: string[] | null;
1571
+ resolved_at?: string | null;
1572
+ title: string;
1573
+ updated_at?: string;
1574
+ user_id: string;
1575
+ };
1576
+ Update: {
1577
+ alert_key?: string;
1578
+ alert_type?: string;
1579
+ created_at?: string;
1580
+ description?: string | null;
1581
+ id?: string;
1582
+ metadata?: import("../integrations/supabase/types").Json | null;
1583
+ priority?: string;
1584
+ raised_at?: string;
1585
+ related_cart_ids?: string[] | null;
1586
+ resolved_at?: string | null;
1587
+ title?: string;
1588
+ updated_at?: string;
1589
+ user_id?: string;
1590
+ };
1591
+ Relationships: [];
1592
+ };
1287
1593
  dashboard_daily_reports: {
1288
1594
  Row: {
1289
1595
  created_at: string;
@@ -2728,34 +3034,52 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
2728
3034
  Row: {
2729
3035
  catalog_key: string | null;
2730
3036
  catalog_url: string;
3037
+ client_id: string | null;
3038
+ client_secret_ciphertext: string | null;
3039
+ client_secret_last4: string | null;
2731
3040
  created_at: string;
2732
3041
  id: number;
2733
3042
  last_meta: import("../integrations/supabase/types").Json | null;
2734
3043
  last_test_at: string | null;
2735
3044
  last_test_error: string | null;
2736
3045
  last_test_ok: boolean | null;
3046
+ last_token_test_at: string | null;
3047
+ last_token_test_error: string | null;
3048
+ last_token_test_ok: boolean | null;
2737
3049
  updated_at: string;
2738
3050
  };
2739
3051
  Insert: {
2740
3052
  catalog_key?: string | null;
2741
3053
  catalog_url?: string;
3054
+ client_id?: string | null;
3055
+ client_secret_ciphertext?: string | null;
3056
+ client_secret_last4?: string | null;
2742
3057
  created_at?: string;
2743
3058
  id?: number;
2744
3059
  last_meta?: import("../integrations/supabase/types").Json | null;
2745
3060
  last_test_at?: string | null;
2746
3061
  last_test_error?: string | null;
2747
3062
  last_test_ok?: boolean | null;
3063
+ last_token_test_at?: string | null;
3064
+ last_token_test_error?: string | null;
3065
+ last_token_test_ok?: boolean | null;
2748
3066
  updated_at?: string;
2749
3067
  };
2750
3068
  Update: {
2751
3069
  catalog_key?: string | null;
2752
3070
  catalog_url?: string;
3071
+ client_id?: string | null;
3072
+ client_secret_ciphertext?: string | null;
3073
+ client_secret_last4?: string | null;
2753
3074
  created_at?: string;
2754
3075
  id?: number;
2755
3076
  last_meta?: import("../integrations/supabase/types").Json | null;
2756
3077
  last_test_at?: string | null;
2757
3078
  last_test_error?: string | null;
2758
3079
  last_test_ok?: boolean | null;
3080
+ last_token_test_at?: string | null;
3081
+ last_token_test_error?: string | null;
3082
+ last_token_test_ok?: boolean | null;
2759
3083
  updated_at?: string;
2760
3084
  };
2761
3085
  Relationships: [];
@@ -2786,6 +3110,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
2786
3110
  };
2787
3111
  floricode_sync_state: {
2788
3112
  Row: {
3113
+ cursor_skip: number;
2789
3114
  error_message: string | null;
2790
3115
  last_change_date_time: string | null;
2791
3116
  last_sequence_number: number;
@@ -2795,6 +3120,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
2795
3120
  updated_at: string;
2796
3121
  };
2797
3122
  Insert: {
3123
+ cursor_skip?: number;
2798
3124
  error_message?: string | null;
2799
3125
  last_change_date_time?: string | null;
2800
3126
  last_sequence_number?: number;
@@ -2804,6 +3130,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
2804
3130
  updated_at?: string;
2805
3131
  };
2806
3132
  Update: {
3133
+ cursor_skip?: number;
2807
3134
  error_message?: string | null;
2808
3135
  last_change_date_time?: string | null;
2809
3136
  last_sequence_number?: number;
@@ -3399,6 +3726,51 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
3399
3726
  referencedColumns: ["id"];
3400
3727
  }];
3401
3728
  };
3729
+ floriday_continuous_stock_queue: {
3730
+ Row: {
3731
+ attempts: number;
3732
+ connection_id: string;
3733
+ created_at: string;
3734
+ gateway_attempt_id: string | null;
3735
+ id: string;
3736
+ last_error: string | null;
3737
+ number_of_pieces: number;
3738
+ sent_at: string | null;
3739
+ status: string;
3740
+ trade_item_id: string;
3741
+ updated_at: string;
3742
+ user_id: string;
3743
+ };
3744
+ Insert: {
3745
+ attempts?: number;
3746
+ connection_id: string;
3747
+ created_at?: string;
3748
+ gateway_attempt_id?: string | null;
3749
+ id?: string;
3750
+ last_error?: string | null;
3751
+ number_of_pieces?: number;
3752
+ sent_at?: string | null;
3753
+ status?: string;
3754
+ trade_item_id: string;
3755
+ updated_at?: string;
3756
+ user_id: string;
3757
+ };
3758
+ Update: {
3759
+ attempts?: number;
3760
+ connection_id?: string;
3761
+ created_at?: string;
3762
+ gateway_attempt_id?: string | null;
3763
+ id?: string;
3764
+ last_error?: string | null;
3765
+ number_of_pieces?: number;
3766
+ sent_at?: string | null;
3767
+ status?: string;
3768
+ trade_item_id?: string;
3769
+ updated_at?: string;
3770
+ user_id?: string;
3771
+ };
3772
+ Relationships: [];
3773
+ };
3402
3774
  floriday_contract_trade_item_groups_cache: {
3403
3775
  Row: {
3404
3776
  connection_id: string;
@@ -4467,51 +4839,105 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
4467
4839
  referencedColumns: ["id"];
4468
4840
  }];
4469
4841
  };
4470
- imap_accounts: {
4842
+ flow_role_assignments: {
4471
4843
  Row: {
4472
4844
  created_at: string;
4473
- email: string | null;
4474
- host: string;
4475
4845
  id: string;
4476
- is_active: boolean;
4477
- last_test_error: string | null;
4478
- last_test_ok: boolean | null;
4479
- last_tested_at: string | null;
4480
- name: string;
4481
- password: string | null;
4482
- password_secret_name: string | null;
4483
- port: number;
4484
- updated_at: string;
4485
- use_tls: boolean;
4486
- username: string;
4846
+ role_id: string;
4847
+ user_id: string;
4487
4848
  };
4488
4849
  Insert: {
4489
4850
  created_at?: string;
4490
- email?: string | null;
4491
- host: string;
4492
4851
  id?: string;
4493
- is_active?: boolean;
4494
- last_test_error?: string | null;
4495
- last_test_ok?: boolean | null;
4496
- last_tested_at?: string | null;
4497
- name: string;
4498
- password?: string | null;
4499
- password_secret_name?: string | null;
4500
- port?: number;
4501
- updated_at?: string;
4502
- use_tls?: boolean;
4503
- username: string;
4852
+ role_id: string;
4853
+ user_id: string;
4504
4854
  };
4505
4855
  Update: {
4506
4856
  created_at?: string;
4507
- email?: string | null;
4508
- host?: string;
4509
4857
  id?: string;
4510
- is_active?: boolean;
4511
- last_test_error?: string | null;
4512
- last_test_ok?: boolean | null;
4513
- last_tested_at?: string | null;
4514
- name?: string;
4858
+ role_id?: string;
4859
+ user_id?: string;
4860
+ };
4861
+ Relationships: [{
4862
+ foreignKeyName: "flow_role_assignments_role_id_fkey";
4863
+ columns: ["role_id"];
4864
+ isOneToOne: false;
4865
+ referencedRelation: "flow_roles";
4866
+ referencedColumns: ["id"];
4867
+ }];
4868
+ };
4869
+ flow_roles: {
4870
+ Row: {
4871
+ created_at: string;
4872
+ description: string | null;
4873
+ id: string;
4874
+ module_access: string[];
4875
+ name: string;
4876
+ updated_at: string;
4877
+ };
4878
+ Insert: {
4879
+ created_at?: string;
4880
+ description?: string | null;
4881
+ id?: string;
4882
+ module_access?: string[];
4883
+ name: string;
4884
+ updated_at?: string;
4885
+ };
4886
+ Update: {
4887
+ created_at?: string;
4888
+ description?: string | null;
4889
+ id?: string;
4890
+ module_access?: string[];
4891
+ name?: string;
4892
+ updated_at?: string;
4893
+ };
4894
+ Relationships: [];
4895
+ };
4896
+ imap_accounts: {
4897
+ Row: {
4898
+ created_at: string;
4899
+ email: string | null;
4900
+ host: string;
4901
+ id: string;
4902
+ is_active: boolean;
4903
+ last_test_error: string | null;
4904
+ last_test_ok: boolean | null;
4905
+ last_tested_at: string | null;
4906
+ name: string;
4907
+ password: string | null;
4908
+ password_secret_name: string | null;
4909
+ port: number;
4910
+ updated_at: string;
4911
+ use_tls: boolean;
4912
+ username: string;
4913
+ };
4914
+ Insert: {
4915
+ created_at?: string;
4916
+ email?: string | null;
4917
+ host: string;
4918
+ id?: string;
4919
+ is_active?: boolean;
4920
+ last_test_error?: string | null;
4921
+ last_test_ok?: boolean | null;
4922
+ last_tested_at?: string | null;
4923
+ name: string;
4924
+ password?: string | null;
4925
+ password_secret_name?: string | null;
4926
+ port?: number;
4927
+ updated_at?: string;
4928
+ use_tls?: boolean;
4929
+ username: string;
4930
+ };
4931
+ Update: {
4932
+ created_at?: string;
4933
+ email?: string | null;
4934
+ host?: string;
4935
+ id?: string;
4936
+ is_active?: boolean;
4937
+ last_test_error?: string | null;
4938
+ last_test_ok?: boolean | null;
4939
+ last_tested_at?: string | null;
4940
+ name?: string;
4515
4941
  password?: string | null;
4516
4942
  password_secret_name?: string | null;
4517
4943
  port?: number;
@@ -4788,6 +5214,204 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
4788
5214
  };
4789
5215
  Relationships: [];
4790
5216
  };
5217
+ local_customer_agreements: {
5218
+ Row: {
5219
+ base_price: number | null;
5220
+ created_at: string;
5221
+ currency: string;
5222
+ customer_id: string;
5223
+ id: string;
5224
+ min_quantity: number;
5225
+ net_price: number;
5226
+ notes: string | null;
5227
+ product_category_id: string | null;
5228
+ product_id: string | null;
5229
+ updated_at: string;
5230
+ valid_from: string | null;
5231
+ valid_until: string | null;
5232
+ };
5233
+ Insert: {
5234
+ base_price?: number | null;
5235
+ created_at?: string;
5236
+ currency?: string;
5237
+ customer_id: string;
5238
+ id?: string;
5239
+ min_quantity?: number;
5240
+ net_price: number;
5241
+ notes?: string | null;
5242
+ product_category_id?: string | null;
5243
+ product_id?: string | null;
5244
+ updated_at?: string;
5245
+ valid_from?: string | null;
5246
+ valid_until?: string | null;
5247
+ };
5248
+ Update: {
5249
+ base_price?: number | null;
5250
+ created_at?: string;
5251
+ currency?: string;
5252
+ customer_id?: string;
5253
+ id?: string;
5254
+ min_quantity?: number;
5255
+ net_price?: number;
5256
+ notes?: string | null;
5257
+ product_category_id?: string | null;
5258
+ product_id?: string | null;
5259
+ updated_at?: string;
5260
+ valid_from?: string | null;
5261
+ valid_until?: string | null;
5262
+ };
5263
+ Relationships: [{
5264
+ foreignKeyName: "local_customer_agreements_customer_id_fkey";
5265
+ columns: ["customer_id"];
5266
+ isOneToOne: false;
5267
+ referencedRelation: "customers";
5268
+ referencedColumns: ["id"];
5269
+ }, {
5270
+ foreignKeyName: "local_customer_agreements_product_category_id_fkey";
5271
+ columns: ["product_category_id"];
5272
+ isOneToOne: false;
5273
+ referencedRelation: "product_categories";
5274
+ referencedColumns: ["id"];
5275
+ }, {
5276
+ foreignKeyName: "local_customer_agreements_product_id_fkey";
5277
+ columns: ["product_id"];
5278
+ isOneToOne: false;
5279
+ referencedRelation: "products";
5280
+ referencedColumns: ["id"];
5281
+ }];
5282
+ };
5283
+ local_customer_price_groups: {
5284
+ Row: {
5285
+ created_at: string;
5286
+ currency: string;
5287
+ customer_id: string;
5288
+ discount_type: string;
5289
+ discount_value: number;
5290
+ id: string;
5291
+ min_quantity: number;
5292
+ notes: string | null;
5293
+ product_category_id: string | null;
5294
+ product_id: string | null;
5295
+ updated_at: string;
5296
+ valid_from: string | null;
5297
+ valid_until: string | null;
5298
+ };
5299
+ Insert: {
5300
+ created_at?: string;
5301
+ currency?: string;
5302
+ customer_id: string;
5303
+ discount_type: string;
5304
+ discount_value: number;
5305
+ id?: string;
5306
+ min_quantity?: number;
5307
+ notes?: string | null;
5308
+ product_category_id?: string | null;
5309
+ product_id?: string | null;
5310
+ updated_at?: string;
5311
+ valid_from?: string | null;
5312
+ valid_until?: string | null;
5313
+ };
5314
+ Update: {
5315
+ created_at?: string;
5316
+ currency?: string;
5317
+ customer_id?: string;
5318
+ discount_type?: string;
5319
+ discount_value?: number;
5320
+ id?: string;
5321
+ min_quantity?: number;
5322
+ notes?: string | null;
5323
+ product_category_id?: string | null;
5324
+ product_id?: string | null;
5325
+ updated_at?: string;
5326
+ valid_from?: string | null;
5327
+ valid_until?: string | null;
5328
+ };
5329
+ Relationships: [{
5330
+ foreignKeyName: "local_customer_price_groups_customer_id_fkey";
5331
+ columns: ["customer_id"];
5332
+ isOneToOne: false;
5333
+ referencedRelation: "customers";
5334
+ referencedColumns: ["id"];
5335
+ }, {
5336
+ foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
5337
+ columns: ["product_category_id"];
5338
+ isOneToOne: false;
5339
+ referencedRelation: "product_categories";
5340
+ referencedColumns: ["id"];
5341
+ }, {
5342
+ foreignKeyName: "local_customer_price_groups_product_id_fkey";
5343
+ columns: ["product_id"];
5344
+ isOneToOne: false;
5345
+ referencedRelation: "products";
5346
+ referencedColumns: ["id"];
5347
+ }];
5348
+ };
5349
+ local_customer_sales_strategies: {
5350
+ Row: {
5351
+ created_at: string;
5352
+ currency: string;
5353
+ customer_id: string;
5354
+ discount_type: string;
5355
+ discount_value: number;
5356
+ id: string;
5357
+ min_quantity: number;
5358
+ notes: string | null;
5359
+ product_category_id: string | null;
5360
+ product_id: string | null;
5361
+ updated_at: string;
5362
+ valid_from: string | null;
5363
+ valid_until: string | null;
5364
+ };
5365
+ Insert: {
5366
+ created_at?: string;
5367
+ currency?: string;
5368
+ customer_id: string;
5369
+ discount_type: string;
5370
+ discount_value: number;
5371
+ id?: string;
5372
+ min_quantity?: number;
5373
+ notes?: string | null;
5374
+ product_category_id?: string | null;
5375
+ product_id?: string | null;
5376
+ updated_at?: string;
5377
+ valid_from?: string | null;
5378
+ valid_until?: string | null;
5379
+ };
5380
+ Update: {
5381
+ created_at?: string;
5382
+ currency?: string;
5383
+ customer_id?: string;
5384
+ discount_type?: string;
5385
+ discount_value?: number;
5386
+ id?: string;
5387
+ min_quantity?: number;
5388
+ notes?: string | null;
5389
+ product_category_id?: string | null;
5390
+ product_id?: string | null;
5391
+ updated_at?: string;
5392
+ valid_from?: string | null;
5393
+ valid_until?: string | null;
5394
+ };
5395
+ Relationships: [{
5396
+ foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
5397
+ columns: ["customer_id"];
5398
+ isOneToOne: false;
5399
+ referencedRelation: "customers";
5400
+ referencedColumns: ["id"];
5401
+ }, {
5402
+ foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
5403
+ columns: ["product_category_id"];
5404
+ isOneToOne: false;
5405
+ referencedRelation: "product_categories";
5406
+ referencedColumns: ["id"];
5407
+ }, {
5408
+ foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
5409
+ columns: ["product_id"];
5410
+ isOneToOne: false;
5411
+ referencedRelation: "products";
5412
+ referencedColumns: ["id"];
5413
+ }];
5414
+ };
4791
5415
  locations: {
4792
5416
  Row: {
4793
5417
  created_at: string;
@@ -4900,6 +5524,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
4900
5524
  matched_customer_id: string | null;
4901
5525
  message_id: string;
4902
5526
  notes: string | null;
5527
+ order_number: string | null;
4903
5528
  parsed_payload: import("../integrations/supabase/types").Json | null;
4904
5529
  reviewed_at: string | null;
4905
5530
  reviewed_by: string | null;
@@ -4915,6 +5540,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
4915
5540
  matched_customer_id?: string | null;
4916
5541
  message_id: string;
4917
5542
  notes?: string | null;
5543
+ order_number?: string | null;
4918
5544
  parsed_payload?: import("../integrations/supabase/types").Json | null;
4919
5545
  reviewed_at?: string | null;
4920
5546
  reviewed_by?: string | null;
@@ -4930,6 +5556,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
4930
5556
  matched_customer_id?: string | null;
4931
5557
  message_id?: string;
4932
5558
  notes?: string | null;
5559
+ order_number?: string | null;
4933
5560
  parsed_payload?: import("../integrations/supabase/types").Json | null;
4934
5561
  reviewed_at?: string | null;
4935
5562
  reviewed_by?: string | null;
@@ -5103,110 +5730,464 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
5103
5730
  referencedColumns: ["id"];
5104
5731
  }];
5105
5732
  };
5106
- mailbox_settings: {
5733
+ mailbox_settings: {
5734
+ Row: {
5735
+ created_at: string;
5736
+ folder: string;
5737
+ id: string;
5738
+ imap_host: string;
5739
+ imap_port: number;
5740
+ imap_use_tls: boolean;
5741
+ imap_username: string;
5742
+ last_error: string | null;
5743
+ last_polled_at: string | null;
5744
+ last_uid_seen: number;
5745
+ polling_enabled: boolean;
5746
+ singleton: boolean;
5747
+ updated_at: string;
5748
+ };
5749
+ Insert: {
5750
+ created_at?: string;
5751
+ folder?: string;
5752
+ id?: string;
5753
+ imap_host?: string;
5754
+ imap_port?: number;
5755
+ imap_use_tls?: boolean;
5756
+ imap_username?: string;
5757
+ last_error?: string | null;
5758
+ last_polled_at?: string | null;
5759
+ last_uid_seen?: number;
5760
+ polling_enabled?: boolean;
5761
+ singleton?: boolean;
5762
+ updated_at?: string;
5763
+ };
5764
+ Update: {
5765
+ created_at?: string;
5766
+ folder?: string;
5767
+ id?: string;
5768
+ imap_host?: string;
5769
+ imap_port?: number;
5770
+ imap_use_tls?: boolean;
5771
+ imap_username?: string;
5772
+ last_error?: string | null;
5773
+ last_polled_at?: string | null;
5774
+ last_uid_seen?: number;
5775
+ polling_enabled?: boolean;
5776
+ singleton?: boolean;
5777
+ updated_at?: string;
5778
+ };
5779
+ Relationships: [];
5780
+ };
5781
+ manufacture_product_components: {
5782
+ Row: {
5783
+ component_type: string;
5784
+ created_at: string;
5785
+ id: string;
5786
+ manufacture_product_id: string;
5787
+ product_group_id: string | null;
5788
+ quantity: number;
5789
+ trade_item_id: string | null;
5790
+ unit: string;
5791
+ };
5792
+ Insert: {
5793
+ component_type: string;
5794
+ created_at?: string;
5795
+ id?: string;
5796
+ manufacture_product_id: string;
5797
+ product_group_id?: string | null;
5798
+ quantity?: number;
5799
+ trade_item_id?: string | null;
5800
+ unit?: string;
5801
+ };
5802
+ Update: {
5803
+ component_type?: string;
5804
+ created_at?: string;
5805
+ id?: string;
5806
+ manufacture_product_id?: string;
5807
+ product_group_id?: string | null;
5808
+ quantity?: number;
5809
+ trade_item_id?: string | null;
5810
+ unit?: string;
5811
+ };
5812
+ Relationships: [{
5813
+ foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey";
5814
+ columns: ["manufacture_product_id"];
5815
+ isOneToOne: false;
5816
+ referencedRelation: "manufacture_product_possible_stock_view";
5817
+ referencedColumns: ["manufacture_product_id"];
5818
+ }, {
5819
+ foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey";
5820
+ columns: ["manufacture_product_id"];
5821
+ isOneToOne: false;
5822
+ referencedRelation: "manufacture_products";
5823
+ referencedColumns: ["id"];
5824
+ }, {
5825
+ foreignKeyName: "manufacture_product_components_product_group_id_fkey";
5826
+ columns: ["product_group_id"];
5827
+ isOneToOne: false;
5828
+ referencedRelation: "product_groups";
5829
+ referencedColumns: ["id"];
5830
+ }];
5831
+ };
5832
+ manufacture_products: {
5833
+ Row: {
5834
+ created_at: string;
5835
+ description: string | null;
5836
+ id: string;
5837
+ is_active: boolean;
5838
+ name: string;
5839
+ produced_stock: number;
5840
+ product_code: string;
5841
+ tenant_id: string;
5842
+ updated_at: string;
5843
+ };
5844
+ Insert: {
5845
+ created_at?: string;
5846
+ description?: string | null;
5847
+ id?: string;
5848
+ is_active?: boolean;
5849
+ name: string;
5850
+ produced_stock?: number;
5851
+ product_code: string;
5852
+ tenant_id: string;
5853
+ updated_at?: string;
5854
+ };
5855
+ Update: {
5856
+ created_at?: string;
5857
+ description?: string | null;
5858
+ id?: string;
5859
+ is_active?: boolean;
5860
+ name?: string;
5861
+ produced_stock?: number;
5862
+ product_code?: string;
5863
+ tenant_id?: string;
5864
+ updated_at?: string;
5865
+ };
5866
+ Relationships: [];
5867
+ };
5868
+ monteurs: {
5869
+ Row: {
5870
+ avatar_url: string | null;
5871
+ color: string | null;
5872
+ created_at: string;
5873
+ email: string | null;
5874
+ id: string;
5875
+ is_active: boolean;
5876
+ leave_balance_hours: number;
5877
+ name: string;
5878
+ persnr: number | null;
5879
+ phone: string | null;
5880
+ role: string;
5881
+ tenant_id: string;
5882
+ updated_at: string;
5883
+ user_id: string | null;
5884
+ };
5885
+ Insert: {
5886
+ avatar_url?: string | null;
5887
+ color?: string | null;
5888
+ created_at?: string;
5889
+ email?: string | null;
5890
+ id?: string;
5891
+ is_active?: boolean;
5892
+ leave_balance_hours?: number;
5893
+ name: string;
5894
+ persnr?: number | null;
5895
+ phone?: string | null;
5896
+ role?: string;
5897
+ tenant_id: string;
5898
+ updated_at?: string;
5899
+ user_id?: string | null;
5900
+ };
5901
+ Update: {
5902
+ avatar_url?: string | null;
5903
+ color?: string | null;
5904
+ created_at?: string;
5905
+ email?: string | null;
5906
+ id?: string;
5907
+ is_active?: boolean;
5908
+ leave_balance_hours?: number;
5909
+ name?: string;
5910
+ persnr?: number | null;
5911
+ phone?: string | null;
5912
+ role?: string;
5913
+ tenant_id?: string;
5914
+ updated_at?: string;
5915
+ user_id?: string | null;
5916
+ };
5917
+ Relationships: [{
5918
+ foreignKeyName: "monteurs_tenant_id_fkey";
5919
+ columns: ["tenant_id"];
5920
+ isOneToOne: false;
5921
+ referencedRelation: "tenants";
5922
+ referencedColumns: ["id"];
5923
+ }];
5924
+ };
5925
+ nmbrs_component_mapping: {
5926
+ Row: {
5927
+ created_at: string;
5928
+ id: string;
5929
+ source_kind: string;
5930
+ source_value: string | null;
5931
+ updated_at: string;
5932
+ wage_code: string;
5933
+ };
5934
+ Insert: {
5935
+ created_at?: string;
5936
+ id?: string;
5937
+ source_kind: string;
5938
+ source_value?: string | null;
5939
+ updated_at?: string;
5940
+ wage_code: string;
5941
+ };
5942
+ Update: {
5943
+ created_at?: string;
5944
+ id?: string;
5945
+ source_kind?: string;
5946
+ source_value?: string | null;
5947
+ updated_at?: string;
5948
+ wage_code?: string;
5949
+ };
5950
+ Relationships: [{
5951
+ foreignKeyName: "nmbrs_component_mapping_wage_code_fkey";
5952
+ columns: ["wage_code"];
5953
+ isOneToOne: false;
5954
+ referencedRelation: "nmbrs_wage_components";
5955
+ referencedColumns: ["code"];
5956
+ }];
5957
+ };
5958
+ nmbrs_employee_mapping: {
5959
+ Row: {
5960
+ active_from: string | null;
5961
+ active_to: string | null;
5962
+ contract_hours_per_week: number | null;
5963
+ created_at: string;
5964
+ hourly_wage: number | null;
5965
+ id: string;
5966
+ monteur_id: string;
5967
+ nmbrs_company_code: string | null;
5968
+ nmbrs_employee_number: string;
5969
+ updated_at: string;
5970
+ };
5971
+ Insert: {
5972
+ active_from?: string | null;
5973
+ active_to?: string | null;
5974
+ contract_hours_per_week?: number | null;
5975
+ created_at?: string;
5976
+ hourly_wage?: number | null;
5977
+ id?: string;
5978
+ monteur_id: string;
5979
+ nmbrs_company_code?: string | null;
5980
+ nmbrs_employee_number: string;
5981
+ updated_at?: string;
5982
+ };
5983
+ Update: {
5984
+ active_from?: string | null;
5985
+ active_to?: string | null;
5986
+ contract_hours_per_week?: number | null;
5987
+ created_at?: string;
5988
+ hourly_wage?: number | null;
5989
+ id?: string;
5990
+ monteur_id?: string;
5991
+ nmbrs_company_code?: string | null;
5992
+ nmbrs_employee_number?: string;
5993
+ updated_at?: string;
5994
+ };
5995
+ Relationships: [{
5996
+ foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
5997
+ columns: ["monteur_id"];
5998
+ isOneToOne: true;
5999
+ referencedRelation: "monteurs";
6000
+ referencedColumns: ["id"];
6001
+ }];
6002
+ };
6003
+ nmbrs_export_lines: {
6004
+ Row: {
6005
+ amount: number;
6006
+ created_at: string;
6007
+ entry_date: string;
6008
+ hours: number;
6009
+ id: string;
6010
+ monteur_id: string;
6011
+ nmbrs_employee_number: string | null;
6012
+ notes: string | null;
6013
+ run_id: string;
6014
+ source_kind: string | null;
6015
+ source_ref_id: string | null;
6016
+ updated_at: string;
6017
+ wage_code: string;
6018
+ };
6019
+ Insert: {
6020
+ amount?: number;
6021
+ created_at?: string;
6022
+ entry_date: string;
6023
+ hours?: number;
6024
+ id?: string;
6025
+ monteur_id: string;
6026
+ nmbrs_employee_number?: string | null;
6027
+ notes?: string | null;
6028
+ run_id: string;
6029
+ source_kind?: string | null;
6030
+ source_ref_id?: string | null;
6031
+ updated_at?: string;
6032
+ wage_code: string;
6033
+ };
6034
+ Update: {
6035
+ amount?: number;
6036
+ created_at?: string;
6037
+ entry_date?: string;
6038
+ hours?: number;
6039
+ id?: string;
6040
+ monteur_id?: string;
6041
+ nmbrs_employee_number?: string | null;
6042
+ notes?: string | null;
6043
+ run_id?: string;
6044
+ source_kind?: string | null;
6045
+ source_ref_id?: string | null;
6046
+ updated_at?: string;
6047
+ wage_code?: string;
6048
+ };
6049
+ Relationships: [{
6050
+ foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
6051
+ columns: ["monteur_id"];
6052
+ isOneToOne: false;
6053
+ referencedRelation: "monteurs";
6054
+ referencedColumns: ["id"];
6055
+ }, {
6056
+ foreignKeyName: "nmbrs_export_lines_run_id_fkey";
6057
+ columns: ["run_id"];
6058
+ isOneToOne: false;
6059
+ referencedRelation: "nmbrs_export_runs";
6060
+ referencedColumns: ["id"];
6061
+ }, {
6062
+ foreignKeyName: "nmbrs_export_lines_wage_code_fkey";
6063
+ columns: ["wage_code"];
6064
+ isOneToOne: false;
6065
+ referencedRelation: "nmbrs_wage_components";
6066
+ referencedColumns: ["code"];
6067
+ }];
6068
+ };
6069
+ nmbrs_export_runs: {
6070
+ Row: {
6071
+ created_at: string;
6072
+ file_name: string | null;
6073
+ generated_at: string;
6074
+ generated_by: string | null;
6075
+ id: string;
6076
+ notes: string | null;
6077
+ period_end: string;
6078
+ period_label: string;
6079
+ period_start: string;
6080
+ status: string;
6081
+ total_hours: number;
6082
+ total_lines: number;
6083
+ updated_at: string;
6084
+ };
6085
+ Insert: {
6086
+ created_at?: string;
6087
+ file_name?: string | null;
6088
+ generated_at?: string;
6089
+ generated_by?: string | null;
6090
+ id?: string;
6091
+ notes?: string | null;
6092
+ period_end: string;
6093
+ period_label: string;
6094
+ period_start: string;
6095
+ status?: string;
6096
+ total_hours?: number;
6097
+ total_lines?: number;
6098
+ updated_at?: string;
6099
+ };
6100
+ Update: {
6101
+ created_at?: string;
6102
+ file_name?: string | null;
6103
+ generated_at?: string;
6104
+ generated_by?: string | null;
6105
+ id?: string;
6106
+ notes?: string | null;
6107
+ period_end?: string;
6108
+ period_label?: string;
6109
+ period_start?: string;
6110
+ status?: string;
6111
+ total_hours?: number;
6112
+ total_lines?: number;
6113
+ updated_at?: string;
6114
+ };
6115
+ Relationships: [];
6116
+ };
6117
+ nmbrs_settings: {
5107
6118
  Row: {
5108
6119
  created_at: string;
5109
- folder: string;
5110
- id: string;
5111
- imap_host: string;
5112
- imap_port: number;
5113
- imap_use_tls: boolean;
5114
- imap_username: string;
5115
- last_error: string | null;
5116
- last_polled_at: string | null;
5117
- last_uid_seen: number;
5118
- polling_enabled: boolean;
5119
- singleton: boolean;
6120
+ default_company_code: string | null;
6121
+ id: boolean;
6122
+ include_travel: boolean;
6123
+ overtime_threshold_daily: number;
6124
+ overtime_threshold_weekly: number;
6125
+ period_type: string;
5120
6126
  updated_at: string;
6127
+ updated_by: string | null;
6128
+ week_start_day: number;
5121
6129
  };
5122
6130
  Insert: {
5123
6131
  created_at?: string;
5124
- folder?: string;
5125
- id?: string;
5126
- imap_host?: string;
5127
- imap_port?: number;
5128
- imap_use_tls?: boolean;
5129
- imap_username?: string;
5130
- last_error?: string | null;
5131
- last_polled_at?: string | null;
5132
- last_uid_seen?: number;
5133
- polling_enabled?: boolean;
5134
- singleton?: boolean;
6132
+ default_company_code?: string | null;
6133
+ id?: boolean;
6134
+ include_travel?: boolean;
6135
+ overtime_threshold_daily?: number;
6136
+ overtime_threshold_weekly?: number;
6137
+ period_type?: string;
5135
6138
  updated_at?: string;
6139
+ updated_by?: string | null;
6140
+ week_start_day?: number;
5136
6141
  };
5137
6142
  Update: {
5138
6143
  created_at?: string;
5139
- folder?: string;
5140
- id?: string;
5141
- imap_host?: string;
5142
- imap_port?: number;
5143
- imap_use_tls?: boolean;
5144
- imap_username?: string;
5145
- last_error?: string | null;
5146
- last_polled_at?: string | null;
5147
- last_uid_seen?: number;
5148
- polling_enabled?: boolean;
5149
- singleton?: boolean;
6144
+ default_company_code?: string | null;
6145
+ id?: boolean;
6146
+ include_travel?: boolean;
6147
+ overtime_threshold_daily?: number;
6148
+ overtime_threshold_weekly?: number;
6149
+ period_type?: string;
5150
6150
  updated_at?: string;
6151
+ updated_by?: string | null;
6152
+ week_start_day?: number;
5151
6153
  };
5152
6154
  Relationships: [];
5153
6155
  };
5154
- monteurs: {
6156
+ nmbrs_wage_components: {
5155
6157
  Row: {
5156
- avatar_url: string | null;
5157
- color: string | null;
6158
+ category: string;
6159
+ code: string;
5158
6160
  created_at: string;
5159
- email: string | null;
5160
6161
  id: string;
5161
6162
  is_active: boolean;
5162
- leave_balance_hours: number;
5163
- name: string;
5164
- persnr: number | null;
5165
- phone: string | null;
5166
- role: string;
5167
- tenant_id: string;
6163
+ label: string;
6164
+ sort_order: number;
6165
+ unit: string;
5168
6166
  updated_at: string;
5169
- user_id: string | null;
5170
6167
  };
5171
6168
  Insert: {
5172
- avatar_url?: string | null;
5173
- color?: string | null;
6169
+ category: string;
6170
+ code: string;
5174
6171
  created_at?: string;
5175
- email?: string | null;
5176
6172
  id?: string;
5177
6173
  is_active?: boolean;
5178
- leave_balance_hours?: number;
5179
- name: string;
5180
- persnr?: number | null;
5181
- phone?: string | null;
5182
- role?: string;
5183
- tenant_id: string;
6174
+ label: string;
6175
+ sort_order?: number;
6176
+ unit: string;
5184
6177
  updated_at?: string;
5185
- user_id?: string | null;
5186
6178
  };
5187
6179
  Update: {
5188
- avatar_url?: string | null;
5189
- color?: string | null;
6180
+ category?: string;
6181
+ code?: string;
5190
6182
  created_at?: string;
5191
- email?: string | null;
5192
6183
  id?: string;
5193
6184
  is_active?: boolean;
5194
- leave_balance_hours?: number;
5195
- name?: string;
5196
- persnr?: number | null;
5197
- phone?: string | null;
5198
- role?: string;
5199
- tenant_id?: string;
6185
+ label?: string;
6186
+ sort_order?: number;
6187
+ unit?: string;
5200
6188
  updated_at?: string;
5201
- user_id?: string | null;
5202
6189
  };
5203
- Relationships: [{
5204
- foreignKeyName: "monteurs_tenant_id_fkey";
5205
- columns: ["tenant_id"];
5206
- isOneToOne: false;
5207
- referencedRelation: "tenants";
5208
- referencedColumns: ["id"];
5209
- }];
6190
+ Relationships: [];
5210
6191
  };
5211
6192
  notifications: {
5212
6193
  Row: {
@@ -5432,6 +6413,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
5432
6413
  id: string;
5433
6414
  items: import("../integrations/supabase/types").Json;
5434
6415
  notes: string | null;
6416
+ order_number: string | null;
5435
6417
  recipient_id: string;
5436
6418
  total_amount: number;
5437
6419
  };
@@ -5445,6 +6427,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
5445
6427
  id?: string;
5446
6428
  items?: import("../integrations/supabase/types").Json;
5447
6429
  notes?: string | null;
6430
+ order_number?: string | null;
5448
6431
  recipient_id: string;
5449
6432
  total_amount?: number;
5450
6433
  };
@@ -5458,6 +6441,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
5458
6441
  id?: string;
5459
6442
  items?: import("../integrations/supabase/types").Json;
5460
6443
  notes?: string | null;
6444
+ order_number?: string | null;
5461
6445
  recipient_id?: string;
5462
6446
  total_amount?: number;
5463
6447
  };
@@ -5617,6 +6601,9 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
5617
6601
  crates_per_layer: number;
5618
6602
  created_at: string;
5619
6603
  id: string;
6604
+ layer_fraction: number;
6605
+ layer_share_pct: number;
6606
+ layers_per_cart: number;
5620
6607
  order_item_id: string | null;
5621
6608
  plants_per_crate: number;
5622
6609
  product_id: string | null;
@@ -5628,6 +6615,9 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
5628
6615
  crates_per_layer?: number;
5629
6616
  created_at?: string;
5630
6617
  id?: string;
6618
+ layer_fraction?: number;
6619
+ layer_share_pct?: number;
6620
+ layers_per_cart?: number;
5631
6621
  order_item_id?: string | null;
5632
6622
  plants_per_crate?: number;
5633
6623
  product_id?: string | null;
@@ -5639,6 +6629,9 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
5639
6629
  crates_per_layer?: number;
5640
6630
  created_at?: string;
5641
6631
  id?: string;
6632
+ layer_fraction?: number;
6633
+ layer_share_pct?: number;
6634
+ layers_per_cart?: number;
5642
6635
  order_item_id?: string | null;
5643
6636
  plants_per_crate?: number;
5644
6637
  product_id?: string | null;
@@ -5666,33 +6659,45 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
5666
6659
  };
5667
6660
  order_carts: {
5668
6661
  Row: {
6662
+ algorithm_version: number;
5669
6663
  cart_number: number;
5670
6664
  created_at: string;
5671
6665
  id: string;
5672
6666
  is_auto: boolean;
5673
6667
  is_complete: boolean;
5674
6668
  notes: string | null;
6669
+ occupancy_pct: number;
5675
6670
  order_id: string;
6671
+ source: string;
6672
+ total_layers_used: number;
5676
6673
  updated_at: string;
5677
6674
  };
5678
6675
  Insert: {
6676
+ algorithm_version?: number;
5679
6677
  cart_number: number;
5680
6678
  created_at?: string;
5681
6679
  id?: string;
5682
6680
  is_auto?: boolean;
5683
6681
  is_complete?: boolean;
5684
6682
  notes?: string | null;
6683
+ occupancy_pct?: number;
5685
6684
  order_id: string;
6685
+ source?: string;
6686
+ total_layers_used?: number;
5686
6687
  updated_at?: string;
5687
6688
  };
5688
6689
  Update: {
6690
+ algorithm_version?: number;
5689
6691
  cart_number?: number;
5690
6692
  created_at?: string;
5691
6693
  id?: string;
5692
6694
  is_auto?: boolean;
5693
6695
  is_complete?: boolean;
5694
6696
  notes?: string | null;
6697
+ occupancy_pct?: number;
5695
6698
  order_id?: string;
6699
+ source?: string;
6700
+ total_layers_used?: number;
5696
6701
  updated_at?: string;
5697
6702
  };
5698
6703
  Relationships: [{
@@ -6111,6 +7116,66 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
6111
7116
  };
6112
7117
  Relationships: [];
6113
7118
  };
7119
+ product_group_items: {
7120
+ Row: {
7121
+ created_at: string;
7122
+ id: string;
7123
+ product_group_id: string;
7124
+ quantity: number;
7125
+ trade_item_id: string;
7126
+ };
7127
+ Insert: {
7128
+ created_at?: string;
7129
+ id?: string;
7130
+ product_group_id: string;
7131
+ quantity?: number;
7132
+ trade_item_id: string;
7133
+ };
7134
+ Update: {
7135
+ created_at?: string;
7136
+ id?: string;
7137
+ product_group_id?: string;
7138
+ quantity?: number;
7139
+ trade_item_id?: string;
7140
+ };
7141
+ Relationships: [{
7142
+ foreignKeyName: "product_group_items_product_group_id_fkey";
7143
+ columns: ["product_group_id"];
7144
+ isOneToOne: false;
7145
+ referencedRelation: "product_groups";
7146
+ referencedColumns: ["id"];
7147
+ }];
7148
+ };
7149
+ product_groups: {
7150
+ Row: {
7151
+ created_at: string;
7152
+ description: string | null;
7153
+ id: string;
7154
+ is_active: boolean;
7155
+ name: string;
7156
+ tenant_id: string;
7157
+ updated_at: string;
7158
+ };
7159
+ Insert: {
7160
+ created_at?: string;
7161
+ description?: string | null;
7162
+ id?: string;
7163
+ is_active?: boolean;
7164
+ name: string;
7165
+ tenant_id: string;
7166
+ updated_at?: string;
7167
+ };
7168
+ Update: {
7169
+ created_at?: string;
7170
+ description?: string | null;
7171
+ id?: string;
7172
+ is_active?: boolean;
7173
+ name?: string;
7174
+ tenant_id?: string;
7175
+ updated_at?: string;
7176
+ };
7177
+ Relationships: [];
7178
+ };
6114
7179
  products: {
6115
7180
  Row: {
6116
7181
  barcode: string | null;
@@ -6130,6 +7195,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
6130
7195
  purchase_price: number | null;
6131
7196
  quantity: number;
6132
7197
  sale_price: number | null;
7198
+ trade_item_key: string | null;
6133
7199
  unit: string;
6134
7200
  updated_at: string;
6135
7201
  weight: string | null;
@@ -6152,6 +7218,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
6152
7218
  purchase_price?: number | null;
6153
7219
  quantity?: number;
6154
7220
  sale_price?: number | null;
7221
+ trade_item_key?: string | null;
6155
7222
  unit?: string;
6156
7223
  updated_at?: string;
6157
7224
  weight?: string | null;
@@ -6174,6 +7241,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
6174
7241
  purchase_price?: number | null;
6175
7242
  quantity?: number;
6176
7243
  sale_price?: number | null;
7244
+ trade_item_key?: string | null;
6177
7245
  unit?: string;
6178
7246
  updated_at?: string;
6179
7247
  weight?: string | null;
@@ -6186,6 +7254,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
6186
7254
  display_name: string | null;
6187
7255
  email: string | null;
6188
7256
  id: string;
7257
+ is_superadmin: boolean;
6189
7258
  notification_preferences: import("../integrations/supabase/types").Json;
6190
7259
  tenant_id: string | null;
6191
7260
  updated_at: string;
@@ -6195,6 +7264,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
6195
7264
  display_name?: string | null;
6196
7265
  email?: string | null;
6197
7266
  id: string;
7267
+ is_superadmin?: boolean;
6198
7268
  notification_preferences?: import("../integrations/supabase/types").Json;
6199
7269
  tenant_id?: string | null;
6200
7270
  updated_at?: string;
@@ -6204,6 +7274,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
6204
7274
  display_name?: string | null;
6205
7275
  email?: string | null;
6206
7276
  id?: string;
7277
+ is_superadmin?: boolean;
6207
7278
  notification_preferences?: import("../integrations/supabase/types").Json;
6208
7279
  tenant_id?: string | null;
6209
7280
  updated_at?: string;
@@ -6993,6 +8064,120 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
6993
8064
  };
6994
8065
  Relationships: [];
6995
8066
  };
8067
+ sidebar_config: {
8068
+ Row: {
8069
+ id: string;
8070
+ module_order: string[];
8071
+ updated_at: string;
8072
+ };
8073
+ Insert: {
8074
+ id?: string;
8075
+ module_order?: string[];
8076
+ updated_at?: string;
8077
+ };
8078
+ Update: {
8079
+ id?: string;
8080
+ module_order?: string[];
8081
+ updated_at?: string;
8082
+ };
8083
+ Relationships: [];
8084
+ };
8085
+ stock_import_runs: {
8086
+ Row: {
8087
+ connection_id: string | null;
8088
+ created_at: string;
8089
+ created_rows: number;
8090
+ errors: import("../integrations/supabase/types").Json;
8091
+ filename: string | null;
8092
+ id: string;
8093
+ mutations: import("../integrations/supabase/types").Json;
8094
+ skipped_rows: number;
8095
+ total_rows: number;
8096
+ updated_rows: number;
8097
+ user_id: string;
8098
+ };
8099
+ Insert: {
8100
+ connection_id?: string | null;
8101
+ created_at?: string;
8102
+ created_rows?: number;
8103
+ errors?: import("../integrations/supabase/types").Json;
8104
+ filename?: string | null;
8105
+ id?: string;
8106
+ mutations?: import("../integrations/supabase/types").Json;
8107
+ skipped_rows?: number;
8108
+ total_rows?: number;
8109
+ updated_rows?: number;
8110
+ user_id: string;
8111
+ };
8112
+ Update: {
8113
+ connection_id?: string | null;
8114
+ created_at?: string;
8115
+ created_rows?: number;
8116
+ errors?: import("../integrations/supabase/types").Json;
8117
+ filename?: string | null;
8118
+ id?: string;
8119
+ mutations?: import("../integrations/supabase/types").Json;
8120
+ skipped_rows?: number;
8121
+ total_rows?: number;
8122
+ updated_rows?: number;
8123
+ user_id?: string;
8124
+ };
8125
+ Relationships: [];
8126
+ };
8127
+ stock_mutation_log: {
8128
+ Row: {
8129
+ connection_id: string | null;
8130
+ created_at: string;
8131
+ created_by: string | null;
8132
+ id: string;
8133
+ mutation_type: string;
8134
+ order_id: string | null;
8135
+ order_item_id: string | null;
8136
+ order_source: string | null;
8137
+ physical_after: number | null;
8138
+ physical_before: number | null;
8139
+ qty_delta: number;
8140
+ reason: string | null;
8141
+ reserved_after: number | null;
8142
+ reserved_before: number | null;
8143
+ trade_item_key: string | null;
8144
+ };
8145
+ Insert: {
8146
+ connection_id?: string | null;
8147
+ created_at?: string;
8148
+ created_by?: string | null;
8149
+ id?: string;
8150
+ mutation_type: string;
8151
+ order_id?: string | null;
8152
+ order_item_id?: string | null;
8153
+ order_source?: string | null;
8154
+ physical_after?: number | null;
8155
+ physical_before?: number | null;
8156
+ qty_delta: number;
8157
+ reason?: string | null;
8158
+ reserved_after?: number | null;
8159
+ reserved_before?: number | null;
8160
+ trade_item_key?: string | null;
8161
+ };
8162
+ Update: {
8163
+ connection_id?: string | null;
8164
+ created_at?: string;
8165
+ created_by?: string | null;
8166
+ id?: string;
8167
+ mutation_type?: string;
8168
+ order_id?: string | null;
8169
+ order_item_id?: string | null;
8170
+ order_source?: string | null;
8171
+ physical_after?: number | null;
8172
+ physical_before?: number | null;
8173
+ qty_delta?: number;
8174
+ reason?: string | null;
8175
+ reserved_after?: number | null;
8176
+ reserved_before?: number | null;
8177
+ trade_item_key?: string | null;
8178
+ };
8179
+ Relationships: [];
8180
+ };
6996
8181
  supplier_products: {
6997
8182
  Row: {
6998
8183
  article_number: string | null;
@@ -7250,7 +8435,13 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7250
8435
  connection_id: string | null;
7251
8436
  created_at: string;
7252
8437
  data: import("../integrations/supabase/types").Json;
8438
+ floriday_id: string | null;
8439
+ floriday_link_error: string | null;
8440
+ floriday_link_status: string;
7253
8441
  id: string;
8442
+ last_floriday_sync_at: string | null;
8443
+ missing_required_fields: string[];
8444
+ source: string;
7254
8445
  updated_at: string;
7255
8446
  user_id: string;
7256
8447
  };
@@ -7258,15 +8449,69 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7258
8449
  connection_id?: string | null;
7259
8450
  created_at?: string;
7260
8451
  data?: import("../integrations/supabase/types").Json;
8452
+ floriday_id?: string | null;
8453
+ floriday_link_error?: string | null;
8454
+ floriday_link_status?: string;
7261
8455
  id?: string;
8456
+ last_floriday_sync_at?: string | null;
8457
+ missing_required_fields?: string[];
8458
+ source?: string;
7262
8459
  updated_at?: string;
7263
8460
  user_id: string;
7264
8461
  };
7265
8462
  Update: {
7266
8463
  connection_id?: string | null;
7267
8464
  created_at?: string;
7268
- data?: import("../integrations/supabase/types").Json;
8465
+ data?: import("../integrations/supabase/types").Json;
8466
+ floriday_id?: string | null;
8467
+ floriday_link_error?: string | null;
8468
+ floriday_link_status?: string;
8469
+ id?: string;
8470
+ last_floriday_sync_at?: string | null;
8471
+ missing_required_fields?: string[];
8472
+ source?: string;
8473
+ updated_at?: string;
8474
+ user_id?: string;
8475
+ };
8476
+ Relationships: [];
8477
+ };
8478
+ trade_item_stock: {
8479
+ Row: {
8480
+ connection_id: string;
8481
+ created_at: string;
8482
+ id: string;
8483
+ incoming_stock: number;
8484
+ minimum_stock: number;
8485
+ notes: string | null;
8486
+ physical_stock: number;
8487
+ reserved_stock: number;
8488
+ trade_item_key: string;
8489
+ updated_at: string;
8490
+ user_id: string;
8491
+ };
8492
+ Insert: {
8493
+ connection_id: string;
8494
+ created_at?: string;
8495
+ id?: string;
8496
+ incoming_stock?: number;
8497
+ minimum_stock?: number;
8498
+ notes?: string | null;
8499
+ physical_stock?: number;
8500
+ reserved_stock?: number;
8501
+ trade_item_key: string;
8502
+ updated_at?: string;
8503
+ user_id: string;
8504
+ };
8505
+ Update: {
8506
+ connection_id?: string;
8507
+ created_at?: string;
7269
8508
  id?: string;
8509
+ incoming_stock?: number;
8510
+ minimum_stock?: number;
8511
+ notes?: string | null;
8512
+ physical_stock?: number;
8513
+ reserved_stock?: number;
8514
+ trade_item_key?: string;
7270
8515
  updated_at?: string;
7271
8516
  user_id?: string;
7272
8517
  };
@@ -7591,6 +8836,10 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7591
8836
  default_invoice_type: string;
7592
8837
  default_payment_term_days: number;
7593
8838
  default_vat_code: string;
8839
+ invoice_enabled_ao: boolean;
8840
+ invoice_enabled_fo: boolean;
8841
+ invoice_enabled_ho: boolean;
8842
+ invoice_enabled_mo: boolean;
7594
8843
  updated_at: string;
7595
8844
  user_id: string;
7596
8845
  };
@@ -7600,6 +8849,10 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7600
8849
  default_invoice_type?: string;
7601
8850
  default_payment_term_days?: number;
7602
8851
  default_vat_code?: string;
8852
+ invoice_enabled_ao?: boolean;
8853
+ invoice_enabled_fo?: boolean;
8854
+ invoice_enabled_ho?: boolean;
8855
+ invoice_enabled_mo?: boolean;
7603
8856
  updated_at?: string;
7604
8857
  user_id: string;
7605
8858
  };
@@ -7609,6 +8862,10 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7609
8862
  default_invoice_type?: string;
7610
8863
  default_payment_term_days?: number;
7611
8864
  default_vat_code?: string;
8865
+ invoice_enabled_ao?: boolean;
8866
+ invoice_enabled_fo?: boolean;
8867
+ invoice_enabled_ho?: boolean;
8868
+ invoice_enabled_mo?: boolean;
7612
8869
  updated_at?: string;
7613
8870
  user_id?: string;
7614
8871
  };
@@ -7616,6 +8873,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7616
8873
  };
7617
8874
  twinfield_invoice_sync_logs: {
7618
8875
  Row: {
8876
+ action_type: string | null;
7619
8877
  created_at: string;
7620
8878
  details: import("../integrations/supabase/types").Json | null;
7621
8879
  duration_ms: number | null;
@@ -7628,6 +8886,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7628
8886
  user_id: string;
7629
8887
  };
7630
8888
  Insert: {
8889
+ action_type?: string | null;
7631
8890
  created_at?: string;
7632
8891
  details?: import("../integrations/supabase/types").Json | null;
7633
8892
  duration_ms?: number | null;
@@ -7640,6 +8899,7 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7640
8899
  user_id: string;
7641
8900
  };
7642
8901
  Update: {
8902
+ action_type?: string | null;
7643
8903
  created_at?: string;
7644
8904
  details?: import("../integrations/supabase/types").Json | null;
7645
8905
  duration_ms?: number | null;
@@ -7875,6 +9135,57 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
7875
9135
  referencedColumns: ["id"];
7876
9136
  }];
7877
9137
  };
9138
+ twinfield_request_metrics: {
9139
+ Row: {
9140
+ bucket_hour: string;
9141
+ connection_id: string;
9142
+ error_count: number;
9143
+ rate_limited_count: number;
9144
+ request_count: number;
9145
+ updated_at: string;
9146
+ };
9147
+ Insert: {
9148
+ bucket_hour: string;
9149
+ connection_id: string;
9150
+ error_count?: number;
9151
+ rate_limited_count?: number;
9152
+ request_count?: number;
9153
+ updated_at?: string;
9154
+ };
9155
+ Update: {
9156
+ bucket_hour?: string;
9157
+ connection_id?: string;
9158
+ error_count?: number;
9159
+ rate_limited_count?: number;
9160
+ request_count?: number;
9161
+ updated_at?: string;
9162
+ };
9163
+ Relationships: [];
9164
+ };
9165
+ twinfield_session_cache: {
9166
+ Row: {
9167
+ cluster: string;
9168
+ created_at: string;
9169
+ expires_at: string;
9170
+ session_id: string;
9171
+ user_id: string;
9172
+ };
9173
+ Insert: {
9174
+ cluster: string;
9175
+ created_at?: string;
9176
+ expires_at: string;
9177
+ session_id: string;
9178
+ user_id: string;
9179
+ };
9180
+ Update: {
9181
+ cluster?: string;
9182
+ created_at?: string;
9183
+ expires_at?: string;
9184
+ session_id?: string;
9185
+ user_id?: string;
9186
+ };
9187
+ Relationships: [];
9188
+ };
7878
9189
  twinfield_settings: {
7879
9190
  Row: {
7880
9191
  active_environment: string;
@@ -8456,6 +9767,73 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8456
9767
  };
8457
9768
  Relationships: [];
8458
9769
  };
9770
+ floriday_customer_discounts: {
9771
+ Row: {
9772
+ base_price: number | null;
9773
+ buyer_organization_id: string | null;
9774
+ currency: string | null;
9775
+ discount_type: string | null;
9776
+ discount_value: number | null;
9777
+ min_quantity: number | null;
9778
+ net_price: number | null;
9779
+ product_group_id: string | null;
9780
+ raw: import("../integrations/supabase/types").Json | null;
9781
+ source: string | null;
9782
+ source_id: string | null;
9783
+ trade_item_id: string | null;
9784
+ valid_from: string | null;
9785
+ valid_until: string | null;
9786
+ };
9787
+ Relationships: [];
9788
+ };
9789
+ local_customer_discounts: {
9790
+ Row: {
9791
+ base_price: number | null;
9792
+ currency: string | null;
9793
+ customer_id: string | null;
9794
+ discount_type: string | null;
9795
+ discount_value: number | null;
9796
+ min_quantity: number | null;
9797
+ net_price: number | null;
9798
+ product_category_id: string | null;
9799
+ product_id: string | null;
9800
+ product_name: string | null;
9801
+ source: string | null;
9802
+ source_id: string | null;
9803
+ valid_from: string | null;
9804
+ valid_until: string | null;
9805
+ };
9806
+ Relationships: [];
9807
+ };
9808
+ manufacture_product_possible_stock_view: {
9809
+ Row: {
9810
+ component_count: number | null;
9811
+ manufacture_product_id: string | null;
9812
+ possible_stock: number | null;
9813
+ };
9814
+ Relationships: [];
9815
+ };
9816
+ product_group_stock_view: {
9817
+ Row: {
9818
+ item_count: number | null;
9819
+ product_group_id: string | null;
9820
+ total_stock: number | null;
9821
+ };
9822
+ Relationships: [{
9823
+ foreignKeyName: "product_group_items_product_group_id_fkey";
9824
+ columns: ["product_group_id"];
9825
+ isOneToOne: false;
9826
+ referencedRelation: "product_groups";
9827
+ referencedColumns: ["id"];
9828
+ }];
9829
+ };
9830
+ trade_item_stock_view: {
9831
+ Row: {
9832
+ stock: number | null;
9833
+ trade_item_id: string | null;
9834
+ };
9835
+ Relationships: [];
9836
+ };
8459
9837
  v_external_customers_exact: {
8460
9838
  Row: {
8461
9839
  account_number: string | null;
@@ -8711,6 +10089,68 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8711
10089
  };
8712
10090
  Returns: number;
8713
10091
  };
10092
+ afh_city_code: {
10093
+ Args: {
10094
+ _city: string;
10095
+ _country: string;
10096
+ };
10097
+ Returns: string;
10098
+ };
10099
+ afh_normalize_country: {
10100
+ Args: {
10101
+ _raw: string;
10102
+ };
10103
+ Returns: string;
10104
+ };
10105
+ afh_normalize_nl_province: {
10106
+ Args: {
10107
+ _raw: string;
10108
+ };
10109
+ Returns: string;
10110
+ };
10111
+ afh_subtract_workdays: {
10112
+ Args: {
10113
+ _date: string;
10114
+ _days: number;
10115
+ };
10116
+ Returns: string;
10117
+ };
10118
+ apply_stock_consumption: {
10119
+ Args: {
10120
+ p_order_id: string;
10121
+ p_order_item_id: string;
10122
+ p_qty: number;
10123
+ p_reason: string;
10124
+ p_source: string;
10125
+ p_trade_item_key: string;
10126
+ };
10127
+ Returns: undefined;
10128
+ };
10129
+ apply_stock_reservation: {
10130
+ Args: {
10131
+ p_order_id: string;
10132
+ p_order_item_id: string;
10133
+ p_qty: number;
10134
+ p_reason: string;
10135
+ p_source: string;
10136
+ p_trade_item_key: string;
10137
+ };
10138
+ Returns: undefined;
10139
+ };
10140
+ assign_cart_numbers: {
10141
+ Args: {
10142
+ p_carts: import("../integrations/supabase/types").Json;
10143
+ };
10144
+ Returns: {
10145
+ cart_index: number;
10146
+ cart_number: string;
10147
+ day_seq: number;
10148
+ order_id: string;
10149
+ order_source: string;
10150
+ pick_date: string;
10151
+ status: string;
10152
+ }[];
10153
+ };
8714
10154
  assign_floriday_order_numbers: {
8715
10155
  Args: {
8716
10156
  p_ids: string[];
@@ -8720,20 +10160,81 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8720
10160
  order_number: string;
8721
10161
  }[];
8722
10162
  };
10163
+ autolink_product_to_floriday: {
10164
+ Args: {
10165
+ p_product_id: string;
10166
+ };
10167
+ Returns: string;
10168
+ };
10169
+ backfill_open_order_reservations: {
10170
+ Args: never;
10171
+ Returns: {
10172
+ processed_items: number;
10173
+ }[];
10174
+ };
8723
10175
  call_exact_route: {
8724
10176
  Args: {
8725
10177
  path: string;
8726
10178
  };
8727
10179
  Returns: number;
8728
10180
  };
10181
+ check_offer_product_available_stock: {
10182
+ Args: {
10183
+ p_campaign_product_id: string;
10184
+ p_code: string;
10185
+ p_needed_qty?: number;
10186
+ p_product_name?: string;
10187
+ };
10188
+ Returns: import("../integrations/supabase/types").Json;
10189
+ };
10190
+ check_trade_item_available_stock: {
10191
+ Args: {
10192
+ p_connection_id?: string;
10193
+ p_context?: string;
10194
+ p_needed_qty?: number;
10195
+ p_order_id?: string;
10196
+ p_order_item_id?: string;
10197
+ p_owner_id?: string;
10198
+ p_product_name?: string;
10199
+ p_trade_item_key: string;
10200
+ };
10201
+ Returns: import("../integrations/supabase/types").Json;
10202
+ };
8729
10203
  cleanup_old_bookings: {
8730
10204
  Args: never;
8731
10205
  Returns: number;
8732
10206
  };
10207
+ control_get_todays_carts: {
10208
+ Args: never;
10209
+ Returns: {
10210
+ cart_index: number;
10211
+ cart_number: string;
10212
+ cart_number_id: string;
10213
+ order_id: string;
10214
+ order_source: string;
10215
+ pick_date: string;
10216
+ status: string;
10217
+ }[];
10218
+ };
10219
+ count_distinct_regulatory_products: {
10220
+ Args: never;
10221
+ Returns: number;
10222
+ };
8733
10223
  current_monteur_id: {
8734
10224
  Args: never;
8735
10225
  Returns: string;
8736
10226
  };
10227
+ dashboard_alert_counts: {
10228
+ Args: never;
10229
+ Returns: import("../integrations/supabase/types").Json;
10230
+ };
10231
+ dashboard_alert_rows: {
10232
+ Args: {
10233
+ check_id: string;
10234
+ row_limit?: number;
10235
+ };
10236
+ Returns: import("../integrations/supabase/types").Json;
10237
+ };
8737
10238
  dashboard_list_public_schema: {
8738
10239
  Args: never;
8739
10240
  Returns: {
@@ -8742,6 +10243,12 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8742
10243
  table_name: string;
8743
10244
  }[];
8744
10245
  };
10246
+ dispatch_carrier_signups_sql: {
10247
+ Args: {
10248
+ _catchup?: string;
10249
+ };
10250
+ Returns: import("../integrations/supabase/types").Json;
10251
+ };
8745
10252
  email_auth_decrypt: {
8746
10253
  Args: {
8747
10254
  cipher: string;
@@ -8777,6 +10284,12 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8777
10284
  status: string;
8778
10285
  }[];
8779
10286
  };
10287
+ ensure_trade_item_stock_row: {
10288
+ Args: {
10289
+ p_key: string;
10290
+ };
10291
+ Returns: undefined;
10292
+ };
8780
10293
  ensure_user_tenant: {
8781
10294
  Args: never;
8782
10295
  Returns: string;
@@ -8814,6 +10327,38 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8814
10327
  };
8815
10328
  Returns: boolean;
8816
10329
  };
10330
+ find_trade_item_key: {
10331
+ Args: {
10332
+ p_barcode: string;
10333
+ p_name: string;
10334
+ p_product_id: string;
10335
+ };
10336
+ Returns: string;
10337
+ };
10338
+ floriday_effective_price: {
10339
+ Args: {
10340
+ _buyer_id: string;
10341
+ _on_date?: string;
10342
+ _quantity?: number;
10343
+ _trade_item_id: string;
10344
+ };
10345
+ Returns: {
10346
+ base_price: number;
10347
+ currency: string;
10348
+ discount_type: string;
10349
+ discount_value: number;
10350
+ net_price: number;
10351
+ source: string;
10352
+ source_id: string;
10353
+ }[];
10354
+ };
10355
+ format_cart_number: {
10356
+ Args: {
10357
+ p_pick_date: string;
10358
+ p_seq: number;
10359
+ };
10360
+ Returns: string;
10361
+ };
8817
10362
  get_active_floriday_connection_public: {
8818
10363
  Args: never;
8819
10364
  Returns: {
@@ -8827,6 +10372,13 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8827
10372
  preferred_warehouse_name: string;
8828
10373
  }[];
8829
10374
  };
10375
+ get_active_floriday_context: {
10376
+ Args: never;
10377
+ Returns: {
10378
+ connection_id: string;
10379
+ user_id: string;
10380
+ }[];
10381
+ };
8830
10382
  get_active_twinfield_public: {
8831
10383
  Args: never;
8832
10384
  Returns: {
@@ -8838,6 +10390,13 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8838
10390
  office_code: string;
8839
10391
  }[];
8840
10392
  };
10393
+ get_floricode_record_counts: {
10394
+ Args: never;
10395
+ Returns: {
10396
+ count: number;
10397
+ resource: string;
10398
+ }[];
10399
+ };
8841
10400
  get_floriday_agreements_active: {
8842
10401
  Args: {
8843
10402
  p_on_date?: string;
@@ -8929,6 +10488,24 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8929
10488
  };
8930
10489
  Returns: import("../integrations/supabase/types").Json;
8931
10490
  };
10491
+ get_offer_delivery_options: {
10492
+ Args: {
10493
+ p_code: string;
10494
+ };
10495
+ Returns: import("../integrations/supabase/types").Json;
10496
+ };
10497
+ get_offer_recipient_by_code: {
10498
+ Args: {
10499
+ p_code: string;
10500
+ };
10501
+ Returns: {
10502
+ campaign_id: string;
10503
+ clicked_at: string;
10504
+ customer_id: string;
10505
+ id: string;
10506
+ ordered_at: string;
10507
+ }[];
10508
+ };
8932
10509
  get_or_assign_floriday_order_number: {
8933
10510
  Args: {
8934
10511
  p_floriday_id: string;
@@ -8981,12 +10558,53 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8981
10558
  Args: never;
8982
10559
  Returns: boolean;
8983
10560
  };
10561
+ is_superadmin: {
10562
+ Args: {
10563
+ _user_id: string;
10564
+ };
10565
+ Returns: boolean;
10566
+ };
10567
+ local_effective_price: {
10568
+ Args: {
10569
+ _customer_id: string;
10570
+ _on_date?: string;
10571
+ _product_id: string;
10572
+ _quantity?: number;
10573
+ };
10574
+ Returns: {
10575
+ currency: string;
10576
+ discount_type: string;
10577
+ discount_value: number;
10578
+ net_price: number;
10579
+ source: string;
10580
+ source_id: string;
10581
+ }[];
10582
+ };
10583
+ mark_offer_clicked: {
10584
+ Args: {
10585
+ p_code: string;
10586
+ };
10587
+ Returns: undefined;
10588
+ };
10589
+ mark_offer_ordered: {
10590
+ Args: {
10591
+ p_code: string;
10592
+ };
10593
+ Returns: undefined;
10594
+ };
8984
10595
  next_order_number: {
8985
10596
  Args: {
8986
10597
  p_prefix: string;
8987
10598
  };
8988
10599
  Returns: string;
8989
10600
  };
10601
+ next_order_number_for_date: {
10602
+ Args: {
10603
+ p_created_at?: string;
10604
+ p_prefix: string;
10605
+ };
10606
+ Returns: string;
10607
+ };
8990
10608
  next_work_order_number: {
8991
10609
  Args: {
8992
10610
  p_parent_work_order_id?: string;
@@ -8994,16 +10612,41 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
8994
10612
  };
8995
10613
  Returns: string;
8996
10614
  };
10615
+ normalize_order_source: {
10616
+ Args: {
10617
+ p_src: string;
10618
+ };
10619
+ Returns: string;
10620
+ };
8997
10621
  normalize_vat: {
8998
10622
  Args: {
8999
10623
  v: string;
9000
10624
  };
9001
10625
  Returns: string;
9002
10626
  };
10627
+ offer_recipient_matches: {
10628
+ Args: {
10629
+ _campaign_id: string;
10630
+ _customer_id: string;
10631
+ _recipient_id: string;
10632
+ };
10633
+ Returns: boolean;
10634
+ };
10635
+ order_number_prefix: {
10636
+ Args: {
10637
+ p_custom_fields?: import("../integrations/supabase/types").Json;
10638
+ p_order_source: string;
10639
+ };
10640
+ Returns: string;
10641
+ };
9003
10642
  pickstation_get_orders_raw: {
9004
10643
  Args: never;
9005
10644
  Returns: import("../integrations/supabase/types").Json;
9006
10645
  };
10646
+ pickstation_get_planning_context: {
10647
+ Args: never;
10648
+ Returns: import("../integrations/supabase/types").Json;
10649
+ };
9007
10650
  pickstation_get_settings: {
9008
10651
  Args: never;
9009
10652
  Returns: import("../integrations/supabase/types").Json;
@@ -9018,6 +10661,26 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
9018
10661
  };
9019
10662
  Returns: undefined;
9020
10663
  };
10664
+ pickstation_set_cart_status: {
10665
+ Args: {
10666
+ p_cart_index: number;
10667
+ p_order_id: string;
10668
+ p_order_source: string;
10669
+ p_status: string;
10670
+ };
10671
+ Returns: undefined;
10672
+ };
10673
+ promote_trade_item_key: {
10674
+ Args: {
10675
+ p_new: string;
10676
+ p_old: string;
10677
+ };
10678
+ Returns: undefined;
10679
+ };
10680
+ refresh_external_customers_grouped: {
10681
+ Args: never;
10682
+ Returns: undefined;
10683
+ };
9021
10684
  refresh_floricode_derived_code_lists: {
9022
10685
  Args: never;
9023
10686
  Returns: {
@@ -9026,6 +10689,18 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
9026
10689
  row_count: number;
9027
10690
  }[];
9028
10691
  };
10692
+ refresh_floricode_derived_for_product: {
10693
+ Args: {
10694
+ p_product_code: string;
10695
+ };
10696
+ Returns: number;
10697
+ };
10698
+ refresh_floricode_derived_for_products: {
10699
+ Args: {
10700
+ _product_ids: string[];
10701
+ };
10702
+ Returns: number;
10703
+ };
9029
10704
  reset_floriday_sync_cursor: {
9030
10705
  Args: {
9031
10706
  p_connection_id: string;
@@ -9033,6 +10708,12 @@ export declare const getCustomerAnalytics: import("@tanstack/start-client-core")
9033
10708
  };
9034
10709
  Returns: undefined;
9035
10710
  };
10711
+ resolve_product_id_for_item: {
10712
+ Args: {
10713
+ p_product_name: string;
10714
+ };
10715
+ Returns: string;
10716
+ };
9036
10717
  schedule_floriday_additional_services_sync: {
9037
10718
  Args: {
9038
10719
  p_apikey: string;