@flowselections/floriday-authenticatie-module 1.0.14 → 1.0.16

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 (35) hide show
  1. package/dist-lib/components/settings/FlorydaySettingsCard.d.ts.map +1 -1
  2. package/dist-lib/components/settings/FlorydaySettingsCard.js +2 -2
  3. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1486 -35
  4. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  5. package/dist-lib/integrations/supabase/client.d.ts +1486 -35
  6. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  7. package/dist-lib/integrations/supabase/client.server.d.ts +1486 -35
  8. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  9. package/dist-lib/integrations/supabase/types.d.ts +1515 -34
  10. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  11. package/dist-lib/lib/floricode-product-features.d.ts.map +1 -1
  12. package/dist-lib/lib/floricode-product-features.js +59 -5
  13. package/dist-lib/lib/floricode-regulatory-features.d.ts +15 -0
  14. package/dist-lib/lib/floricode-regulatory-features.d.ts.map +1 -1
  15. package/dist-lib/lib/floricode-regulatory-features.js +77 -21
  16. package/dist-lib/lib/floriday-auction-letters.functions.d.ts +1486 -35
  17. package/dist-lib/lib/floriday-auction-letters.functions.d.ts.map +1 -1
  18. package/dist-lib/lib/floriday-labels.functions.d.ts +1486 -35
  19. package/dist-lib/lib/floriday-labels.functions.d.ts.map +1 -1
  20. package/dist-lib/lib/floriday-public.functions.d.ts +8706 -0
  21. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  22. package/dist-lib/lib/floriday-scopes.d.ts +17 -1
  23. package/dist-lib/lib/floriday-scopes.d.ts.map +1 -1
  24. package/dist-lib/lib/floriday-scopes.js +66 -5
  25. package/dist-lib/lib/floriday-stickers.functions.d.ts +1486 -35
  26. package/dist-lib/lib/floriday-stickers.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/floriday-sync.functions.d.ts +66486 -1
  28. package/dist-lib/lib/floriday-sync.functions.d.ts.map +1 -1
  29. package/dist-lib/lib/floriday-sync.functions.js +92 -2
  30. package/dist-lib/lib/floriday-writes.functions.d.ts +8724 -6
  31. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  32. package/dist-lib/lib/floriday.functions.d.ts +26244 -144
  33. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  34. package/dist-lib/lib/floriday.functions.js +13 -2
  35. package/package.json +1 -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;
@@ -3441,6 +3719,51 @@ export type Database = {
3441
3719
  }
3442
3720
  ];
3443
3721
  };
