@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
@@ -10,10 +10,12 @@ export type Database = {
10
10
  afhandeling_settings: {
11
11
  Row: {
12
12
  created_at: string;
13
+ extra_pick_days_with_stickers: number;
13
14
  id: string;
14
15
  max_workdays_earlier_pick: number;
15
16
  pick_days_before_transport: number;
16
17
  pick_distribution_enabled: boolean;
18
+ pick_weekdays: number[];
17
19
  signup_mail_enabled: boolean;
18
20
  signup_mail_lead_minutes: number;
19
21
  signup_mail_purpose: string;
@@ -23,10 +25,12 @@ export type Database = {
23
25
  };
24
26
  Insert: {
25
27
  created_at?: string;
28
+ extra_pick_days_with_stickers?: number;
26
29
  id?: string;
27
30
  max_workdays_earlier_pick?: number;
28
31
  pick_days_before_transport?: number;
29
32
  pick_distribution_enabled?: boolean;
33
+ pick_weekdays?: number[];
30
34
  signup_mail_enabled?: boolean;
31
35
  signup_mail_lead_minutes?: number;
32
36
  signup_mail_purpose?: string;
@@ -36,10 +40,12 @@ export type Database = {
36
40
  };
37
41
  Update: {
38
42
  created_at?: string;
43
+ extra_pick_days_with_stickers?: number;
39
44
  id?: string;
40
45
  max_workdays_earlier_pick?: number;
41
46
  pick_days_before_transport?: number;
42
47
  pick_distribution_enabled?: boolean;
48
+ pick_weekdays?: number[];
43
49
  signup_mail_enabled?: boolean;
44
50
  signup_mail_lead_minutes?: number;
45
51
  signup_mail_purpose?: string;
@@ -458,6 +464,48 @@ export type Database = {
458
464
  }
459
465
  ];
460
466
  };
467
+ carrier_signup_dispatch_runs: {
468
+ Row: {
469
+ detail: Json | null;
470
+ error: string | null;
471
+ finished_at: string | null;
472
+ groups: number;
473
+ id: string;
474
+ ok: boolean;
475
+ reason: string | null;
476
+ sent: number;
477
+ skipped: Json;
478
+ started_at: string;
479
+ unassigned: Json;
480
+ };
481
+ Insert: {
482
+ detail?: Json | null;
483
+ error?: string | null;
484
+ finished_at?: string | null;
485
+ groups?: number;
486
+ id?: string;
487
+ ok?: boolean;
488
+ reason?: string | null;
489
+ sent?: number;
490
+ skipped?: Json;
491
+ started_at?: string;
492
+ unassigned?: Json;
493
+ };
494
+ Update: {
495
+ detail?: Json | null;
496
+ error?: string | null;
497
+ finished_at?: string | null;
498
+ groups?: number;
499
+ id?: string;
500
+ ok?: boolean;
501
+ reason?: string | null;
502
+ sent?: number;
503
+ skipped?: Json;
504
+ started_at?: string;
505
+ unassigned?: Json;
506
+ };
507
+ Relationships: [];
508
+ };
461
509
  carrier_signup_dispatches: {
462
510
  Row: {
463
511
  carrier_id: string;
@@ -511,6 +559,7 @@ export type Database = {
511
559
  contact_person: string | null;
512
560
  created_at: string;
513
561
  delivery_days: number | null;
562
+ delivery_weekdays: number[];
514
563
  email: string | null;
515
564
  id: string;
516
565
  is_default: boolean;
@@ -518,6 +567,7 @@ export type Database = {
518
567
  notes: string | null;
519
568
  phone: string | null;
520
569
  pickup_moments: Json;
570
+ pickup_weekdays: number[];
521
571
  service_cities: string[];
522
572
  service_countries: string[];
523
573
  service_provinces: string[];
@@ -533,6 +583,7 @@ export type Database = {
533
583
  contact_person?: string | null;
534
584
  created_at?: string;
535
585
  delivery_days?: number | null;
586
+ delivery_weekdays?: number[];
536
587
  email?: string | null;
537
588
  id?: string;
538
589
  is_default?: boolean;
@@ -540,6 +591,7 @@ export type Database = {
540
591
  notes?: string | null;
541
592
  phone?: string | null;
542
593
  pickup_moments?: Json;
594
+ pickup_weekdays?: number[];
543
595
  service_cities?: string[];
544
596
  service_countries?: string[];
545
597
  service_provinces?: string[];
@@ -555,6 +607,7 @@ export type Database = {
555
607
  contact_person?: string | null;
556
608
  created_at?: string;
557
609
  delivery_days?: number | null;
610
+ delivery_weekdays?: number[];
558
611
  email?: string | null;
559
612
  id?: string;
560
613
  is_default?: boolean;
@@ -562,6 +615,7 @@ export type Database = {
562
615
  notes?: string | null;
563
616
  phone?: string | null;
564
617
  pickup_moments?: Json;
618
+ pickup_weekdays?: number[];
565
619
  service_cities?: string[];
566
620
  service_countries?: string[];
567
621
  service_provinces?: string[];
@@ -574,6 +628,182 @@ export type Database = {
574
628
  };
575
629
  Relationships: [];
576
630
  };
631
+ cart_control_draft: {
632
+ Row: {
633
+ cart_states: Json;
634
+ checked_keys: Json;
635
+ draft_date: string;
636
+ form_state: Json;
637
+ notes: string;
638
+ updated_at: string;
639
+ user_id: string;
640
+ };
641
+ Insert: {
642
+ cart_states?: Json;
643
+ checked_keys?: Json;
644
+ draft_date: string;
645
+ form_state?: Json;
646
+ notes?: string;
647
+ updated_at?: string;
648
+ user_id: string;
649
+ };
650
+ Update: {
651
+ cart_states?: Json;
652
+ checked_keys?: Json;
653
+ draft_date?: string;
654
+ form_state?: Json;
655
+ notes?: string;
656
+ updated_at?: string;
657
+ user_id?: string;
658
+ };
659
+ Relationships: [];
660
+ };
661
+ cart_control_items: {
662
+ Row: {
663
+ action: string;
664
+ block_reason: string | null;
665
+ carrier_name: string | null;
666
+ cart_index: number;
667
+ cart_number_id: string | null;
668
+ cart_number_label: string | null;
669
+ created_at: string;
670
+ customer_name: string | null;
671
+ delivery_date: string | null;
672
+ id: string;
673
+ new_pick_date: string | null;
674
+ order_id: string;
675
+ order_number: string | null;
676
+ order_source: string;
677
+ pickup_date: string | null;
678
+ session_id: string;
679
+ };
680
+ Insert: {
681
+ action: string;
682
+ block_reason?: string | null;
683
+ carrier_name?: string | null;
684
+ cart_index: number;
685
+ cart_number_id?: string | null;
686
+ cart_number_label?: string | null;
687
+ created_at?: string;
688
+ customer_name?: string | null;
689
+ delivery_date?: string | null;
690
+ id?: string;
691
+ new_pick_date?: string | null;
692
+ order_id: string;
693
+ order_number?: string | null;
694
+ order_source: string;
695
+ pickup_date?: string | null;
696
+ session_id: string;
697
+ };
698
+ Update: {
699
+ action?: string;
700
+ block_reason?: string | null;
701
+ carrier_name?: string | null;
702
+ cart_index?: number;
703
+ cart_number_id?: string | null;
704
+ cart_number_label?: string | null;
705
+ created_at?: string;
706
+ customer_name?: string | null;
707
+ delivery_date?: string | null;
708
+ id?: string;
709
+ new_pick_date?: string | null;
710
+ order_id?: string;
711
+ order_number?: string | null;
712
+ order_source?: string;
713
+ pickup_date?: string | null;
714
+ session_id?: string;
715
+ };
716
+ Relationships: [
717
+ {
718
+ foreignKeyName: "cart_control_items_session_id_fkey";
719
+ columns: ["session_id"];
720
+ isOneToOne: false;
721
+ referencedRelation: "cart_control_sessions";
722
+ referencedColumns: ["id"];
723
+ }
724
+ ];
725
+ };
726
+ cart_control_sessions: {
727
+ Row: {
728
+ blocked_count: number;
729
+ checked_count: number;
730
+ control_date: string;
731
+ created_at: string;
732
+ id: string;
733
+ notes: string | null;
734
+ performed_at: string;
735
+ rescheduled_count: number;
736
+ stock_consumed_at: string | null;
737
+ total_carts: number;
738
+ updated_at: string;
739
+ user_id: string;
740
+ };
741
+ Insert: {
742
+ blocked_count?: number;
743
+ checked_count?: number;
744
+ control_date?: string;
745
+ created_at?: string;
746
+ id?: string;
747
+ notes?: string | null;
748
+ performed_at?: string;
749
+ rescheduled_count?: number;
750
+ stock_consumed_at?: string | null;
751
+ total_carts?: number;
752
+ updated_at?: string;
753
+ user_id: string;
754
+ };
755
+ Update: {
756
+ blocked_count?: number;
757
+ checked_count?: number;
758
+ control_date?: string;
759
+ created_at?: string;
760
+ id?: string;
761
+ notes?: string | null;
762
+ performed_at?: string;
763
+ rescheduled_count?: number;
764
+ stock_consumed_at?: string | null;
765
+ total_carts?: number;
766
+ updated_at?: string;
767
+ user_id?: string;
768
+ };
769
+ Relationships: [];
770
+ };
771
+ cart_numbers: {
772
+ Row: {
773
+ assigned_at: string;
774
+ cart_index: number;
775
+ cart_number: string;
776
+ day_seq: number;
777
+ id: string;
778
+ order_id: string;
779
+ order_source: string;
780
+ pick_date: string;
781
+ status: string;
782
+ };
783
+ Insert: {
784
+ assigned_at?: string;
785
+ cart_index: number;
786
+ cart_number: string;
787
+ day_seq: number;
788
+ id?: string;
789
+ order_id: string;
790
+ order_source: string;
791
+ pick_date: string;
792
+ status?: string;
793
+ };
794
+ Update: {
795
+ assigned_at?: string;
796
+ cart_index?: number;
797
+ cart_number?: string;
798
+ day_seq?: number;
799
+ id?: string;
800
+ order_id?: string;
801
+ order_source?: string;
802
+ pick_date?: string;
803
+ status?: string;
804
+ };
805
+ Relationships: [];
806
+ };
577
807
  cart_pick_overrides: {
578
808
  Row: {
579
809
  cart_index: number;
@@ -613,6 +843,38 @@ export type Database = {
613
843
  };
614
844
  Relationships: [];
615
845
  };
846
+ cart_replan_queue: {
847
+ Row: {
848
+ attempts: number;
849
+ last_error: string | null;
850
+ order_id: string;
851
+ processed_at: string | null;
852
+ requested_at: string;
853
+ };
854
+ Insert: {
855
+ attempts?: number;
856
+ last_error?: string | null;
857
+ order_id: string;
858
+ processed_at?: string | null;
859
+ requested_at?: string;
860
+ };
861
+ Update: {
862
+ attempts?: number;
863
+ last_error?: string | null;
864
+ order_id?: string;
865
+ processed_at?: string | null;
866
+ requested_at?: string;
867
+ };
868
+ Relationships: [
869
+ {
870
+ foreignKeyName: "cart_replan_queue_order_id_fkey";
871
+ columns: ["order_id"];
872
+ isOneToOne: true;
873
+ referencedRelation: "orders";
874
+ referencedColumns: ["id"];
875
+ }
876
+ ];
877
+ };
616
878
  collections: {
617
879
  Row: {
618
880
  created_at: string;
@@ -1266,6 +1528,54 @@ export type Database = {
1266
1528
  }
1267
1529
  ];
1268
1530
  };
1531
+ dashboard_critical_alerts: {
1532
+ Row: {
1533
+ alert_key: string;
1534
+ alert_type: string;
1535
+ created_at: string;
1536
+ description: string | null;
1537
+ id: string;
1538
+ metadata: Json | null;
1539
+ priority: string;
1540
+ raised_at: string;
1541
+ related_cart_ids: string[] | null;
1542
+ resolved_at: string | null;
1543
+ title: string;
1544
+ updated_at: string;
1545
+ user_id: string;
1546
+ };
1547
+ Insert: {
1548
+ alert_key: string;
1549
+ alert_type: string;
1550
+ created_at?: string;
1551
+ description?: string | null;
1552
+ id?: string;
1553
+ metadata?: Json | null;
1554
+ priority?: string;
1555
+ raised_at?: string;
1556
+ related_cart_ids?: string[] | null;
1557
+ resolved_at?: string | null;
1558
+ title: string;
1559
+ updated_at?: string;
1560
+ user_id: string;
1561
+ };
1562
+ Update: {
1563
+ alert_key?: string;
1564
+ alert_type?: string;
1565
+ created_at?: string;
1566
+ description?: string | null;
1567
+ id?: string;
1568
+ metadata?: Json | null;
1569
+ priority?: string;
1570
+ raised_at?: string;
1571
+ related_cart_ids?: string[] | null;
1572
+ resolved_at?: string | null;
1573
+ title?: string;
1574
+ updated_at?: string;
1575
+ user_id?: string;
1576
+ };
1577
+ Relationships: [];
1578
+ };
1269
1579
  dashboard_daily_reports: {
1270
1580
  Row: {
1271
1581
  created_at: string;
@@ -2746,34 +3056,52 @@ export type Database = {
2746
3056
  Row: {
2747
3057
  catalog_key: string | null;
2748
3058
  catalog_url: string;
3059
+ client_id: string | null;
3060
+ client_secret_ciphertext: string | null;
3061
+ client_secret_last4: string | null;
2749
3062
  created_at: string;
2750
3063
  id: number;
2751
3064
  last_meta: Json | null;
2752
3065
  last_test_at: string | null;
2753
3066
  last_test_error: string | null;
2754
3067
  last_test_ok: boolean | null;
3068
+ last_token_test_at: string | null;
3069
+ last_token_test_error: string | null;
3070
+ last_token_test_ok: boolean | null;
2755
3071
  updated_at: string;
2756
3072
  };
2757
3073
  Insert: {
2758
3074
  catalog_key?: string | null;
2759
3075
  catalog_url?: string;
3076
+ client_id?: string | null;
3077
+ client_secret_ciphertext?: string | null;
3078
+ client_secret_last4?: string | null;
2760
3079
  created_at?: string;
2761
3080
  id?: number;
2762
3081
  last_meta?: Json | null;
2763
3082
  last_test_at?: string | null;
2764
3083
  last_test_error?: string | null;
2765
3084
  last_test_ok?: boolean | null;
3085
+ last_token_test_at?: string | null;
3086
+ last_token_test_error?: string | null;
3087
+ last_token_test_ok?: boolean | null;
2766
3088
  updated_at?: string;
2767
3089
  };
2768
3090
  Update: {
2769
3091
  catalog_key?: string | null;
2770
3092
  catalog_url?: string;
3093
+ client_id?: string | null;
3094
+ client_secret_ciphertext?: string | null;
3095
+ client_secret_last4?: string | null;
2771
3096
  created_at?: string;
2772
3097
  id?: number;
2773
3098
  last_meta?: Json | null;
2774
3099
  last_test_at?: string | null;
2775
3100
  last_test_error?: string | null;
2776
3101
  last_test_ok?: boolean | null;
3102
+ last_token_test_at?: string | null;
3103
+ last_token_test_error?: string | null;
3104
+ last_token_test_ok?: boolean | null;
2777
3105
  updated_at?: string;
2778
3106
  };
2779
3107
  Relationships: [];
@@ -2804,6 +3132,7 @@ export type Database = {
2804
3132
  };
2805
3133
  floricode_sync_state: {
2806
3134
  Row: {
3135
+ cursor_skip: number;
2807
3136
  error_message: string | null;
2808
3137
  last_change_date_time: string | null;
2809
3138
  last_sequence_number: number;
@@ -2813,6 +3142,7 @@ export type Database = {
2813
3142
  updated_at: string;
2814
3143
  };
2815
3144
  Insert: {
3145
+ cursor_skip?: number;
2816
3146
  error_message?: string | null;
2817
3147
  last_change_date_time?: string | null;
2818
3148
  last_sequence_number?: number;
@@ -2822,6 +3152,7 @@ export type Database = {
2822
3152
  updated_at?: string;
2823
3153
  };
2824
3154
  Update: {
3155
+ cursor_skip?: number;
2825
3156
  error_message?: string | null;
2826
3157
  last_change_date_time?: string | null;
2827
3158
  last_sequence_number?: number;
@@ -3441,6 +3772,51 @@ export type Database = {
3441
3772
  }
3442
3773
  ];
3443
3774
  };
3775
+ floriday_continuous_stock_queue: {
3776
+ Row: {
3777
+ attempts: number;
3778
+ connection_id: string;
3779
+ created_at: string;
3780
+ gateway_attempt_id: string | null;
3781
+ id: string;
3782
+ last_error: string | null;
3783
+ number_of_pieces: number;
3784
+ sent_at: string | null;
3785
+ status: string;
3786
+ trade_item_id: string;
3787
+ updated_at: string;
3788
+ user_id: string;
3789
+ };
3790
+ Insert: {
3791
+ attempts?: number;
3792
+ connection_id: string;
3793
+ created_at?: string;
3794
+ gateway_attempt_id?: string | null;
3795
+ id?: string;
3796
+ last_error?: string | null;
3797
+ number_of_pieces?: number;
3798
+ sent_at?: string | null;
3799
+ status?: string;
3800
+ trade_item_id: string;
3801
+ updated_at?: string;
3802
+ user_id: string;
3803
+ };
3804
+ Update: {
3805
+ attempts?: number;
3806
+ connection_id?: string;
3807
+ created_at?: string;
3808
+ gateway_attempt_id?: string | null;
3809
+ id?: string;
3810
+ last_error?: string | null;
3811
+ number_of_pieces?: number;
3812
+ sent_at?: string | null;
3813
+ status?: string;
3814
+ trade_item_id?: string;
3815
+ updated_at?: string;
3816
+ user_id?: string;
3817
+ };
3818
+ Relationships: [];
3819
+ };
3444
3820
  floriday_contract_trade_item_groups_cache: {
3445
3821
  Row: {
3446
3822
  connection_id: string;
@@ -4553,47 +4929,103 @@ export type Database = {
4553
4929
  }
4554
4930
  ];
4555
4931
  };
4556
- imap_accounts: {
4932
+ flow_role_assignments: {
4557
4933
  Row: {
4558
4934
  created_at: string;
4559
- email: string | null;
4560
- host: string;
4561
4935
  id: string;
4562
- is_active: boolean;
4563
- last_test_error: string | null;
4564
- last_test_ok: boolean | null;
4565
- last_tested_at: string | null;
4566
- name: string;
4567
- password: string | null;
4568
- password_secret_name: string | null;
4569
- port: number;
4570
- updated_at: string;
4571
- use_tls: boolean;
4572
- username: string;
4936
+ role_id: string;
4937
+ user_id: string;
4573
4938
  };
4574
4939
  Insert: {
4575
4940
  created_at?: string;
4576
- email?: string | null;
4577
- host: string;
4578
4941
  id?: string;
4579
- is_active?: boolean;
4580
- last_test_error?: string | null;
4581
- last_test_ok?: boolean | null;
4582
- last_tested_at?: string | null;
4583
- name: string;
4584
- password?: string | null;
4585
- password_secret_name?: string | null;
4586
- port?: number;
4587
- updated_at?: string;
4588
- use_tls?: boolean;
4589
- username: string;
4942
+ role_id: string;
4943
+ user_id: string;
4590
4944
  };
4591
4945
  Update: {
4592
4946
  created_at?: string;
4593
- email?: string | null;
4594
- host?: string;
4595
4947
  id?: string;
4596
- is_active?: boolean;
4948
+ role_id?: string;
4949
+ user_id?: string;
4950
+ };
4951
+ Relationships: [
4952
+ {
4953
+ foreignKeyName: "flow_role_assignments_role_id_fkey";
4954
+ columns: ["role_id"];
4955
+ isOneToOne: false;
4956
+ referencedRelation: "flow_roles";
4957
+ referencedColumns: ["id"];
4958
+ }
4959
+ ];
4960
+ };
4961
+ flow_roles: {
4962
+ Row: {
4963
+ created_at: string;
4964
+ description: string | null;
4965
+ id: string;
4966
+ module_access: string[];
4967
+ name: string;
4968
+ updated_at: string;
4969
+ };
4970
+ Insert: {
4971
+ created_at?: string;
4972
+ description?: string | null;
4973
+ id?: string;
4974
+ module_access?: string[];
4975
+ name: string;
4976
+ updated_at?: string;
4977
+ };
4978
+ Update: {
4979
+ created_at?: string;
4980
+ description?: string | null;
4981
+ id?: string;
4982
+ module_access?: string[];
4983
+ name?: string;
4984
+ updated_at?: string;
4985
+ };
4986
+ Relationships: [];
4987
+ };
4988
+ imap_accounts: {
4989
+ Row: {
4990
+ created_at: string;
4991
+ email: string | null;
4992
+ host: string;
4993
+ id: string;
4994
+ is_active: boolean;
4995
+ last_test_error: string | null;
4996
+ last_test_ok: boolean | null;
4997
+ last_tested_at: string | null;
4998
+ name: string;
4999
+ password: string | null;
5000
+ password_secret_name: string | null;
5001
+ port: number;
5002
+ updated_at: string;
5003
+ use_tls: boolean;
5004
+ username: string;
5005
+ };
5006
+ Insert: {
5007
+ created_at?: string;
5008
+ email?: string | null;
5009
+ host: string;
5010
+ id?: string;
5011
+ is_active?: boolean;
5012
+ last_test_error?: string | null;
5013
+ last_test_ok?: boolean | null;
5014
+ last_tested_at?: string | null;
5015
+ name: string;
5016
+ password?: string | null;
5017
+ password_secret_name?: string | null;
5018
+ port?: number;
5019
+ updated_at?: string;
5020
+ use_tls?: boolean;
5021
+ username: string;
5022
+ };
5023
+ Update: {
5024
+ created_at?: string;
5025
+ email?: string | null;
5026
+ host?: string;
5027
+ id?: string;
5028
+ is_active?: boolean;
4597
5029
  last_test_error?: string | null;
4598
5030
  last_test_ok?: boolean | null;
4599
5031
  last_tested_at?: string | null;
@@ -4884,6 +5316,216 @@ export type Database = {
4884
5316
  };
4885
5317
  Relationships: [];
4886
5318
  };
5319
+ local_customer_agreements: {
5320
+ Row: {
5321
+ base_price: number | null;
5322
+ created_at: string;
5323
+ currency: string;
5324
+ customer_id: string;
5325
+ id: string;
5326
+ min_quantity: number;
5327
+ net_price: number;
5328
+ notes: string | null;
5329
+ product_category_id: string | null;
5330
+ product_id: string | null;
5331
+ updated_at: string;
5332
+ valid_from: string | null;
5333
+ valid_until: string | null;
5334
+ };
5335
+ Insert: {
5336
+ base_price?: number | null;
5337
+ created_at?: string;
5338
+ currency?: string;
5339
+ customer_id: string;
5340
+ id?: string;
5341
+ min_quantity?: number;
5342
+ net_price: number;
5343
+ notes?: string | null;
5344
+ product_category_id?: string | null;
5345
+ product_id?: string | null;
5346
+ updated_at?: string;
5347
+ valid_from?: string | null;
5348
+ valid_until?: string | null;
5349
+ };
5350
+ Update: {
5351
+ base_price?: number | null;
5352
+ created_at?: string;
5353
+ currency?: string;
5354
+ customer_id?: string;
5355
+ id?: string;
5356
+ min_quantity?: number;
5357
+ net_price?: 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
+ Relationships: [
5366
+ {
5367
+ foreignKeyName: "local_customer_agreements_customer_id_fkey";
5368
+ columns: ["customer_id"];
5369
+ isOneToOne: false;
5370
+ referencedRelation: "customers";
5371
+ referencedColumns: ["id"];
5372
+ },
5373
+ {
5374
+ foreignKeyName: "local_customer_agreements_product_category_id_fkey";
5375
+ columns: ["product_category_id"];
5376
+ isOneToOne: false;
5377
+ referencedRelation: "product_categories";
5378
+ referencedColumns: ["id"];
5379
+ },
5380
+ {
5381
+ foreignKeyName: "local_customer_agreements_product_id_fkey";
5382
+ columns: ["product_id"];
5383
+ isOneToOne: false;
5384
+ referencedRelation: "products";
5385
+ referencedColumns: ["id"];
5386
+ }
5387
+ ];
5388
+ };
5389
+ local_customer_price_groups: {
5390
+ Row: {
5391
+ created_at: string;
5392
+ currency: string;
5393
+ customer_id: string;
5394
+ discount_type: string;
5395
+ discount_value: number;
5396
+ id: string;
5397
+ min_quantity: number;
5398
+ notes: string | null;
5399
+ product_category_id: string | null;
5400
+ product_id: string | null;
5401
+ updated_at: string;
5402
+ valid_from: string | null;
5403
+ valid_until: string | null;
5404
+ };
5405
+ Insert: {
5406
+ created_at?: string;
5407
+ currency?: string;
5408
+ customer_id: string;
5409
+ discount_type: string;
5410
+ discount_value: number;
5411
+ id?: string;
5412
+ min_quantity?: number;
5413
+ notes?: string | null;
5414
+ product_category_id?: string | null;
5415
+ product_id?: string | null;
5416
+ updated_at?: string;
5417
+ valid_from?: string | null;
5418
+ valid_until?: string | null;
5419
+ };
5420
+ Update: {
5421
+ created_at?: string;
5422
+ currency?: string;
5423
+ customer_id?: string;
5424
+ discount_type?: string;
5425
+ discount_value?: number;
5426
+ id?: string;
5427
+ min_quantity?: number;
5428
+ notes?: string | null;
5429
+ product_category_id?: string | null;
5430
+ product_id?: string | null;
5431
+ updated_at?: string;
5432
+ valid_from?: string | null;
5433
+ valid_until?: string | null;
5434
+ };
5435
+ Relationships: [
5436
+ {
5437
+ foreignKeyName: "local_customer_price_groups_customer_id_fkey";
5438
+ columns: ["customer_id"];
5439
+ isOneToOne: false;
5440
+ referencedRelation: "customers";
5441
+ referencedColumns: ["id"];
5442
+ },
5443
+ {
5444
+ foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
5445
+ columns: ["product_category_id"];
5446
+ isOneToOne: false;
5447
+ referencedRelation: "product_categories";
5448
+ referencedColumns: ["id"];
5449
+ },
5450
+ {
5451
+ foreignKeyName: "local_customer_price_groups_product_id_fkey";
5452
+ columns: ["product_id"];
5453
+ isOneToOne: false;
5454
+ referencedRelation: "products";
5455
+ referencedColumns: ["id"];
5456
+ }
5457
+ ];
5458
+ };
5459
+ local_customer_sales_strategies: {
5460
+ Row: {
5461
+ created_at: string;
5462
+ currency: string;
5463
+ customer_id: string;
5464
+ discount_type: string;
5465
+ discount_value: number;
5466
+ id: string;
5467
+ min_quantity: number;
5468
+ notes: string | null;
5469
+ product_category_id: string | null;
5470
+ product_id: string | null;
5471
+ updated_at: string;
5472
+ valid_from: string | null;
5473
+ valid_until: string | null;
5474
+ };
5475
+ Insert: {
5476
+ created_at?: string;
5477
+ currency?: string;
5478
+ customer_id: string;
5479
+ discount_type: string;
5480
+ discount_value: number;
5481
+ id?: string;
5482
+ min_quantity?: number;
5483
+ notes?: string | null;
5484
+ product_category_id?: string | null;
5485
+ product_id?: string | null;
5486
+ updated_at?: string;
5487
+ valid_from?: string | null;
5488
+ valid_until?: string | null;
5489
+ };
5490
+ Update: {
5491
+ created_at?: string;
5492
+ currency?: string;
5493
+ customer_id?: string;
5494
+ discount_type?: string;
5495
+ discount_value?: number;
5496
+ id?: string;
5497
+ min_quantity?: number;
5498
+ notes?: string | null;
5499
+ product_category_id?: string | null;
5500
+ product_id?: string | null;
5501
+ updated_at?: string;
5502
+ valid_from?: string | null;
5503
+ valid_until?: string | null;
5504
+ };
5505
+ Relationships: [
5506
+ {
5507
+ foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
5508
+ columns: ["customer_id"];
5509
+ isOneToOne: false;
5510
+ referencedRelation: "customers";
5511
+ referencedColumns: ["id"];
5512
+ },
5513
+ {
5514
+ foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
5515
+ columns: ["product_category_id"];
5516
+ isOneToOne: false;
5517
+ referencedRelation: "product_categories";
5518
+ referencedColumns: ["id"];
5519
+ },
5520
+ {
5521
+ foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
5522
+ columns: ["product_id"];
5523
+ isOneToOne: false;
5524
+ referencedRelation: "products";
5525
+ referencedColumns: ["id"];
5526
+ }
5527
+ ];
5528
+ };
4887
5529
  locations: {
4888
5530
  Row: {
4889
5531
  created_at: string;
@@ -5000,6 +5642,7 @@ export type Database = {
5000
5642
  matched_customer_id: string | null;
5001
5643
  message_id: string;
5002
5644
  notes: string | null;
5645
+ order_number: string | null;
5003
5646
  parsed_payload: Json | null;
5004
5647
  reviewed_at: string | null;
5005
5648
  reviewed_by: string | null;
@@ -5015,6 +5658,7 @@ export type Database = {
5015
5658
  matched_customer_id?: string | null;
5016
5659
  message_id: string;
5017
5660
  notes?: string | null;
5661
+ order_number?: string | null;
5018
5662
  parsed_payload?: Json | null;
5019
5663
  reviewed_at?: string | null;
5020
5664
  reviewed_by?: string | null;
@@ -5030,6 +5674,7 @@ export type Database = {
5030
5674
  matched_customer_id?: string | null;
5031
5675
  message_id?: string;
5032
5676
  notes?: string | null;
5677
+ order_number?: string | null;
5033
5678
  parsed_payload?: Json | null;
5034
5679
  reviewed_at?: string | null;
5035
5680
  reviewed_by?: string | null;
@@ -5212,112 +5857,478 @@ export type Database = {
5212
5857
  }
5213
5858
  ];
5214
5859
  };
5215
- mailbox_settings: {
5860
+ mailbox_settings: {
5861
+ Row: {
5862
+ created_at: string;
5863
+ folder: string;
5864
+ id: string;
5865
+ imap_host: string;
5866
+ imap_port: number;
5867
+ imap_use_tls: boolean;
5868
+ imap_username: string;
5869
+ last_error: string | null;
5870
+ last_polled_at: string | null;
5871
+ last_uid_seen: number;
5872
+ polling_enabled: boolean;
5873
+ singleton: boolean;
5874
+ updated_at: string;
5875
+ };
5876
+ Insert: {
5877
+ created_at?: string;
5878
+ folder?: string;
5879
+ id?: string;
5880
+ imap_host?: string;
5881
+ imap_port?: number;
5882
+ imap_use_tls?: boolean;
5883
+ imap_username?: string;
5884
+ last_error?: string | null;
5885
+ last_polled_at?: string | null;
5886
+ last_uid_seen?: number;
5887
+ polling_enabled?: boolean;
5888
+ singleton?: boolean;
5889
+ updated_at?: string;
5890
+ };
5891
+ Update: {
5892
+ created_at?: string;
5893
+ folder?: string;
5894
+ id?: string;
5895
+ imap_host?: string;
5896
+ imap_port?: number;
5897
+ imap_use_tls?: boolean;
5898
+ imap_username?: string;
5899
+ last_error?: string | null;
5900
+ last_polled_at?: string | null;
5901
+ last_uid_seen?: number;
5902
+ polling_enabled?: boolean;
5903
+ singleton?: boolean;
5904
+ updated_at?: string;
5905
+ };
5906
+ Relationships: [];
5907
+ };
5908
+ manufacture_product_components: {
5909
+ Row: {
5910
+ component_type: string;
5911
+ created_at: string;
5912
+ id: string;
5913
+ manufacture_product_id: string;
5914
+ product_group_id: string | null;
5915
+ quantity: number;
5916
+ trade_item_id: string | null;
5917
+ unit: string;
5918
+ };
5919
+ Insert: {
5920
+ component_type: string;
5921
+ created_at?: string;
5922
+ id?: string;
5923
+ manufacture_product_id: string;
5924
+ product_group_id?: string | null;
5925
+ quantity?: number;
5926
+ trade_item_id?: string | null;
5927
+ unit?: string;
5928
+ };
5929
+ Update: {
5930
+ component_type?: string;
5931
+ created_at?: string;
5932
+ id?: string;
5933
+ manufacture_product_id?: string;
5934
+ product_group_id?: string | null;
5935
+ quantity?: number;
5936
+ trade_item_id?: string | null;
5937
+ unit?: string;
5938
+ };
5939
+ Relationships: [
5940
+ {
5941
+ foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey";
5942
+ columns: ["manufacture_product_id"];
5943
+ isOneToOne: false;
5944
+ referencedRelation: "manufacture_product_possible_stock_view";
5945
+ referencedColumns: ["manufacture_product_id"];
5946
+ },
5947
+ {
5948
+ foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey";
5949
+ columns: ["manufacture_product_id"];
5950
+ isOneToOne: false;
5951
+ referencedRelation: "manufacture_products";
5952
+ referencedColumns: ["id"];
5953
+ },
5954
+ {
5955
+ foreignKeyName: "manufacture_product_components_product_group_id_fkey";
5956
+ columns: ["product_group_id"];
5957
+ isOneToOne: false;
5958
+ referencedRelation: "product_groups";
5959
+ referencedColumns: ["id"];
5960
+ }
5961
+ ];
5962
+ };
5963
+ manufacture_products: {
5964
+ Row: {
5965
+ created_at: string;
5966
+ description: string | null;
5967
+ id: string;
5968
+ is_active: boolean;
5969
+ name: string;
5970
+ produced_stock: number;
5971
+ product_code: string;
5972
+ tenant_id: string;
5973
+ updated_at: string;
5974
+ };
5975
+ Insert: {
5976
+ created_at?: string;
5977
+ description?: string | null;
5978
+ id?: string;
5979
+ is_active?: boolean;
5980
+ name: string;
5981
+ produced_stock?: number;
5982
+ product_code: string;
5983
+ tenant_id: string;
5984
+ updated_at?: string;
5985
+ };
5986
+ Update: {
5987
+ created_at?: string;
5988
+ description?: string | null;
5989
+ id?: string;
5990
+ is_active?: boolean;
5991
+ name?: string;
5992
+ produced_stock?: number;
5993
+ product_code?: string;
5994
+ tenant_id?: string;
5995
+ updated_at?: string;
5996
+ };
5997
+ Relationships: [];
5998
+ };
5999
+ monteurs: {
6000
+ Row: {
6001
+ avatar_url: string | null;
6002
+ color: string | null;
6003
+ created_at: string;
6004
+ email: string | null;
6005
+ id: string;
6006
+ is_active: boolean;
6007
+ leave_balance_hours: number;
6008
+ name: string;
6009
+ persnr: number | null;
6010
+ phone: string | null;
6011
+ role: string;
6012
+ tenant_id: string;
6013
+ updated_at: string;
6014
+ user_id: string | null;
6015
+ };
6016
+ Insert: {
6017
+ avatar_url?: string | null;
6018
+ color?: string | null;
6019
+ created_at?: string;
6020
+ email?: string | null;
6021
+ id?: string;
6022
+ is_active?: boolean;
6023
+ leave_balance_hours?: number;
6024
+ name: string;
6025
+ persnr?: number | null;
6026
+ phone?: string | null;
6027
+ role?: string;
6028
+ tenant_id: string;
6029
+ updated_at?: string;
6030
+ user_id?: string | null;
6031
+ };
6032
+ Update: {
6033
+ avatar_url?: string | null;
6034
+ color?: string | null;
6035
+ created_at?: string;
6036
+ email?: string | null;
6037
+ id?: string;
6038
+ is_active?: boolean;
6039
+ leave_balance_hours?: number;
6040
+ name?: string;
6041
+ persnr?: number | null;
6042
+ phone?: string | null;
6043
+ role?: string;
6044
+ tenant_id?: string;
6045
+ updated_at?: string;
6046
+ user_id?: string | null;
6047
+ };
6048
+ Relationships: [
6049
+ {
6050
+ foreignKeyName: "monteurs_tenant_id_fkey";
6051
+ columns: ["tenant_id"];
6052
+ isOneToOne: false;
6053
+ referencedRelation: "tenants";
6054
+ referencedColumns: ["id"];
6055
+ }
6056
+ ];
6057
+ };
6058
+ nmbrs_component_mapping: {
6059
+ Row: {
6060
+ created_at: string;
6061
+ id: string;
6062
+ source_kind: string;
6063
+ source_value: string | null;
6064
+ updated_at: string;
6065
+ wage_code: string;
6066
+ };
6067
+ Insert: {
6068
+ created_at?: string;
6069
+ id?: string;
6070
+ source_kind: string;
6071
+ source_value?: string | null;
6072
+ updated_at?: string;
6073
+ wage_code: string;
6074
+ };
6075
+ Update: {
6076
+ created_at?: string;
6077
+ id?: string;
6078
+ source_kind?: string;
6079
+ source_value?: string | null;
6080
+ updated_at?: string;
6081
+ wage_code?: string;
6082
+ };
6083
+ Relationships: [
6084
+ {
6085
+ foreignKeyName: "nmbrs_component_mapping_wage_code_fkey";
6086
+ columns: ["wage_code"];
6087
+ isOneToOne: false;
6088
+ referencedRelation: "nmbrs_wage_components";
6089
+ referencedColumns: ["code"];
6090
+ }
6091
+ ];
6092
+ };
6093
+ nmbrs_employee_mapping: {
6094
+ Row: {
6095
+ active_from: string | null;
6096
+ active_to: string | null;
6097
+ contract_hours_per_week: number | null;
6098
+ created_at: string;
6099
+ hourly_wage: number | null;
6100
+ id: string;
6101
+ monteur_id: string;
6102
+ nmbrs_company_code: string | null;
6103
+ nmbrs_employee_number: string;
6104
+ updated_at: string;
6105
+ };
6106
+ Insert: {
6107
+ active_from?: string | null;
6108
+ active_to?: string | null;
6109
+ contract_hours_per_week?: number | null;
6110
+ created_at?: string;
6111
+ hourly_wage?: number | null;
6112
+ id?: string;
6113
+ monteur_id: string;
6114
+ nmbrs_company_code?: string | null;
6115
+ nmbrs_employee_number: string;
6116
+ updated_at?: string;
6117
+ };
6118
+ Update: {
6119
+ active_from?: string | null;
6120
+ active_to?: string | null;
6121
+ contract_hours_per_week?: number | null;
6122
+ created_at?: string;
6123
+ hourly_wage?: number | null;
6124
+ id?: string;
6125
+ monteur_id?: string;
6126
+ nmbrs_company_code?: string | null;
6127
+ nmbrs_employee_number?: string;
6128
+ updated_at?: string;
6129
+ };
6130
+ Relationships: [
6131
+ {
6132
+ foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
6133
+ columns: ["monteur_id"];
6134
+ isOneToOne: true;
6135
+ referencedRelation: "monteurs";
6136
+ referencedColumns: ["id"];
6137
+ }
6138
+ ];
6139
+ };
6140
+ nmbrs_export_lines: {
6141
+ Row: {
6142
+ amount: number;
6143
+ created_at: string;
6144
+ entry_date: string;
6145
+ hours: number;
6146
+ id: string;
6147
+ monteur_id: string;
6148
+ nmbrs_employee_number: string | null;
6149
+ notes: string | null;
6150
+ run_id: string;
6151
+ source_kind: string | null;
6152
+ source_ref_id: string | null;
6153
+ updated_at: string;
6154
+ wage_code: string;
6155
+ };
6156
+ Insert: {
6157
+ amount?: number;
6158
+ created_at?: string;
6159
+ entry_date: string;
6160
+ hours?: number;
6161
+ id?: string;
6162
+ monteur_id: string;
6163
+ nmbrs_employee_number?: string | null;
6164
+ notes?: string | null;
6165
+ run_id: string;
6166
+ source_kind?: string | null;
6167
+ source_ref_id?: string | null;
6168
+ updated_at?: string;
6169
+ wage_code: string;
6170
+ };
6171
+ Update: {
6172
+ amount?: number;
6173
+ created_at?: string;
6174
+ entry_date?: string;
6175
+ hours?: number;
6176
+ id?: string;
6177
+ monteur_id?: string;
6178
+ nmbrs_employee_number?: string | null;
6179
+ notes?: string | null;
6180
+ run_id?: string;
6181
+ source_kind?: string | null;
6182
+ source_ref_id?: string | null;
6183
+ updated_at?: string;
6184
+ wage_code?: string;
6185
+ };
6186
+ Relationships: [
6187
+ {
6188
+ foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
6189
+ columns: ["monteur_id"];
6190
+ isOneToOne: false;
6191
+ referencedRelation: "monteurs";
6192
+ referencedColumns: ["id"];
6193
+ },
6194
+ {
6195
+ foreignKeyName: "nmbrs_export_lines_run_id_fkey";
6196
+ columns: ["run_id"];
6197
+ isOneToOne: false;
6198
+ referencedRelation: "nmbrs_export_runs";
6199
+ referencedColumns: ["id"];
6200
+ },
6201
+ {
6202
+ foreignKeyName: "nmbrs_export_lines_wage_code_fkey";
6203
+ columns: ["wage_code"];
6204
+ isOneToOne: false;
6205
+ referencedRelation: "nmbrs_wage_components";
6206
+ referencedColumns: ["code"];
6207
+ }
6208
+ ];
6209
+ };
6210
+ nmbrs_export_runs: {
6211
+ Row: {
6212
+ created_at: string;
6213
+ file_name: string | null;
6214
+ generated_at: string;
6215
+ generated_by: string | null;
6216
+ id: string;
6217
+ notes: string | null;
6218
+ period_end: string;
6219
+ period_label: string;
6220
+ period_start: string;
6221
+ status: string;
6222
+ total_hours: number;
6223
+ total_lines: number;
6224
+ updated_at: string;
6225
+ };
6226
+ Insert: {
6227
+ created_at?: string;
6228
+ file_name?: string | null;
6229
+ generated_at?: string;
6230
+ generated_by?: string | null;
6231
+ id?: string;
6232
+ notes?: string | null;
6233
+ period_end: string;
6234
+ period_label: string;
6235
+ period_start: string;
6236
+ status?: string;
6237
+ total_hours?: number;
6238
+ total_lines?: number;
6239
+ updated_at?: string;
6240
+ };
6241
+ Update: {
6242
+ created_at?: string;
6243
+ file_name?: string | null;
6244
+ generated_at?: string;
6245
+ generated_by?: string | null;
6246
+ id?: string;
6247
+ notes?: string | null;
6248
+ period_end?: string;
6249
+ period_label?: string;
6250
+ period_start?: string;
6251
+ status?: string;
6252
+ total_hours?: number;
6253
+ total_lines?: number;
6254
+ updated_at?: string;
6255
+ };
6256
+ Relationships: [];
6257
+ };
6258
+ nmbrs_settings: {
5216
6259
  Row: {
5217
6260
  created_at: string;
5218
- folder: string;
5219
- id: string;
5220
- imap_host: string;
5221
- imap_port: number;
5222
- imap_use_tls: boolean;
5223
- imap_username: string;
5224
- last_error: string | null;
5225
- last_polled_at: string | null;
5226
- last_uid_seen: number;
5227
- polling_enabled: boolean;
5228
- singleton: boolean;
6261
+ default_company_code: string | null;
6262
+ id: boolean;
6263
+ include_travel: boolean;
6264
+ overtime_threshold_daily: number;
6265
+ overtime_threshold_weekly: number;
6266
+ period_type: string;
5229
6267
  updated_at: string;
6268
+ updated_by: string | null;
6269
+ week_start_day: number;
5230
6270
  };
5231
6271
  Insert: {
5232
6272
  created_at?: string;
5233
- folder?: string;
5234
- id?: string;
5235
- imap_host?: string;
5236
- imap_port?: number;
5237
- imap_use_tls?: boolean;
5238
- imap_username?: string;
5239
- last_error?: string | null;
5240
- last_polled_at?: string | null;
5241
- last_uid_seen?: number;
5242
- polling_enabled?: boolean;
5243
- singleton?: boolean;
6273
+ default_company_code?: string | null;
6274
+ id?: boolean;
6275
+ include_travel?: boolean;
6276
+ overtime_threshold_daily?: number;
6277
+ overtime_threshold_weekly?: number;
6278
+ period_type?: string;
5244
6279
  updated_at?: string;
6280
+ updated_by?: string | null;
6281
+ week_start_day?: number;
5245
6282
  };
5246
6283
  Update: {
5247
6284
  created_at?: string;
5248
- folder?: string;
5249
- id?: string;
5250
- imap_host?: string;
5251
- imap_port?: number;
5252
- imap_use_tls?: boolean;
5253
- imap_username?: string;
5254
- last_error?: string | null;
5255
- last_polled_at?: string | null;
5256
- last_uid_seen?: number;
5257
- polling_enabled?: boolean;
5258
- singleton?: boolean;
6285
+ default_company_code?: string | null;
6286
+ id?: boolean;
6287
+ include_travel?: boolean;
6288
+ overtime_threshold_daily?: number;
6289
+ overtime_threshold_weekly?: number;
6290
+ period_type?: string;
5259
6291
  updated_at?: string;
6292
+ updated_by?: string | null;
6293
+ week_start_day?: number;
5260
6294
  };
5261
6295
  Relationships: [];
5262
6296
  };
5263
- monteurs: {
6297
+ nmbrs_wage_components: {
5264
6298
  Row: {
5265
- avatar_url: string | null;
5266
- color: string | null;
6299
+ category: string;
6300
+ code: string;
5267
6301
  created_at: string;
5268
- email: string | null;
5269
6302
  id: string;
5270
6303
  is_active: boolean;
5271
- leave_balance_hours: number;
5272
- name: string;
5273
- persnr: number | null;
5274
- phone: string | null;
5275
- role: string;
5276
- tenant_id: string;
6304
+ label: string;
6305
+ sort_order: number;
6306
+ unit: string;
5277
6307
  updated_at: string;
5278
- user_id: string | null;
5279
6308
  };
5280
6309
  Insert: {
5281
- avatar_url?: string | null;
5282
- color?: string | null;
6310
+ category: string;
6311
+ code: string;
5283
6312
  created_at?: string;
5284
- email?: string | null;
5285
6313
  id?: string;
5286
6314
  is_active?: boolean;
5287
- leave_balance_hours?: number;
5288
- name: string;
5289
- persnr?: number | null;
5290
- phone?: string | null;
5291
- role?: string;
5292
- tenant_id: string;
6315
+ label: string;
6316
+ sort_order?: number;
6317
+ unit: string;
5293
6318
  updated_at?: string;
5294
- user_id?: string | null;
5295
6319
  };
5296
6320
  Update: {
5297
- avatar_url?: string | null;
5298
- color?: string | null;
6321
+ category?: string;
6322
+ code?: string;
5299
6323
  created_at?: string;
5300
- email?: string | null;
5301
6324
  id?: string;
5302
6325
  is_active?: boolean;
5303
- leave_balance_hours?: number;
5304
- name?: string;
5305
- persnr?: number | null;
5306
- phone?: string | null;
5307
- role?: string;
5308
- tenant_id?: string;
6326
+ label?: string;
6327
+ sort_order?: number;
6328
+ unit?: string;
5309
6329
  updated_at?: string;
5310
- user_id?: string | null;
5311
6330
  };
5312
- Relationships: [
5313
- {
5314
- foreignKeyName: "monteurs_tenant_id_fkey";
5315
- columns: ["tenant_id"];
5316
- isOneToOne: false;
5317
- referencedRelation: "tenants";
5318
- referencedColumns: ["id"];
5319
- }
5320
- ];
6331
+ Relationships: [];
5321
6332
  };
5322
6333
  notifications: {
5323
6334
  Row: {
@@ -5550,6 +6561,7 @@ export type Database = {
5550
6561
  id: string;
5551
6562
  items: Json;
5552
6563
  notes: string | null;
6564
+ order_number: string | null;
5553
6565
  recipient_id: string;
5554
6566
  total_amount: number;
5555
6567
  };
@@ -5563,6 +6575,7 @@ export type Database = {
5563
6575
  id?: string;
5564
6576
  items?: Json;
5565
6577
  notes?: string | null;
6578
+ order_number?: string | null;
5566
6579
  recipient_id: string;
5567
6580
  total_amount?: number;
5568
6581
  };
@@ -5576,6 +6589,7 @@ export type Database = {
5576
6589
  id?: string;
5577
6590
  items?: Json;
5578
6591
  notes?: string | null;
6592
+ order_number?: string | null;
5579
6593
  recipient_id?: string;
5580
6594
  total_amount?: number;
5581
6595
  };
@@ -5743,6 +6757,9 @@ export type Database = {
5743
6757
  crates_per_layer: number;
5744
6758
  created_at: string;
5745
6759
  id: string;
6760
+ layer_fraction: number;
6761
+ layer_share_pct: number;
6762
+ layers_per_cart: number;
5746
6763
  order_item_id: string | null;
5747
6764
  plants_per_crate: number;
5748
6765
  product_id: string | null;
@@ -5754,6 +6771,9 @@ export type Database = {
5754
6771
  crates_per_layer?: number;
5755
6772
  created_at?: string;
5756
6773
  id?: string;
6774
+ layer_fraction?: number;
6775
+ layer_share_pct?: number;
6776
+ layers_per_cart?: number;
5757
6777
  order_item_id?: string | null;
5758
6778
  plants_per_crate?: number;
5759
6779
  product_id?: string | null;
@@ -5765,6 +6785,9 @@ export type Database = {
5765
6785
  crates_per_layer?: number;
5766
6786
  created_at?: string;
5767
6787
  id?: string;
6788
+ layer_fraction?: number;
6789
+ layer_share_pct?: number;
6790
+ layers_per_cart?: number;
5768
6791
  order_item_id?: string | null;
5769
6792
  plants_per_crate?: number;
5770
6793
  product_id?: string | null;
@@ -5796,33 +6819,45 @@ export type Database = {
5796
6819
  };
5797
6820
  order_carts: {
5798
6821
  Row: {
6822
+ algorithm_version: number;
5799
6823
  cart_number: number;
5800
6824
  created_at: string;
5801
6825
  id: string;
5802
6826
  is_auto: boolean;
5803
6827
  is_complete: boolean;
5804
6828
  notes: string | null;
6829
+ occupancy_pct: number;
5805
6830
  order_id: string;
6831
+ source: string;
6832
+ total_layers_used: number;
5806
6833
  updated_at: string;
5807
6834
  };
5808
6835
  Insert: {
6836
+ algorithm_version?: number;
5809
6837
  cart_number: number;
5810
6838
  created_at?: string;
5811
6839
  id?: string;
5812
6840
  is_auto?: boolean;
5813
6841
  is_complete?: boolean;
5814
6842
  notes?: string | null;
6843
+ occupancy_pct?: number;
5815
6844
  order_id: string;
6845
+ source?: string;
6846
+ total_layers_used?: number;
5816
6847
  updated_at?: string;
5817
6848
  };
5818
6849
  Update: {
6850
+ algorithm_version?: number;
5819
6851
  cart_number?: number;
5820
6852
  created_at?: string;
5821
6853
  id?: string;
5822
6854
  is_auto?: boolean;
5823
6855
  is_complete?: boolean;
5824
6856
  notes?: string | null;
6857
+ occupancy_pct?: number;
5825
6858
  order_id?: string;
6859
+ source?: string;
6860
+ total_layers_used?: number;
5826
6861
  updated_at?: string;
5827
6862
  };
5828
6863
  Relationships: [
@@ -6252,6 +7287,68 @@ export type Database = {
6252
7287
  };
6253
7288
  Relationships: [];
6254
7289
  };
7290
+ product_group_items: {
7291
+ Row: {
7292
+ created_at: string;
7293
+ id: string;
7294
+ product_group_id: string;
7295
+ quantity: number;
7296
+ trade_item_id: string;
7297
+ };
7298
+ Insert: {
7299
+ created_at?: string;
7300
+ id?: string;
7301
+ product_group_id: string;
7302
+ quantity?: number;
7303
+ trade_item_id: string;
7304
+ };
7305
+ Update: {
7306
+ created_at?: string;
7307
+ id?: string;
7308
+ product_group_id?: string;
7309
+ quantity?: number;
7310
+ trade_item_id?: string;
7311
+ };
7312
+ Relationships: [
7313
+ {
7314
+ foreignKeyName: "product_group_items_product_group_id_fkey";
7315
+ columns: ["product_group_id"];
7316
+ isOneToOne: false;
7317
+ referencedRelation: "product_groups";
7318
+ referencedColumns: ["id"];
7319
+ }
7320
+ ];
7321
+ };
7322
+ product_groups: {
7323
+ Row: {
7324
+ created_at: string;
7325
+ description: string | null;
7326
+ id: string;
7327
+ is_active: boolean;
7328
+ name: string;
7329
+ tenant_id: string;
7330
+ updated_at: string;
7331
+ };
7332
+ Insert: {
7333
+ created_at?: string;
7334
+ description?: string | null;
7335
+ id?: string;
7336
+ is_active?: boolean;
7337
+ name: string;
7338
+ tenant_id: string;
7339
+ updated_at?: string;
7340
+ };
7341
+ Update: {
7342
+ created_at?: string;
7343
+ description?: string | null;
7344
+ id?: string;
7345
+ is_active?: boolean;
7346
+ name?: string;
7347
+ tenant_id?: string;
7348
+ updated_at?: string;
7349
+ };
7350
+ Relationships: [];
7351
+ };
6255
7352
  products: {
6256
7353
  Row: {
6257
7354
  barcode: string | null;
@@ -6271,6 +7368,7 @@ export type Database = {
6271
7368
  purchase_price: number | null;
6272
7369
  quantity: number;
6273
7370
  sale_price: number | null;
7371
+ trade_item_key: string | null;
6274
7372
  unit: string;
6275
7373
  updated_at: string;
6276
7374
  weight: string | null;
@@ -6293,6 +7391,7 @@ export type Database = {
6293
7391
  purchase_price?: number | null;
6294
7392
  quantity?: number;
6295
7393
  sale_price?: number | null;
7394
+ trade_item_key?: string | null;
6296
7395
  unit?: string;
6297
7396
  updated_at?: string;
6298
7397
  weight?: string | null;
@@ -6315,6 +7414,7 @@ export type Database = {
6315
7414
  purchase_price?: number | null;
6316
7415
  quantity?: number;
6317
7416
  sale_price?: number | null;
7417
+ trade_item_key?: string | null;
6318
7418
  unit?: string;
6319
7419
  updated_at?: string;
6320
7420
  weight?: string | null;
@@ -6327,6 +7427,7 @@ export type Database = {
6327
7427
  display_name: string | null;
6328
7428
  email: string | null;
6329
7429
  id: string;
7430
+ is_superadmin: boolean;
6330
7431
  notification_preferences: Json;
6331
7432
  tenant_id: string | null;
6332
7433
  updated_at: string;
@@ -6336,6 +7437,7 @@ export type Database = {
6336
7437
  display_name?: string | null;
6337
7438
  email?: string | null;
6338
7439
  id: string;
7440
+ is_superadmin?: boolean;
6339
7441
  notification_preferences?: Json;
6340
7442
  tenant_id?: string | null;
6341
7443
  updated_at?: string;
@@ -6345,6 +7447,7 @@ export type Database = {
6345
7447
  display_name?: string | null;
6346
7448
  email?: string | null;
6347
7449
  id?: string;
7450
+ is_superadmin?: boolean;
6348
7451
  notification_preferences?: Json;
6349
7452
  tenant_id?: string | null;
6350
7453
  updated_at?: string;
@@ -7166,6 +8269,120 @@ export type Database = {
7166
8269
  };
7167
8270
  Relationships: [];
7168
8271
  };
8272
+ sidebar_config: {
8273
+ Row: {
8274
+ id: string;
8275
+ module_order: string[];
8276
+ updated_at: string;
8277
+ };
8278
+ Insert: {
8279
+ id?: string;
8280
+ module_order?: string[];
8281
+ updated_at?: string;
8282
+ };
8283
+ Update: {
8284
+ id?: string;
8285
+ module_order?: string[];
8286
+ updated_at?: string;
8287
+ };
8288
+ Relationships: [];
8289
+ };
8290
+ stock_import_runs: {
8291
+ Row: {
8292
+ connection_id: string | null;
8293
+ created_at: string;
8294
+ created_rows: number;
8295
+ errors: Json;
8296
+ filename: string | null;
8297
+ id: string;
8298
+ mutations: Json;
8299
+ skipped_rows: number;
8300
+ total_rows: number;
8301
+ updated_rows: number;
8302
+ user_id: string;
8303
+ };
8304
+ Insert: {
8305
+ connection_id?: string | null;
8306
+ created_at?: string;
8307
+ created_rows?: number;
8308
+ errors?: Json;
8309
+ filename?: string | null;
8310
+ id?: string;
8311
+ mutations?: Json;
8312
+ skipped_rows?: number;
8313
+ total_rows?: number;
8314
+ updated_rows?: number;
8315
+ user_id: string;
8316
+ };
8317
+ Update: {
8318
+ connection_id?: string | null;
8319
+ created_at?: string;
8320
+ created_rows?: number;
8321
+ errors?: Json;
8322
+ filename?: string | null;
8323
+ id?: string;
8324
+ mutations?: Json;
8325
+ skipped_rows?: number;
8326
+ total_rows?: number;
8327
+ updated_rows?: number;
8328
+ user_id?: string;
8329
+ };
8330
+ Relationships: [];
8331
+ };
8332
+ stock_mutation_log: {
8333
+ Row: {
8334
+ connection_id: string | null;
8335
+ created_at: string;
8336
+ created_by: string | null;
8337
+ id: string;
8338
+ mutation_type: string;
8339
+ order_id: string | null;
8340
+ order_item_id: string | null;
8341
+ order_source: string | null;
8342
+ physical_after: number | null;
8343
+ physical_before: number | null;
8344
+ qty_delta: number;
8345
+ reason: string | null;
8346
+ reserved_after: number | null;
8347
+ reserved_before: number | null;
8348
+ trade_item_key: string | null;
8349
+ };
8350
+ Insert: {
8351
+ connection_id?: string | null;
8352
+ created_at?: string;
8353
+ created_by?: string | null;
8354
+ id?: string;
8355
+ mutation_type: string;
8356
+ order_id?: string | null;
8357
+ order_item_id?: string | null;
8358
+ order_source?: string | null;
8359
+ physical_after?: number | null;
8360
+ physical_before?: number | null;
8361
+ qty_delta: number;
8362
+ reason?: string | null;
8363
+ reserved_after?: number | null;
8364
+ reserved_before?: number | null;
8365
+ trade_item_key?: string | null;
8366
+ };
8367
+ Update: {
8368
+ connection_id?: string | null;
8369
+ created_at?: string;
8370
+ created_by?: string | null;
8371
+ id?: string;
8372
+ mutation_type?: string;
8373
+ order_id?: string | null;
8374
+ order_item_id?: string | null;
8375
+ order_source?: string | null;
8376
+ physical_after?: number | null;
8377
+ physical_before?: number | null;
8378
+ qty_delta?: number;
8379
+ reason?: string | null;
8380
+ reserved_after?: number | null;
8381
+ reserved_before?: number | null;
8382
+ trade_item_key?: string | null;
8383
+ };
8384
+ Relationships: [];
8385
+ };
7169
8386
  supplier_products: {
7170
8387
  Row: {
7171
8388
  article_number: string | null;
@@ -7431,7 +8648,13 @@ export type Database = {
7431
8648
  connection_id: string | null;
7432
8649
  created_at: string;
7433
8650
  data: Json;
8651
+ floriday_id: string | null;
8652
+ floriday_link_error: string | null;
8653
+ floriday_link_status: string;
7434
8654
  id: string;
8655
+ last_floriday_sync_at: string | null;
8656
+ missing_required_fields: string[];
8657
+ source: string;
7435
8658
  updated_at: string;
7436
8659
  user_id: string;
7437
8660
  };
@@ -7439,7 +8662,13 @@ export type Database = {
7439
8662
  connection_id?: string | null;
7440
8663
  created_at?: string;
7441
8664
  data?: Json;
8665
+ floriday_id?: string | null;
8666
+ floriday_link_error?: string | null;
8667
+ floriday_link_status?: string;
7442
8668
  id?: string;
8669
+ last_floriday_sync_at?: string | null;
8670
+ missing_required_fields?: string[];
8671
+ source?: string;
7443
8672
  updated_at?: string;
7444
8673
  user_id: string;
7445
8674
  };
@@ -7447,7 +8676,55 @@ export type Database = {
7447
8676
  connection_id?: string | null;
7448
8677
  created_at?: string;
7449
8678
  data?: Json;
8679
+ floriday_id?: string | null;
8680
+ floriday_link_error?: string | null;
8681
+ floriday_link_status?: string;
8682
+ id?: string;
8683
+ last_floriday_sync_at?: string | null;
8684
+ missing_required_fields?: string[];
8685
+ source?: string;
8686
+ updated_at?: string;
8687
+ user_id?: string;
8688
+ };
8689
+ Relationships: [];
8690
+ };
8691
+ trade_item_stock: {
8692
+ Row: {
8693
+ connection_id: string;
8694
+ created_at: string;
8695
+ id: string;
8696
+ incoming_stock: number;
8697
+ minimum_stock: number;
8698
+ notes: string | null;
8699
+ physical_stock: number;
8700
+ reserved_stock: number;
8701
+ trade_item_key: string;
8702
+ updated_at: string;
8703
+ user_id: string;
8704
+ };
8705
+ Insert: {
8706
+ connection_id: string;
8707
+ created_at?: string;
8708
+ id?: string;
8709
+ incoming_stock?: number;
8710
+ minimum_stock?: number;
8711
+ notes?: string | null;
8712
+ physical_stock?: number;
8713
+ reserved_stock?: number;
8714
+ trade_item_key: string;
8715
+ updated_at?: string;
8716
+ user_id: string;
8717
+ };
8718
+ Update: {
8719
+ connection_id?: string;
8720
+ created_at?: string;
7450
8721
  id?: string;
8722
+ incoming_stock?: number;
8723
+ minimum_stock?: number;
8724
+ notes?: string | null;
8725
+ physical_stock?: number;
8726
+ reserved_stock?: number;
8727
+ trade_item_key?: string;
7451
8728
  updated_at?: string;
7452
8729
  user_id?: string;
7453
8730
  };
@@ -7778,6 +9055,10 @@ export type Database = {
7778
9055
  default_invoice_type: string;
7779
9056
  default_payment_term_days: number;
7780
9057
  default_vat_code: string;
9058
+ invoice_enabled_ao: boolean;
9059
+ invoice_enabled_fo: boolean;
9060
+ invoice_enabled_ho: boolean;
9061
+ invoice_enabled_mo: boolean;
7781
9062
  updated_at: string;
7782
9063
  user_id: string;
7783
9064
  };
@@ -7787,6 +9068,10 @@ export type Database = {
7787
9068
  default_invoice_type?: string;
7788
9069
  default_payment_term_days?: number;
7789
9070
  default_vat_code?: string;
9071
+ invoice_enabled_ao?: boolean;
9072
+ invoice_enabled_fo?: boolean;
9073
+ invoice_enabled_ho?: boolean;
9074
+ invoice_enabled_mo?: boolean;
7790
9075
  updated_at?: string;
7791
9076
  user_id: string;
7792
9077
  };
@@ -7796,6 +9081,10 @@ export type Database = {
7796
9081
  default_invoice_type?: string;
7797
9082
  default_payment_term_days?: number;
7798
9083
  default_vat_code?: string;
9084
+ invoice_enabled_ao?: boolean;
9085
+ invoice_enabled_fo?: boolean;
9086
+ invoice_enabled_ho?: boolean;
9087
+ invoice_enabled_mo?: boolean;
7799
9088
  updated_at?: string;
7800
9089
  user_id?: string;
7801
9090
  };
@@ -7803,6 +9092,7 @@ export type Database = {
7803
9092
  };
7804
9093
  twinfield_invoice_sync_logs: {
7805
9094
  Row: {
9095
+ action_type: string | null;
7806
9096
  created_at: string;
7807
9097
  details: Json | null;
7808
9098
  duration_ms: number | null;
@@ -7815,6 +9105,7 @@ export type Database = {
7815
9105
  user_id: string;
7816
9106
  };
7817
9107
  Insert: {
9108
+ action_type?: string | null;
7818
9109
  created_at?: string;
7819
9110
  details?: Json | null;
7820
9111
  duration_ms?: number | null;
@@ -7827,6 +9118,7 @@ export type Database = {
7827
9118
  user_id: string;
7828
9119
  };
7829
9120
  Update: {
9121
+ action_type?: string | null;
7830
9122
  created_at?: string;
7831
9123
  details?: Json | null;
7832
9124
  duration_ms?: number | null;
@@ -8066,6 +9358,57 @@ export type Database = {
8066
9358
  }
8067
9359
  ];
8068
9360
  };
9361
+ twinfield_request_metrics: {
9362
+ Row: {
9363
+ bucket_hour: string;
9364
+ connection_id: string;
9365
+ error_count: number;
9366
+ rate_limited_count: number;
9367
+ request_count: number;
9368
+ updated_at: string;
9369
+ };
9370
+ Insert: {
9371
+ bucket_hour: string;
9372
+ connection_id: string;
9373
+ error_count?: number;
9374
+ rate_limited_count?: number;
9375
+ request_count?: number;
9376
+ updated_at?: string;
9377
+ };
9378
+ Update: {
9379
+ bucket_hour?: string;
9380
+ connection_id?: string;
9381
+ error_count?: number;
9382
+ rate_limited_count?: number;
9383
+ request_count?: number;
9384
+ updated_at?: string;
9385
+ };
9386
+ Relationships: [];
9387
+ };
9388
+ twinfield_session_cache: {
9389
+ Row: {
9390
+ cluster: string;
9391
+ created_at: string;
9392
+ expires_at: string;
9393
+ session_id: string;
9394
+ user_id: string;
9395
+ };
9396
+ Insert: {
9397
+ cluster: string;
9398
+ created_at?: string;
9399
+ expires_at: string;
9400
+ session_id: string;
9401
+ user_id: string;
9402
+ };
9403
+ Update: {
9404
+ cluster?: string;
9405
+ created_at?: string;
9406
+ expires_at?: string;
9407
+ session_id?: string;
9408
+ user_id?: string;
9409
+ };
9410
+ Relationships: [];
9411
+ };
8069
9412
  twinfield_settings: {
8070
9413
  Row: {
8071
9414
  active_environment: string;
@@ -8659,6 +10002,75 @@ export type Database = {
8659
10002
  };
8660
10003
  Relationships: [];
8661
10004
  };
10005
+ floriday_customer_discounts: {
10006
+ Row: {
10007
+ base_price: number | null;
10008
+ buyer_organization_id: string | null;
10009
+ currency: string | null;
10010
+ discount_type: string | null;
10011
+ discount_value: number | null;
10012
+ min_quantity: number | null;
10013
+ net_price: number | null;
10014
+ product_group_id: string | null;
10015
+ raw: Json | null;
10016
+ source: string | null;
10017
+ source_id: string | null;
10018
+ trade_item_id: string | null;
10019
+ valid_from: string | null;
10020
+ valid_until: string | null;
10021
+ };
10022
+ Relationships: [];
10023
+ };
10024
+ local_customer_discounts: {
10025
+ Row: {
10026
+ base_price: number | null;
10027
+ currency: string | null;
10028
+ customer_id: string | null;
10029
+ discount_type: string | null;
10030
+ discount_value: number | null;
10031
+ min_quantity: number | null;
10032
+ net_price: number | null;
10033
+ product_category_id: string | null;
10034
+ product_id: string | null;
10035
+ product_name: string | null;
10036
+ source: string | null;
10037
+ source_id: string | null;
10038
+ valid_from: string | null;
10039
+ valid_until: string | null;
10040
+ };
10041
+ Relationships: [];
10042
+ };
10043
+ manufacture_product_possible_stock_view: {
10044
+ Row: {
10045
+ component_count: number | null;
10046
+ manufacture_product_id: string | null;
10047
+ possible_stock: number | null;
10048
+ };
10049
+ Relationships: [];
10050
+ };
10051
+ product_group_stock_view: {
10052
+ Row: {
10053
+ item_count: number | null;
10054
+ product_group_id: string | null;
10055
+ total_stock: number | null;
10056
+ };
10057
+ Relationships: [
10058
+ {
10059
+ foreignKeyName: "product_group_items_product_group_id_fkey";
10060
+ columns: ["product_group_id"];
10061
+ isOneToOne: false;
10062
+ referencedRelation: "product_groups";
10063
+ referencedColumns: ["id"];
10064
+ }
10065
+ ];
10066
+ };
10067
+ trade_item_stock_view: {
10068
+ Row: {
10069
+ stock: number | null;
10070
+ trade_item_id: string | null;
10071
+ };
10072
+ Relationships: [];
10073
+ };
8662
10074
  v_external_customers_exact: {
8663
10075
  Row: {
8664
10076
  account_number: string | null;
@@ -8924,6 +10336,68 @@ export type Database = {
8924
10336
  };
8925
10337
  Returns: number;
8926
10338
  };
10339
+ afh_city_code: {
10340
+ Args: {
10341
+ _city: string;
10342
+ _country: string;
10343
+ };
10344
+ Returns: string;
10345
+ };
10346
+ afh_normalize_country: {
10347
+ Args: {
10348
+ _raw: string;
10349
+ };
10350
+ Returns: string;
10351
+ };
10352
+ afh_normalize_nl_province: {
10353
+ Args: {
10354
+ _raw: string;
10355
+ };
10356
+ Returns: string;
10357
+ };
10358
+ afh_subtract_workdays: {
10359
+ Args: {
10360
+ _date: string;
10361
+ _days: number;
10362
+ };
10363
+ Returns: string;
10364
+ };
10365
+ apply_stock_consumption: {
10366
+ Args: {
10367
+ p_order_id: string;
10368
+ p_order_item_id: string;
10369
+ p_qty: number;
10370
+ p_reason: string;
10371
+ p_source: string;
10372
+ p_trade_item_key: string;
10373
+ };
10374
+ Returns: undefined;
10375
+ };
10376
+ apply_stock_reservation: {
10377
+ Args: {
10378
+ p_order_id: string;
10379
+ p_order_item_id: string;
10380
+ p_qty: number;
10381
+ p_reason: string;
10382
+ p_source: string;
10383
+ p_trade_item_key: string;
10384
+ };
10385
+ Returns: undefined;
10386
+ };
10387
+ assign_cart_numbers: {
10388
+ Args: {
10389
+ p_carts: Json;
10390
+ };
10391
+ Returns: {
10392
+ cart_index: number;
10393
+ cart_number: string;
10394
+ day_seq: number;
10395
+ order_id: string;
10396
+ order_source: string;
10397
+ pick_date: string;
10398
+ status: string;
10399
+ }[];
10400
+ };
8927
10401
  assign_floriday_order_numbers: {
8928
10402
  Args: {
8929
10403
  p_ids: string[];
@@ -8933,20 +10407,81 @@ export type Database = {
8933
10407
  order_number: string;
8934
10408
  }[];
8935
10409
  };
10410
+ autolink_product_to_floriday: {
10411
+ Args: {
10412
+ p_product_id: string;
10413
+ };
10414
+ Returns: string;
10415
+ };
10416
+ backfill_open_order_reservations: {
10417
+ Args: never;
10418
+ Returns: {
10419
+ processed_items: number;
10420
+ }[];
10421
+ };
8936
10422
  call_exact_route: {
8937
10423
  Args: {
8938
10424
  path: string;
8939
10425
  };
8940
10426
  Returns: number;
8941
10427
  };
10428
+ check_offer_product_available_stock: {
10429
+ Args: {
10430
+ p_campaign_product_id: string;
10431
+ p_code: string;
10432
+ p_needed_qty?: number;
10433
+ p_product_name?: string;
10434
+ };
10435
+ Returns: Json;
10436
+ };
10437
+ check_trade_item_available_stock: {
10438
+ Args: {
10439
+ p_connection_id?: string;
10440
+ p_context?: string;
10441
+ p_needed_qty?: number;
10442
+ p_order_id?: string;
10443
+ p_order_item_id?: string;
10444
+ p_owner_id?: string;
10445
+ p_product_name?: string;
10446
+ p_trade_item_key: string;
10447
+ };
10448
+ Returns: Json;
10449
+ };
8942
10450
  cleanup_old_bookings: {
8943
10451
  Args: never;
8944
10452
  Returns: number;
8945
10453
  };
10454
+ control_get_todays_carts: {
10455
+ Args: never;
10456
+ Returns: {
10457
+ cart_index: number;
10458
+ cart_number: string;
10459
+ cart_number_id: string;
10460
+ order_id: string;
10461
+ order_source: string;
10462
+ pick_date: string;
10463
+ status: string;
10464
+ }[];
10465
+ };
10466
+ count_distinct_regulatory_products: {
10467
+ Args: never;
10468
+ Returns: number;
10469
+ };
8946
10470
  current_monteur_id: {
8947
10471
  Args: never;
8948
10472
  Returns: string;
8949
10473
  };
10474
+ dashboard_alert_counts: {
10475
+ Args: never;
10476
+ Returns: Json;
10477
+ };
10478
+ dashboard_alert_rows: {
10479
+ Args: {
10480
+ check_id: string;
10481
+ row_limit?: number;
10482
+ };
10483
+ Returns: Json;
10484
+ };
8950
10485
  dashboard_list_public_schema: {
8951
10486
  Args: never;
8952
10487
  Returns: {
@@ -8955,6 +10490,12 @@ export type Database = {
8955
10490
  table_name: string;
8956
10491
  }[];
8957
10492
  };
10493
+ dispatch_carrier_signups_sql: {
10494
+ Args: {
10495
+ _catchup?: string;
10496
+ };
10497
+ Returns: Json;
10498
+ };
8958
10499
  email_auth_decrypt: {
8959
10500
  Args: {
8960
10501
  cipher: string;
@@ -8990,6 +10531,12 @@ export type Database = {
8990
10531
  status: string;
8991
10532
  }[];
8992
10533
  };
10534
+ ensure_trade_item_stock_row: {
10535
+ Args: {
10536
+ p_key: string;
10537
+ };
10538
+ Returns: undefined;
10539
+ };
8993
10540
  ensure_user_tenant: {
8994
10541
  Args: never;
8995
10542
  Returns: string;
@@ -9027,6 +10574,38 @@ export type Database = {
9027
10574
  };
9028
10575
  Returns: boolean;
9029
10576
  };
10577
+ find_trade_item_key: {
10578
+ Args: {
10579
+ p_barcode: string;
10580
+ p_name: string;
10581
+ p_product_id: string;
10582
+ };
10583
+ Returns: string;
10584
+ };
10585
+ floriday_effective_price: {
10586
+ Args: {
10587
+ _buyer_id: string;
10588
+ _on_date?: string;
10589
+ _quantity?: number;
10590
+ _trade_item_id: string;
10591
+ };
10592
+ Returns: {
10593
+ base_price: number;
10594
+ currency: string;
10595
+ discount_type: string;
10596
+ discount_value: number;
10597
+ net_price: number;
10598
+ source: string;
10599
+ source_id: string;
10600
+ }[];
10601
+ };
10602
+ format_cart_number: {
10603
+ Args: {
10604
+ p_pick_date: string;
10605
+ p_seq: number;
10606
+ };
10607
+ Returns: string;
10608
+ };
9030
10609
  get_active_floriday_connection_public: {
9031
10610
  Args: never;
9032
10611
  Returns: {
@@ -9040,6 +10619,13 @@ export type Database = {
9040
10619
  preferred_warehouse_name: string;
9041
10620
  }[];
9042
10621
  };
10622
+ get_active_floriday_context: {
10623
+ Args: never;
10624
+ Returns: {
10625
+ connection_id: string;
10626
+ user_id: string;
10627
+ }[];
10628
+ };
9043
10629
  get_active_twinfield_public: {
9044
10630
  Args: never;
9045
10631
  Returns: {
@@ -9051,6 +10637,13 @@ export type Database = {
9051
10637
  office_code: string;
9052
10638
  }[];
9053
10639
  };
10640
+ get_floricode_record_counts: {
10641
+ Args: never;
10642
+ Returns: {
10643
+ count: number;
10644
+ resource: string;
10645
+ }[];
10646
+ };
9054
10647
  get_floriday_agreements_active: {
9055
10648
  Args: {
9056
10649
  p_on_date?: string;
@@ -9142,6 +10735,24 @@ export type Database = {
9142
10735
  };
9143
10736
  Returns: Json;
9144
10737
  };
10738
+ get_offer_delivery_options: {
10739
+ Args: {
10740
+ p_code: string;
10741
+ };
10742
+ Returns: Json;
10743
+ };
10744
+ get_offer_recipient_by_code: {
10745
+ Args: {
10746
+ p_code: string;
10747
+ };
10748
+ Returns: {
10749
+ campaign_id: string;
10750
+ clicked_at: string;
10751
+ customer_id: string;
10752
+ id: string;
10753
+ ordered_at: string;
10754
+ }[];
10755
+ };
9145
10756
  get_or_assign_floriday_order_number: {
9146
10757
  Args: {
9147
10758
  p_floriday_id: string;
@@ -9194,12 +10805,53 @@ export type Database = {
9194
10805
  Args: never;
9195
10806
  Returns: boolean;
9196
10807
  };
10808
+ is_superadmin: {
10809
+ Args: {
10810
+ _user_id: string;
10811
+ };
10812
+ Returns: boolean;
10813
+ };
10814
+ local_effective_price: {
10815
+ Args: {
10816
+ _customer_id: string;
10817
+ _on_date?: string;
10818
+ _product_id: string;
10819
+ _quantity?: number;
10820
+ };
10821
+ Returns: {
10822
+ currency: string;
10823
+ discount_type: string;
10824
+ discount_value: number;
10825
+ net_price: number;
10826
+ source: string;
10827
+ source_id: string;
10828
+ }[];
10829
+ };
10830
+ mark_offer_clicked: {
10831
+ Args: {
10832
+ p_code: string;
10833
+ };
10834
+ Returns: undefined;
10835
+ };
10836
+ mark_offer_ordered: {
10837
+ Args: {
10838
+ p_code: string;
10839
+ };
10840
+ Returns: undefined;
10841
+ };
9197
10842
  next_order_number: {
9198
10843
  Args: {
9199
10844
  p_prefix: string;
9200
10845
  };
9201
10846
  Returns: string;
9202
10847
  };
10848
+ next_order_number_for_date: {
10849
+ Args: {
10850
+ p_created_at?: string;
10851
+ p_prefix: string;
10852
+ };
10853
+ Returns: string;
10854
+ };
9203
10855
  next_work_order_number: {
9204
10856
  Args: {
9205
10857
  p_parent_work_order_id?: string;
@@ -9207,16 +10859,41 @@ export type Database = {
9207
10859
  };
9208
10860
  Returns: string;
9209
10861
  };
10862
+ normalize_order_source: {
10863
+ Args: {
10864
+ p_src: string;
10865
+ };
10866
+ Returns: string;
10867
+ };
9210
10868
  normalize_vat: {
9211
10869
  Args: {
9212
10870
  v: string;
9213
10871
  };
9214
10872
  Returns: string;
9215
10873
  };
10874
+ offer_recipient_matches: {
10875
+ Args: {
10876
+ _campaign_id: string;
10877
+ _customer_id: string;
10878
+ _recipient_id: string;
10879
+ };
10880
+ Returns: boolean;
10881
+ };
10882
+ order_number_prefix: {
10883
+ Args: {
10884
+ p_custom_fields?: Json;
10885
+ p_order_source: string;
10886
+ };
10887
+ Returns: string;
10888
+ };
9216
10889
  pickstation_get_orders_raw: {
9217
10890
  Args: never;
9218
10891
  Returns: Json;
9219
10892
  };
10893
+ pickstation_get_planning_context: {
10894
+ Args: never;
10895
+ Returns: Json;
10896
+ };
9220
10897
  pickstation_get_settings: {
9221
10898
  Args: never;
9222
10899
  Returns: Json;
@@ -9231,6 +10908,26 @@ export type Database = {
9231
10908
  };
9232
10909
  Returns: undefined;
9233
10910
  };
10911
+ pickstation_set_cart_status: {
10912
+ Args: {
10913
+ p_cart_index: number;
10914
+ p_order_id: string;
10915
+ p_order_source: string;
10916
+ p_status: string;
10917
+ };
10918
+ Returns: undefined;
10919
+ };
10920
+ promote_trade_item_key: {
10921
+ Args: {
10922
+ p_new: string;
10923
+ p_old: string;
10924
+ };
10925
+ Returns: undefined;
10926
+ };
10927
+ refresh_external_customers_grouped: {
10928
+ Args: never;
10929
+ Returns: undefined;
10930
+ };
9234
10931
  refresh_floricode_derived_code_lists: {
9235
10932
  Args: never;
9236
10933
  Returns: {
@@ -9239,6 +10936,18 @@ export type Database = {
9239
10936
  row_count: number;
9240
10937
  }[];
9241
10938
  };
10939
+ refresh_floricode_derived_for_product: {
10940
+ Args: {
10941
+ p_product_code: string;
10942
+ };
10943
+ Returns: number;
10944
+ };
10945
+ refresh_floricode_derived_for_products: {
10946
+ Args: {
10947
+ _product_ids: string[];
10948
+ };
10949
+ Returns: number;
10950
+ };
9242
10951
  reset_floriday_sync_cursor: {
9243
10952
  Args: {
9244
10953
  p_connection_id: string;
@@ -9246,6 +10955,12 @@ export type Database = {
9246
10955
  };
9247
10956
  Returns: undefined;
9248
10957
  };
10958
+ resolve_product_id_for_item: {
10959
+ Args: {
10960
+ p_product_name: string;
10961
+ };
10962
+ Returns: string;
10963
+ };
9249
10964
  schedule_floriday_additional_services_sync: {
9250
10965
  Args: {
9251
10966
  p_apikey: string;