@flowselections/floriday-afhandeling-module 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist-lib/components/afhandeling/ControleLijstPrint.d.ts +7 -0
  2. package/dist-lib/components/afhandeling/ControleLijstPrint.d.ts.map +1 -0
  3. package/dist-lib/components/afhandeling/ControleLijstPrint.js +67 -0
  4. package/dist-lib/components/afhandeling/ControlePage.d.ts +4 -0
  5. package/dist-lib/components/afhandeling/ControlePage.d.ts.map +1 -0
  6. package/dist-lib/components/afhandeling/ControlePage.js +460 -0
  7. package/dist-lib/components/afhandeling/DagDetailDialog.d.ts.map +1 -1
  8. package/dist-lib/components/afhandeling/DagDetailDialog.js +9 -5
  9. package/dist-lib/components/afhandeling/VervoerderForm.d.ts.map +1 -1
  10. package/dist-lib/components/afhandeling/VervoerderForm.js +10 -1
  11. package/dist-lib/components/afhandeling/VervoerdersPage.d.ts.map +1 -1
  12. package/dist-lib/components/afhandeling/VervoerdersPage.js +3 -2
  13. package/dist-lib/components/afhandeling/WeekAgendaView.d.ts.map +1 -1
  14. package/dist-lib/components/afhandeling/WeekAgendaView.js +15 -5
  15. package/dist-lib/components/afhandeling/WeekdayPicker.d.ts +12 -0
  16. package/dist-lib/components/afhandeling/WeekdayPicker.d.ts.map +1 -0
  17. package/dist-lib/components/afhandeling/WeekdayPicker.js +30 -0
  18. package/dist-lib/components/pickstation/PakbonTemplate.d.ts +1 -0
  19. package/dist-lib/components/pickstation/PakbonTemplate.d.ts.map +1 -1
  20. package/dist-lib/components/pickstation/PakbonTemplate.js +31 -8
  21. package/dist-lib/components/settings/AfhandelingSettingsCard.d.ts.map +1 -1
  22. package/dist-lib/components/settings/AfhandelingSettingsCard.js +9 -2
  23. package/dist-lib/components/ui/responsive-dialog.d.ts +20 -0
  24. package/dist-lib/components/ui/responsive-dialog.d.ts.map +1 -0
  25. package/dist-lib/components/ui/responsive-dialog.js +44 -0
  26. package/dist-lib/hooks/useOrderPlanning.d.ts.map +1 -1
  27. package/dist-lib/hooks/useOrderPlanning.js +17 -6
  28. package/dist-lib/index.d.ts +1 -0
  29. package/dist-lib/index.d.ts.map +1 -1
  30. package/dist-lib/index.js +4 -2
  31. package/dist-lib/integrations/supabase/auth-middleware.d.ts +755 -3
  32. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  33. package/dist-lib/integrations/supabase/client.d.ts +755 -3
  34. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  35. package/dist-lib/integrations/supabase/client.server.d.ts +755 -3
  36. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  37. package/dist-lib/integrations/supabase/types.d.ts +765 -3
  38. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  39. package/dist-lib/lib/afhandelingSettings.functions.d.ts +1565 -57
  40. package/dist-lib/lib/afhandelingSettings.functions.d.ts.map +1 -1
  41. package/dist-lib/lib/afhandelingSettings.functions.js +16 -1
  42. package/dist-lib/lib/carrierMatch.server.d.ts +27 -0
  43. package/dist-lib/lib/carrierMatch.server.d.ts.map +1 -0
  44. package/dist-lib/lib/carrierMatch.server.js +75 -0
  45. package/dist-lib/lib/carriers.functions.d.ts +3781 -15
  46. package/dist-lib/lib/carriers.functions.d.ts.map +1 -1
  47. package/dist-lib/lib/carriers.functions.js +17 -2
  48. package/dist-lib/lib/cartAssignments.functions.d.ts +3775 -15
  49. package/dist-lib/lib/cartAssignments.functions.d.ts.map +1 -1
  50. package/dist-lib/lib/cartControl.functions.d.ts +100519 -0
  51. package/dist-lib/lib/cartControl.functions.d.ts.map +1 -0
  52. package/dist-lib/lib/cartControl.functions.js +489 -0
  53. package/dist-lib/lib/cartRescheduling.d.ts +30 -0
  54. package/dist-lib/lib/cartRescheduling.d.ts.map +1 -0
  55. package/dist-lib/lib/cartRescheduling.js +71 -0
  56. package/dist-lib/lib/floriday.functions.d.ts +755 -3
  57. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  58. package/dist-lib/lib/pickstationI18n.d.ts +8 -0
  59. package/dist-lib/lib/pickstationI18n.d.ts.map +1 -1
  60. package/dist-lib/lib/pickstationI18n.js +48 -0
  61. package/dist-lib/lib/pickstationOrders.server.d.ts +1 -0
  62. package/dist-lib/lib/pickstationOrders.server.d.ts.map +1 -1
  63. package/dist-lib/lib/pickstationOrders.server.js +94 -7
  64. package/dist-lib/lib/pickstationTypes.d.ts +12 -0
  65. package/dist-lib/lib/pickstationTypes.d.ts.map +1 -1
  66. package/dist-lib/lib/planning.d.ts +23 -0
  67. package/dist-lib/lib/planning.d.ts.map +1 -1
  68. package/dist-lib/lib/planning.js +66 -6
  69. package/package.json +6 -1
