@accounter/server 0.0.8-alpha-20251104120008-7c1d79bd7d8d67caed9e03a81f242f34b4150dc9 → 0.0.8-alpha-20251104122353-2d314f94e40ac7980868e9dfa877281f49b761c4
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.
- package/CHANGELOG.md +27 -5
- package/dist/server/src/__generated__/types.d.ts +11 -4
- package/dist/server/src/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/app-providers/green-invoice-client.d.ts +1 -1
- package/dist/server/src/modules/charges-matcher/__generated__/types.d.ts +3 -1
- package/dist/server/src/modules/charges-matcher/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/charges-matcher/__tests__/auto-match-integration.test.js +0 -1
- package/dist/server/src/modules/charges-matcher/__tests__/auto-match-integration.test.js.map +1 -1
- package/dist/server/src/modules/charges-matcher/__tests__/test-helpers.d.ts +2 -2
- package/dist/server/src/modules/charges-matcher/__tests__/test-helpers.js.map +1 -1
- package/dist/server/src/modules/charges-matcher/providers/auto-match.provider.js +10 -1
- package/dist/server/src/modules/charges-matcher/providers/auto-match.provider.js.map +1 -1
- package/dist/server/src/modules/charges-matcher/providers/charges-matcher.provider.js +22 -10
- package/dist/server/src/modules/charges-matcher/providers/charges-matcher.provider.js.map +1 -1
- package/dist/server/src/modules/charges-matcher/resolvers/index.js +4 -0
- package/dist/server/src/modules/charges-matcher/resolvers/index.js.map +1 -1
- package/dist/server/src/modules/charges-matcher/typeDefs/charges-matcher.graphql.js +1 -0
- package/dist/server/src/modules/charges-matcher/typeDefs/charges-matcher.graphql.js.map +1 -1
- package/dist/server/src/modules/charges-matcher/types.d.ts +5 -3
- package/dist/server/src/modules/charges-matcher/types.js +1 -1
- package/dist/server/src/modules/charges-matcher/types.js.map +1 -1
- package/dist/server/src/modules/financial-entities/__generated__/clients.types.d.ts +8 -0
- package/dist/server/src/modules/green-invoice/helpers/green-invoice.helper.js +514 -1005
- package/dist/server/src/modules/green-invoice/helpers/green-invoice.helper.js.map +1 -1
- package/package.json +1 -1
- package/src/__generated__/types.ts +7 -4
- package/src/modules/charges-matcher/__generated__/types.ts +3 -1
- package/src/modules/charges-matcher/__tests__/auto-match-integration.test.ts +0 -1
- package/src/modules/charges-matcher/__tests__/test-helpers.ts +3 -3
- package/src/modules/charges-matcher/providers/auto-match.provider.ts +11 -1
- package/src/modules/charges-matcher/providers/charges-matcher.provider.ts +63 -46
- package/src/modules/charges-matcher/resolvers/index.ts +5 -0
- package/src/modules/charges-matcher/typeDefs/charges-matcher.graphql.ts +1 -0
- package/src/modules/charges-matcher/types.ts +6 -4
- package/src/modules/financial-entities/__generated__/clients.types.ts +7 -0
- package/src/modules/green-invoice/helpers/green-invoice.helper.ts +516 -1005
|
@@ -484,1016 +484,527 @@ export function convertCurrencyToGreenInvoice(currency: Currency): GreenInvoiceC
|
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
export function greenInvoiceCountryToCountryCode(country: GreenInvoiceCountry): CountryCode {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
case 'LK':
|
|
747
|
-
return CountryCode['Sri Lanka'];
|
|
748
|
-
case 'LR':
|
|
749
|
-
return CountryCode.Liberia;
|
|
750
|
-
case 'LS':
|
|
751
|
-
return CountryCode.Lesotho;
|
|
752
|
-
case 'LT':
|
|
753
|
-
return CountryCode.Lithuania;
|
|
754
|
-
case 'LU':
|
|
755
|
-
return CountryCode.Luxembourg;
|
|
756
|
-
case 'LV':
|
|
757
|
-
return CountryCode.Latvia;
|
|
758
|
-
case 'LY':
|
|
759
|
-
return CountryCode.Libya;
|
|
760
|
-
case 'MA':
|
|
761
|
-
return CountryCode.Morocco;
|
|
762
|
-
case 'MC':
|
|
763
|
-
return CountryCode.Monaco;
|
|
764
|
-
case 'MD':
|
|
765
|
-
return CountryCode['Moldova (the Republic of)'];
|
|
766
|
-
case 'ME':
|
|
767
|
-
return CountryCode.Montenegro;
|
|
768
|
-
case 'MF':
|
|
769
|
-
return CountryCode['Saint Martin (French part)'];
|
|
770
|
-
case 'MG':
|
|
771
|
-
return CountryCode.Madagascar;
|
|
772
|
-
case 'MH':
|
|
773
|
-
return CountryCode['Marshall Islands (the)'];
|
|
774
|
-
case 'MK':
|
|
775
|
-
return CountryCode['Republic of North Macedonia'];
|
|
776
|
-
case 'ML':
|
|
777
|
-
return CountryCode.Mali;
|
|
778
|
-
case 'MM':
|
|
779
|
-
return CountryCode.Myanmar;
|
|
780
|
-
case 'MN':
|
|
781
|
-
return CountryCode.Mongolia;
|
|
782
|
-
case 'MO':
|
|
783
|
-
return CountryCode.Macao;
|
|
784
|
-
case 'MP':
|
|
785
|
-
return CountryCode['Northern Mariana Islands (the)'];
|
|
786
|
-
case 'MQ':
|
|
787
|
-
return CountryCode.Martinique;
|
|
788
|
-
case 'MR':
|
|
789
|
-
return CountryCode.Mauritania;
|
|
790
|
-
case 'MS':
|
|
791
|
-
return CountryCode.Montserrat;
|
|
792
|
-
case 'MT':
|
|
793
|
-
return CountryCode.Malta;
|
|
794
|
-
case 'MU':
|
|
795
|
-
return CountryCode.Mauritius;
|
|
796
|
-
case 'MV':
|
|
797
|
-
return CountryCode.Maldives;
|
|
798
|
-
case 'MW':
|
|
799
|
-
return CountryCode.Malawi;
|
|
800
|
-
case 'MX':
|
|
801
|
-
return CountryCode.Mexico;
|
|
802
|
-
case 'MY':
|
|
803
|
-
return CountryCode.Malaysia;
|
|
804
|
-
case 'MZ':
|
|
805
|
-
return CountryCode.Mozambique;
|
|
806
|
-
case 'NA':
|
|
807
|
-
return CountryCode.Namibia;
|
|
808
|
-
case 'NC':
|
|
809
|
-
return CountryCode['New Caledonia'];
|
|
810
|
-
case 'NE':
|
|
811
|
-
return CountryCode['Niger (the)'];
|
|
812
|
-
case 'NF':
|
|
813
|
-
return CountryCode['Norfolk Island'];
|
|
814
|
-
case 'NG':
|
|
815
|
-
return CountryCode.Nigeria;
|
|
816
|
-
case 'NI':
|
|
817
|
-
return CountryCode.Nicaragua;
|
|
818
|
-
case 'NL':
|
|
819
|
-
return CountryCode['Netherlands (the)'];
|
|
820
|
-
case 'NO':
|
|
821
|
-
return CountryCode.Norway;
|
|
822
|
-
case 'NP':
|
|
823
|
-
return CountryCode.Nepal;
|
|
824
|
-
case 'NR':
|
|
825
|
-
return CountryCode.Nauru;
|
|
826
|
-
case 'NU':
|
|
827
|
-
return CountryCode.Niue;
|
|
828
|
-
case 'NZ':
|
|
829
|
-
return CountryCode['New Zealand'];
|
|
830
|
-
case 'OM':
|
|
831
|
-
return CountryCode.Oman;
|
|
832
|
-
case 'PA':
|
|
833
|
-
return CountryCode.Panama;
|
|
834
|
-
case 'PE':
|
|
835
|
-
return CountryCode.Peru;
|
|
836
|
-
case 'PF':
|
|
837
|
-
return CountryCode['French Polynesia'];
|
|
838
|
-
case 'PG':
|
|
839
|
-
return CountryCode['Papua New Guinea'];
|
|
840
|
-
case 'PH':
|
|
841
|
-
return CountryCode['Philippines (the)'];
|
|
842
|
-
case 'PK':
|
|
843
|
-
return CountryCode.Pakistan;
|
|
844
|
-
case 'PL':
|
|
845
|
-
return CountryCode.Poland;
|
|
846
|
-
case 'PM':
|
|
847
|
-
return CountryCode['Saint Pierre and Miquelon'];
|
|
848
|
-
case 'PN':
|
|
849
|
-
return CountryCode.Pitcairn;
|
|
850
|
-
case 'PR':
|
|
851
|
-
return CountryCode['Puerto Rico'];
|
|
852
|
-
case 'PS':
|
|
853
|
-
return CountryCode['Palestine, State of'];
|
|
854
|
-
case 'PT':
|
|
855
|
-
return CountryCode.Portugal;
|
|
856
|
-
case 'PW':
|
|
857
|
-
return CountryCode.Palau;
|
|
858
|
-
case 'PY':
|
|
859
|
-
return CountryCode.Paraguay;
|
|
860
|
-
case 'QA':
|
|
861
|
-
return CountryCode.Qatar;
|
|
862
|
-
case 'RE':
|
|
863
|
-
return CountryCode.Réunion;
|
|
864
|
-
case 'RO':
|
|
865
|
-
return CountryCode.Romania;
|
|
866
|
-
case 'RS':
|
|
867
|
-
return CountryCode.Serbia;
|
|
868
|
-
case 'RU':
|
|
869
|
-
return CountryCode['Russian Federation (the)'];
|
|
870
|
-
case 'RW':
|
|
871
|
-
return CountryCode.Rwanda;
|
|
872
|
-
case 'SA':
|
|
873
|
-
return CountryCode['Saudi Arabia'];
|
|
874
|
-
case 'SB':
|
|
875
|
-
return CountryCode['Solomon Islands'];
|
|
876
|
-
case 'SC':
|
|
877
|
-
return CountryCode.Seychelles;
|
|
878
|
-
case 'SD':
|
|
879
|
-
return CountryCode['Sudan (the)'];
|
|
880
|
-
case 'SE':
|
|
881
|
-
return CountryCode.Sweden;
|
|
882
|
-
case 'SG':
|
|
883
|
-
return CountryCode.Singapore;
|
|
884
|
-
case 'SH':
|
|
885
|
-
return CountryCode['Saint Helena, Ascension and Tristan da Cunha'];
|
|
886
|
-
case 'SI':
|
|
887
|
-
return CountryCode.Slovenia;
|
|
888
|
-
case 'SJ':
|
|
889
|
-
return CountryCode['Svalbard and Jan Mayen'];
|
|
890
|
-
case 'SK':
|
|
891
|
-
return CountryCode.Slovakia;
|
|
892
|
-
case 'SL':
|
|
893
|
-
return CountryCode['Sierra Leone'];
|
|
894
|
-
case 'SM':
|
|
895
|
-
return CountryCode['San Marino'];
|
|
896
|
-
case 'SN':
|
|
897
|
-
return CountryCode.Senegal;
|
|
898
|
-
case 'SO':
|
|
899
|
-
return CountryCode.Somalia;
|
|
900
|
-
case 'SR':
|
|
901
|
-
return CountryCode.Suriname;
|
|
902
|
-
case 'SS':
|
|
903
|
-
return CountryCode['South Sudan'];
|
|
904
|
-
case 'ST':
|
|
905
|
-
return CountryCode['Sao Tome and Principe'];
|
|
906
|
-
case 'SV':
|
|
907
|
-
return CountryCode['El Salvador'];
|
|
908
|
-
case 'SX':
|
|
909
|
-
return CountryCode['Sint Maarten (Dutch part)'];
|
|
910
|
-
case 'SY':
|
|
911
|
-
return CountryCode['Syrian Arab Republic'];
|
|
912
|
-
case 'SZ':
|
|
913
|
-
return CountryCode.Eswatini;
|
|
914
|
-
case 'TC':
|
|
915
|
-
return CountryCode['Turks and Caicos Islands (the)'];
|
|
916
|
-
case 'TD':
|
|
917
|
-
return CountryCode.Chad;
|
|
918
|
-
case 'TF':
|
|
919
|
-
return CountryCode['French Southern Territories (the)'];
|
|
920
|
-
case 'TG':
|
|
921
|
-
return CountryCode.Togo;
|
|
922
|
-
case 'TH':
|
|
923
|
-
return CountryCode.Thailand;
|
|
924
|
-
case 'TJ':
|
|
925
|
-
return CountryCode.Tajikistan;
|
|
926
|
-
case 'TK':
|
|
927
|
-
return CountryCode.Tokelau;
|
|
928
|
-
case 'TL':
|
|
929
|
-
return CountryCode['Timor-Leste'];
|
|
930
|
-
case 'TM':
|
|
931
|
-
return CountryCode.Turkmenistan;
|
|
932
|
-
case 'TN':
|
|
933
|
-
return CountryCode.Tunisia;
|
|
934
|
-
case 'TO':
|
|
935
|
-
return CountryCode.Tonga;
|
|
936
|
-
case 'TR':
|
|
937
|
-
return CountryCode.Turkey;
|
|
938
|
-
case 'TT':
|
|
939
|
-
return CountryCode['Trinidad and Tobago'];
|
|
940
|
-
case 'TV':
|
|
941
|
-
return CountryCode.Tuvalu;
|
|
942
|
-
case 'TW':
|
|
943
|
-
return CountryCode['Taiwan (Province of China)'];
|
|
944
|
-
case 'TZ':
|
|
945
|
-
return CountryCode['Tanzania, United Republic of'];
|
|
946
|
-
case 'UA':
|
|
947
|
-
return CountryCode.Ukraine;
|
|
948
|
-
case 'UG':
|
|
949
|
-
return CountryCode.Uganda;
|
|
950
|
-
case 'UM':
|
|
951
|
-
return CountryCode['United States Minor Outlying Islands (the)'];
|
|
952
|
-
case 'US':
|
|
953
|
-
return CountryCode['United States of America (the)'];
|
|
954
|
-
case 'UY':
|
|
955
|
-
return CountryCode.Uruguay;
|
|
956
|
-
case 'UZ':
|
|
957
|
-
return CountryCode.Uzbekistan;
|
|
958
|
-
case 'VA':
|
|
959
|
-
return CountryCode['Holy See (the)'];
|
|
960
|
-
case 'VC':
|
|
961
|
-
return CountryCode['Saint Vincent and the Grenadines'];
|
|
962
|
-
case 'VE':
|
|
963
|
-
return CountryCode['Venezuela (Bolivarian Republic of)'];
|
|
964
|
-
case 'VG':
|
|
965
|
-
return CountryCode['Virgin Islands (British)'];
|
|
966
|
-
case 'VI':
|
|
967
|
-
return CountryCode['Virgin Islands (U.S.)'];
|
|
968
|
-
case 'VN':
|
|
969
|
-
return CountryCode['Viet Nam'];
|
|
970
|
-
case 'VU':
|
|
971
|
-
return CountryCode.Vanuatu;
|
|
972
|
-
case 'WF':
|
|
973
|
-
return CountryCode['Wallis and Futuna'];
|
|
974
|
-
case 'WS':
|
|
975
|
-
return CountryCode.Samoa;
|
|
976
|
-
case 'YE':
|
|
977
|
-
return CountryCode.Yemen;
|
|
978
|
-
case 'YT':
|
|
979
|
-
return CountryCode.Mayotte;
|
|
980
|
-
case 'ZA':
|
|
981
|
-
return CountryCode['South Africa'];
|
|
982
|
-
case 'ZM':
|
|
983
|
-
return CountryCode.Zambia;
|
|
984
|
-
case 'ZW':
|
|
985
|
-
return CountryCode.Zimbabwe;
|
|
986
|
-
case 'XK':
|
|
987
|
-
// TODO: remove this once green invoice adds Kosovo to their list
|
|
988
|
-
return CountryCode.Serbia;
|
|
989
|
-
default:
|
|
990
|
-
throw new Error(`Unsupported Green Invoice country: ${country}`);
|
|
487
|
+
const greenInvoiceToCountryCodeMap: Partial<Record<GreenInvoiceCountry, CountryCode>> = {
|
|
488
|
+
AD: CountryCode.Andorra,
|
|
489
|
+
AE: CountryCode['United Arab Emirates (the)'],
|
|
490
|
+
AF: CountryCode.Afghanistan,
|
|
491
|
+
AG: CountryCode['Antigua and Barbuda'],
|
|
492
|
+
AI: CountryCode.Anguilla,
|
|
493
|
+
AL: CountryCode.Albania,
|
|
494
|
+
AM: CountryCode.Armenia,
|
|
495
|
+
AO: CountryCode.Angola,
|
|
496
|
+
AQ: CountryCode.Antarctica,
|
|
497
|
+
AR: CountryCode.Argentina,
|
|
498
|
+
AS: CountryCode['American Samoa'],
|
|
499
|
+
AT: CountryCode.Austria,
|
|
500
|
+
AU: CountryCode.Australia,
|
|
501
|
+
AW: CountryCode.Aruba,
|
|
502
|
+
AX: CountryCode['Åland Islands'],
|
|
503
|
+
AZ: CountryCode.Azerbaijan,
|
|
504
|
+
BA: CountryCode['Bosnia and Herzegovina'],
|
|
505
|
+
BB: CountryCode.Barbados,
|
|
506
|
+
BD: CountryCode.Bangladesh,
|
|
507
|
+
BE: CountryCode.Belgium,
|
|
508
|
+
BF: CountryCode['Burkina Faso'],
|
|
509
|
+
BG: CountryCode.Bulgaria,
|
|
510
|
+
BH: CountryCode.Bahrain,
|
|
511
|
+
BI: CountryCode.Burundi,
|
|
512
|
+
BJ: CountryCode.Benin,
|
|
513
|
+
BL: CountryCode['Saint Barthélemy'],
|
|
514
|
+
BM: CountryCode.Bermuda,
|
|
515
|
+
BN: CountryCode['Brunei Darussalam'],
|
|
516
|
+
BO: CountryCode['Bolivia (Plurinational State of)'],
|
|
517
|
+
BQ: CountryCode['Bonaire, Sint Eustatius and Saba'],
|
|
518
|
+
BR: CountryCode.Brazil,
|
|
519
|
+
BS: CountryCode['Bahamas (the)'],
|
|
520
|
+
BT: CountryCode.Bhutan,
|
|
521
|
+
BV: CountryCode['Bouvet Island'],
|
|
522
|
+
BW: CountryCode.Botswana,
|
|
523
|
+
BY: CountryCode.Belarus,
|
|
524
|
+
BZ: CountryCode.Belize,
|
|
525
|
+
CA: CountryCode.Canada,
|
|
526
|
+
CC: CountryCode['Cocos (Keeling) Islands (the)'],
|
|
527
|
+
CD: CountryCode['Congo (the Democratic Republic of the)'],
|
|
528
|
+
CF: CountryCode['Central African Republic (the)'],
|
|
529
|
+
CG: CountryCode['Congo (the)'],
|
|
530
|
+
CH: CountryCode.Switzerland,
|
|
531
|
+
CI: CountryCode["Côte d'Ivoire"],
|
|
532
|
+
CK: CountryCode['Cook Islands (the)'],
|
|
533
|
+
CL: CountryCode.Chile,
|
|
534
|
+
CM: CountryCode.Cameroon,
|
|
535
|
+
CN: CountryCode.China,
|
|
536
|
+
CO: CountryCode.Colombia,
|
|
537
|
+
CR: CountryCode['Costa Rica'],
|
|
538
|
+
CU: CountryCode.Cuba,
|
|
539
|
+
CV: CountryCode['Cabo Verde'],
|
|
540
|
+
CW: CountryCode.Curaçao,
|
|
541
|
+
CX: CountryCode['Christmas Island'],
|
|
542
|
+
CY: CountryCode.Cyprus,
|
|
543
|
+
CZ: CountryCode.Czechia,
|
|
544
|
+
DE: CountryCode.Germany,
|
|
545
|
+
DJ: CountryCode.Djibouti,
|
|
546
|
+
DK: CountryCode.Denmark,
|
|
547
|
+
DM: CountryCode.Dominica,
|
|
548
|
+
DO: CountryCode['Dominican Republic (the)'],
|
|
549
|
+
DZ: CountryCode.Algeria,
|
|
550
|
+
EC: CountryCode.Ecuador,
|
|
551
|
+
EE: CountryCode.Estonia,
|
|
552
|
+
EG: CountryCode.Egypt,
|
|
553
|
+
EH: CountryCode['Western Sahara'],
|
|
554
|
+
ER: CountryCode.Eritrea,
|
|
555
|
+
ES: CountryCode.Spain,
|
|
556
|
+
ET: CountryCode.Ethiopia,
|
|
557
|
+
FI: CountryCode.Finland,
|
|
558
|
+
FJ: CountryCode.Fiji,
|
|
559
|
+
FK: CountryCode['Falkland Islands (the) [Malvinas]'],
|
|
560
|
+
FM: CountryCode['Micronesia (Federated States of)'],
|
|
561
|
+
FO: CountryCode['Faroe Islands (the)'],
|
|
562
|
+
FR: CountryCode.France,
|
|
563
|
+
GA: CountryCode.Gabon,
|
|
564
|
+
GB: CountryCode['United Kingdom of Great Britain and Northern Ireland (the)'],
|
|
565
|
+
GD: CountryCode.Grenada,
|
|
566
|
+
GE: CountryCode.Georgia,
|
|
567
|
+
GF: CountryCode['French Guiana'],
|
|
568
|
+
GG: CountryCode.Guernsey,
|
|
569
|
+
GH: CountryCode.Ghana,
|
|
570
|
+
GI: CountryCode.Gibraltar,
|
|
571
|
+
GL: CountryCode.Greenland,
|
|
572
|
+
GM: CountryCode['Gambia (the)'],
|
|
573
|
+
GN: CountryCode.Guinea,
|
|
574
|
+
GP: CountryCode.Guadeloupe,
|
|
575
|
+
GQ: CountryCode['Equatorial Guinea'],
|
|
576
|
+
GR: CountryCode.Greece,
|
|
577
|
+
GS: CountryCode['South Georgia and the South Sandwich Islands'],
|
|
578
|
+
GT: CountryCode.Guatemala,
|
|
579
|
+
GU: CountryCode.Guam,
|
|
580
|
+
GW: CountryCode['Guinea-Bissau'],
|
|
581
|
+
GY: CountryCode.Guyana,
|
|
582
|
+
HK: CountryCode['Hong Kong'],
|
|
583
|
+
HM: CountryCode['Heard Island and McDonald Islands'],
|
|
584
|
+
HN: CountryCode.Honduras,
|
|
585
|
+
HR: CountryCode.Croatia,
|
|
586
|
+
HT: CountryCode.Haiti,
|
|
587
|
+
HU: CountryCode.Hungary,
|
|
588
|
+
ID: CountryCode.Indonesia,
|
|
589
|
+
IE: CountryCode.Ireland,
|
|
590
|
+
IL: CountryCode.Israel,
|
|
591
|
+
IM: CountryCode['Isle of Man'],
|
|
592
|
+
IN: CountryCode.India,
|
|
593
|
+
IO: CountryCode['British Indian Ocean Territory (the)'],
|
|
594
|
+
IQ: CountryCode.Iraq,
|
|
595
|
+
IR: CountryCode['Iran (Islamic Republic of)'],
|
|
596
|
+
IS: CountryCode.Iceland,
|
|
597
|
+
IT: CountryCode.Italy,
|
|
598
|
+
JE: CountryCode.Jersey,
|
|
599
|
+
JM: CountryCode.Jamaica,
|
|
600
|
+
JO: CountryCode.Jordan,
|
|
601
|
+
JP: CountryCode.Japan,
|
|
602
|
+
KE: CountryCode.Kenya,
|
|
603
|
+
KG: CountryCode.Kyrgyzstan,
|
|
604
|
+
KH: CountryCode.Cambodia,
|
|
605
|
+
KI: CountryCode.Kiribati,
|
|
606
|
+
KM: CountryCode['Comoros (the)'],
|
|
607
|
+
KN: CountryCode['Saint Kitts and Nevis'],
|
|
608
|
+
KP: CountryCode["Korea (the Democratic People's Republic of)"],
|
|
609
|
+
KR: CountryCode['Korea (the Republic of)'],
|
|
610
|
+
KW: CountryCode.Kuwait,
|
|
611
|
+
KY: CountryCode['Cayman Islands (the)'],
|
|
612
|
+
KZ: CountryCode.Kazakhstan,
|
|
613
|
+
LA: CountryCode["Lao People's Democratic Republic (the)"],
|
|
614
|
+
LB: CountryCode.Lebanon,
|
|
615
|
+
LC: CountryCode['Saint Lucia'],
|
|
616
|
+
LI: CountryCode.Liechtenstein,
|
|
617
|
+
LK: CountryCode['Sri Lanka'],
|
|
618
|
+
LR: CountryCode.Liberia,
|
|
619
|
+
LS: CountryCode.Lesotho,
|
|
620
|
+
LT: CountryCode.Lithuania,
|
|
621
|
+
LU: CountryCode.Luxembourg,
|
|
622
|
+
LV: CountryCode.Latvia,
|
|
623
|
+
LY: CountryCode.Libya,
|
|
624
|
+
MA: CountryCode.Morocco,
|
|
625
|
+
MC: CountryCode.Monaco,
|
|
626
|
+
MD: CountryCode['Moldova (the Republic of)'],
|
|
627
|
+
ME: CountryCode.Montenegro,
|
|
628
|
+
MF: CountryCode['Saint Martin (French part)'],
|
|
629
|
+
MG: CountryCode.Madagascar,
|
|
630
|
+
MH: CountryCode['Marshall Islands (the)'],
|
|
631
|
+
MK: CountryCode['Republic of North Macedonia'],
|
|
632
|
+
ML: CountryCode.Mali,
|
|
633
|
+
MM: CountryCode.Myanmar,
|
|
634
|
+
MN: CountryCode.Mongolia,
|
|
635
|
+
MO: CountryCode.Macao,
|
|
636
|
+
MP: CountryCode['Northern Mariana Islands (the)'],
|
|
637
|
+
MQ: CountryCode.Martinique,
|
|
638
|
+
MR: CountryCode.Mauritania,
|
|
639
|
+
MS: CountryCode.Montserrat,
|
|
640
|
+
MT: CountryCode.Malta,
|
|
641
|
+
MU: CountryCode.Mauritius,
|
|
642
|
+
MV: CountryCode.Maldives,
|
|
643
|
+
MW: CountryCode.Malawi,
|
|
644
|
+
MX: CountryCode.Mexico,
|
|
645
|
+
MY: CountryCode.Malaysia,
|
|
646
|
+
MZ: CountryCode.Mozambique,
|
|
647
|
+
NA: CountryCode.Namibia,
|
|
648
|
+
NC: CountryCode['New Caledonia'],
|
|
649
|
+
NE: CountryCode['Niger (the)'],
|
|
650
|
+
NF: CountryCode['Norfolk Island'],
|
|
651
|
+
NG: CountryCode.Nigeria,
|
|
652
|
+
NI: CountryCode.Nicaragua,
|
|
653
|
+
NL: CountryCode['Netherlands (the)'],
|
|
654
|
+
NO: CountryCode.Norway,
|
|
655
|
+
NP: CountryCode.Nepal,
|
|
656
|
+
NR: CountryCode.Nauru,
|
|
657
|
+
NU: CountryCode.Niue,
|
|
658
|
+
NZ: CountryCode['New Zealand'],
|
|
659
|
+
OM: CountryCode.Oman,
|
|
660
|
+
PA: CountryCode.Panama,
|
|
661
|
+
PE: CountryCode.Peru,
|
|
662
|
+
PF: CountryCode['French Polynesia'],
|
|
663
|
+
PG: CountryCode['Papua New Guinea'],
|
|
664
|
+
PH: CountryCode['Philippines (the)'],
|
|
665
|
+
PK: CountryCode.Pakistan,
|
|
666
|
+
PL: CountryCode.Poland,
|
|
667
|
+
PM: CountryCode['Saint Pierre and Miquelon'],
|
|
668
|
+
PN: CountryCode.Pitcairn,
|
|
669
|
+
PR: CountryCode['Puerto Rico'],
|
|
670
|
+
PS: CountryCode['Palestine, State of'],
|
|
671
|
+
PT: CountryCode.Portugal,
|
|
672
|
+
PW: CountryCode.Palau,
|
|
673
|
+
PY: CountryCode.Paraguay,
|
|
674
|
+
QA: CountryCode.Qatar,
|
|
675
|
+
RE: CountryCode.Réunion,
|
|
676
|
+
RO: CountryCode.Romania,
|
|
677
|
+
RS: CountryCode.Serbia,
|
|
678
|
+
RU: CountryCode['Russian Federation (the)'],
|
|
679
|
+
RW: CountryCode.Rwanda,
|
|
680
|
+
SA: CountryCode['Saudi Arabia'],
|
|
681
|
+
SB: CountryCode['Solomon Islands'],
|
|
682
|
+
SC: CountryCode.Seychelles,
|
|
683
|
+
SD: CountryCode['Sudan (the)'],
|
|
684
|
+
SE: CountryCode.Sweden,
|
|
685
|
+
SG: CountryCode.Singapore,
|
|
686
|
+
SH: CountryCode['Saint Helena, Ascension and Tristan da Cunha'],
|
|
687
|
+
SI: CountryCode.Slovenia,
|
|
688
|
+
SJ: CountryCode['Svalbard and Jan Mayen'],
|
|
689
|
+
SK: CountryCode.Slovakia,
|
|
690
|
+
SL: CountryCode['Sierra Leone'],
|
|
691
|
+
SM: CountryCode['San Marino'],
|
|
692
|
+
SN: CountryCode.Senegal,
|
|
693
|
+
SO: CountryCode.Somalia,
|
|
694
|
+
SR: CountryCode.Suriname,
|
|
695
|
+
SS: CountryCode['South Sudan'],
|
|
696
|
+
ST: CountryCode['Sao Tome and Principe'],
|
|
697
|
+
SV: CountryCode['El Salvador'],
|
|
698
|
+
SX: CountryCode['Sint Maarten (Dutch part)'],
|
|
699
|
+
SY: CountryCode['Syrian Arab Republic'],
|
|
700
|
+
SZ: CountryCode.Eswatini,
|
|
701
|
+
TC: CountryCode['Turks and Caicos Islands (the)'],
|
|
702
|
+
TD: CountryCode.Chad,
|
|
703
|
+
TF: CountryCode['French Southern Territories (the)'],
|
|
704
|
+
TG: CountryCode.Togo,
|
|
705
|
+
TH: CountryCode.Thailand,
|
|
706
|
+
TJ: CountryCode.Tajikistan,
|
|
707
|
+
TK: CountryCode.Tokelau,
|
|
708
|
+
TL: CountryCode['Timor-Leste'],
|
|
709
|
+
TM: CountryCode.Turkmenistan,
|
|
710
|
+
TN: CountryCode.Tunisia,
|
|
711
|
+
TO: CountryCode.Tonga,
|
|
712
|
+
TR: CountryCode.Turkey,
|
|
713
|
+
TT: CountryCode['Trinidad and Tobago'],
|
|
714
|
+
TV: CountryCode.Tuvalu,
|
|
715
|
+
TW: CountryCode['Taiwan (Province of China)'],
|
|
716
|
+
TZ: CountryCode['Tanzania, United Republic of'],
|
|
717
|
+
UA: CountryCode.Ukraine,
|
|
718
|
+
UG: CountryCode.Uganda,
|
|
719
|
+
UM: CountryCode['United States Minor Outlying Islands (the)'],
|
|
720
|
+
US: CountryCode['United States of America (the)'],
|
|
721
|
+
UY: CountryCode.Uruguay,
|
|
722
|
+
UZ: CountryCode.Uzbekistan,
|
|
723
|
+
VA: CountryCode['Holy See (the)'],
|
|
724
|
+
VC: CountryCode['Saint Vincent and the Grenadines'],
|
|
725
|
+
VE: CountryCode['Venezuela (Bolivarian Republic of)'],
|
|
726
|
+
VG: CountryCode['Virgin Islands (British)'],
|
|
727
|
+
VI: CountryCode['Virgin Islands (U.S.)'],
|
|
728
|
+
VN: CountryCode['Viet Nam'],
|
|
729
|
+
VU: CountryCode.Vanuatu,
|
|
730
|
+
WF: CountryCode['Wallis and Futuna'],
|
|
731
|
+
WS: CountryCode.Samoa,
|
|
732
|
+
YE: CountryCode.Yemen,
|
|
733
|
+
YT: CountryCode.Mayotte,
|
|
734
|
+
ZA: CountryCode['South Africa'],
|
|
735
|
+
ZM: CountryCode.Zambia,
|
|
736
|
+
ZW: CountryCode.Zimbabwe,
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
if (country === 'XK') {
|
|
740
|
+
// TODO: remove this once green invoice adds Kosovo to their list
|
|
741
|
+
return CountryCode.Serbia;
|
|
742
|
+
}
|
|
743
|
+
const code = greenInvoiceToCountryCodeMap[country];
|
|
744
|
+
if (code) {
|
|
745
|
+
return code;
|
|
991
746
|
}
|
|
747
|
+
throw new Error(`Unsupported Green Invoice country: ${country}`);
|
|
992
748
|
}
|
|
993
749
|
|
|
994
750
|
export function countryCodeToGreenInvoiceCountry(countryCode: CountryCode): GreenInvoiceCountry {
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
case CountryCode.Libya:
|
|
1251
|
-
return 'LY';
|
|
1252
|
-
case CountryCode.Liechtenstein:
|
|
1253
|
-
return 'LI';
|
|
1254
|
-
case CountryCode.Lithuania:
|
|
1255
|
-
return 'LT';
|
|
1256
|
-
case CountryCode.Luxembourg:
|
|
1257
|
-
return 'LU';
|
|
1258
|
-
case CountryCode.Macao:
|
|
1259
|
-
return 'MO';
|
|
1260
|
-
case CountryCode.Madagascar:
|
|
1261
|
-
return 'MG';
|
|
1262
|
-
case CountryCode.Malawi:
|
|
1263
|
-
return 'MW';
|
|
1264
|
-
case CountryCode.Malaysia:
|
|
1265
|
-
return 'MY';
|
|
1266
|
-
case CountryCode.Maldives:
|
|
1267
|
-
return 'MV';
|
|
1268
|
-
case CountryCode.Mali:
|
|
1269
|
-
return 'ML';
|
|
1270
|
-
case CountryCode.Malta:
|
|
1271
|
-
return 'MT';
|
|
1272
|
-
case CountryCode['Marshall Islands (the)']:
|
|
1273
|
-
return 'MH';
|
|
1274
|
-
case CountryCode.Martinique:
|
|
1275
|
-
return 'MQ';
|
|
1276
|
-
case CountryCode.Mauritania:
|
|
1277
|
-
return 'MR';
|
|
1278
|
-
case CountryCode.Mauritius:
|
|
1279
|
-
return 'MU';
|
|
1280
|
-
case CountryCode.Mayotte:
|
|
1281
|
-
return 'YT';
|
|
1282
|
-
case CountryCode.Mexico:
|
|
1283
|
-
return 'MX';
|
|
1284
|
-
case CountryCode['Micronesia (Federated States of)']:
|
|
1285
|
-
return 'FM';
|
|
1286
|
-
case CountryCode['Moldova (the Republic of)']:
|
|
1287
|
-
return 'MD';
|
|
1288
|
-
case CountryCode.Monaco:
|
|
1289
|
-
return 'MC';
|
|
1290
|
-
case CountryCode.Mongolia:
|
|
1291
|
-
return 'MN';
|
|
1292
|
-
case CountryCode.Montenegro:
|
|
1293
|
-
return 'ME';
|
|
1294
|
-
case CountryCode.Montserrat:
|
|
1295
|
-
return 'MS';
|
|
1296
|
-
case CountryCode.Morocco:
|
|
1297
|
-
return 'MA';
|
|
1298
|
-
case CountryCode.Mozambique:
|
|
1299
|
-
return 'MZ';
|
|
1300
|
-
case CountryCode.Myanmar:
|
|
1301
|
-
return 'MM';
|
|
1302
|
-
case CountryCode.Namibia:
|
|
1303
|
-
return 'NA';
|
|
1304
|
-
case CountryCode.Nauru:
|
|
1305
|
-
return 'NR';
|
|
1306
|
-
case CountryCode.Nepal:
|
|
1307
|
-
return 'NP';
|
|
1308
|
-
case CountryCode['Netherlands (the)']:
|
|
1309
|
-
return 'NL';
|
|
1310
|
-
case CountryCode['New Caledonia']:
|
|
1311
|
-
return 'NC';
|
|
1312
|
-
case CountryCode['New Zealand']:
|
|
1313
|
-
return 'NZ';
|
|
1314
|
-
case CountryCode.Nicaragua:
|
|
1315
|
-
return 'NI';
|
|
1316
|
-
case CountryCode['Niger (the)']:
|
|
1317
|
-
return 'NE';
|
|
1318
|
-
case CountryCode.Nigeria:
|
|
1319
|
-
return 'NG';
|
|
1320
|
-
case CountryCode.Niue:
|
|
1321
|
-
return 'NU';
|
|
1322
|
-
case CountryCode['Norfolk Island']:
|
|
1323
|
-
return 'NF';
|
|
1324
|
-
case CountryCode['Northern Mariana Islands (the)']:
|
|
1325
|
-
return 'MP';
|
|
1326
|
-
case CountryCode.Norway:
|
|
1327
|
-
return 'NO';
|
|
1328
|
-
case CountryCode.Oman:
|
|
1329
|
-
return 'OM';
|
|
1330
|
-
case CountryCode.Pakistan:
|
|
1331
|
-
return 'PK';
|
|
1332
|
-
case CountryCode.Palau:
|
|
1333
|
-
return 'PW';
|
|
1334
|
-
case CountryCode['Palestine, State of']:
|
|
1335
|
-
return 'PS';
|
|
1336
|
-
case CountryCode.Panama:
|
|
1337
|
-
return 'PA';
|
|
1338
|
-
case CountryCode['Papua New Guinea']:
|
|
1339
|
-
return 'PG';
|
|
1340
|
-
case CountryCode.Paraguay:
|
|
1341
|
-
return 'PY';
|
|
1342
|
-
case CountryCode.Peru:
|
|
1343
|
-
return 'PE';
|
|
1344
|
-
case CountryCode['Philippines (the)']:
|
|
1345
|
-
return 'PH';
|
|
1346
|
-
case CountryCode.Pitcairn:
|
|
1347
|
-
return 'PN';
|
|
1348
|
-
case CountryCode.Poland:
|
|
1349
|
-
return 'PL';
|
|
1350
|
-
case CountryCode.Portugal:
|
|
1351
|
-
return 'PT';
|
|
1352
|
-
case CountryCode['Puerto Rico']:
|
|
1353
|
-
return 'PR';
|
|
1354
|
-
case CountryCode.Qatar:
|
|
1355
|
-
return 'QA';
|
|
1356
|
-
case CountryCode['Republic of North Macedonia']:
|
|
1357
|
-
return 'MK';
|
|
1358
|
-
case CountryCode.Romania:
|
|
1359
|
-
return 'RO';
|
|
1360
|
-
case CountryCode['Russian Federation (the)']:
|
|
1361
|
-
return 'RU';
|
|
1362
|
-
case CountryCode.Rwanda:
|
|
1363
|
-
return 'RW';
|
|
1364
|
-
case CountryCode.Réunion:
|
|
1365
|
-
return 'RE';
|
|
1366
|
-
case CountryCode['Saint Barthélemy']:
|
|
1367
|
-
return 'BL';
|
|
1368
|
-
case CountryCode['Saint Helena, Ascension and Tristan da Cunha']:
|
|
1369
|
-
return 'SH';
|
|
1370
|
-
case CountryCode['Saint Kitts and Nevis']:
|
|
1371
|
-
return 'KN';
|
|
1372
|
-
case CountryCode['Saint Lucia']:
|
|
1373
|
-
return 'LC';
|
|
1374
|
-
case CountryCode['Saint Martin (French part)']:
|
|
1375
|
-
return 'MF';
|
|
1376
|
-
case CountryCode['Saint Pierre and Miquelon']:
|
|
1377
|
-
return 'PM';
|
|
1378
|
-
case CountryCode['Saint Vincent and the Grenadines']:
|
|
1379
|
-
return 'VC';
|
|
1380
|
-
case CountryCode.Samoa:
|
|
1381
|
-
return 'WS';
|
|
1382
|
-
case CountryCode['San Marino']:
|
|
1383
|
-
return 'SM';
|
|
1384
|
-
case CountryCode['Sao Tome and Principe']:
|
|
1385
|
-
return 'ST';
|
|
1386
|
-
case CountryCode['Saudi Arabia']:
|
|
1387
|
-
return 'SA';
|
|
1388
|
-
case CountryCode.Senegal:
|
|
1389
|
-
return 'SN';
|
|
1390
|
-
case CountryCode.Serbia:
|
|
1391
|
-
return 'RS';
|
|
1392
|
-
case CountryCode.Seychelles:
|
|
1393
|
-
return 'SC';
|
|
1394
|
-
case CountryCode['Sierra Leone']:
|
|
1395
|
-
return 'SL';
|
|
1396
|
-
case CountryCode.Singapore:
|
|
1397
|
-
return 'SG';
|
|
1398
|
-
case CountryCode['Sint Maarten (Dutch part)']:
|
|
1399
|
-
return 'SX';
|
|
1400
|
-
case CountryCode.Slovakia:
|
|
1401
|
-
return 'SK';
|
|
1402
|
-
case CountryCode.Slovenia:
|
|
1403
|
-
return 'SI';
|
|
1404
|
-
case CountryCode['Solomon Islands']:
|
|
1405
|
-
return 'SB';
|
|
1406
|
-
case CountryCode.Somalia:
|
|
1407
|
-
return 'SO';
|
|
1408
|
-
case CountryCode['South Africa']:
|
|
1409
|
-
return 'ZA';
|
|
1410
|
-
case CountryCode['South Georgia and the South Sandwich Islands']:
|
|
1411
|
-
return 'GS';
|
|
1412
|
-
case CountryCode['South Sudan']:
|
|
1413
|
-
return 'SS';
|
|
1414
|
-
case CountryCode.Spain:
|
|
1415
|
-
return 'ES';
|
|
1416
|
-
case CountryCode['Sri Lanka']:
|
|
1417
|
-
return 'LK';
|
|
1418
|
-
case CountryCode['Sudan (the)']:
|
|
1419
|
-
return 'SD';
|
|
1420
|
-
case CountryCode.Suriname:
|
|
1421
|
-
return 'SR';
|
|
1422
|
-
case CountryCode['Svalbard and Jan Mayen']:
|
|
1423
|
-
return 'SJ';
|
|
1424
|
-
case CountryCode.Sweden:
|
|
1425
|
-
return 'SE';
|
|
1426
|
-
case CountryCode.Switzerland:
|
|
1427
|
-
return 'CH';
|
|
1428
|
-
case CountryCode['Syrian Arab Republic']:
|
|
1429
|
-
return 'SY';
|
|
1430
|
-
case CountryCode['Taiwan (Province of China)']:
|
|
1431
|
-
return 'TW';
|
|
1432
|
-
case CountryCode.Tajikistan:
|
|
1433
|
-
return 'TJ';
|
|
1434
|
-
case CountryCode['Tanzania, United Republic of']:
|
|
1435
|
-
return 'TZ';
|
|
1436
|
-
case CountryCode.Thailand:
|
|
1437
|
-
return 'TH';
|
|
1438
|
-
case CountryCode['Timor-Leste']:
|
|
1439
|
-
return 'TL';
|
|
1440
|
-
case CountryCode.Togo:
|
|
1441
|
-
return 'TG';
|
|
1442
|
-
case CountryCode.Tokelau:
|
|
1443
|
-
return 'TK';
|
|
1444
|
-
case CountryCode.Tonga:
|
|
1445
|
-
return 'TO';
|
|
1446
|
-
case CountryCode['Trinidad and Tobago']:
|
|
1447
|
-
return 'TT';
|
|
1448
|
-
case CountryCode.Tunisia:
|
|
1449
|
-
return 'TN';
|
|
1450
|
-
case CountryCode.Turkey:
|
|
1451
|
-
return 'TR';
|
|
1452
|
-
case CountryCode.Turkmenistan:
|
|
1453
|
-
return 'TM';
|
|
1454
|
-
case CountryCode['Turks and Caicos Islands (the)']:
|
|
1455
|
-
return 'TC';
|
|
1456
|
-
case CountryCode.Tuvalu:
|
|
1457
|
-
return 'TV';
|
|
1458
|
-
case CountryCode.Uganda:
|
|
1459
|
-
return 'UG';
|
|
1460
|
-
case CountryCode.Ukraine:
|
|
1461
|
-
return 'UA';
|
|
1462
|
-
case CountryCode['United Arab Emirates (the)']:
|
|
1463
|
-
return 'AE';
|
|
1464
|
-
case CountryCode['United Kingdom of Great Britain and Northern Ireland (the)']:
|
|
1465
|
-
return 'GB';
|
|
1466
|
-
case CountryCode['United States Minor Outlying Islands (the)']:
|
|
1467
|
-
return 'UM';
|
|
1468
|
-
case CountryCode['United States of America (the)']:
|
|
1469
|
-
return 'US';
|
|
1470
|
-
case CountryCode.Uruguay:
|
|
1471
|
-
return 'UY';
|
|
1472
|
-
case CountryCode.Uzbekistan:
|
|
1473
|
-
return 'UZ';
|
|
1474
|
-
case CountryCode.Vanuatu:
|
|
1475
|
-
return 'VU';
|
|
1476
|
-
case CountryCode['Venezuela (Bolivarian Republic of)']:
|
|
1477
|
-
return 'VE';
|
|
1478
|
-
case CountryCode['Viet Nam']:
|
|
1479
|
-
return 'VN';
|
|
1480
|
-
case CountryCode['Virgin Islands (British)']:
|
|
1481
|
-
return 'VG';
|
|
1482
|
-
case CountryCode['Virgin Islands (U.S.)']:
|
|
1483
|
-
return 'VI';
|
|
1484
|
-
case CountryCode['Wallis and Futuna']:
|
|
1485
|
-
return 'WF';
|
|
1486
|
-
case CountryCode['Western Sahara']:
|
|
1487
|
-
return 'EH';
|
|
1488
|
-
case CountryCode.Yemen:
|
|
1489
|
-
return 'YE';
|
|
1490
|
-
case CountryCode.Zambia:
|
|
1491
|
-
return 'ZM';
|
|
1492
|
-
case CountryCode.Zimbabwe:
|
|
1493
|
-
return 'ZW';
|
|
1494
|
-
default:
|
|
1495
|
-
throw new Error(`Unsupported country code: ${countryCode}`);
|
|
751
|
+
const countryCodeToGreenInvoiceMap: Partial<Record<CountryCode, GreenInvoiceCountry>> = {
|
|
752
|
+
[CountryCode.Afghanistan]: 'AF',
|
|
753
|
+
[CountryCode['Åland Islands']]: 'AX',
|
|
754
|
+
[CountryCode.Albania]: 'AL',
|
|
755
|
+
[CountryCode.Algeria]: 'DZ',
|
|
756
|
+
[CountryCode['American Samoa']]: 'AS',
|
|
757
|
+
[CountryCode.Andorra]: 'AD',
|
|
758
|
+
[CountryCode.Angola]: 'AO',
|
|
759
|
+
[CountryCode.Anguilla]: 'AI',
|
|
760
|
+
[CountryCode.Antarctica]: 'AQ',
|
|
761
|
+
[CountryCode['Antigua and Barbuda']]: 'AG',
|
|
762
|
+
[CountryCode.Argentina]: 'AR',
|
|
763
|
+
[CountryCode.Armenia]: 'AM',
|
|
764
|
+
[CountryCode.Aruba]: 'AW',
|
|
765
|
+
[CountryCode.Australia]: 'AU',
|
|
766
|
+
[CountryCode.Austria]: 'AT',
|
|
767
|
+
[CountryCode.Azerbaijan]: 'AZ',
|
|
768
|
+
[CountryCode['Bahamas (the)']]: 'BS',
|
|
769
|
+
[CountryCode.Bahrain]: 'BH',
|
|
770
|
+
[CountryCode.Bangladesh]: 'BD',
|
|
771
|
+
[CountryCode.Barbados]: 'BB',
|
|
772
|
+
[CountryCode.Belarus]: 'BY',
|
|
773
|
+
[CountryCode.Belgium]: 'BE',
|
|
774
|
+
[CountryCode.Belize]: 'BZ',
|
|
775
|
+
[CountryCode.Benin]: 'BJ',
|
|
776
|
+
[CountryCode.Bermuda]: 'BM',
|
|
777
|
+
[CountryCode.Bhutan]: 'BT',
|
|
778
|
+
[CountryCode['Bolivia (Plurinational State of)']]: 'BO',
|
|
779
|
+
[CountryCode['Bonaire, Sint Eustatius and Saba']]: 'BQ',
|
|
780
|
+
[CountryCode['Bosnia and Herzegovina']]: 'BA',
|
|
781
|
+
[CountryCode.Botswana]: 'BW',
|
|
782
|
+
[CountryCode['Bouvet Island']]: 'BV',
|
|
783
|
+
[CountryCode.Brazil]: 'BR',
|
|
784
|
+
[CountryCode['British Indian Ocean Territory (the)']]: 'IO',
|
|
785
|
+
[CountryCode['Brunei Darussalam']]: 'BN',
|
|
786
|
+
[CountryCode.Bulgaria]: 'BG',
|
|
787
|
+
[CountryCode['Burkina Faso']]: 'BF',
|
|
788
|
+
[CountryCode.Burundi]: 'BI',
|
|
789
|
+
[CountryCode['Cabo Verde']]: 'CV',
|
|
790
|
+
[CountryCode.Cambodia]: 'KH',
|
|
791
|
+
[CountryCode.Cameroon]: 'CM',
|
|
792
|
+
[CountryCode.Canada]: 'CA',
|
|
793
|
+
[CountryCode['Cayman Islands (the)']]: 'KY',
|
|
794
|
+
[CountryCode['Central African Republic (the)']]: 'CF',
|
|
795
|
+
[CountryCode.Chad]: 'TD',
|
|
796
|
+
[CountryCode.Chile]: 'CL',
|
|
797
|
+
[CountryCode.China]: 'CN',
|
|
798
|
+
[CountryCode['Christmas Island']]: 'CX',
|
|
799
|
+
[CountryCode['Cocos (Keeling) Islands (the)']]: 'CC',
|
|
800
|
+
[CountryCode.Colombia]: 'CO',
|
|
801
|
+
[CountryCode['Comoros (the)']]: 'KM',
|
|
802
|
+
[CountryCode['Congo (the Democratic Republic of the)']]: 'CD',
|
|
803
|
+
[CountryCode['Congo (the)']]: 'CG',
|
|
804
|
+
[CountryCode['Cook Islands (the)']]: 'CK',
|
|
805
|
+
[CountryCode['Costa Rica']]: 'CR',
|
|
806
|
+
[CountryCode.Croatia]: 'HR',
|
|
807
|
+
[CountryCode.Cuba]: 'CU',
|
|
808
|
+
[CountryCode.Curaçao]: 'CW',
|
|
809
|
+
[CountryCode.Cyprus]: 'CY',
|
|
810
|
+
[CountryCode.Czechia]: 'CZ',
|
|
811
|
+
[CountryCode["Côte d'Ivoire"]]: 'CI',
|
|
812
|
+
[CountryCode.Denmark]: 'DK',
|
|
813
|
+
[CountryCode.Djibouti]: 'DJ',
|
|
814
|
+
[CountryCode.Dominica]: 'DM',
|
|
815
|
+
[CountryCode['Dominican Republic (the)']]: 'DO',
|
|
816
|
+
[CountryCode.Ecuador]: 'EC',
|
|
817
|
+
[CountryCode.Egypt]: 'EG',
|
|
818
|
+
[CountryCode['El Salvador']]: 'SV',
|
|
819
|
+
[CountryCode['Equatorial Guinea']]: 'GQ',
|
|
820
|
+
[CountryCode.Eritrea]: 'ER',
|
|
821
|
+
[CountryCode.Estonia]: 'EE',
|
|
822
|
+
[CountryCode.Eswatini]: 'SZ',
|
|
823
|
+
[CountryCode.Ethiopia]: 'ET',
|
|
824
|
+
[CountryCode['Falkland Islands (the) [Malvinas]']]: 'FK',
|
|
825
|
+
[CountryCode['Faroe Islands (the)']]: 'FO',
|
|
826
|
+
[CountryCode.Fiji]: 'FJ',
|
|
827
|
+
[CountryCode.Finland]: 'FI',
|
|
828
|
+
[CountryCode.France]: 'FR',
|
|
829
|
+
[CountryCode['French Guiana']]: 'GF',
|
|
830
|
+
[CountryCode['French Polynesia']]: 'PF',
|
|
831
|
+
[CountryCode['French Southern Territories (the)']]: 'TF',
|
|
832
|
+
[CountryCode.Gabon]: 'GA',
|
|
833
|
+
[CountryCode['Gambia (the)']]: 'GM',
|
|
834
|
+
[CountryCode.Georgia]: 'GE',
|
|
835
|
+
[CountryCode.Germany]: 'DE',
|
|
836
|
+
[CountryCode.Ghana]: 'GH',
|
|
837
|
+
[CountryCode.Gibraltar]: 'GI',
|
|
838
|
+
[CountryCode.Greece]: 'GR',
|
|
839
|
+
[CountryCode.Greenland]: 'GL',
|
|
840
|
+
[CountryCode.Grenada]: 'GD',
|
|
841
|
+
[CountryCode.Guadeloupe]: 'GP',
|
|
842
|
+
[CountryCode.Guam]: 'GU',
|
|
843
|
+
[CountryCode.Guatemala]: 'GT',
|
|
844
|
+
[CountryCode.Guernsey]: 'GG',
|
|
845
|
+
[CountryCode.Guinea]: 'GN',
|
|
846
|
+
[CountryCode['Guinea-Bissau']]: 'GW',
|
|
847
|
+
[CountryCode.Guyana]: 'GY',
|
|
848
|
+
[CountryCode.Haiti]: 'HT',
|
|
849
|
+
[CountryCode['Heard Island and McDonald Islands']]: 'HM',
|
|
850
|
+
[CountryCode['Holy See (the)']]: 'VA',
|
|
851
|
+
[CountryCode.Honduras]: 'HN',
|
|
852
|
+
[CountryCode['Hong Kong']]: 'HK',
|
|
853
|
+
[CountryCode.Hungary]: 'HU',
|
|
854
|
+
[CountryCode.Iceland]: 'IS',
|
|
855
|
+
[CountryCode.India]: 'IN',
|
|
856
|
+
[CountryCode.Indonesia]: 'ID',
|
|
857
|
+
[CountryCode['Iran (Islamic Republic of)']]: 'IR',
|
|
858
|
+
[CountryCode.Iraq]: 'IQ',
|
|
859
|
+
[CountryCode.Ireland]: 'IE',
|
|
860
|
+
[CountryCode['Isle of Man']]: 'IM',
|
|
861
|
+
[CountryCode.Israel]: 'IL',
|
|
862
|
+
[CountryCode.Italy]: 'IT',
|
|
863
|
+
[CountryCode.Jamaica]: 'JM',
|
|
864
|
+
[CountryCode.Japan]: 'JP',
|
|
865
|
+
[CountryCode.Jersey]: 'JE',
|
|
866
|
+
[CountryCode.Jordan]: 'JO',
|
|
867
|
+
[CountryCode.Kazakhstan]: 'KZ',
|
|
868
|
+
[CountryCode.Kenya]: 'KE',
|
|
869
|
+
[CountryCode.Kiribati]: 'KI',
|
|
870
|
+
[CountryCode["Korea (the Democratic People's Republic of)"]]: 'KP',
|
|
871
|
+
[CountryCode['Korea (the Republic of)']]: 'KR',
|
|
872
|
+
[CountryCode.Kuwait]: 'KW',
|
|
873
|
+
[CountryCode.Kyrgyzstan]: 'KG',
|
|
874
|
+
[CountryCode["Lao People's Democratic Republic (the)"]]: 'LA',
|
|
875
|
+
[CountryCode.Latvia]: 'LV',
|
|
876
|
+
[CountryCode.Lebanon]: 'LB',
|
|
877
|
+
[CountryCode.Lesotho]: 'LS',
|
|
878
|
+
[CountryCode.Liberia]: 'LR',
|
|
879
|
+
[CountryCode.Libya]: 'LY',
|
|
880
|
+
[CountryCode.Liechtenstein]: 'LI',
|
|
881
|
+
[CountryCode.Lithuania]: 'LT',
|
|
882
|
+
[CountryCode.Luxembourg]: 'LU',
|
|
883
|
+
[CountryCode.Macao]: 'MO',
|
|
884
|
+
[CountryCode.Madagascar]: 'MG',
|
|
885
|
+
[CountryCode.Malawi]: 'MW',
|
|
886
|
+
[CountryCode.Malaysia]: 'MY',
|
|
887
|
+
[CountryCode.Maldives]: 'MV',
|
|
888
|
+
[CountryCode.Mali]: 'ML',
|
|
889
|
+
[CountryCode.Malta]: 'MT',
|
|
890
|
+
[CountryCode['Marshall Islands (the)']]: 'MH',
|
|
891
|
+
[CountryCode.Martinique]: 'MQ',
|
|
892
|
+
[CountryCode.Mauritania]: 'MR',
|
|
893
|
+
[CountryCode.Mauritius]: 'MU',
|
|
894
|
+
[CountryCode.Mayotte]: 'YT',
|
|
895
|
+
[CountryCode.Mexico]: 'MX',
|
|
896
|
+
[CountryCode['Micronesia (Federated States of)']]: 'FM',
|
|
897
|
+
[CountryCode['Moldova (the Republic of)']]: 'MD',
|
|
898
|
+
[CountryCode.Monaco]: 'MC',
|
|
899
|
+
[CountryCode.Mongolia]: 'MN',
|
|
900
|
+
[CountryCode.Montenegro]: 'ME',
|
|
901
|
+
[CountryCode.Montserrat]: 'MS',
|
|
902
|
+
[CountryCode.Morocco]: 'MA',
|
|
903
|
+
[CountryCode.Mozambique]: 'MZ',
|
|
904
|
+
[CountryCode.Myanmar]: 'MM',
|
|
905
|
+
[CountryCode.Namibia]: 'NA',
|
|
906
|
+
[CountryCode.Nauru]: 'NR',
|
|
907
|
+
[CountryCode.Nepal]: 'NP',
|
|
908
|
+
[CountryCode['Netherlands (the)']]: 'NL',
|
|
909
|
+
[CountryCode['New Caledonia']]: 'NC',
|
|
910
|
+
[CountryCode['New Zealand']]: 'NZ',
|
|
911
|
+
[CountryCode.Nicaragua]: 'NI',
|
|
912
|
+
[CountryCode['Niger (the)']]: 'NE',
|
|
913
|
+
[CountryCode.Nigeria]: 'NG',
|
|
914
|
+
[CountryCode.Niue]: 'NU',
|
|
915
|
+
[CountryCode['Norfolk Island']]: 'NF',
|
|
916
|
+
[CountryCode['Northern Mariana Islands (the)']]: 'MP',
|
|
917
|
+
[CountryCode.Norway]: 'NO',
|
|
918
|
+
[CountryCode.Oman]: 'OM',
|
|
919
|
+
[CountryCode.Pakistan]: 'PK',
|
|
920
|
+
[CountryCode.Palau]: 'PW',
|
|
921
|
+
[CountryCode['Palestine, State of']]: 'PS',
|
|
922
|
+
[CountryCode.Panama]: 'PA',
|
|
923
|
+
[CountryCode['Papua New Guinea']]: 'PG',
|
|
924
|
+
[CountryCode.Paraguay]: 'PY',
|
|
925
|
+
[CountryCode.Peru]: 'PE',
|
|
926
|
+
[CountryCode['Philippines (the)']]: 'PH',
|
|
927
|
+
[CountryCode.Pitcairn]: 'PN',
|
|
928
|
+
[CountryCode.Poland]: 'PL',
|
|
929
|
+
[CountryCode.Portugal]: 'PT',
|
|
930
|
+
[CountryCode['Puerto Rico']]: 'PR',
|
|
931
|
+
[CountryCode.Qatar]: 'QA',
|
|
932
|
+
[CountryCode['Republic of North Macedonia']]: 'MK',
|
|
933
|
+
[CountryCode.Romania]: 'RO',
|
|
934
|
+
[CountryCode['Russian Federation (the)']]: 'RU',
|
|
935
|
+
[CountryCode.Rwanda]: 'RW',
|
|
936
|
+
[CountryCode.Réunion]: 'RE',
|
|
937
|
+
[CountryCode['Saint Barthélemy']]: 'BL',
|
|
938
|
+
[CountryCode['Saint Helena, Ascension and Tristan da Cunha']]: 'SH',
|
|
939
|
+
[CountryCode['Saint Kitts and Nevis']]: 'KN',
|
|
940
|
+
[CountryCode['Saint Lucia']]: 'LC',
|
|
941
|
+
[CountryCode['Saint Martin (French part)']]: 'MF',
|
|
942
|
+
[CountryCode['Saint Pierre and Miquelon']]: 'PM',
|
|
943
|
+
[CountryCode['Saint Vincent and the Grenadines']]: 'VC',
|
|
944
|
+
[CountryCode.Samoa]: 'WS',
|
|
945
|
+
[CountryCode['San Marino']]: 'SM',
|
|
946
|
+
[CountryCode['Sao Tome and Principe']]: 'ST',
|
|
947
|
+
[CountryCode['Saudi Arabia']]: 'SA',
|
|
948
|
+
[CountryCode.Senegal]: 'SN',
|
|
949
|
+
[CountryCode.Serbia]: 'RS',
|
|
950
|
+
[CountryCode.Seychelles]: 'SC',
|
|
951
|
+
[CountryCode['Sierra Leone']]: 'SL',
|
|
952
|
+
[CountryCode.Singapore]: 'SG',
|
|
953
|
+
[CountryCode['Sint Maarten (Dutch part)']]: 'SX',
|
|
954
|
+
[CountryCode.Slovakia]: 'SK',
|
|
955
|
+
[CountryCode.Slovenia]: 'SI',
|
|
956
|
+
[CountryCode['Solomon Islands']]: 'SB',
|
|
957
|
+
[CountryCode.Somalia]: 'SO',
|
|
958
|
+
[CountryCode['South Africa']]: 'ZA',
|
|
959
|
+
[CountryCode['South Georgia and the South Sandwich Islands']]: 'GS',
|
|
960
|
+
[CountryCode['South Sudan']]: 'SS',
|
|
961
|
+
[CountryCode.Spain]: 'ES',
|
|
962
|
+
[CountryCode['Sri Lanka']]: 'LK',
|
|
963
|
+
[CountryCode['Sudan (the)']]: 'SD',
|
|
964
|
+
[CountryCode.Suriname]: 'SR',
|
|
965
|
+
[CountryCode['Svalbard and Jan Mayen']]: 'SJ',
|
|
966
|
+
[CountryCode.Sweden]: 'SE',
|
|
967
|
+
[CountryCode.Switzerland]: 'CH',
|
|
968
|
+
[CountryCode['Syrian Arab Republic']]: 'SY',
|
|
969
|
+
[CountryCode['Taiwan (Province of China)']]: 'TW',
|
|
970
|
+
[CountryCode.Tajikistan]: 'TJ',
|
|
971
|
+
[CountryCode['Tanzania, United Republic of']]: 'TZ',
|
|
972
|
+
[CountryCode.Thailand]: 'TH',
|
|
973
|
+
[CountryCode['Timor-Leste']]: 'TL',
|
|
974
|
+
[CountryCode.Togo]: 'TG',
|
|
975
|
+
[CountryCode.Tokelau]: 'TK',
|
|
976
|
+
[CountryCode.Tonga]: 'TO',
|
|
977
|
+
[CountryCode['Trinidad and Tobago']]: 'TT',
|
|
978
|
+
[CountryCode.Tunisia]: 'TN',
|
|
979
|
+
[CountryCode.Turkey]: 'TR',
|
|
980
|
+
[CountryCode.Turkmenistan]: 'TM',
|
|
981
|
+
[CountryCode['Turks and Caicos Islands (the)']]: 'TC',
|
|
982
|
+
[CountryCode.Tuvalu]: 'TV',
|
|
983
|
+
[CountryCode.Uganda]: 'UG',
|
|
984
|
+
[CountryCode.Ukraine]: 'UA',
|
|
985
|
+
[CountryCode['United Arab Emirates (the)']]: 'AE',
|
|
986
|
+
[CountryCode['United Kingdom of Great Britain and Northern Ireland (the)']]: 'GB',
|
|
987
|
+
[CountryCode['United States Minor Outlying Islands (the)']]: 'UM',
|
|
988
|
+
[CountryCode['United States of America (the)']]: 'US',
|
|
989
|
+
[CountryCode.Uruguay]: 'UY',
|
|
990
|
+
[CountryCode.Uzbekistan]: 'UZ',
|
|
991
|
+
[CountryCode.Vanuatu]: 'VU',
|
|
992
|
+
[CountryCode['Venezuela (Bolivarian Republic of)']]: 'VE',
|
|
993
|
+
[CountryCode['Viet Nam']]: 'VN',
|
|
994
|
+
[CountryCode['Virgin Islands (British)']]: 'VG',
|
|
995
|
+
[CountryCode['Virgin Islands (U.S.)']]: 'VI',
|
|
996
|
+
[CountryCode['Wallis and Futuna']]: 'WF',
|
|
997
|
+
[CountryCode['Western Sahara']]: 'EH',
|
|
998
|
+
[CountryCode.Yemen]: 'YE',
|
|
999
|
+
[CountryCode.Zambia]: 'ZM',
|
|
1000
|
+
[CountryCode.Zimbabwe]: 'ZW',
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
const greenInvoiceCountry = countryCodeToGreenInvoiceMap[countryCode];
|
|
1004
|
+
if (greenInvoiceCountry) {
|
|
1005
|
+
return greenInvoiceCountry;
|
|
1496
1006
|
}
|
|
1007
|
+
throw new Error(`Unsupported country code: ${countryCode}`);
|
|
1497
1008
|
}
|
|
1498
1009
|
|
|
1499
1010
|
export function greenInvoiceToDocumentStatus(greenInvoiceStatus: number): document_status {
|