@flowselections/mailbox-orders 1.0.4 → 1.0.6

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.
@@ -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;
@@ -4015,6 +4293,24 @@ export type Database = {
4015
4293
  };
4016
4294
  Relationships: [];
4017
4295
  };
4296
+ floriday_order_number_map: {
4297
+ Row: {
4298
+ created_at: string;
4299
+ floriday_id: string;
4300
+ order_number: string;
4301
+ };
4302
+ Insert: {
4303
+ created_at?: string;
4304
+ floriday_id: string;
4305
+ order_number: string;
4306
+ };
4307
+ Update: {
4308
+ created_at?: string;
4309
+ floriday_id?: string;
4310
+ order_number?: string;
4311
+ };
4312
+ Relationships: [];
4313
+ };
4018
4314
  floriday_packings_cache: {
4019
4315
  Row: {
4020
4316
  connection_id: string;
@@ -5242,6 +5538,97 @@ export type Database = {
5242
5538
  };
5243
5539
  Relationships: [];
5244
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
+ };
5245
5632
  monteurs: {
5246
5633
  Row: {
5247
5634
  avatar_url: string | null;
@@ -5933,6 +6320,24 @@ export type Database = {
5933
6320
  }
5934
6321
  ];
5935
6322
  };
6323
+ order_number_counters: {
6324
+ Row: {
6325
+ last_value: number;
6326
+ updated_at: string;
6327
+ year: number;
6328
+ };
6329
+ Insert: {
6330
+ last_value?: number;
6331
+ updated_at?: string;
6332
+ year: number;
6333
+ };
6334
+ Update: {
6335
+ last_value?: number;
6336
+ updated_at?: string;
6337
+ year?: number;
6338
+ };
6339
+ Relationships: [];
6340
+ };
5936
6341
  orders: {
5937
6342
  Row: {
5938
6343
  created_at: string;
@@ -5945,6 +6350,7 @@ export type Database = {
5945
6350
  notes: string | null;
5946
6351
  order_date: string;
5947
6352
  order_number: string;
6353
+ order_source: string;
5948
6354
  status: string;
5949
6355
  total: string;
5950
6356
  updated_at: string;
@@ -5960,6 +6366,7 @@ export type Database = {
5960
6366
  notes?: string | null;
5961
6367
  order_date?: string;
5962
6368
  order_number: string;
6369
+ order_source?: string;
5963
6370
  status?: string;
5964
6371
  total?: string;
5965
6372
  updated_at?: string;
@@ -5975,6 +6382,7 @@ export type Database = {
5975
6382
  notes?: string | null;
5976
6383
  order_date?: string;
5977
6384
  order_number?: string;
6385
+ order_source?: string;
5978
6386
  status?: string;
5979
6387
  total?: string;
5980
6388
  updated_at?: string;
@@ -6213,6 +6621,68 @@ export type Database = {
6213
6621
  };
6214
6622
  Relationships: [];
6215
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
+ };
6216
6686
  products: {
6217
6687
  Row: {
6218
6688
  barcode: string | null;
@@ -6232,6 +6702,7 @@ export type Database = {
6232
6702
  purchase_price: number | null;
6233
6703
  quantity: number;
6234
6704
  sale_price: number | null;
6705
+ trade_item_key: string | null;
6235
6706
  unit: string;
6236
6707
  updated_at: string;
6237
6708
  weight: string | null;
@@ -6254,6 +6725,7 @@ export type Database = {
6254
6725
  purchase_price?: number | null;
6255
6726
  quantity?: number;
6256
6727
  sale_price?: number | null;
6728
+ trade_item_key?: string | null;
6257
6729
  unit?: string;
6258
6730
  updated_at?: string;
6259
6731
  weight?: string | null;
@@ -6276,6 +6748,7 @@ export type Database = {
6276
6748
  purchase_price?: number | null;
6277
6749
  quantity?: number;
6278
6750
  sale_price?: number | null;
6751
+ trade_item_key?: string | null;
6279
6752
  unit?: string;
6280
6753
  updated_at?: string;
6281
6754
  weight?: string | null;
@@ -7127,6 +7600,60 @@ export type Database = {
7127
7600
  };
7128
7601
  Relationships: [];
7129
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
+ };
7130
7657
  supplier_products: {
7131
7658
  Row: {
7132
7659
  article_number: string | null;
@@ -7392,7 +7919,13 @@ export type Database = {
7392
7919
  connection_id: string | null;
7393
7920
  created_at: string;
7394
7921
  data: Json;
7922
+ floriday_id: string | null;
7923
+ floriday_link_error: string | null;
7924
+ floriday_link_status: string;
7395
7925
  id: string;
7926
+ last_floriday_sync_at: string | null;
7927
+ missing_required_fields: string[];
7928
+ source: string;
7396
7929
  updated_at: string;
7397
7930
  user_id: string;
7398
7931
  };
@@ -7400,7 +7933,13 @@ export type Database = {
7400
7933
  connection_id?: string | null;
7401
7934
  created_at?: string;
7402
7935
  data?: Json;
7936
+ floriday_id?: string | null;
7937
+ floriday_link_error?: string | null;
7938
+ floriday_link_status?: string;
7403
7939
  id?: string;
7940
+ last_floriday_sync_at?: string | null;
7941
+ missing_required_fields?: string[];
7942
+ source?: string;
7404
7943
  updated_at?: string;
7405
7944
  user_id: string;
7406
7945
  };
@@ -7408,7 +7947,55 @@ export type Database = {
7408
7947
  connection_id?: string | null;
7409
7948
  created_at?: string;
7410
7949
  data?: Json;
7950
+ floriday_id?: string | null;
7951
+ floriday_link_error?: string | null;
7952
+ floriday_link_status?: string;
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;
7411
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;
7412
7999
  updated_at?: string;
7413
8000
  user_id?: string;
7414
8001
  };
@@ -7764,6 +8351,7 @@ export type Database = {
7764
8351
  };
7765
8352
  twinfield_invoice_sync_logs: {
7766
8353
  Row: {
8354
+ action_type: string | null;
7767
8355
  created_at: string;
7768
8356
  details: Json | null;
7769
8357
  duration_ms: number | null;
@@ -7776,6 +8364,7 @@ export type Database = {
7776
8364
  user_id: string;
7777
8365
  };
7778
8366
  Insert: {
8367
+ action_type?: string | null;
7779
8368
  created_at?: string;
7780
8369
  details?: Json | null;
7781
8370
  duration_ms?: number | null;
@@ -7788,6 +8377,7 @@ export type Database = {
7788
8377
  user_id: string;
7789
8378
  };
7790
8379
  Update: {
8380
+ action_type?: string | null;
7791
8381
  created_at?: string;
7792
8382
  details?: Json | null;
7793
8383
  duration_ms?: number | null;
@@ -8027,6 +8617,57 @@ export type Database = {
8027
8617
  }
8028
8618
  ];
8029
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
+ };
8030
8671
  twinfield_settings: {
8031
8672
  Row: {
8032
8673
  active_environment: string;
@@ -8620,6 +9261,37 @@ export type Database = {
8620
9261
  };
8621
9262
  Relationships: [];
8622
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
+ };
8623
9295
  v_external_customers_exact: {
8624
9296
  Row: {
8625
9297
  account_number: string | null;
@@ -8885,6 +9557,51 @@ export type Database = {
8885
9557
  };
8886
9558
  Returns: number;
8887
9559
  };
9560
+ apply_stock_consumption: {
9561
+ Args: {
9562
+ p_order_id: string;
9563
+ p_order_item_id: string;
9564
+ p_qty: number;
9565
+ p_reason: string;
9566
+ p_source: string;
9567
+ p_trade_item_key: string;
9568
+ };
9569
+ Returns: undefined;
9570
+ };
9571
+ apply_stock_reservation: {
9572
+ Args: {
9573
+ p_order_id: string;
9574
+ p_order_item_id: string;
9575
+ p_qty: number;
9576
+ p_reason: string;
9577
+ p_source: string;
9578
+ p_trade_item_key: string;
9579
+ };
9580
+ Returns: undefined;
9581
+ };
9582
+ assign_cart_numbers: {
9583
+ Args: {
9584
+ p_carts: Json;
9585
+ };
9586
+ Returns: {
9587
+ cart_index: number;
9588
+ cart_number: string;
9589
+ day_seq: number;
9590
+ order_id: string;
9591
+ order_source: string;
9592
+ pick_date: string;
9593
+ status: string;
9594
+ }[];
9595
+ };
9596
+ assign_floriday_order_numbers: {
9597
+ Args: {
9598
+ p_ids: string[];
9599
+ };
9600
+ Returns: {
9601
+ floriday_id: string;
9602
+ order_number: string;
9603
+ }[];
9604
+ };
8888
9605
  call_exact_route: {
8889
9606
  Args: {
8890
9607
  path: string;
@@ -8895,10 +9612,37 @@ export type Database = {
8895
9612
  Args: never;
8896
9613
  Returns: number;
8897
9614
  };
9615
+ control_get_todays_carts: {
9616
+ Args: never;
9617
+ Returns: {
9618
+ cart_index: number;
9619
+ cart_number: string;
9620
+ cart_number_id: string;
9621
+ order_id: string;
9622
+ order_source: string;
9623
+ pick_date: string;
9624
+ status: string;
9625
+ }[];
9626
+ };
9627
+ count_distinct_regulatory_products: {
9628
+ Args: never;
9629
+ Returns: number;
9630
+ };
8898
9631
  current_monteur_id: {
8899
9632
  Args: never;
8900
9633
  Returns: string;
8901
9634
  };
9635
+ dashboard_alert_counts: {
9636
+ Args: never;
9637
+ Returns: Json;
9638
+ };
9639
+ dashboard_alert_rows: {
9640
+ Args: {
9641
+ check_id: string;
9642
+ row_limit?: number;
9643
+ };
9644
+ Returns: Json;
9645
+ };
8902
9646
  dashboard_list_public_schema: {
8903
9647
  Args: never;
8904
9648
  Returns: {
@@ -8979,6 +9723,13 @@ export type Database = {
8979
9723
  };
8980
9724
  Returns: boolean;
8981
9725
  };
9726
+ format_cart_number: {
9727
+ Args: {
9728
+ p_pick_date: string;
9729
+ p_seq: number;
9730
+ };
9731
+ Returns: string;
9732
+ };
8982
9733
  get_active_floriday_connection_public: {
8983
9734
  Args: never;
8984
9735
  Returns: {
@@ -9094,6 +9845,12 @@ export type Database = {
9094
9845
  };
9095
9846
  Returns: Json;
9096
9847
  };
9848
+ get_or_assign_floriday_order_number: {
9849
+ Args: {
9850
+ p_floriday_id: string;
9851
+ };
9852
+ Returns: string;
9853
+ };
9097
9854
  get_room_busy_windows: {
9098
9855
  Args: {
9099
9856
  p_from: string;
@@ -9140,6 +9897,12 @@ export type Database = {
9140
9897
  Args: never;
9141
9898
  Returns: boolean;
9142
9899
  };
9900
+ next_order_number: {
9901
+ Args: {
9902
+ p_prefix: string;
9903
+ };
9904
+ Returns: string;
9905
+ };
9143
9906
  next_work_order_number: {
9144
9907
  Args: {
9145
9908
  p_parent_work_order_id?: string;
@@ -9171,14 +9934,29 @@ export type Database = {
9171
9934
  };
9172
9935
  Returns: undefined;
9173
9936
  };
9937
+ pickstation_set_cart_status: {
9938
+ Args: {
9939
+ p_cart_index: number;
9940
+ p_order_id: string;
9941
+ p_order_source: string;
9942
+ p_status: string;
9943
+ };
9944
+ Returns: undefined;
9945
+ };
9174
9946
  refresh_floricode_derived_code_lists: {
9175
9947
  Args: never;
9176
9948
  Returns: {
9177
- out_environment: string;
9178
- out_list_name: string;
9179
- out_row_count: number;
9949
+ environment: string;
9950
+ list_name: string;
9951
+ row_count: number;
9180
9952
  }[];
9181
9953
  };
9954
+ refresh_floricode_derived_for_product: {
9955
+ Args: {
9956
+ p_product_code: string;
9957
+ };
9958
+ Returns: number;
9959
+ };
9182
9960
  reset_floriday_sync_cursor: {
9183
9961
  Args: {
9184
9962
  p_connection_id: string;