@@ -14,6 +14,7 @@ export type Database = {
14
14
  max_workdays_earlier_pick: number;
15
15
  pick_days_before_transport: number;
16
16
  pick_distribution_enabled: boolean;
17
+ pick_weekdays: number[];
17
18
  signup_mail_enabled: boolean;
18
19
  signup_mail_lead_minutes: number;
19
20
  signup_mail_purpose: string;
@@ -27,6 +28,7 @@ export type Database = {
27
28
  max_workdays_earlier_pick?: number;
28
29
  pick_days_before_transport?: number;
29
30
  pick_distribution_enabled?: boolean;
31
+ pick_weekdays?: number[];
30
32
  signup_mail_enabled?: boolean;
31
33
  signup_mail_lead_minutes?: number;
32
34
  signup_mail_purpose?: string;
@@ -40,6 +42,7 @@ export type Database = {
40
42
  max_workdays_earlier_pick?: number;
41
43
  pick_days_before_transport?: number;
42
44
  pick_distribution_enabled?: boolean;
45
+ pick_weekdays?: number[];
43
46
  signup_mail_enabled?: boolean;
44
47
  signup_mail_lead_minutes?: number;
45
48
  signup_mail_purpose?: string;
@@ -458,6 +461,48 @@ export type Database = {
458
461
  }
459
462
  ];
460
463
  };
464
+ carrier_signup_dispatch_runs: {
465
+ Row: {
466
+ detail: Json | null;
467
+ error: string | null;
468
+ finished_at: string | null;
469
+ groups: number;
470
+ id: string;
471
+ ok: boolean;
472
+ reason: string | null;
473
+ sent: number;
474
+ skipped: Json;
475
+ started_at: string;
476
+ unassigned: Json;
477
+ };
478
+ Insert: {
479
+ detail?: Json | null;
480
+ error?: string | null;
481
+ finished_at?: string | null;
482
+ groups?: number;
483
+ id?: string;
484
+ ok?: boolean;
485
+ reason?: string | null;
486
+ sent?: number;
487
+ skipped?: Json;
488
+ started_at?: string;
489
+ unassigned?: Json;
490
+ };
491
+ Update: {
492
+ detail?: Json | null;
493
+ error?: string | null;
494
+ finished_at?: string | null;
495
+ groups?: number;
496
+ id?: string;
497
+ ok?: boolean;
498
+ reason?: string | null;
499
+ sent?: number;
500
+ skipped?: Json;
501
+ started_at?: string;
502
+ unassigned?: Json;
503
+ };
504
+ Relationships: [];
505
+ };
461
506
  carrier_signup_dispatches: {
462
507
  Row: {
463
508
  carrier_id: string;
@@ -511,6 +556,7 @@ export type Database = {
511
556
  contact_person: string | null;
512
557
  created_at: string;
513
558
  delivery_days: number | null;
559
+ delivery_weekdays: number[];
514
560
  email: string | null;
515
561
  id: string;
516
562
  is_default: boolean;
@@ -518,6 +564,7 @@ export type Database = {
518
564
  notes: string | null;
519
565
  phone: string | null;
520
566
  pickup_moments: Json;
567
+ pickup_weekdays: number[];
521
568
  service_cities: string[];
522
569
  service_countries: string[];
523
570
  service_provinces: string[];
@@ -533,6 +580,7 @@ export type Database = {
533
580
  contact_person?: string | null;
534
581
  created_at?: string;
535
582
  delivery_days?: number | null;
583
+ delivery_weekdays?: number[];
536
584
  email?: string | null;
537
585
  id?: string;
538
586
  is_default?: boolean;
@@ -540,6 +588,7 @@ export type Database = {
540
588
  notes?: string | null;
541
589
  phone?: string | null;
542
590
  pickup_moments?: Json;
591
+ pickup_weekdays?: number[];
543
592
  service_cities?: string[];
544
593
  service_countries?: string[];
545
594
  service_provinces?: string[];
@@ -555,6 +604,7 @@ export type Database = {
555
604
  contact_person?: string | null;
556
605
  created_at?: string;
557
606
  delivery_days?: number | null;
607
+ delivery_weekdays?: number[];
558
608
  email?: string | null;
559
609
  id?: string;
560
610
  is_default?: boolean;
@@ -562,6 +612,7 @@ export type Database = {
562
612
  notes?: string | null;
563
613
  phone?: string | null;
564
614
  pickup_moments?: Json;
615
+ pickup_weekdays?: number[];
565
616
  service_cities?: string[];
566
617
  service_countries?: string[];
567
618
  service_provinces?: string[];
@@ -574,6 +625,182 @@ export type Database = {
574
625
  };
575
626
  Relationships: [];
576
627
  };
628
+ cart_control_draft: {
629
+ Row: {
630
+ cart_states: Json;
631
+ checked_keys: Json;
632
+ draft_date: string;
633
+ form_state: Json;
634
+ notes: string;
635
+ updated_at: string;
636
+ user_id: string;
637
+ };
638
+ Insert: {
639
+ cart_states?: Json;
640
+ checked_keys?: Json;
641
+ draft_date: string;
642
+ form_state?: Json;
643
+ notes?: string;
644
+ updated_at?: string;
645
+ user_id: string;
646
+ };
647
+ Update: {
648
+ cart_states?: Json;
649
+ checked_keys?: Json;
650
+ draft_date?: string;
651
+ form_state?: Json;
652
+ notes?: string;
653
+ updated_at?: string;
654
+ user_id?: string;
655
+ };
656
+ Relationships: [];
657
+ };
658
+ cart_control_items: {
659
+ Row: {
660
+ action: string;
661
+ block_reason: string | null;
662
+ carrier_name: string | null;
663
+ cart_index: number;
664
+ cart_number_id: string | null;
665
+ cart_number_label: string | null;
666
+ created_at: string;
667
+ customer_name: string | null;
668
+ delivery_date: string | null;
669
+ id: string;
670
+ new_pick_date: string | null;
671
+ order_id: string;
672
+ order_number: string | null;
673
+ order_source: string;
674
+ pickup_date: string | null;
675
+ session_id: string;
676
+ };
677
+ Insert: {
678
+ action: string;
679
+ block_reason?: string | null;
680
+ carrier_name?: string | null;
681
+ cart_index: number;
682
+ cart_number_id?: string | null;
683
+ cart_number_label?: string | null;
684
+ created_at?: string;
685
+ customer_name?: string | null;
686
+ delivery_date?: string | null;
687
+ id?: string;
688
+ new_pick_date?: string | null;
689
+ order_id: string;
690
+ order_number?: string | null;
691
+ order_source: string;
692
+ pickup_date?: string | null;
693
+ session_id: string;
694
+ };
695
+ Update: {
696
+ action?: string;
697
+ block_reason?: string | null;
698
+ carrier_name?: string | null;
699
+ cart_index?: number;
700
+ cart_number_id?: string | null;
701
+ cart_number_label?: string | null;
702
+ created_at?: string;
703
+ customer_name?: string | null;
704
+ delivery_date?: string | null;
705
+ id?: string;
706
+ new_pick_date?: string | null;
707
+ order_id?: string;
708
+ order_number?: string | null;
709
+ order_source?: string;
710
+ pickup_date?: string | null;
711
+ session_id?: string;
712
+ };
713
+ Relationships: [
714
+ {
715
+ foreignKeyName: "cart_control_items_session_id_fkey";
716
+ columns: ["session_id"];
717
+ isOneToOne: false;
718
+ referencedRelation: "cart_control_sessions";
719
+ referencedColumns: ["id"];
720
+ }
721
+ ];
722
+ };
723
+ cart_control_sessions: {
724
+ Row: {
725
+ blocked_count: number;
726
+ checked_count: number;
727
+ control_date: string;
728
+ created_at: string;
729
+ id: string;
730
+ notes: string | null;
731
+ performed_at: string;
732
+ rescheduled_count: number;
733
+ stock_consumed_at: string | null;
734
+ total_carts: number;
735
+ updated_at: string;
736
+ user_id: string;
737
+ };
738
+ Insert: {
739
+ blocked_count?: number;
740
+ checked_count?: number;
741
+ control_date?: string;
742
+ created_at?: string;
743
+ id?: string;
744
+ notes?: string | null;
745
+ performed_at?: string;
746
+ rescheduled_count?: number;
747
+ stock_consumed_at?: string | null;
748
+ total_carts?: number;
749
+ updated_at?: string;
750
+ user_id: string;
751
+ };
752
+ Update: {
753
+ blocked_count?: number;
754
+ checked_count?: number;
755
+ control_date?: string;
756
+ created_at?: string;
757
+ id?: string;
758
+ notes?: string | null;
759
+ performed_at?: string;
760
+ rescheduled_count?: number;
761
+ stock_consumed_at?: string | null;
762
+ total_carts?: number;
763
+ updated_at?: string;
764
+ user_id?: string;
765
+ };
766
+ Relationships: [];
767
+ };
768
+ cart_numbers: {
769
+ Row: {
770
+ assigned_at: string;
771
+ cart_index: number;
772
+ cart_number: string;
773
+ day_seq: number;
774
+ id: string;
775
+ order_id: string;
776
+ order_source: string;
777
+ pick_date: string;
778
+ status: string;
779
+ };
780
+ Insert: {
781
+ assigned_at?: string;
782
+ cart_index: number;
783
+ cart_number: string;
784
+ day_seq: number;
785
+ id?: string;
786
+ order_id: string;
787
+ order_source: string;
788
+ pick_date: string;
789
+ status?: string;
790
+ };
791
+ Update: {
792
+ assigned_at?: string;
793
+ cart_index?: number;
794
+ cart_number?: string;
795
+ day_seq?: number;
796
+ id?: string;
797
+ order_id?: string;
798
+ order_source?: string;
799
+ pick_date?: string;
800
+ status?: string;
801
+ };
802
+ Relationships: [];
803
+ };
577
804
  cart_pick_overrides: {
578
805
  Row: {
579
806
  cart_index: number;
@@ -1266,6 +1493,54 @@ export type Database = {
1266
1493
  }
1267
1494
  ];
1268
1495
  };
1496
+ dashboard_critical_alerts: {
1497
+ Row: {
1498
+ alert_key: string;
1499
+ alert_type: string;
1500
+ created_at: string;
1501
+ description: string | null;
1502
+ id: string;
1503
+ metadata: Json | null;
1504
+ priority: string;
1505
+ raised_at: string;
1506
+ related_cart_ids: string[] | null;
1507
+ resolved_at: string | null;
1508
+ title: string;
1509
+ updated_at: string;
1510
+ user_id: string;
1511
+ };
1512
+ Insert: {
1513
+ alert_key: string;
1514
+ alert_type: string;
1515
+ created_at?: string;
1516
+ description?: string | null;
1517
+ id?: string;
1518
+ metadata?: Json | null;
1519
+ priority?: string;
1520
+ raised_at?: string;
1521
+ related_cart_ids?: string[] | null;
1522
+ resolved_at?: string | null;
1523
+ title: string;
1524
+ updated_at?: string;
1525
+ user_id: string;
1526
+ };
1527
+ Update: {
1528
+ alert_key?: string;
1529
+ alert_type?: string;
1530
+ created_at?: string;
1531
+ description?: string | null;
1532
+ id?: string;
1533
+ metadata?: Json | null;
1534
+ priority?: string;
1535
+ raised_at?: string;
1536
+ related_cart_ids?: string[] | null;
1537
+ resolved_at?: string | null;
1538
+ title?: string;
1539
+ updated_at?: string;
1540
+ user_id?: string;
1541
+ };
1542
+ Relationships: [];
1543
+ };
1269
1544
  dashboard_daily_reports: {
1270
1545
  Row: {
1271
1546
  created_at: string;
@@ -2804,6 +3079,7 @@ export type Database = {
2804
3079
  };
2805
3080
  floricode_sync_state: {
2806
3081
  Row: {
3082
+ cursor_skip: number;
2807
3083
  error_message: string | null;
2808
3084
  last_change_date_time: string | null;
2809
3085
  last_sequence_number: number;
@@ -2813,6 +3089,7 @@ export type Database = {
2813
3089
  updated_at: string;
2814
3090
  };
2815
3091
  Insert: {
3092
+ cursor_skip?: number;
2816
3093
  error_message?: string | null;
2817
3094
  last_change_date_time?: string | null;
2818
3095
  last_sequence_number?: number;
@@ -2822,6 +3099,7 @@ export type Database = {
2822
3099
  updated_at?: string;
2823
3100
  };
2824
3101
  Update: {
3102
+ cursor_skip?: number;
2825
3103
  error_message?: string | null;
2826
3104
  last_change_date_time?: string | null;
2827
3105
  last_sequence_number?: number;
@@ -5260,6 +5538,97 @@ export type Database = {
5260
5538
  };
5261
5539
  Relationships: [];
5262
5540
  };
5541
+ manufacture_product_components: {
5542
+ Row: {
5543
+ component_type: string;
5544
+ created_at: string;
5545
+ id: string;
5546
+ manufacture_product_id: string;
5547
+ product_group_id: string | null;
5548
+ quantity: number;
5549
+ trade_item_id: string | null;
5550
+ unit: string;
5551
+ };
5552
+ Insert: {
5553
+ component_type: string;
5554
+ created_at?: string;
5555
+ id?: string;
5556
+ manufacture_product_id: string;
5557
+ product_group_id?: string | null;
5558
+ quantity?: number;
5559
+ trade_item_id?: string | null;
5560
+ unit?: string;
5561
+ };
5562
+ Update: {
5563
+ component_type?: string;
5564
+ created_at?: string;
5565
+ id?: string;
5566
+ manufacture_product_id?: string;
5567
+ product_group_id?: string | null;
5568
+ quantity?: number;
5569
+ trade_item_id?: string | null;
5570
+ unit?: string;
5571
+ };
5572
+ Relationships: [
5573
+ {
5574
+ foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey";
5575
+ columns: ["manufacture_product_id"];
5576
+ isOneToOne: false;
5577
+ referencedRelation: "manufacture_product_possible_stock_view";
5578
+ referencedColumns: ["manufacture_product_id"];
5579
+ },
5580
+ {
5581
+ foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey";
5582
+ columns: ["manufacture_product_id"];
5583
+ isOneToOne: false;
5584
+ referencedRelation: "manufacture_products";
5585
+ referencedColumns: ["id"];
5586
+ },
5587
+ {
5588
+ foreignKeyName: "manufacture_product_components_product_group_id_fkey";
5589
+ columns: ["product_group_id"];
5590
+ isOneToOne: false;
5591
+ referencedRelation: "product_groups";
5592
+ referencedColumns: ["id"];
5593
+ }
5594
+ ];
5595
+ };
5596
+ manufacture_products: {
5597
+ Row: {
5598
+ created_at: string;
5599
+ description: string | null;
5600
+ id: string;
5601
+ is_active: boolean;
5602
+ name: string;
5603
+ produced_stock: number;
5604
+ product_code: string;
5605
+ tenant_id: string;
5606
+ updated_at: string;
5607
+ };
5608
+ Insert: {
5609
+ created_at?: string;
5610
+ description?: string | null;
5611
+ id?: string;
5612
+ is_active?: boolean;
5613
+ name: string;
5614
+ produced_stock?: number;
5615
+ product_code: string;
5616
+ tenant_id: string;
5617
+ updated_at?: string;
5618
+ };
5619
+ Update: {
5620
+ created_at?: string;
5621
+ description?: string | null;
5622
+ id?: string;
5623
+ is_active?: boolean;
5624
+ name?: string;
5625
+ produced_stock?: number;
5626
+ product_code?: string;
5627
+ tenant_id?: string;
5628
+ updated_at?: string;
5629
+ };
5630
+ Relationships: [];
5631
+ };
5263
5632
  monteurs: {
5264
5633
  Row: {
5265
5634
  avatar_url: string | null;
@@ -6252,6 +6621,68 @@ export type Database = {
6252
6621
  };
6253
6622
  Relationships: [];
6254
6623
  };
6624
+ product_group_items: {
6625
+ Row: {
6626
+ created_at: string;
6627
+ id: string;
6628
+ product_group_id: string;
6629
+ quantity: number;
6630
+ trade_item_id: string;
6631
+ };
6632
+ Insert: {
6633
+ created_at?: string;
6634
+ id?: string;
6635
+ product_group_id: string;
6636
+ quantity?: number;
6637
+ trade_item_id: string;
6638
+ };
6639
+ Update: {
6640
+ created_at?: string;
6641
+ id?: string;
6642
+ product_group_id?: string;
6643
+ quantity?: number;
6644
+ trade_item_id?: string;
6645
+ };
6646
+ Relationships: [
6647
+ {
6648
+ foreignKeyName: "product_group_items_product_group_id_fkey";
6649
+ columns: ["product_group_id"];
6650
+ isOneToOne: false;
6651
+ referencedRelation: "product_groups";
6652
+ referencedColumns: ["id"];
6653
+ }
6654
+ ];
6655
+ };
6656
+ product_groups: {
6657
+ Row: {
6658
+ created_at: string;
6659
+ description: string | null;
6660
+ id: string;
6661
+ is_active: boolean;
6662
+ name: string;
6663
+ tenant_id: string;
6664
+ updated_at: string;
6665
+ };
6666
+ Insert: {
6667
+ created_at?: string;
6668
+ description?: string | null;
6669
+ id?: string;
6670
+ is_active?: boolean;
6671
+ name: string;
6672
+ tenant_id: string;
6673
+ updated_at?: string;
6674
+ };
6675
+ Update: {
6676
+ created_at?: string;
6677
+ description?: string | null;
6678
+ id?: string;
6679
+ is_active?: boolean;
6680
+ name?: string;
6681
+ tenant_id?: string;
6682
+ updated_at?: string;
6683
+ };
6684
+ Relationships: [];
6685
+ };
6255
6686
  products: {
6256
6687
  Row: {
6257
6688
  barcode: string | null;
@@ -6271,6 +6702,7 @@ export type Database = {
6271
6702
  purchase_price: number | null;
6272
6703
  quantity: number;
6273
6704
  sale_price: number | null;
6705
+ trade_item_key: string | null;
6274
6706
  unit: string;
6275
6707
  updated_at: string;
6276
6708
  weight: string | null;
@@ -6293,6 +6725,7 @@ export type Database = {
6293
6725
  purchase_price?: number | null;
6294
6726
  quantity?: number;
6295
6727
  sale_price?: number | null;
6728
+ trade_item_key?: string | null;
6296
6729
  unit?: string;
6297
6730
  updated_at?: string;
6298
6731
  weight?: string | null;
@@ -6315,6 +6748,7 @@ export type Database = {
6315
6748
  purchase_price?: number | null;
6316
6749
  quantity?: number;
6317
6750
  sale_price?: number | null;
6751
+ trade_item_key?: string | null;
6318
6752
  unit?: string;
6319
6753
  updated_at?: string;
6320
6754
  weight?: string | null;
@@ -7166,6 +7600,60 @@ export type Database = {
7166
7600
  };
7167
7601
  Relationships: [];
7168
7602
  };
7603
+ stock_mutation_log: {
7604
+ Row: {
7605
+ connection_id: string | null;
7606
+ created_at: string;
7607
+ created_by: string | null;
7608
+ id: string;
7609
+ mutation_type: string;
7610
+ order_id: string | null;
7611
+ order_item_id: string | null;
7612
+ order_source: string | null;
7613
+ physical_after: number | null;
7614
+ physical_before: number | null;
7615
+ qty_delta: number;
7616
+ reason: string | null;
7617
+ reserved_after: number | null;
7618
+ reserved_before: number | null;
7619
+ trade_item_key: string;
7620
+ };
7621
+ Insert: {
7622
+ connection_id?: string | null;
7623
+ created_at?: string;
7624
+ created_by?: string | null;
7625
+ id?: string;
7626
+ mutation_type: string;
7627
+ order_id?: string | null;
7628
+ order_item_id?: string | null;
7629
+ order_source?: string | null;
7630
+ physical_after?: number | null;
7631
+ physical_before?: number | null;
7632
+ qty_delta: number;
7633
+ reason?: string | null;
7634
+ reserved_after?: number | null;
7635
+ reserved_before?: number | null;
7636
+ trade_item_key: string;
7637
+ };
7638
+ Update: {
7639
+ connection_id?: string | null;
7640
+ created_at?: string;
7641
+ created_by?: string | null;
7642
+ id?: string;
7643
+ mutation_type?: string;
7644
+ order_id?: string | null;
7645
+ order_item_id?: string | null;
7646
+ order_source?: string | null;
7647
+ physical_after?: number | null;
7648
+ physical_before?: number | null;
7649
+ qty_delta?: number;
7650
+ reason?: string | null;
7651
+ reserved_after?: number | null;
7652
+ reserved_before?: number | null;
7653
+ trade_item_key?: string;
7654
+ };
7655
+ Relationships: [];
7656
+ };
7169
7657
  supplier_products: {
7170
7658
  Row: {
7171
7659
  article_number: string | null;
@@ -7431,7 +7919,13 @@ export type Database = {
7431
7919
  connection_id: string | null;
7432
7920
  created_at: string;
7433
7921
  data: Json;
7922
+ floriday_id: string | null;
7923
+ floriday_link_error: string | null;
7924
+ floriday_link_status: string;
7434
7925
  id: string;
7926
+ last_floriday_sync_at: string | null;
7927
+ missing_required_fields: string[];
7928
+ source: string;
7435
7929
  updated_at: string;
7436
7930
  user_id: string;
7437
7931
  };
@@ -7439,7 +7933,13 @@ export type Database = {
7439
7933
  connection_id?: string | null;
7440
7934
  created_at?: string;
7441
7935
  data?: Json;
7936
+ floriday_id?: string | null;
7937
+ floriday_link_error?: string | null;
7938
+ floriday_link_status?: string;
7442
7939
  id?: string;
7940
+ last_floriday_sync_at?: string | null;
7941
+ missing_required_fields?: string[];
7942
+ source?: string;
7443
7943
  updated_at?: string;
7444
7944
  user_id: string;
7445
7945
  };
@@ -7447,7 +7947,55 @@ export type Database = {
7447
7947
  connection_id?: string | null;
7448
7948
  created_at?: string;
7449
7949
  data?: Json;
7950
+ floriday_id?: string | null;
7951
+ floriday_link_error?: string | null;
7952
+ floriday_link_status?: string;
7450
7953
  id?: string;
7954
+ last_floriday_sync_at?: string | null;
7955
+ missing_required_fields?: string[];
7956
+ source?: string;
7957
+ updated_at?: string;
7958
+ user_id?: string;
7959
+ };
7960
+ Relationships: [];
7961
+ };
7962
+ trade_item_stock: {
7963
+ Row: {
7964
+ connection_id: string;
7965
+ created_at: string;
7966
+ id: string;
7967
+ incoming_stock: number;
7968
+ minimum_stock: number;
7969
+ notes: string | null;
7970
+ physical_stock: number;
7971
+ reserved_stock: number;
7972
+ trade_item_key: string;
7973
+ updated_at: string;
7974
+ user_id: string;
7975
+ };
7976
+ Insert: {
7977
+ connection_id: string;
7978
+ created_at?: string;
7979
+ id?: string;
7980
+ incoming_stock?: number;
7981
+ minimum_stock?: number;
7982
+ notes?: string | null;
7983
+ physical_stock?: number;
7984
+ reserved_stock?: number;
7985
+ trade_item_key: string;
7986
+ updated_at?: string;
7987
+ user_id: string;
7988
+ };
7989
+ Update: {
7990
+ connection_id?: string;
7991
+ created_at?: string;
7992
+ id?: string;
7993
+ incoming_stock?: number;
7994
+ minimum_stock?: number;
7995
+ notes?: string | null;
7996
+ physical_stock?: number;
7997
+ reserved_stock?: number;
7998
+ trade_item_key?: string;
7451
7999
  updated_at?: string;
7452
8000
  user_id?: string;
7453
8001
  };
@@ -7803,6 +8351,7 @@ export type Database = {
7803
8351
  };
7804
8352
  twinfield_invoice_sync_logs: {
7805
8353
  Row: {
8354
+ action_type: string | null;
7806
8355
  created_at: string;
7807
8356
  details: Json | null;
7808
8357
  duration_ms: number | null;
@@ -7815,6 +8364,7 @@ export type Database = {
7815
8364
  user_id: string;
7816
8365
  };
7817
8366
  Insert: {
8367
+ action_type?: string | null;
7818
8368
  created_at?: string;
7819
8369
  details?: Json | null;
7820
8370
  duration_ms?: number | null;
@@ -7827,6 +8377,7 @@ export type Database = {
7827
8377
  user_id: string;
7828
8378
  };
7829
8379
  Update: {
8380
+ action_type?: string | null;
7830
8381
  created_at?: string;
7831
8382
  details?: Json | null;
7832
8383
  duration_ms?: number | null;
@@ -8066,6 +8617,57 @@ export type Database = {
8066
8617
  }
8067
8618
  ];
8068
8619
  };
8620
+ twinfield_request_metrics: {
8621
+ Row: {
8622
+ bucket_hour: string;
8623
+ connection_id: string;
8624
+ error_count: number;
8625
+ rate_limited_count: number;
8626
+ request_count: number;
8627
+ updated_at: string;
8628
+ };
8629
+ Insert: {
8630
+ bucket_hour: string;
8631
+ connection_id: string;
8632
+ error_count?: number;
8633
+ rate_limited_count?: number;
8634
+ request_count?: number;
8635
+ updated_at?: string;
8636
+ };
8637
+ Update: {
8638
+ bucket_hour?: string;
8639
+ connection_id?: string;
8640
+ error_count?: number;
8641
+ rate_limited_count?: number;
8642
+ request_count?: number;
8643
+ updated_at?: string;
8644
+ };
8645
+ Relationships: [];
8646
+ };
8647
+ twinfield_session_cache: {
8648
+ Row: {
8649
+ cluster: string;
8650
+ created_at: string;
8651
+ expires_at: string;
8652
+ session_id: string;
8653
+ user_id: string;
8654
+ };
8655
+ Insert: {
8656
+ cluster: string;
8657
+ created_at?: string;
8658
+ expires_at: string;
8659
+ session_id: string;
8660
+ user_id: string;
8661
+ };
8662
+ Update: {
8663
+ cluster?: string;
8664
+ created_at?: string;
8665
+ expires_at?: string;
8666
+ session_id?: string;
8667
+ user_id?: string;
8668
+ };
8669
+ Relationships: [];
8670
+ };
8069
8671
  twinfield_settings: {
8070
8672
  Row: {
8071
8673
  active_environment: string;
@@ -8659,6 +9261,37 @@ export type Database = {
8659
9261
  };
8660
9262
  Relationships: [];
8661
9263
  };
9264
+ manufacture_product_possible_stock_view: {
9265
+ Row: {
9266
+ component_count: number | null;
9267
+ manufacture_product_id: string | null;
9268
+ possible_stock: number | null;
9269
+ };
9270
+ Relationships: [];
9271
+ };
9272
+ product_group_stock_view: {
9273
+ Row: {
9274
+ item_count: number | null;
9275
+ product_group_id: string | null;
9276
+ total_stock: number | null;
9277
+ };
9278
+ Relationships: [
9279
+ {
9280
+ foreignKeyName: "product_group_items_product_group_id_fkey";
9281
+ columns: ["product_group_id"];
9282
+ isOneToOne: false;
9283
+ referencedRelation: "product_groups";
9284
+ referencedColumns: ["id"];
9285
+ }
9286
+ ];
9287
+ };
9288
+ trade_item_stock_view: {
9289
+ Row: {
9290
+ stock: number | null;
9291
+ trade_item_id: string | null;
9292
+ };
9293
+ Relationships: [];
9294
+ };
8662
9295
  v_external_customers_exact: {
8663
9296
  Row: {
8664
9297
  account_number: string | null;
@@ -8924,6 +9557,68 @@ export type Database = {
8924
9557
  };
8925
9558
  Returns: number;
8926
9559
  };
9560
+ afh_city_code: {
9561
+ Args: {
9562
+ _city: string;
9563
+ _country: string;
9564
+ };
9565
+ Returns: string;
9566
+ };
9567
+ afh_normalize_country: {
9568
+ Args: {
9569
+ _raw: string;
9570
+ };
9571
+ Returns: string;
9572
+ };
9573
+ afh_normalize_nl_province: {
9574
+ Args: {
9575
+ _raw: string;
9576
+ };
9577
+ Returns: string;
9578
+ };
9579
+ afh_subtract_workdays: {
9580
+ Args: {
9581
+ _date: string;
9582
+ _days: number;
9583
+ };
9584
+ Returns: string;
9585
+ };
9586
+ apply_stock_consumption: {
9587
+ Args: {
9588
+ p_order_id: string;
9589
+ p_order_item_id: string;
9590
+ p_qty: number;
9591
+ p_reason: string;
9592
+ p_source: string;
9593
+ p_trade_item_key: string;
9594
+ };
9595
+ Returns: undefined;
9596
+ };
9597
+ apply_stock_reservation: {
9598
+ Args: {
9599
+ p_order_id: string;
9600
+ p_order_item_id: string;
9601
+ p_qty: number;
9602
+ p_reason: string;
9603
+ p_source: string;
9604
+ p_trade_item_key: string;
9605
+ };
9606
+ Returns: undefined;
9607
+ };
9608
+ assign_cart_numbers: {
9609
+ Args: {
9610
+ p_carts: Json;
9611
+ };
9612
+ Returns: {
9613
+ cart_index: number;
9614
+ cart_number: string;
9615
+ day_seq: number;
9616
+ order_id: string;
9617
+ order_source: string;
9618
+ pick_date: string;
9619
+ status: string;
9620
+ }[];
9621
+ };
8927
9622
  assign_floriday_order_numbers: {
8928
9623
  Args: {
8929
9624
  p_ids: string[];
@@ -8933,6 +9628,12 @@ export type Database = {
8933
9628
  order_number: string;
8934
9629
  }[];
8935
9630
  };
9631
+ backfill_open_order_reservations: {
9632
+ Args: never;
9633
+ Returns: {
9634
+ processed_items: number;
9635
+ }[];
9636
+ };
8936
9637
  call_exact_route: {
8937
9638
  Args: {
8938
9639
  path: string;
@@ -8943,10 +9644,37 @@ export type Database = {
8943
9644
  Args: never;
8944
9645
  Returns: number;
8945
9646
  };
9647
+ control_get_todays_carts: {
9648
+ Args: never;
9649
+ Returns: {
9650
+ cart_index: number;
9651
+ cart_number: string;
9652
+ cart_number_id: string;
9653
+ order_id: string;
9654
+ order_source: string;
9655
+ pick_date: string;
9656
+ status: string;
9657
+ }[];
9658
+ };
9659
+ count_distinct_regulatory_products: {
9660
+ Args: never;
9661
+ Returns: number;
9662
+ };
8946
9663
  current_monteur_id: {
8947
9664
  Args: never;
8948
9665
  Returns: string;
8949
9666
  };
9667
+ dashboard_alert_counts: {
9668
+ Args: never;
9669
+ Returns: Json;
9670
+ };
9671
+ dashboard_alert_rows: {
9672
+ Args: {
9673
+ check_id: string;
9674
+ row_limit?: number;
9675
+ };
9676
+ Returns: Json;
9677
+ };
8950
9678
  dashboard_list_public_schema: {
8951
9679
  Args: never;
8952
9680
  Returns: {
@@ -8955,6 +9683,12 @@ export type Database = {
8955
9683
  table_name: string;
8956
9684
  }[];
8957
9685
  };
9686
+ dispatch_carrier_signups_sql: {
9687
+ Args: {
9688
+ _catchup?: string;
9689
+ };
9690
+ Returns: Json;
9691
+ };
8958
9692
  email_auth_decrypt: {
8959
9693
  Args: {
8960
9694
  cipher: string;
@@ -9027,6 +9761,19 @@ export type Database = {
9027
9761
  };
9028
9762
  Returns: boolean;
9029
9763
  };
9764
+ find_trade_item_key_by_name: {
9765
+ Args: {
9766
+ p_name: string;
9767
+ };
9768
+ Returns: string;
9769
+ };
9770
+ format_cart_number: {
9771
+ Args: {
9772
+ p_pick_date: string;
9773
+ p_seq: number;
9774
+ };
9775
+ Returns: string;
9776
+ };
9030
9777
  get_active_floriday_connection_public: {
9031
9778
  Args: never;
9032
9779
  Returns: {
@@ -9231,14 +9978,29 @@ export type Database = {
9231
9978
  };
9232
9979
  Returns: undefined;
9233
9980
  };
9981
+ pickstation_set_cart_status: {
9982
+ Args: {
9983
+ p_cart_index: number;
9984
+ p_order_id: string;
9985
+ p_order_source: string;
9986
+ p_status: string;
9987
+ };
9988
+ Returns: undefined;
9989
+ };
9234
9990
  refresh_floricode_derived_code_lists: {
9235
9991
  Args: never;
9236
9992
  Returns: {
9237
- out_environment: string;
9238
- out_list_name: string;
9239
- out_row_count: number;
9993
+ environment: string;
9994
+ list_name: string;
9995
+ row_count: number;
9240
9996
  }[];
9241
9997
  };
9998
+ refresh_floricode_derived_for_product: {
9999
+ Args: {
10000
+ p_product_code: string;
10001
+ };
10002
+ Returns: number;
10003
+ };
9242
10004
  reset_floriday_sync_cursor: {
9243
10005
  Args: {
9244
10006
  p_connection_id: string;