3722
+ floriday_continuous_stock_queue: {
3723
+ Row: {
3724
+ attempts: number;
3725
+ connection_id: string;
3726
+ created_at: string;
3727
+ gateway_attempt_id: string | null;
3728
+ id: string;
3729
+ last_error: string | null;
3730
+ number_of_pieces: number;
3731
+ sent_at: string | null;
3732
+ status: string;
3733
+ trade_item_id: string;
3734
+ updated_at: string;
3735
+ user_id: string;
3736
+ };
3737
+ Insert: {
3738
+ attempts?: number;
3739
+ connection_id: string;
3740
+ created_at?: string;
3741
+ gateway_attempt_id?: string | null;
3742
+ id?: string;
3743
+ last_error?: string | null;
3744
+ number_of_pieces?: number;
3745
+ sent_at?: string | null;
3746
+ status?: string;
3747
+ trade_item_id: string;
3748
+ updated_at?: string;
3749
+ user_id: string;
3750
+ };
3751
+ Update: {
3752
+ attempts?: number;
3753
+ connection_id?: string;
3754
+ created_at?: string;
3755
+ gateway_attempt_id?: string | null;
3756
+ id?: string;
3757
+ last_error?: string | null;
3758
+ number_of_pieces?: number;
3759
+ sent_at?: string | null;
3760
+ status?: string;
3761
+ trade_item_id?: string;
3762
+ updated_at?: string;
3763
+ user_id?: string;
3764
+ };
3765
+ Relationships: [];
3766
+ };
3444
3767
  floriday_contract_trade_item_groups_cache: {
3445
3768
  Row: {
3446
3769
  connection_id: string;
@@ -4884,49 +5207,259 @@ export type Database = {
4884
5207
  };
4885
5208
  Relationships: [];
4886
5209
  };
4887
- locations: {
5210
+ local_customer_agreements: {
4888
5211
  Row: {
5212
+ base_price: number | null;
4889
5213
  created_at: string;
5214
+ currency: string;
5215
+ customer_id: string;
4890
5216
  id: string;
4891
- name: string;
4892
- sort_order: number;
5217
+ min_quantity: number;
5218
+ net_price: number;
5219
+ notes: string | null;
5220
+ product_category_id: string | null;
5221
+ product_id: string | null;
4893
5222
  updated_at: string;
5223
+ valid_from: string | null;
5224
+ valid_until: string | null;
4894
5225
  };
4895
5226
  Insert: {
5227
+ base_price?: number | null;
4896
5228
  created_at?: string;
5229
+ currency?: string;
5230
+ customer_id: string;
4897
5231
  id?: string;
4898
- name: string;
4899
- sort_order?: number;
5232
+ min_quantity?: number;
5233
+ net_price: number;
5234
+ notes?: string | null;
5235
+ product_category_id?: string | null;
5236
+ product_id?: string | null;
4900
5237
  updated_at?: string;
5238
+ valid_from?: string | null;
5239
+ valid_until?: string | null;
4901
5240
  };
4902
5241
  Update: {
5242
+ base_price?: number | null;
4903
5243
  created_at?: string;
5244
+ currency?: string;
5245
+ customer_id?: string;
4904
5246
  id?: string;
4905
- name?: string;
4906
- sort_order?: number;
5247
+ min_quantity?: number;
5248
+ net_price?: number;
5249
+ notes?: string | null;
5250
+ product_category_id?: string | null;
5251
+ product_id?: string | null;
4907
5252
  updated_at?: string;
5253
+ valid_from?: string | null;
5254
+ valid_until?: string | null;
4908
5255
  };
4909
- Relationships: [];
5256
+ Relationships: [
5257
+ {
5258
+ foreignKeyName: "local_customer_agreements_customer_id_fkey";
5259
+ columns: ["customer_id"];
5260
+ isOneToOne: false;
5261
+ referencedRelation: "customers";
5262
+ referencedColumns: ["id"];
5263
+ },
5264
+ {
5265
+ foreignKeyName: "local_customer_agreements_product_category_id_fkey";
5266
+ columns: ["product_category_id"];
5267
+ isOneToOne: false;
5268
+ referencedRelation: "product_categories";
5269
+ referencedColumns: ["id"];
5270
+ },
5271
+ {
5272
+ foreignKeyName: "local_customer_agreements_product_id_fkey";
5273
+ columns: ["product_id"];
5274
+ isOneToOne: false;
5275
+ referencedRelation: "products";
5276
+ referencedColumns: ["id"];
5277
+ }
5278
+ ];
4910
5279
  };
4911
- mailbox_messages: {
5280
+ local_customer_price_groups: {
4912
5281
  Row: {
4913
- body_html: string | null;
4914
- body_text: string | null;
4915
- connection_id: string | null;
4916
5282
  created_at: string;
4917
- error_message: string | null;
4918
- external_id: string | null;
4919
- from_email: string | null;
4920
- from_name: string | null;
5283
+ currency: string;
5284
+ customer_id: string;
5285
+ discount_type: string;
5286
+ discount_value: number;
4921
5287
  id: string;
4922
- message_id: string | null;
4923
- profile_id: string | null;
4924
- raw_size: number | null;
4925
- received_at: string | null;
4926
- status: string;
4927
- subject: string | null;
4928
- uid: number | null;
4929
- updated_at: string;
5288
+ min_quantity: number;
5289
+ notes: string | null;
5290
+ product_category_id: string | null;
5291
+ product_id: string | null;
5292
+ updated_at: string;
5293
+ valid_from: string | null;
5294
+ valid_until: string | null;
5295
+ };
5296
+ Insert: {
5297
+ created_at?: string;
5298
+ currency?: string;
5299
+ customer_id: string;
5300
+ discount_type: string;
5301
+ discount_value: number;
5302
+ id?: string;
5303
+ min_quantity?: number;
5304
+ notes?: string | null;
5305
+ product_category_id?: string | null;
5306
+ product_id?: string | null;
5307
+ updated_at?: string;
5308
+ valid_from?: string | null;
5309
+ valid_until?: string | null;
5310
+ };
5311
+ Update: {
5312
+ created_at?: string;
5313
+ currency?: string;
5314
+ customer_id?: string;
5315
+ discount_type?: string;
5316
+ discount_value?: number;
5317
+ id?: string;
5318
+ min_quantity?: number;
5319
+ notes?: string | null;
5320
+ product_category_id?: string | null;
5321
+ product_id?: string | null;
5322
+ updated_at?: string;
5323
+ valid_from?: string | null;
5324
+ valid_until?: string | null;
5325
+ };
5326
+ Relationships: [
5327
+ {
5328
+ foreignKeyName: "local_customer_price_groups_customer_id_fkey";
5329
+ columns: ["customer_id"];
5330
+ isOneToOne: false;
5331
+ referencedRelation: "customers";
5332
+ referencedColumns: ["id"];
5333
+ },
5334
+ {
5335
+ foreignKeyName: "local_customer_price_groups_product_category_id_fkey";
5336
+ columns: ["product_category_id"];
5337
+ isOneToOne: false;
5338
+ referencedRelation: "product_categories";
5339
+ referencedColumns: ["id"];
5340
+ },
5341
+ {
5342
+ foreignKeyName: "local_customer_price_groups_product_id_fkey";
5343
+ columns: ["product_id"];
5344
+ isOneToOne: false;
5345
+ referencedRelation: "products";
5346
+ referencedColumns: ["id"];
5347
+ }
5348
+ ];
5349
+ };
5350
+ local_customer_sales_strategies: {
5351
+ Row: {
5352
+ created_at: string;
5353
+ currency: string;
5354
+ customer_id: string;
5355
+ discount_type: string;
5356
+ discount_value: number;
5357
+ id: string;
5358
+ min_quantity: number;
5359
+ notes: string | null;
5360
+ product_category_id: string | null;
5361
+ product_id: string | null;
5362
+ updated_at: string;
5363
+ valid_from: string | null;
5364
+ valid_until: string | null;
5365
+ };
5366
+ Insert: {
5367
+ created_at?: string;
5368
+ currency?: string;
5369
+ customer_id: string;
5370
+ discount_type: string;
5371
+ discount_value: number;
5372
+ id?: string;
5373
+ min_quantity?: number;
5374
+ notes?: string | null;
5375
+ product_category_id?: string | null;
5376
+ product_id?: string | null;
5377
+ updated_at?: string;
5378
+ valid_from?: string | null;
5379
+ valid_until?: string | null;
5380
+ };
5381
+ Update: {
5382
+ created_at?: string;
5383
+ currency?: string;
5384
+ customer_id?: string;
5385
+ discount_type?: string;
5386
+ discount_value?: number;
5387
+ id?: string;
5388
+ min_quantity?: number;
5389
+ notes?: string | null;
5390
+ product_category_id?: string | null;
5391
+ product_id?: string | null;
5392
+ updated_at?: string;
5393
+ valid_from?: string | null;
5394
+ valid_until?: string | null;
5395
+ };
5396
+ Relationships: [
5397
+ {
5398
+ foreignKeyName: "local_customer_sales_strategies_customer_id_fkey";
5399
+ columns: ["customer_id"];
5400
+ isOneToOne: false;
5401
+ referencedRelation: "customers";
5402
+ referencedColumns: ["id"];
5403
+ },
5404
+ {
5405
+ foreignKeyName: "local_customer_sales_strategies_product_category_id_fkey";
5406
+ columns: ["product_category_id"];
5407
+ isOneToOne: false;
5408
+ referencedRelation: "product_categories";
5409
+ referencedColumns: ["id"];
5410
+ },
5411
+ {
5412
+ foreignKeyName: "local_customer_sales_strategies_product_id_fkey";
5413
+ columns: ["product_id"];
5414
+ isOneToOne: false;
5415
+ referencedRelation: "products";
5416
+ referencedColumns: ["id"];
5417
+ }
5418
+ ];
5419
+ };
5420
+ locations: {
5421
+ Row: {
5422
+ created_at: string;
5423
+ id: string;
5424
+ name: string;
5425
+ sort_order: number;
5426
+ updated_at: string;
5427
+ };
5428
+ Insert: {
5429
+ created_at?: string;
5430
+ id?: string;
5431
+ name: string;
5432
+ sort_order?: number;
5433
+ updated_at?: string;
5434
+ };
5435
+ Update: {
5436
+ created_at?: string;
5437
+ id?: string;
5438
+ name?: string;
5439
+ sort_order?: number;
5440
+ updated_at?: string;
5441
+ };
5442
+ Relationships: [];
5443
+ };
5444
+ mailbox_messages: {
5445
+ Row: {
5446
+ body_html: string | null;
5447
+ body_text: string | null;
5448
+ connection_id: string | null;
5449
+ created_at: string;
5450
+ error_message: string | null;
5451
+ external_id: string | null;
5452
+ from_email: string | null;
5453
+ from_name: string | null;
5454
+ id: string;
5455
+ message_id: string | null;
5456
+ profile_id: string | null;
5457
+ raw_size: number | null;
5458
+ received_at: string | null;
5459
+ status: string;
5460
+ subject: string | null;
5461
+ uid: number | null;
5462
+ updated_at: string;
4930
5463
  };
4931
5464
  Insert: {
4932
5465
  body_html?: string | null;
@@ -5260,6 +5793,97 @@ export type Database = {
5260
5793
  };
5261
5794
  Relationships: [];
5262
5795
  };
5796
+ manufacture_product_components: {
5797
+ Row: {
5798
+ component_type: string;
5799
+ created_at: string;
5800
+ id: string;
5801
+ manufacture_product_id: string;
5802
+ product_group_id: string | null;
5803
+ quantity: number;
5804
+ trade_item_id: string | null;
5805
+ unit: string;
5806
+ };
5807
+ Insert: {
5808
+ component_type: string;
5809
+ created_at?: string;
5810
+ id?: string;
5811
+ manufacture_product_id: string;
5812
+ product_group_id?: string | null;
5813
+ quantity?: number;
5814
+ trade_item_id?: string | null;
5815
+ unit?: string;
5816
+ };
5817
+ Update: {
5818
+ component_type?: string;
5819
+ created_at?: string;
5820
+ id?: string;
5821
+ manufacture_product_id?: string;
5822
+ product_group_id?: string | null;
5823
+ quantity?: number;
5824
+ trade_item_id?: string | null;
5825
+ unit?: string;
5826
+ };
5827
+ Relationships: [
5828
+ {
5829
+ foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey";
5830
+ columns: ["manufacture_product_id"];
5831
+ isOneToOne: false;
5832
+ referencedRelation: "manufacture_product_possible_stock_view";
5833
+ referencedColumns: ["manufacture_product_id"];
5834
+ },
5835
+ {
5836
+ foreignKeyName: "manufacture_product_components_manufacture_product_id_fkey";
5837
+ columns: ["manufacture_product_id"];
5838
+ isOneToOne: false;
5839
+ referencedRelation: "manufacture_products";
5840
+ referencedColumns: ["id"];
5841
+ },
5842
+ {
5843
+ foreignKeyName: "manufacture_product_components_product_group_id_fkey";
5844
+ columns: ["product_group_id"];
5845
+ isOneToOne: false;
5846
+ referencedRelation: "product_groups";
5847
+ referencedColumns: ["id"];
5848
+ }
5849
+ ];
5850
+ };
5851
+ manufacture_products: {
5852
+ Row: {
5853
+ created_at: string;
5854
+ description: string | null;
5855
+ id: string;
5856
+ is_active: boolean;
5857
+ name: string;
5858
+ produced_stock: number;
5859
+ product_code: string;
5860
+ tenant_id: string;
5861
+ updated_at: string;
5862
+ };
5863
+ Insert: {
5864
+ created_at?: string;
5865
+ description?: string | null;
5866
+ id?: string;
5867
+ is_active?: boolean;
5868
+ name: string;
5869
+ produced_stock?: number;
5870
+ product_code: string;
5871
+ tenant_id: string;
5872
+ updated_at?: string;
5873
+ };
5874
+ Update: {
5875
+ created_at?: string;
5876
+ description?: string | null;
5877
+ id?: string;
5878
+ is_active?: boolean;
5879
+ name?: string;
5880
+ produced_stock?: number;
5881
+ product_code?: string;
5882
+ tenant_id?: string;
5883
+ updated_at?: string;
5884
+ };
5885
+ Relationships: [];
5886
+ };
5263
5887
  monteurs: {
5264
5888
  Row: {
5265
5889
  avatar_url: string | null;
@@ -5319,6 +5943,281 @@ export type Database = {
5319
5943
  }
5320
5944
  ];
5321
5945
  };
5946
+ nmbrs_component_mapping: {
5947
+ Row: {
5948
+ created_at: string;
5949
+ id: string;
5950
+ source_kind: string;
5951
+ source_value: string | null;
5952
+ updated_at: string;
5953
+ wage_code: string;
5954
+ };
5955
+ Insert: {
5956
+ created_at?: string;
5957
+ id?: string;
5958
+ source_kind: string;
5959
+ source_value?: string | null;
5960
+ updated_at?: string;
5961
+ wage_code: string;
5962
+ };
5963
+ Update: {
5964
+ created_at?: string;
5965
+ id?: string;
5966
+ source_kind?: string;
5967
+ source_value?: string | null;
5968
+ updated_at?: string;
5969
+ wage_code?: string;
5970
+ };
5971
+ Relationships: [
5972
+ {
5973
+ foreignKeyName: "nmbrs_component_mapping_wage_code_fkey";
5974
+ columns: ["wage_code"];
5975
+ isOneToOne: false;
5976
+ referencedRelation: "nmbrs_wage_components";
5977
+ referencedColumns: ["code"];
5978
+ }
5979
+ ];
5980
+ };
5981
+ nmbrs_employee_mapping: {
5982
+ Row: {
5983
+ active_from: string | null;
5984
+ active_to: string | null;
5985
+ contract_hours_per_week: number | null;
5986
+ created_at: string;
5987
+ hourly_wage: number | null;
5988
+ id: string;
5989
+ monteur_id: string;
5990
+ nmbrs_company_code: string | null;
5991
+ nmbrs_employee_number: string;
5992
+ updated_at: string;
5993
+ };
5994
+ Insert: {
5995
+ active_from?: string | null;
5996
+ active_to?: string | null;
5997
+ contract_hours_per_week?: number | null;
5998
+ created_at?: string;
5999
+ hourly_wage?: number | null;
6000
+ id?: string;
6001
+ monteur_id: string;
6002
+ nmbrs_company_code?: string | null;
6003
+ nmbrs_employee_number: string;
6004
+ updated_at?: string;
6005
+ };
6006
+ Update: {
6007
+ active_from?: string | null;
6008
+ active_to?: string | null;
6009
+ contract_hours_per_week?: number | null;
6010
+ created_at?: string;
6011
+ hourly_wage?: number | null;
6012
+ id?: string;
6013
+ monteur_id?: string;
6014
+ nmbrs_company_code?: string | null;
6015
+ nmbrs_employee_number?: string;
6016
+ updated_at?: string;
6017
+ };
6018
+ Relationships: [
6019
+ {
6020
+ foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
6021
+ columns: ["monteur_id"];
6022
+ isOneToOne: true;
6023
+ referencedRelation: "monteurs";
6024
+ referencedColumns: ["id"];
6025
+ }
6026
+ ];
6027
+ };
6028
+ nmbrs_export_lines: {
6029
+ Row: {
6030
+ amount: number;
6031
+ created_at: string;
6032
+ entry_date: string;
6033
+ hours: number;
6034
+ id: string;
6035
+ monteur_id: string;
6036
+ nmbrs_employee_number: string | null;
6037
+ notes: string | null;
6038
+ run_id: string;
6039
+ source_kind: string | null;
6040
+ source_ref_id: string | null;
6041
+ updated_at: string;
6042
+ wage_code: string;
6043
+ };
6044
+ Insert: {
6045
+ amount?: number;
6046
+ created_at?: string;
6047
+ entry_date: string;
6048
+ hours?: number;
6049
+ id?: string;
6050
+ monteur_id: string;
6051
+ nmbrs_employee_number?: string | null;
6052
+ notes?: string | null;
6053
+ run_id: string;
6054
+ source_kind?: string | null;
6055
+ source_ref_id?: string | null;
6056
+ updated_at?: string;
6057
+ wage_code: string;
6058
+ };
6059
+ Update: {
6060
+ amount?: number;
6061
+ created_at?: string;
6062
+ entry_date?: string;
6063
+ hours?: number;
6064
+ id?: string;
6065
+ monteur_id?: string;
6066
+ nmbrs_employee_number?: string | null;
6067
+ notes?: string | null;
6068
+ run_id?: string;
6069
+ source_kind?: string | null;
6070
+ source_ref_id?: string | null;
6071
+ updated_at?: string;
6072
+ wage_code?: string;
6073
+ };
6074
+ Relationships: [
6075
+ {
6076
+ foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
6077
+ columns: ["monteur_id"];
6078
+ isOneToOne: false;
6079
+ referencedRelation: "monteurs";
6080
+ referencedColumns: ["id"];
6081
+ },
6082
+ {
6083
+ foreignKeyName: "nmbrs_export_lines_run_id_fkey";
6084
+ columns: ["run_id"];
6085
+ isOneToOne: false;
6086
+ referencedRelation: "nmbrs_export_runs";
6087
+ referencedColumns: ["id"];
6088
+ },
6089
+ {
6090
+ foreignKeyName: "nmbrs_export_lines_wage_code_fkey";
6091
+ columns: ["wage_code"];
6092
+ isOneToOne: false;
6093
+ referencedRelation: "nmbrs_wage_components";
6094
+ referencedColumns: ["code"];
6095
+ }
6096
+ ];
6097
+ };
6098
+ nmbrs_export_runs: {
6099
+ Row: {
6100
+ created_at: string;
6101
+ file_name: string | null;
6102
+ generated_at: string;
6103
+ generated_by: string | null;
6104
+ id: string;
6105
+ notes: string | null;
6106
+ period_end: string;
6107
+ period_label: string;
6108
+ period_start: string;
6109
+ status: string;
6110
+ total_hours: number;
6111
+ total_lines: number;
6112
+ updated_at: string;
6113
+ };
6114
+ Insert: {
6115
+ created_at?: string;
6116
+ file_name?: string | null;
6117
+ generated_at?: string;
6118
+ generated_by?: string | null;
6119
+ id?: string;
6120
+ notes?: string | null;
6121
+ period_end: string;
6122
+ period_label: string;
6123
+ period_start: string;
6124
+ status?: string;
6125
+ total_hours?: number;
6126
+ total_lines?: number;
6127
+ updated_at?: string;
6128
+ };
6129
+ Update: {
6130
+ created_at?: string;
6131
+ file_name?: string | null;
6132
+ generated_at?: string;
6133
+ generated_by?: string | null;
6134
+ id?: string;
6135
+ notes?: string | null;
6136
+ period_end?: string;
6137
+ period_label?: string;
6138
+ period_start?: string;
6139
+ status?: string;
6140
+ total_hours?: number;
6141
+ total_lines?: number;
6142
+ updated_at?: string;
6143
+ };
6144
+ Relationships: [];
6145
+ };
6146
+ nmbrs_settings: {
6147
+ Row: {
6148
+ created_at: string;
6149
+ default_company_code: string | null;
6150
+ id: boolean;
6151
+ include_travel: boolean;
6152
+ overtime_threshold_daily: number;
6153
+ overtime_threshold_weekly: number;
6154
+ period_type: string;
6155
+ updated_at: string;
6156
+ updated_by: string | null;
6157
+ week_start_day: number;
6158
+ };
6159
+ Insert: {
6160
+ created_at?: string;
6161
+ default_company_code?: string | null;
6162
+ id?: boolean;
6163
+ include_travel?: boolean;
6164
+ overtime_threshold_daily?: number;
6165
+ overtime_threshold_weekly?: number;
6166
+ period_type?: string;
6167
+ updated_at?: string;
6168
+ updated_by?: string | null;
6169
+ week_start_day?: number;
6170
+ };
6171
+ Update: {
6172
+ created_at?: string;
6173
+ default_company_code?: string | null;
6174
+ id?: boolean;
6175
+ include_travel?: boolean;
6176
+ overtime_threshold_daily?: number;
6177
+ overtime_threshold_weekly?: number;
6178
+ period_type?: string;
6179
+ updated_at?: string;
6180
+ updated_by?: string | null;
6181
+ week_start_day?: number;
6182
+ };
6183
+ Relationships: [];
6184
+ };
6185
+ nmbrs_wage_components: {
6186
+ Row: {
6187
+ category: string;
6188
+ code: string;
6189
+ created_at: string;
6190
+ id: string;
6191
+ is_active: boolean;
6192
+ label: string;
6193
+ sort_order: number;
6194
+ unit: string;
6195
+ updated_at: string;
6196
+ };
6197
+ Insert: {
6198
+ category: string;
6199
+ code: string;
6200
+ created_at?: string;
6201
+ id?: string;
6202
+ is_active?: boolean;
6203
+ label: string;
6204
+ sort_order?: number;
6205
+ unit: string;
6206
+ updated_at?: string;
6207
+ };
6208
+ Update: {
6209
+ category?: string;
6210
+ code?: string;
6211
+ created_at?: string;
6212
+ id?: string;
6213
+ is_active?: boolean;
6214
+ label?: string;
6215
+ sort_order?: number;
6216
+ unit?: string;
6217
+ updated_at?: string;
6218
+ };
6219
+ Relationships: [];
6220
+ };
5322
6221
  notifications: {
5323
6222
  Row: {
5324
6223
  created_at: string;
@@ -6252,6 +7151,68 @@ export type Database = {
6252
7151
  };
6253
7152
  Relationships: [];
6254
7153
  };
7154
+ product_group_items: {
7155
+ Row: {
7156
+ created_at: string;
7157
+ id: string;
7158
+ product_group_id: string;
7159
+ quantity: number;
7160
+ trade_item_id: string;
7161
+ };
7162
+ Insert: {
7163
+ created_at?: string;
7164
+ id?: string;
7165
+ product_group_id: string;
7166
+ quantity?: number;
7167
+ trade_item_id: string;
7168
+ };
7169
+ Update: {
7170
+ created_at?: string;
7171
+ id?: string;
7172
+ product_group_id?: string;
7173
+ quantity?: number;
7174
+ trade_item_id?: string;
7175
+ };
7176
+ Relationships: [
7177
+ {
7178
+ foreignKeyName: "product_group_items_product_group_id_fkey";
7179
+ columns: ["product_group_id"];
7180
+ isOneToOne: false;
7181
+ referencedRelation: "product_groups";
7182
+ referencedColumns: ["id"];
7183
+ }
7184
+ ];
7185
+ };
7186
+ product_groups: {
7187
+ Row: {
7188
+ created_at: string;
7189
+ description: string | null;
7190
+ id: string;
7191
+ is_active: boolean;
7192
+ name: string;
7193
+ tenant_id: string;
7194
+ updated_at: string;
7195
+ };
7196
+ Insert: {
7197
+ created_at?: string;
7198
+ description?: string | null;
7199
+ id?: string;
7200
+ is_active?: boolean;
7201
+ name: string;
7202
+ tenant_id: string;
7203
+ updated_at?: string;
7204
+ };
7205
+ Update: {
7206
+ created_at?: string;
7207
+ description?: string | null;
7208
+ id?: string;
7209
+ is_active?: boolean;
7210
+ name?: string;
7211
+ tenant_id?: string;
7212
+ updated_at?: string;
7213
+ };
7214
+ Relationships: [];
7215
+ };
6255
7216
  products: {
6256
7217
  Row: {
6257
7218
  barcode: string | null;
@@ -6271,6 +7232,7 @@ export type Database = {
6271
7232
  purchase_price: number | null;
6272
7233
  quantity: number;
6273
7234
  sale_price: number | null;
7235
+ trade_item_key: string | null;
6274
7236
  unit: string;
6275
7237
  updated_at: string;
6276
7238
  weight: string | null;
@@ -6293,6 +7255,7 @@ export type Database = {
6293
7255
  purchase_price?: number | null;
6294
7256
  quantity?: number;
6295
7257
  sale_price?: number | null;
7258
+ trade_item_key?: string | null;
6296
7259
  unit?: string;
6297
7260
  updated_at?: string;
6298
7261
  weight?: string | null;
@@ -6315,6 +7278,7 @@ export type Database = {
6315
7278
  purchase_price?: number | null;
6316
7279
  quantity?: number;
6317
7280
  sale_price?: number | null;
7281
+ trade_item_key?: string | null;
6318
7282
  unit?: string;
6319
7283
  updated_at?: string;
6320
7284
  weight?: string | null;
@@ -7149,20 +8113,116 @@ export type Database = {
7149
8113
  description?: string | null;
7150
8114
  hourly_rate?: number;
7151
8115
  id?: string;
7152
- image_url?: string | null;
7153
- is_active?: boolean;
7154
- name: string;
8116
+ image_url?: string | null;
8117
+ is_active?: boolean;
8118
+ name: string;
8119
+ };
8120
+ Update: {
8121
+ capacity?: number;
8122
+ color_code?: string | null;
8123
+ created_at?: string;
8124
+ description?: string | null;
8125
+ hourly_rate?: number;
8126
+ id?: string;
8127
+ image_url?: string | null;
8128
+ is_active?: boolean;
8129
+ name?: string;
8130
+ };
8131
+ Relationships: [];
8132
+ };
8133
+ stock_import_runs: {
8134
+ Row: {
8135
+ connection_id: string | null;
8136
+ created_at: string;
8137
+ created_rows: number;
8138
+ errors: Json;
8139
+ filename: string | null;
8140
+ id: string;
8141
+ mutations: Json;
8142
+ skipped_rows: number;
8143
+ total_rows: number;
8144
+ updated_rows: number;
8145
+ user_id: string;
8146
+ };
8147
+ Insert: {
8148
+ connection_id?: string | null;
8149
+ created_at?: string;
8150
+ created_rows?: number;
8151
+ errors?: Json;
8152
+ filename?: string | null;
8153
+ id?: string;
8154
+ mutations?: Json;
8155
+ skipped_rows?: number;
8156
+ total_rows?: number;
8157
+ updated_rows?: number;
8158
+ user_id: string;
8159
+ };
8160
+ Update: {
8161
+ connection_id?: string | null;
8162
+ created_at?: string;
8163
+ created_rows?: number;
8164
+ errors?: Json;
8165
+ filename?: string | null;
8166
+ id?: string;
8167
+ mutations?: Json;
8168
+ skipped_rows?: number;
8169
+ total_rows?: number;
8170
+ updated_rows?: number;
8171
+ user_id?: string;
8172
+ };
8173
+ Relationships: [];
8174
+ };
8175
+ stock_mutation_log: {
8176
+ Row: {
8177
+ connection_id: string | null;
8178
+ created_at: string;
8179
+ created_by: string | null;
8180
+ id: string;
8181
+ mutation_type: string;
8182
+ order_id: string | null;
8183
+ order_item_id: string | null;
8184
+ order_source: string | null;
8185
+ physical_after: number | null;
8186
+ physical_before: number | null;
8187
+ qty_delta: number;
8188
+ reason: string | null;
8189
+ reserved_after: number | null;
8190
+ reserved_before: number | null;
8191
+ trade_item_key: string;
8192
+ };
8193
+ Insert: {
8194
+ connection_id?: string | null;
8195
+ created_at?: string;
8196
+ created_by?: string | null;
8197
+ id?: string;
8198
+ mutation_type: string;
8199
+ order_id?: string | null;
8200
+ order_item_id?: string | null;
8201
+ order_source?: string | null;
8202
+ physical_after?: number | null;
8203
+ physical_before?: number | null;
8204
+ qty_delta: number;
8205
+ reason?: string | null;
8206
+ reserved_after?: number | null;
8207
+ reserved_before?: number | null;
8208
+ trade_item_key: string;
7155
8209
  };
7156
8210
  Update: {
7157
- capacity?: number;
7158
- color_code?: string | null;
8211
+ connection_id?: string | null;
7159
8212
  created_at?: string;
7160
- description?: string | null;
7161
- hourly_rate?: number;
8213
+ created_by?: string | null;
7162
8214
  id?: string;
7163
- image_url?: string | null;
7164
- is_active?: boolean;
7165
- name?: string;
8215
+ mutation_type?: string;
8216
+ order_id?: string | null;
8217
+ order_item_id?: string | null;
8218
+ order_source?: string | null;
8219
+ physical_after?: number | null;
8220
+ physical_before?: number | null;
8221
+ qty_delta?: number;
8222
+ reason?: string | null;
8223
+ reserved_after?: number | null;
8224
+ reserved_before?: number | null;
8225
+ trade_item_key?: string;
7166
8226
  };
7167
8227
  Relationships: [];
7168
8228
  };
@@ -7431,7 +8491,13 @@ export type Database = {
7431
8491
  connection_id: string | null;
7432
8492
  created_at: string;
7433
8493
  data: Json;
8494
+ floriday_id: string | null;
8495
+ floriday_link_error: string | null;
8496
+ floriday_link_status: string;
7434
8497
  id: string;
8498
+ last_floriday_sync_at: string | null;
8499
+ missing_required_fields: string[];
8500
+ source: string;
7435
8501
  updated_at: string;
7436
8502
  user_id: string;
7437
8503
  };
@@ -7439,7 +8505,13 @@ export type Database = {
7439
8505
  connection_id?: string | null;
7440
8506
  created_at?: string;
7441
8507
  data?: Json;
8508
+ floriday_id?: string | null;
8509
+ floriday_link_error?: string | null;
8510
+ floriday_link_status?: string;
7442
8511
  id?: string;
8512
+ last_floriday_sync_at?: string | null;
8513
+ missing_required_fields?: string[];
8514
+ source?: string;
7443
8515
  updated_at?: string;
7444
8516
  user_id: string;
7445
8517
  };
@@ -7447,7 +8519,55 @@ export type Database = {
7447
8519
  connection_id?: string | null;
7448
8520
  created_at?: string;
7449
8521
  data?: Json;
8522
+ floriday_id?: string | null;
8523
+ floriday_link_error?: string | null;
8524
+ floriday_link_status?: string;
8525
+ id?: string;
8526
+ last_floriday_sync_at?: string | null;
8527
+ missing_required_fields?: string[];
8528
+ source?: string;
8529
+ updated_at?: string;
8530
+ user_id?: string;
8531
+ };
8532
+ Relationships: [];
8533
+ };
8534
+ trade_item_stock: {
8535
+ Row: {
8536
+ connection_id: string;
8537
+ created_at: string;
8538
+ id: string;
8539
+ incoming_stock: number;
8540
+ minimum_stock: number;
8541
+ notes: string | null;
8542
+ physical_stock: number;
8543
+ reserved_stock: number;
8544
+ trade_item_key: string;
8545
+ updated_at: string;
8546
+ user_id: string;
8547
+ };
8548
+ Insert: {
8549
+ connection_id: string;
8550
+ created_at?: string;
8551
+ id?: string;
8552
+ incoming_stock?: number;
8553
+ minimum_stock?: number;
8554
+ notes?: string | null;
8555
+ physical_stock?: number;
8556
+ reserved_stock?: number;
8557
+ trade_item_key: string;
8558
+ updated_at?: string;
8559
+ user_id: string;
8560
+ };
8561
+ Update: {
8562
+ connection_id?: string;
8563
+ created_at?: string;
7450
8564
  id?: string;
8565
+ incoming_stock?: number;
8566
+ minimum_stock?: number;
8567
+ notes?: string | null;
8568
+ physical_stock?: number;
8569
+ reserved_stock?: number;
8570
+ trade_item_key?: string;
7451
8571
  updated_at?: string;
7452
8572
  user_id?: string;
7453
8573
  };
@@ -7803,6 +8923,7 @@ export type Database = {
7803
8923
  };
7804
8924
  twinfield_invoice_sync_logs: {
7805
8925
  Row: {
8926
+ action_type: string | null;
7806
8927
  created_at: string;
7807
8928
  details: Json | null;
7808
8929
  duration_ms: number | null;
@@ -7815,6 +8936,7 @@ export type Database = {
7815
8936
  user_id: string;
7816
8937
  };
7817
8938
  Insert: {
8939
+ action_type?: string | null;
7818
8940
  created_at?: string;
7819
8941
  details?: Json | null;
7820
8942
  duration_ms?: number | null;
@@ -7827,6 +8949,7 @@ export type Database = {
7827
8949
  user_id: string;
7828
8950
  };
7829
8951
  Update: {
8952
+ action_type?: string | null;
7830
8953
  created_at?: string;
7831
8954
  details?: Json | null;
7832
8955
  duration_ms?: number | null;
@@ -8066,6 +9189,57 @@ export type Database = {
8066
9189
  }
8067
9190
  ];
8068
9191
  };
9192
+ twinfield_request_metrics: {
9193
+ Row: {
9194
+ bucket_hour: string;
9195
+ connection_id: string;
9196
+ error_count: number;
9197
+ rate_limited_count: number;
9198
+ request_count: number;
9199
+ updated_at: string;
9200
+ };
9201
+ Insert: {
9202
+ bucket_hour: string;
9203
+ connection_id: string;
9204
+ error_count?: number;
9205
+ rate_limited_count?: number;
9206
+ request_count?: number;
9207
+ updated_at?: string;
9208
+ };
9209
+ Update: {
9210
+ bucket_hour?: string;
9211
+ connection_id?: string;
9212
+ error_count?: number;
9213
+ rate_limited_count?: number;
9214
+ request_count?: number;
9215
+ updated_at?: string;
9216
+ };
9217
+ Relationships: [];
9218
+ };
9219
+ twinfield_session_cache: {
9220
+ Row: {
9221
+ cluster: string;
9222
+ created_at: string;
9223
+ expires_at: string;
9224
+ session_id: string;
9225
+ user_id: string;
9226
+ };
9227
+ Insert: {
9228
+ cluster: string;
9229
+ created_at?: string;
9230
+ expires_at: string;
9231
+ session_id: string;
9232
+ user_id: string;
9233
+ };
9234
+ Update: {
9235
+ cluster?: string;
9236
+ created_at?: string;
9237
+ expires_at?: string;
9238
+ session_id?: string;
9239
+ user_id?: string;
9240
+ };
9241
+ Relationships: [];
9242
+ };
8069
9243
  twinfield_settings: {
8070
9244
  Row: {
8071
9245
  active_environment: string;
@@ -8659,6 +9833,75 @@ export type Database = {
8659
9833
  };
8660
9834
  Relationships: [];
8661
9835
  };
9836
+ floriday_customer_discounts: {
9837
+ Row: {
9838
+ base_price: number | null;
9839
+ buyer_organization_id: string | null;
9840
+ currency: string | null;
9841
+ discount_type: string | null;
9842
+ discount_value: number | null;
9843
+ min_quantity: number | null;
9844
+ net_price: number | null;
9845
+ product_group_id: string | null;
9846
+ raw: Json | null;
9847
+ source: string | null;
9848
+ source_id: string | null;
9849
+ trade_item_id: string | null;
9850
+ valid_from: string | null;
9851
+ valid_until: string | null;
9852
+ };
9853
+ Relationships: [];
9854
+ };
9855
+ local_customer_discounts: {
9856
+ Row: {
9857
+ base_price: number | null;
9858
+ currency: string | null;
9859
+ customer_id: string | null;
9860
+ discount_type: string | null;
9861
+ discount_value: number | null;
9862
+ min_quantity: number | null;
9863
+ net_price: number | null;
9864
+ product_category_id: string | null;
9865
+ product_id: string | null;
9866
+ product_name: string | null;
9867
+ source: string | null;
9868
+ source_id: string | null;
9869
+ valid_from: string | null;
9870
+ valid_until: string | null;
9871
+ };
9872
+ Relationships: [];
9873
+ };
9874
+ manufacture_product_possible_stock_view: {
9875
+ Row: {
9876
+ component_count: number | null;
9877
+ manufacture_product_id: string | null;
9878
+ possible_stock: number | null;
9879
+ };
9880
+ Relationships: [];
9881
+ };
9882
+ product_group_stock_view: {
9883
+ Row: {
9884
+ item_count: number | null;
9885
+ product_group_id: string | null;
9886
+ total_stock: number | null;
9887
+ };
9888
+ Relationships: [
9889
+ {
9890
+ foreignKeyName: "product_group_items_product_group_id_fkey";
9891
+ columns: ["product_group_id"];
9892
+ isOneToOne: false;
9893
+ referencedRelation: "product_groups";
9894
+ referencedColumns: ["id"];
9895
+ }
9896
+ ];
9897
+ };
9898
+ trade_item_stock_view: {
9899
+ Row: {
9900
+ stock: number | null;
9901
+ trade_item_id: string | null;
9902
+ };
9903
+ Relationships: [];
9904
+ };
8662
9905
  v_external_customers_exact: {
8663
9906
  Row: {
8664
9907
  account_number: string | null;
@@ -8924,6 +10167,68 @@ export type Database = {
8924
10167
  };
8925
10168
  Returns: number;
8926
10169
  };
10170
+ afh_city_code: {
10171
+ Args: {
10172
+ _city: string;
10173
+ _country: string;
10174
+ };
10175
+ Returns: string;
10176
+ };
10177
+ afh_normalize_country: {
10178
+ Args: {
10179
+ _raw: string;
10180
+ };
10181
+ Returns: string;
10182
+ };
10183
+ afh_normalize_nl_province: {
10184
+ Args: {
10185
+ _raw: string;
10186
+ };
10187
+ Returns: string;
10188
+ };
10189
+ afh_subtract_workdays: {
10190
+ Args: {
10191
+ _date: string;
10192
+ _days: number;
10193
+ };
10194
+ Returns: string;
10195
+ };
10196
+ apply_stock_consumption: {
10197
+ Args: {
10198
+ p_order_id: string;
10199
+ p_order_item_id: string;
10200
+ p_qty: number;
10201
+ p_reason: string;
10202
+ p_source: string;
10203
+ p_trade_item_key: string;
10204
+ };
10205
+ Returns: undefined;
10206
+ };
10207
+ apply_stock_reservation: {
10208
+ Args: {
10209
+ p_order_id: string;
10210
+ p_order_item_id: string;
10211
+ p_qty: number;
10212
+ p_reason: string;
10213
+ p_source: string;
10214
+ p_trade_item_key: string;
10215
+ };
10216
+ Returns: undefined;
10217
+ };
10218
+ assign_cart_numbers: {
10219
+ Args: {
10220
+ p_carts: Json;
10221
+ };
10222
+ Returns: {
10223
+ cart_index: number;
10224
+ cart_number: string;
10225
+ day_seq: number;
10226
+ order_id: string;
10227
+ order_source: string;
10228
+ pick_date: string;
10229
+ status: string;
10230
+ }[];
10231
+ };
8927
10232
  assign_floriday_order_numbers: {
8928
10233
  Args: {
8929
10234
  p_ids: string[];
@@ -8933,20 +10238,75 @@ export type Database = {
8933
10238
  order_number: string;
8934
10239
  }[];
8935
10240
  };
10241
+ backfill_open_order_reservations: {
10242
+ Args: never;
10243
+ Returns: {
10244
+ processed_items: number;
10245
+ }[];
10246
+ };
8936
10247
  call_exact_route: {
8937
10248
  Args: {
8938
10249
  path: string;
8939
10250
  };
8940
10251
  Returns: number;
8941
10252
  };
10253
+ check_offer_product_available_stock: {
10254
+ Args: {
10255
+ p_campaign_product_id: string;
10256
+ p_code: string;
10257
+ p_needed_qty?: number;
10258
+ p_product_name?: string;
10259
+ };
10260
+ Returns: Json;
10261
+ };
10262
+ check_trade_item_available_stock: {
10263
+ Args: {
10264
+ p_connection_id?: string;
10265
+ p_context?: string;
10266
+ p_needed_qty?: number;
10267
+ p_order_id?: string;
10268
+ p_order_item_id?: string;
10269
+ p_owner_id?: string;
10270
+ p_product_name?: string;
10271
+ p_trade_item_key: string;
10272
+ };
10273
+ Returns: Json;
10274
+ };
8942
10275
  cleanup_old_bookings: {
8943
10276
  Args: never;
8944
10277
  Returns: number;
8945
10278
  };
10279
+ control_get_todays_carts: {
10280
+ Args: never;
10281
+ Returns: {
10282
+ cart_index: number;
10283
+ cart_number: string;
10284
+ cart_number_id: string;
10285
+ order_id: string;
10286
+ order_source: string;
10287
+ pick_date: string;
10288
+ status: string;
10289
+ }[];
10290
+ };
10291
+ count_distinct_regulatory_products: {
10292
+ Args: never;
10293
+ Returns: number;
10294
+ };
8946
10295
  current_monteur_id: {
8947
10296
  Args: never;
8948
10297
  Returns: string;
8949
10298
  };
10299
+ dashboard_alert_counts: {
10300
+ Args: never;
10301
+ Returns: Json;
10302
+ };
10303
+ dashboard_alert_rows: {
10304
+ Args: {
10305
+ check_id: string;
10306
+ row_limit?: number;
10307
+ };
10308
+ Returns: Json;
10309
+ };
8950
10310
  dashboard_list_public_schema: {
8951
10311
  Args: never;
8952
10312
  Returns: {
@@ -8955,6 +10315,12 @@ export type Database = {
8955
10315
  table_name: string;
8956
10316
  }[];
8957
10317
  };
10318
+ dispatch_carrier_signups_sql: {
10319
+ Args: {
10320
+ _catchup?: string;
10321
+ };
10322
+ Returns: Json;
10323
+ };
8958
10324
  email_auth_decrypt: {
8959
10325
  Args: {
8960
10326
  cipher: string;
@@ -8990,6 +10356,12 @@ export type Database = {
8990
10356
  status: string;
8991
10357
  }[];
8992
10358
  };
10359
+ ensure_trade_item_stock_row: {
10360
+ Args: {
10361
+ p_key: string;
10362
+ };
10363
+ Returns: undefined;
10364
+ };
8993
10365
  ensure_user_tenant: {
8994
10366
  Args: never;
8995
10367
  Returns: string;
@@ -9027,6 +10399,38 @@ export type Database = {
9027
10399
  };
9028
10400
  Returns: boolean;
9029
10401
  };
10402
+ find_trade_item_key: {
10403
+ Args: {
10404
+ p_barcode: string;
10405
+ p_name: string;
10406
+ p_product_id: string;
10407
+ };
10408
+ Returns: string;
10409
+ };
10410
+ floriday_effective_price: {
10411
+ Args: {
10412
+ _buyer_id: string;
10413
+ _on_date?: string;
10414
+ _quantity?: number;
10415
+ _trade_item_id: string;
10416
+ };
10417
+ Returns: {
10418
+ base_price: number;
10419
+ currency: string;
10420
+ discount_type: string;
10421
+ discount_value: number;
10422
+ net_price: number;
10423
+ source: string;
10424
+ source_id: string;
10425
+ }[];
10426
+ };
10427
+ format_cart_number: {
10428
+ Args: {
10429
+ p_pick_date: string;
10430
+ p_seq: number;
10431
+ };
10432
+ Returns: string;
10433
+ };
9030
10434
  get_active_floriday_connection_public: {
9031
10435
  Args: never;
9032
10436
  Returns: {
@@ -9040,6 +10444,13 @@ export type Database = {
9040
10444
  preferred_warehouse_name: string;
9041
10445
  }[];
9042
10446
  };
10447
+ get_active_floriday_context: {
10448
+ Args: never;
10449
+ Returns: {
10450
+ connection_id: string;
10451
+ user_id: string;
10452
+ }[];
10453
+ };
9043
10454
  get_active_twinfield_public: {
9044
10455
  Args: never;
9045
10456
  Returns: {
@@ -9142,6 +10553,18 @@ export type Database = {
9142
10553
  };
9143
10554
  Returns: Json;
9144
10555
  };
10556
+ get_offer_recipient_by_code: {
10557
+ Args: {
10558
+ p_code: string;
10559
+ };
10560
+ Returns: {
10561
+ campaign_id: string;
10562
+ clicked_at: string;
10563
+ customer_id: string;
10564
+ id: string;
10565
+ ordered_at: string;
10566
+ }[];
10567
+ };
9145
10568
  get_or_assign_floriday_order_number: {
9146
10569
  Args: {
9147
10570
  p_floriday_id: string;
@@ -9194,6 +10617,34 @@ export type Database = {
9194
10617
  Args: never;
9195
10618
  Returns: boolean;
9196
10619
  };
10620
+ local_effective_price: {
10621
+ Args: {
10622
+ _customer_id: string;
10623
+ _on_date?: string;
10624
+ _product_id: string;
10625
+ _quantity?: number;
10626
+ };
10627
+ Returns: {
10628
+ currency: string;
10629
+ discount_type: string;
10630
+ discount_value: number;
10631
+ net_price: number;
10632
+ source: string;
10633
+ source_id: string;
10634
+ }[];
10635
+ };
10636
+ mark_offer_clicked: {
10637
+ Args: {
10638
+ p_code: string;
10639
+ };
10640
+ Returns: undefined;
10641
+ };
10642
+ mark_offer_ordered: {
10643
+ Args: {
10644
+ p_code: string;
10645
+ };
10646
+ Returns: undefined;
10647
+ };
9197
10648
  next_order_number: {
9198
10649
  Args: {
9199
10650
  p_prefix: string;
@@ -9213,6 +10664,14 @@ export type Database = {
9213
10664
  };
9214
10665
  Returns: string;
9215
10666
  };
10667
+ offer_recipient_matches: {
10668
+ Args: {
10669
+ _campaign_id: string;
10670
+ _customer_id: string;
10671
+ _recipient_id: string;
10672
+ };
10673
+ Returns: boolean;
10674
+ };
9216
10675
  pickstation_get_orders_raw: {
9217
10676
  Args: never;
9218
10677
  Returns: Json;
@@ -9231,6 +10690,22 @@ export type Database = {
9231
10690
  };
9232
10691
  Returns: undefined;
9233
10692
  };
10693
+ pickstation_set_cart_status: {
10694
+ Args: {
10695
+ p_cart_index: number;
10696
+ p_order_id: string;
10697
+ p_order_source: string;
10698
+ p_status: string;
10699
+ };
10700
+ Returns: undefined;
10701
+ };
10702
+ promote_trade_item_key: {
10703
+ Args: {
10704
+ p_new: string;
10705
+ p_old: string;
10706
+ };
10707
+ Returns: undefined;
10708
+ };
9234
10709
  refresh_floricode_derived_code_lists: {
9235
10710
  Args: never;
9236
10711
  Returns: {
@@ -9239,6 +10714,12 @@ export type Database = {
9239
10714
  row_count: number;
9240
10715
  }[];
9241
10716
  };
10717
+ refresh_floricode_derived_for_product: {
10718
+ Args: {
10719
+ p_product_code: string;
10720
+ };
10721
+ Returns: number;
10722
+ };
9242
10723
  reset_floriday_sync_cursor: {
9243
10724
  Args: {
9244
10725
  p_connection_id: string;