@seidor-cloud-produtos/tax-core 1.0.13 → 1.0.15

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/dist/index.d.mts CHANGED
@@ -535,6 +535,7 @@ declare namespace CountryCodeEnum {
535
535
 
536
536
  declare enum MunicipalObligationIdEnum {
537
537
  DDS = "DDS",
538
+ DNR = "DNR",
538
539
  DES_BH = "DES-BH",
539
540
  DST = "DST",
540
541
  DISTRITO_FEDERAL = "DISTRITO_FEDERAL",
@@ -544,27 +545,37 @@ declare enum MunicipalObligationIdEnum {
544
545
  NFTS_SP = "NFTS",
545
546
  CURITIBA = "CURITIBA",
546
547
  FORTALEZA = "FORTALEZA",
548
+ NATAL = "NATAL",
549
+ BAURU = "BAURU",
550
+ BELEM_PA = "BELEM_PA",
547
551
  RIO_DE_JANEIRO = "RIO_DE_JANEIRO",
548
- RECIFE = "RECIFE"
552
+ RECIFE = "RECIFE",
553
+ SAO_BERNARDO_DO_CAMPO = "SAO_BERNARDO_DO_CAMPO",
554
+ FLORIANOPOLIS = "FLORIANOPOLIS"
549
555
  }
550
556
 
551
557
  declare enum MunicipalObligationNameEnum {
552
558
  DES = "DES",
553
559
  ISS = "ISS",
560
+ ISSE = "ISS-e",
554
561
  NFSE = "NFSe",
555
562
  REST = "REST",
556
563
  DDS = "DDS",
557
564
  DSRE = "DSR-e",
558
565
  NOTA_CARIOCA = "Nota Carioca",
559
566
  NFTS = "NFTS",
560
- DST = "DST"
567
+ DST = "DST",
568
+ DECLARACAO_SERVICOS_CONTRATADOS = "Declara\u00E7\u00E3o de Servi\u00E7os Contratados",
569
+ GIF_ST = "GIF-ST",
570
+ GIF_AJUSTE = "GIF-AJUSTE",
571
+ GISS_ONLINE = "GISS ONLINE"
561
572
  }
562
573
 
563
574
  declare enum MunicipalObligationTypeEnum {
564
- NORMAL = "Normal (Original)",// Representa a entrega inicial da obrigação fiscal
565
- CORRECTIVE = "Retificadora (Substitutiva)",// Corrige informações de uma obrigação já entregue anteriormente. Substitui integralmente a versão anterior.
566
- COMPLEMENTARY = "Complementar",// Utilizadas para acrescentar informações (ex.: notas fiscais) que não estavam incluídas na entrega original.
567
- CANCELLATION = "Cancelamento",// Indicadas quando é necessário invalidar totalmente uma obrigação ou registro anterior.
575
+ NORMAL = "Normal (Original)",
576
+ CORRECTIVE = "Retificadora (Substitutiva)",
577
+ COMPLEMENTARY = "Complementar",
578
+ CANCELLATION = "Cancelamento",
568
579
  ADJUSTMENT = "Ajuste"
569
580
  }
570
581
 
@@ -583,6 +594,12 @@ declare class MunicipalObligation {
583
594
  isVersionAvailable(version: string): boolean;
584
595
  }
585
596
 
597
+ interface ILC116Code {
598
+ municipal_service_code: string;
599
+ description: string;
600
+ aliquot: number;
601
+ }
602
+
586
603
  declare class Municipality {
587
604
  protected _IBGE_code: number;
588
605
  protected _name: string;
@@ -592,6 +609,7 @@ declare class Municipality {
592
609
  protected _sedetec_code: string;
593
610
  protected _rest_code: number;
594
611
  protected _municipal_obligations: Map<string, MunicipalObligation>;
612
+ protected _lc116_codes: Map<string, ILC116Code>;
595
613
  constructor(state: State, ibge_code: number, name: string, ddd: string);
596
614
  set siafi_code(siafi_code: string);
597
615
  set sedetec_code(sedetec_code: string);
@@ -606,6 +624,10 @@ declare class Municipality {
606
624
  get rest_code(): number;
607
625
  addMunicipalObligation(obligation: MunicipalObligation): void;
608
626
  getMunicipalObligationById(obligationId: string): MunicipalObligation;
627
+ setLC116Codes(codes: Map<string, ILC116Code>): void;
628
+ hasLC116Codes(): boolean;
629
+ getLC116CodeInfo(lc116Code: string): ILC116Code | undefined;
630
+ getLC116EquivalentCode(lc116Code: string): string;
609
631
  }
610
632
 
611
633
  declare enum StateEnum {
@@ -662,6 +684,14 @@ declare class ServiceCode {
662
684
  get description(): string;
663
685
  }
664
686
 
687
+ declare class Country {
688
+ protected _code: number;
689
+ protected _name: string;
690
+ constructor(code: number, name: string);
691
+ get code(): number;
692
+ get name(): string;
693
+ }
694
+
665
695
  interface Repository {
666
696
  getAllStates(): State[];
667
697
  getAllMunicipalities(): Municipality[];
@@ -670,6 +700,8 @@ interface Repository {
670
700
  getMunicipalitiesWithMunicipalObligation(): Municipality[];
671
701
  getAllServiceCodes(): ServiceCode[];
672
702
  getServiceCodeByCode(code: string): ServiceCode | undefined;
703
+ getAllCountries(): Country[];
704
+ getCountryByCode(code: number): Country | undefined;
673
705
  }
674
706
 
675
707
  declare class MemoryMasterDataRepository implements Repository {
@@ -677,6 +709,7 @@ declare class MemoryMasterDataRepository implements Repository {
677
709
  private states;
678
710
  private municipalities;
679
711
  private serviceCodes;
712
+ private countries;
680
713
  private constructor();
681
714
  static getInstance(): MemoryMasterDataRepository;
682
715
  private loadData;
@@ -687,31 +720,44 @@ declare class MemoryMasterDataRepository implements Repository {
687
720
  getMunicipalitiesWithMunicipalObligation(): Municipality[];
688
721
  getMunicipalityByIBGECode(ibge_code: number): Municipality | undefined;
689
722
  getStateByUF(uf: string): State | undefined;
723
+ getAllCountries(): Country[];
724
+ getCountryByCode(code: number): Country | undefined;
690
725
  }
691
726
 
692
727
  declare class Address implements Cloneable {
728
+ private _id;
693
729
  private _neighborhood;
694
- private _municipality_code;
695
- private _country_code;
730
+ private _municipality;
731
+ private _country;
696
732
  private _postal_code;
697
733
  private _supplement;
698
734
  private _state;
699
735
  private _street;
700
736
  private _number;
701
737
  private _telephone;
738
+ private _category;
739
+ private _isMain;
740
+ set id(value: string);
741
+ get id(): string;
702
742
  get neighborhood(): string;
703
743
  set neighborhood(value: string);
704
744
  get municipality_code(): string;
705
745
  get municipality_code_number(): number;
706
746
  set municipality_code(value: string);
747
+ get municipality(): Municipality | undefined;
748
+ set municipality(value: Municipality | undefined);
707
749
  get country_code(): CountryCodeEnum;
708
750
  set country_code(value: CountryCodeEnum);
751
+ get country(): Country | undefined;
752
+ set country(value: Country | undefined);
709
753
  get postal_code(): string;
710
754
  set postal_code(value: string);
711
755
  get supplement(): string;
712
756
  set supplement(value: string);
713
757
  get state(): StateEnum;
714
758
  set state(value: StateEnum);
759
+ get stateObject(): State | undefined;
760
+ set stateObject(value: State | undefined);
715
761
  get street(): string;
716
762
  set street(value: string);
717
763
  get number(): string;
@@ -719,13 +765,17 @@ declare class Address implements Cloneable {
719
765
  get telephone(): string;
720
766
  set telephone(value: string);
721
767
  clone(): this;
768
+ get category(): string;
769
+ set category(value: string);
770
+ get isMain(): boolean;
771
+ set isMain(value: boolean);
722
772
  }
723
773
 
724
774
  declare enum CodeStatusEnum {
725
- AUTHORIZED = "00",// Autorizado
726
- CANCELLED = "02",// Cancelado
727
- LATE_REGULARIZED = "04",// Denegado
728
- LATE_CANCELLED = "05",// Inutilizado
775
+ AUTHORIZED = "00",
776
+ CANCELLED = "02",
777
+ LATE_REGULARIZED = "04",
778
+ LATE_CANCELLED = "05",
729
779
  NOT_APPLICABLE = ""
730
780
  }
731
781
  declare namespace CodeStatusEnum {
@@ -734,12 +784,12 @@ declare namespace CodeStatusEnum {
734
784
  }
735
785
 
736
786
  declare enum CteTypeEnum {
737
- NORMAL = "0",// CT-e or BP-e Normal
738
- VALUE_COMPLEMENT = "1",// CT-e for Value Complement
739
- REPLACEMENT = "3",// CT-e or BP-e Replacement
740
- METROPOLITAN_TRANSPORT = "4",// BP-e TM (Metropolitan Transport)
741
- SIMPLIFIED = "5",// Simplified CT-e
742
- SIMPLIFIED_REPLACEMENT = "6",// Replacement of Simplified CT-e
787
+ NORMAL = "0",
788
+ VALUE_COMPLEMENT = "1",
789
+ REPLACEMENT = "3",
790
+ METROPOLITAN_TRANSPORT = "4",
791
+ SIMPLIFIED = "5",
792
+ SIMPLIFIED_REPLACEMENT = "6",
743
793
  NOT_APPLICABLE = ""
744
794
  }
745
795
  declare namespace CteTypeEnum {
@@ -811,16 +861,16 @@ declare namespace PaymentTypeEnum {
811
861
  }
812
862
 
813
863
  declare enum RevenueTypeEnum {
814
- OWN_SERVICES_PROVIDED = "0",// Receita própria - serviços prestados
815
- OWN_DEBT_COLLECTION = "1",// Receita própria - cobrança de débitos
816
- OWN_PREPAID_SERVICE_PAST_BILLING = "2",// Receita própria - venda de serviço pré-pago – faturamento de períodos anteriores
817
- OWN_PREPAID_SERVICE_CURRENT_BILLING = "3",// Receita própria - venda de serviço pré-pago – faturamento no período
818
- OTHER_OWN_COMMUNICATION_REVENUES = "4",// Outras receitas próprias de serviços de comunicação e telecomunicação
819
- OWN_CO_BILLING = "5",// Receita própria - co-faturamento
820
- OWN_SERVICES_TO_BILL_FUTURE = "6",// Receita própria – serviços a faturar em período futuro
821
- OTHER_OWN_NON_CUMULATIVE_REVENUES = "7",// Outras receitas próprias de natureza não-cumulativa
822
- OTHER_THIRD_PARTY_REVENUES = "8",// Outras receitas de terceiros
823
- OTHER_REVENUES = "9",// Outras receitas
864
+ OWN_SERVICES_PROVIDED = "0",
865
+ OWN_DEBT_COLLECTION = "1",
866
+ OWN_PREPAID_SERVICE_PAST_BILLING = "2",
867
+ OWN_PREPAID_SERVICE_CURRENT_BILLING = "3",
868
+ OTHER_OWN_COMMUNICATION_REVENUES = "4",
869
+ OWN_CO_BILLING = "5",
870
+ OWN_SERVICES_TO_BILL_FUTURE = "6",
871
+ OTHER_OWN_NON_CUMULATIVE_REVENUES = "7",
872
+ OTHER_THIRD_PARTY_REVENUES = "8",
873
+ OTHER_REVENUES = "9",
824
874
  NOT_APPLICABLE = ""
825
875
  }
826
876
  declare namespace RevenueTypeEnum {
@@ -853,13 +903,13 @@ declare class ConversionFactor implements Cloneable {
853
903
  }
854
904
 
855
905
  declare enum FreightContractedNatureIndicatorEnum {
856
- SALE_SELLER_BEARING_COST = "0",// Operações de vendas, com ônus suportado pelo estabelecimento vendedor
857
- SALE_BUYER_BEARING_COST = "1",// Operações de vendas, com ônus suportado pelo adquirente
858
- PURCHASE_WITH_CREDIT = "2",// Operações de compras (bens para revenda, matérias-prima e outros produtos, geradores de crédito)
859
- PURCHASE_WITHOUT_CREDIT = "3",// Operações de compras (bens para revenda, matérias-prima e outros produtos, não geradores de crédito)
860
- FINISHED_PRODUCT_TRANSFER = "4",// Transferência de produtos acabados entre estabelecimentos da pessoa jurídica
861
- IN_PROCESS_PRODUCT_TRANSFER = "5",// Transferência de produtos em elaboração entre estabelecimentos da pessoa jurídica
862
- OTHERS = "9",// Outras
906
+ SALE_SELLER_BEARING_COST = "0",
907
+ SALE_BUYER_BEARING_COST = "1",
908
+ PURCHASE_WITH_CREDIT = "2",
909
+ PURCHASE_WITHOUT_CREDIT = "3",
910
+ FINISHED_PRODUCT_TRANSFER = "4",
911
+ IN_PROCESS_PRODUCT_TRANSFER = "5",
912
+ OTHERS = "9",
863
913
  NOT_APPLICABLE = ""
864
914
  }
865
915
  declare namespace FreightContractedNatureIndicatorEnum {
@@ -868,18 +918,18 @@ declare namespace FreightContractedNatureIndicatorEnum {
868
918
  }
869
919
 
870
920
  declare enum ItemTypeEnum {
871
- GOODS_FOR_RESALE = "00",// Mercadoria para Revenda
872
- RAW_MATERIAL = "01",// Matéria-prima
873
- PACKAGING = "02",// Embalagem
874
- PRODUCT_IN_PROCESS = "03",// Produto em Processo
875
- FINISHED_PRODUCT = "04",// Produto Acabado
876
- BYPRODUCT = "05",// Subproduto
877
- INTERMEDIATE_PRODUCT = "06",// Produto Intermediário
878
- CONSUMABLE_MATERIAL = "07",// Material de Uso e Consumo
879
- FIXED_ASSET = "08",// Ativo Imobilizado
880
- SERVICES = "09",// Serviços
881
- OTHER_INPUTS = "10",// Outros insumos
882
- OTHERS = "99",// Outras
921
+ GOODS_FOR_RESALE = "00",
922
+ RAW_MATERIAL = "01",
923
+ PACKAGING = "02",
924
+ PRODUCT_IN_PROCESS = "03",
925
+ FINISHED_PRODUCT = "04",
926
+ BYPRODUCT = "05",
927
+ INTERMEDIATE_PRODUCT = "06",
928
+ CONSUMABLE_MATERIAL = "07",
929
+ FIXED_ASSET = "08",
930
+ SERVICES = "09",
931
+ OTHER_INPUTS = "10",
932
+ OTHERS = "99",
883
933
  NOT_APPLICABLE = ""
884
934
  }
885
935
  declare namespace ItemTypeEnum {
@@ -1181,9 +1231,9 @@ declare class OurDate extends Date {
1181
1231
  }
1182
1232
 
1183
1233
  declare enum IntermediationTypeEnum {
1184
- OWN_ACCOUNT = 1,// Importação por conta própria
1185
- ACCOUNT_AND_ORDER = 2,// Importação por conta e ordem
1186
- ON_BEHALF = 3,// Importação por encomenda
1234
+ OWN_ACCOUNT = 1,
1235
+ ACCOUNT_AND_ORDER = 2,
1236
+ ON_BEHALF = 3,
1187
1237
  NOT_APPLICABLE = 0
1188
1238
  }
1189
1239
  declare namespace IntermediationTypeEnum {
@@ -1192,18 +1242,18 @@ declare namespace IntermediationTypeEnum {
1192
1242
  }
1193
1243
 
1194
1244
  declare enum InternationalTransportTypeEnum {
1195
- MARITIME = 1,// Marítima
1196
- FLUVIAL = 2,// Fluvial
1197
- LACUSTRINE = 3,// Lacustre
1198
- AIR = 4,// Aérea
1199
- POSTAL = 5,// Postal
1200
- RAIL = 6,// Ferroviária
1201
- ROAD = 7,// Rodoviária
1202
- PIPELINE_NETWORK = 8,// Conduto / Rede Transmissão
1203
- OWN_MEANS = 9,// Meios Próprios
1204
- VIRTUAL_ENTRY_EXIT = 10,// Entrada / Saída ficta
1205
- COURIER = 11,// Courier
1206
- HANDCARRY = 12,// Handcarry
1245
+ MARITIME = 1,
1246
+ FLUVIAL = 2,
1247
+ LACUSTRINE = 3,
1248
+ AIR = 4,
1249
+ POSTAL = 5,
1250
+ RAIL = 6,
1251
+ ROAD = 7,
1252
+ PIPELINE_NETWORK = 8,
1253
+ OWN_MEANS = 9,
1254
+ VIRTUAL_ENTRY_EXIT = 10,
1255
+ COURIER = 11,
1256
+ HANDCARRY = 12,
1207
1257
  NOT_APPLICABLE = 0
1208
1258
  }
1209
1259
  declare namespace InternationalTransportTypeEnum {
@@ -1281,11 +1331,11 @@ declare namespace ProductOriginEnum {
1281
1331
  }
1282
1332
 
1283
1333
  declare enum EnforceabilityOfISSEnum {
1284
- TAXABLE_IN_MUNICIPALITY = 1,// Exigível (ISS Tributado no município)
1285
- NON_INCIDENCE = 2,// Não incidência
1286
- EXEMPT = 3,// Isenção
1287
- EXPORT = 4,// Exportação
1288
- IMMUNITY = 5,// Imunidade
1334
+ TAXABLE_IN_MUNICIPALITY = 1,
1335
+ NON_INCIDENCE = 2,
1336
+ EXEMPT = 3,
1337
+ EXPORT = 4,
1338
+ IMMUNITY = 5,
1289
1339
  NOT_APPLICABLE = 0
1290
1340
  }
1291
1341
  declare namespace EnforceabilityOfISSEnum {
@@ -1305,11 +1355,11 @@ declare enum DonationIndicatorEnum {
1305
1355
  }
1306
1356
 
1307
1357
  declare enum ZfmPresumedCreditTypeEnum {
1308
- NO_PRESUMED_CREDIT = "0",// 0 - Sem Crédito Presumido
1309
- FINAL_CONSUMER_GOODS = "1",// 1 - Bens de consumo final (55%)
1310
- CAPITAL_GOODS = "2",// 2 - Bens de capital (75%)
1311
- INTERMEDIATE_GOODS = "3",// 3 - Bens intermediários (90.25%)
1312
- IT_AND_LEGAL_DEFINED_GOODS = "4",// 4 - Bens de informática e outros definidos em legislação (100%)
1358
+ NO_PRESUMED_CREDIT = "0",
1359
+ FINAL_CONSUMER_GOODS = "1",
1360
+ CAPITAL_GOODS = "2",
1361
+ INTERMEDIATE_GOODS = "3",
1362
+ IT_AND_LEGAL_DEFINED_GOODS = "4",
1313
1363
  NOT_APPLICABLE = ""
1314
1364
  }
1315
1365
 
@@ -1552,9 +1602,9 @@ declare class Item implements Cloneable {
1552
1602
  }
1553
1603
 
1554
1604
  declare enum StateRegistrationIndicatorEnum {
1555
- CONTRIBUTOR = "1",// Contribuinte de ICMS
1556
- EXEMPT = "2",// Contribuinte isento de inscrição
1557
- NON_CONTRIBUTOR = "9",// Não contribuinte
1605
+ CONTRIBUTOR = "1",
1606
+ EXEMPT = "2",
1607
+ NON_CONTRIBUTOR = "9",
1558
1608
  NOT_APPLICABLE = ""
1559
1609
  }
1560
1610
  declare namespace StateRegistrationIndicatorEnum {
@@ -1563,10 +1613,10 @@ declare namespace StateRegistrationIndicatorEnum {
1563
1613
  }
1564
1614
 
1565
1615
  declare enum TaxRegimeEnum {
1566
- NOT_APPLICABLE = "",// Não Aplicável,
1567
- SIMPLES_NACIONAL = "1",// Simples Nacional
1568
- SIMPLES_NACIONAL_EXCESSO = "2",// Simples Nacional - Excesso de Sublimite da Receita Bruta
1569
- REGIME_NORMAL = "3",// Regime Normal (Lucro Presumido ou Lucro Real)
1616
+ NOT_APPLICABLE = "",
1617
+ SIMPLES_NACIONAL = "1",
1618
+ SIMPLES_NACIONAL_EXCESSO = "2",
1619
+ REGIME_NORMAL = "3",
1570
1620
  MEI = "4"
1571
1621
  }
1572
1622
  declare namespace TaxRegimeEnum {
@@ -1636,6 +1686,44 @@ declare class Person implements Cloneable {
1636
1686
  isForeignPartner(): boolean;
1637
1687
  }
1638
1688
 
1689
+ declare class CNPJ implements IdentificationNumber {
1690
+ private readonly _value;
1691
+ constructor(cnpj: string);
1692
+ private removeInvalidDigits;
1693
+ isValid(): boolean;
1694
+ get rawValue(): string;
1695
+ get formattedValue(): string;
1696
+ validationErrors(): string[];
1697
+ private allDigitsTheSame;
1698
+ private calculateDigit;
1699
+ private extractActualDigit;
1700
+ }
1701
+
1702
+ declare class CPF implements IdentificationNumber {
1703
+ private readonly _value;
1704
+ constructor(cpf: string);
1705
+ private removeNonDigits;
1706
+ isValid(): boolean;
1707
+ get rawValue(): string;
1708
+ get formattedValue(): string;
1709
+ validationErrors(): string[];
1710
+ private allDigitsTheSame;
1711
+ private calculateDigit;
1712
+ private extractActualDigit;
1713
+ }
1714
+
1715
+ declare class Telephone {
1716
+ private readonly _value;
1717
+ constructor(value: string);
1718
+ private removeInvalidDigits;
1719
+ isValid(): boolean;
1720
+ validationErrors(): string[];
1721
+ get rawValue(): string;
1722
+ get validValue(): string;
1723
+ get formattedValue(): string;
1724
+ get rawValueWithoutDDI(): string;
1725
+ }
1726
+
1639
1727
  declare class Document implements Cloneable {
1640
1728
  private _id;
1641
1729
  private _branch_id;
@@ -1738,6 +1826,7 @@ declare class Document implements Cloneable {
1738
1826
  set issuer_indicator(value: IssuerIndicatorEnum);
1739
1827
  get rps_number(): string;
1740
1828
  set rps_number(value: string);
1829
+ private get isInboundOwnIssuance();
1741
1830
  get issuer(): Person;
1742
1831
  get issuerOrigin(): Person;
1743
1832
  set issuer(value: Person);
@@ -1774,6 +1863,14 @@ declare class Document implements Cloneable {
1774
1863
  get fcp_value_destination(): number;
1775
1864
  get icms_value_destination_uf(): number;
1776
1865
  get icms_value_origin_uf(): number;
1866
+ getParties(): {
1867
+ issuer: Person;
1868
+ recipient: Person;
1869
+ };
1870
+ getPartiesByPartnerCnpj(cnpj: CNPJ | string): {
1871
+ issuer: Person;
1872
+ recipient: Person;
1873
+ };
1777
1874
  isInbound(): boolean;
1778
1875
  isOutbound(): boolean;
1779
1876
  isCancelled(): boolean;
@@ -1798,10 +1895,13 @@ declare class BuilderAddress {
1798
1895
  build(): Address;
1799
1896
  withNeighborhood(neighborhood: string): BuilderAddress;
1800
1897
  withMunicipalityCode(municipality_code: string): BuilderAddress;
1898
+ withMunicipality(municipality: Municipality): BuilderAddress;
1801
1899
  withCountryCode(country_code: CountryCodeEnum): BuilderAddress;
1900
+ withCountry(country: Country): BuilderAddress;
1802
1901
  withPostalCode(postal_code: string): BuilderAddress;
1803
1902
  withSupplement(supplement: string): BuilderAddress;
1804
1903
  withState(state: string): BuilderAddress;
1904
+ withStateObject(state: State): BuilderAddress;
1805
1905
  withStreet(street: string): BuilderAddress;
1806
1906
  withNumber(number: string): BuilderAddress;
1807
1907
  withTelephone(telephone: string): BuilderAddress;
@@ -1937,6 +2037,7 @@ declare class BuilderPerson {
1937
2037
  withCNPJ(cnpj: string): BuilderPerson;
1938
2038
  withCPF(cpf: string): BuilderPerson;
1939
2039
  withName(name: string): BuilderPerson;
2040
+ withEmail(email: string): BuilderPerson;
1940
2041
  withStateRegistrationNumber(state_registration_number: string): BuilderPerson;
1941
2042
  withMunicipalRegistrationNumber(municipal_registration_number: string): BuilderPerson;
1942
2043
  withSuframaRegistrationNumber(suframa_registration_number: string): BuilderPerson;
@@ -1997,10 +2098,10 @@ declare class BuilderConversionFactor {
1997
2098
  }
1998
2099
 
1999
2100
  declare enum DescriptionStatusEnum {
2000
- AUTHORIZED = "Autorizado",// 00
2001
- CANCELED = "Cancelado",// 02
2002
- LATE_REGULARIZED = "Denegado",// 04
2003
- LATE_CANCELED = "Inutilizado",// 05
2101
+ AUTHORIZED = "Autorizado",
2102
+ CANCELED = "Cancelado",
2103
+ LATE_REGULARIZED = "Denegado",
2104
+ LATE_CANCELED = "Inutilizado",
2004
2105
  NOT_APPLICABLE = ""
2005
2106
  }
2006
2107
  declare namespace DescriptionStatusEnum {
@@ -2101,6 +2202,7 @@ interface IPersonMongo {
2101
2202
  cnpj: string;
2102
2203
  cpf: string;
2103
2204
  cnae: string;
2205
+ email: string;
2104
2206
  state_registration_number: string;
2105
2207
  municipal_registration_number: string;
2106
2208
  suframa_registration_number: string;
@@ -2262,19 +2364,6 @@ declare class MongoConfig {
2262
2364
  minPoolSize: number;
2263
2365
  connectTimeoutMS: number;
2264
2366
  socketTimeoutMS: number;
2265
- /**
2266
- * MongoDB configuration class.
2267
- * @param host - The host of the MongoDB server.
2268
- * @param port - The port of the MongoDB server.
2269
- * @param database - The name of the database to connect to.
2270
- * @param username - Optional username for authentication.
2271
- * @param password - Optional password for authentication.
2272
- * @param isSrv - Whether to use SRV connection string format (default: false).
2273
- * @param maxPoolSize - Maximum number of connections in the pool (default: 20).
2274
- * @param minPoolSize - Minimum number of connections in the pool (default: 5).
2275
- * @param connectTimeoutMS - Connection timeout in milliseconds (default: 10000).
2276
- * @param socketTimeoutMS - Socket timeout in milliseconds (default: 45000).
2277
- */
2278
2367
  constructor(host: string, port: number, database: string, username?: string, password?: string, isSrv?: boolean, maxPoolSize?: number, minPoolSize?: number, connectTimeoutMS?: number, socketTimeoutMS?: number);
2279
2368
  getConnectionString(): string;
2280
2369
  getPoolOptions(): {
@@ -2296,15 +2385,6 @@ declare class PostgresConfig {
2296
2385
  rejectUnauthorized: boolean;
2297
2386
  };
2298
2387
  };
2299
- /**
2300
- * PostgresDB configuration class.
2301
- * @param user - The username for authentication.
2302
- * @param host - The host of the PostgresDB server.
2303
- * @param database - The name of the database to connect to.
2304
- * @param password - The password for authentication.
2305
- * @param port - The port of the PostgresDB server.
2306
- * @param ssl - The ssl connection of the PostgresDB server.
2307
- */
2308
2388
  constructor(config: {
2309
2389
  user: string;
2310
2390
  host: string;
@@ -2871,7 +2951,7 @@ interface IIcmsAdjustmentSetting {
2871
2951
  tenantid: string;
2872
2952
  profile_id: string;
2873
2953
  establishment_id: string;
2874
- setting_number: number;
2954
+ code: number;
2875
2955
  tax_type: IcmsAdjustmentTaxTypeEnum;
2876
2956
  adjustment_type: IcmsAdjustmentTypeEnum;
2877
2957
  initial_date: string;
@@ -3032,56 +3112,20 @@ declare enum TaxCollectionType {
3032
3112
  OPERATION = "OPERATION",
3033
3113
  APURATION = "APURATION"
3034
3114
  }
3035
- /**
3036
- * Represents the information of the audit tax collection.
3037
- */
3038
3115
  type AuditTaxCollectionInfo = {
3039
- /**
3040
- * The ID of the audit's solicitation.
3041
- */
3042
3116
  solicitation_id: string;
3043
- /**
3044
- * The period of the audit.
3045
- */
3046
3117
  period: string;
3047
- /**
3048
- * Details of tax collection of ICMS Audit (Registry E116).
3049
- */
3050
3118
  icms?: AuditTaxCollectionDetails;
3051
- /**
3052
- * Details of tax collection of ICMS Sub-Apuration of an ICMS Audit (Registry 1926).
3053
- */
3054
3119
  icms_sub_apuracao?: AuditTaxCollectionDetails;
3055
3120
  };
3056
- /**
3057
- * Represents the Audit Type.
3058
- */
3059
3121
  type AuditTaxCollectionDetails = {
3060
- /**
3061
- * The total of value to be collected.
3062
- */
3063
3122
  vl_recolher: number;
3064
- /**
3065
- * The total of special Debit.
3066
- */
3067
3123
  deb_esp: number;
3068
- /**
3069
- * Details of the tax collection.
3070
- */
3071
3124
  details: TaxCollectionDetails[];
3072
3125
  };
3073
3126
  type TaxCollectionDetails = ITaxTypeConfigBase & {
3074
- /**
3075
- * The amount to be collected.
3076
- */
3077
3127
  amount: number;
3078
- /**
3079
- * The due period of the collection.
3080
- */
3081
3128
  due_period: string;
3082
- /**
3083
- * Additional information.
3084
- */
3085
3129
  txt_compl?: string;
3086
3130
  };
3087
3131
  interface GetAuditTaxCollectionQuery {
@@ -3160,7 +3204,7 @@ declare class IcmsAdjustmentSetting {
3160
3204
  protected _tenantid: string;
3161
3205
  protected _profile_id: string;
3162
3206
  protected _establishment_id: string;
3163
- protected _setting_number: number;
3207
+ protected _code: number;
3164
3208
  protected _tax_type: IcmsAdjustmentTaxTypeEnum;
3165
3209
  protected _adjustment_type: IcmsAdjustmentTypeEnum;
3166
3210
  protected _initial_date: string;
@@ -3179,7 +3223,7 @@ declare class IcmsAdjustmentSetting {
3179
3223
  set tenantid(tenantid: string);
3180
3224
  set profile_id(profile_id: string);
3181
3225
  set establishment_id(establishment_id: string);
3182
- set setting_number(setting_number: number);
3226
+ set code(code: number);
3183
3227
  set tax_type(value: IcmsAdjustmentTaxTypeEnum);
3184
3228
  set adjustment_type(value: IcmsAdjustmentTypeEnum);
3185
3229
  set initial_date(value: string);
@@ -3198,7 +3242,7 @@ declare class IcmsAdjustmentSetting {
3198
3242
  get tenantid(): string;
3199
3243
  get profile_id(): string;
3200
3244
  get establishment_id(): string;
3201
- get setting_number(): number;
3245
+ get code(): number;
3202
3246
  get tax_type(): IcmsAdjustmentTaxTypeEnum;
3203
3247
  get adjustment_type(): IcmsAdjustmentTypeEnum;
3204
3248
  get initial_date(): string;
@@ -3252,33 +3296,37 @@ declare enum FiscalQualificationType {
3252
3296
  }
3253
3297
 
3254
3298
  declare enum StateCollectionSettingsTaxTypeEnum {
3255
- ICMS = "ICMS",// ICMS
3256
- ICMS_ST = "ICMS_ST",// ICMS-ST
3257
- ICMS_SUB_AUDITING = "ICMS_SUB_AUDITING",// ICMS Sub-Apuração
3299
+ ICMS = "ICMS",
3300
+ ICMS_ST = "ICMS_ST",
3301
+ ICMS_SUB_AUDITING = "ICMS_SUB_AUDITING",
3258
3302
  DIFAL_FCP = "DIFAL_FCP"
3259
3303
  }
3260
3304
 
3261
3305
  declare enum StateCollectionSettingsConfigTypeEnum {
3262
- TAX_TO_COLLECTED = "TAX_TO_COLLECTED",// Imposto a Recolher
3306
+ TAX_TO_COLLECTED = "TAX_TO_COLLECTED",
3263
3307
  EXTRA_VALUE_CALCULATION = "EXTRA_VALUE_CALCULATION"
3264
3308
  }
3265
3309
 
3266
3310
  declare enum TaxCollectionTypeEnum {
3267
- OPERATION = "OPERATION",// Operação
3311
+ OPERATION = "OPERATION",
3268
3312
  APURATION = "APURATION"
3269
3313
  }
3270
3314
 
3271
- declare class CNPJ implements IdentificationNumber {
3272
- private readonly _value;
3273
- constructor(cnpj: string);
3274
- private removeInvalidDigits;
3275
- isValid(): boolean;
3276
- get rawValue(): string;
3277
- get formattedValue(): string;
3278
- validationErrors(): string[];
3279
- private allDigitsTheSame;
3280
- private calculateDigit;
3281
- private extractActualDigit;
3315
+ declare enum StartingCreditBalanceTypeEnum {
3316
+ ICMS = "icms",
3317
+ ICMS_ST = "icms-st",
3318
+ IPI = "ipi",
3319
+ DIFAL_FCP = "difal-fcp",
3320
+ PIS = "pis",
3321
+ COFINS = "cofins"
3322
+ }
3323
+ declare enum CreditBalanceOriginCreditTypeEnum {
3324
+ credit_balance = 0,
3325
+ tax_withheld = 1
3326
+ }
3327
+ declare enum CreditBalanceRegimeTypeEnum {
3328
+ cumulative = 0,
3329
+ not_cumulative = 1
3282
3330
  }
3283
3331
 
3284
3332
  declare class EstablishmentEvent {
@@ -3484,8 +3532,71 @@ declare class StateCollectionSettings {
3484
3532
  get updated_by_email(): string;
3485
3533
  }
3486
3534
 
3535
+ declare class StateRegistration {
3536
+ protected _id: string;
3537
+ protected _state: State;
3538
+ protected _number: string;
3539
+ protected _createdAt: Date;
3540
+ protected _inactiveAt: Date | null;
3541
+ protected _isTaxSubstitution: boolean;
3542
+ get id(): string;
3543
+ set id(value: string);
3544
+ get state(): State;
3545
+ set state(value: State);
3546
+ get number(): string;
3547
+ set number(value: string);
3548
+ get createdAt(): Date;
3549
+ set createdAt(value: Date);
3550
+ get inactiveAt(): Date | null;
3551
+ set inactiveAt(value: Date | null);
3552
+ get isTaxSubstitution(): boolean;
3553
+ set isTaxSubstitution(value: boolean);
3554
+ }
3555
+
3556
+ declare class MunicipalRegistration {
3557
+ protected _id: string;
3558
+ protected _state: State;
3559
+ protected _number: string;
3560
+ protected _municipality: Municipality;
3561
+ protected _createdAt: Date;
3562
+ protected _inactiveAt: Date | null;
3563
+ get id(): string;
3564
+ set id(value: string);
3565
+ get state(): State;
3566
+ set state(value: State);
3567
+ get number(): string;
3568
+ set number(value: string);
3569
+ set municipality(value: Municipality);
3570
+ get municipality(): Municipality;
3571
+ get municipalityCode(): number;
3572
+ get createdAt(): Date;
3573
+ set createdAt(value: Date);
3574
+ get inactiveAt(): Date | null;
3575
+ set inactiveAt(value: Date | null);
3576
+ }
3577
+
3578
+ declare enum ContactTypesEnum {
3579
+ email = "EMAIL",
3580
+ telephone = "PHONE"
3581
+ }
3582
+ declare class Contact {
3583
+ protected _type: ContactTypesEnum;
3584
+ protected _value: Telephone | Email;
3585
+ protected _description: string | undefined;
3586
+ protected _responsible: string | null;
3587
+ get type(): ContactTypesEnum;
3588
+ get value(): Telephone | Email;
3589
+ get responsible(): string | null;
3590
+ set type(type: ContactTypesEnum);
3591
+ set value(value: Telephone | Email);
3592
+ set responsible(responsible: string | null);
3593
+ set description(description: string | undefined);
3594
+ get description(): string | undefined;
3595
+ }
3596
+
3487
3597
  declare class Establishment {
3488
- protected _alias: string;
3598
+ protected _id: string;
3599
+ protected _fantasyName: string;
3489
3600
  protected _tenantid: string;
3490
3601
  protected _taxation_type: TaxationType;
3491
3602
  protected _cod_inc_trib: string;
@@ -3497,15 +3608,33 @@ declare class Establishment {
3497
3608
  protected _profileId: string;
3498
3609
  protected _fiscal_id_number: CNPJ;
3499
3610
  protected _headerAccountPlanId: string;
3500
- protected _id: string;
3501
3611
  protected _created_at: Date;
3612
+ protected _active: boolean;
3613
+ protected _nire: string;
3614
+ protected _crt: number;
3615
+ protected _suframa: string;
3616
+ protected _mainEmail: Contact | undefined;
3617
+ protected _mainTelephone: Contact | undefined;
3502
3618
  protected _efdIcmsIpiSpecializedProfile: EfdIcmsIpiSpecializedProfile;
3503
3619
  protected _signatories: Signatory[];
3504
3620
  protected _scps: Scp[];
3505
3621
  protected _events: EstablishmentEvent[];
3506
3622
  protected _stateCollectionsSettings: StateCollectionSettings[];
3623
+ protected _stateRegistrations: StateRegistration[];
3624
+ protected _municipalRegistrations: MunicipalRegistration[];
3625
+ protected _addresses: Address[];
3626
+ protected _contacts: Contact[];
3627
+ get mainEmail(): Contact | undefined;
3628
+ set mainEmail(mainEmail: Contact);
3629
+ get mainTelephone(): Contact | undefined;
3630
+ set mainTelephone(mainTelephone: Contact);
3631
+ private hasContact;
3507
3632
  get alias(): string;
3633
+ get active(): boolean;
3634
+ set active(active: boolean);
3508
3635
  set alias(alias: string);
3636
+ get fantasyName(): string;
3637
+ set fantasyName(fantasyName: string);
3509
3638
  set tenantid(tenantid: string);
3510
3639
  set taxation_type(taxation_type: TaxationType);
3511
3640
  set cod_inc_trib(cod_inc_trib: string);
@@ -3542,7 +3671,25 @@ declare class Establishment {
3542
3671
  get events(): EstablishmentEvent[];
3543
3672
  set stateCollectionSettings(stateCollectionSettings: StateCollectionSettings[]);
3544
3673
  get stateCollectionSettings(): StateCollectionSettings[];
3545
- getStateCollectionSettingsByTaxType(tax_type: StateCollectionSettingsTaxTypeEnum): StateCollectionSettings;
3674
+ getStateCollectionSettingsByTaxType(tax_type: StateCollectionSettingsTaxTypeEnum): StateCollectionSettings[];
3675
+ get nire(): string;
3676
+ set nire(value: string);
3677
+ get crt(): number;
3678
+ set crt(value: number);
3679
+ get suframa(): string;
3680
+ set suframa(value: string);
3681
+ addStateRegistration(establishmentStateRegistration: StateRegistration): void;
3682
+ addMunicipalRegistration(establishmentMunicipalRegistration: MunicipalRegistration): void;
3683
+ get stateRegistrations(): StateRegistration[];
3684
+ get municipalRegistrations(): MunicipalRegistration[];
3685
+ addAddress(establishmentAddress: Address): void;
3686
+ get addresses(): Address[];
3687
+ get fiscalAddress(): Address | undefined;
3688
+ get billingAddress(): Address | undefined;
3689
+ addContact(establishmentContact: Contact): void;
3690
+ get contacts(): Contact[];
3691
+ get telephoneContact(): Contact | undefined;
3692
+ get emailContact(): Contact | undefined;
3546
3693
  }
3547
3694
 
3548
3695
  interface IReinfAdditionalFields {
@@ -3796,27 +3943,88 @@ declare class ReinfSpecializedProfile {
3796
3943
  get updated_at(): Date;
3797
3944
  }
3798
3945
 
3946
+ declare class StartingCreditBalance {
3947
+ protected _id: string;
3948
+ protected _tenantid: string;
3949
+ protected _period: string;
3950
+ protected _establishment_id: string;
3951
+ protected _establishment?: Establishment;
3952
+ protected _profile_id: string;
3953
+ protected _type: StartingCreditBalanceTypeEnum;
3954
+ protected _credit_balance_previous_period: number;
3955
+ protected _credit_balance_sub_auditing?: number;
3956
+ protected _credit_balance_previous_period_fcp?: number;
3957
+ protected _uf?: string;
3958
+ protected _credit_balance_control_id?: string;
3959
+ protected _withholding_nature_indicator?: string;
3960
+ protected _origin_credit?: CreditBalanceOriginCreditTypeEnum;
3961
+ protected _type_regime?: CreditBalanceRegimeTypeEnum;
3962
+ protected _total_value?: number;
3963
+ protected _credit_type?: string;
3964
+ protected _created_at: Date;
3965
+ get id(): string;
3966
+ set id(value: string);
3967
+ get tenantid(): string;
3968
+ set tenantid(value: string);
3969
+ get period(): string;
3970
+ set period(value: string);
3971
+ get establishment_id(): string;
3972
+ set establishment_id(value: string);
3973
+ get establishment(): Establishment | undefined;
3974
+ set establishment(value: Establishment | undefined);
3975
+ get profile_id(): string;
3976
+ set profile_id(value: string);
3977
+ get type(): StartingCreditBalanceTypeEnum;
3978
+ set type(value: StartingCreditBalanceTypeEnum);
3979
+ get credit_balance_previous_period(): number;
3980
+ set credit_balance_previous_period(value: number);
3981
+ get credit_balance_sub_auditing(): number | undefined;
3982
+ set credit_balance_sub_auditing(value: number | undefined);
3983
+ get credit_balance_previous_period_fcp(): number | undefined;
3984
+ set credit_balance_previous_period_fcp(value: number | undefined);
3985
+ get uf(): string | undefined;
3986
+ set uf(value: string | undefined);
3987
+ get credit_balance_control_id(): string | undefined;
3988
+ set credit_balance_control_id(value: string | undefined);
3989
+ get withholding_nature_indicator(): string | undefined;
3990
+ set withholding_nature_indicator(value: string | undefined);
3991
+ get origin_credit(): CreditBalanceOriginCreditTypeEnum | undefined;
3992
+ set origin_credit(value: CreditBalanceOriginCreditTypeEnum | undefined);
3993
+ get type_regime(): CreditBalanceRegimeTypeEnum | undefined;
3994
+ set type_regime(value: CreditBalanceRegimeTypeEnum | undefined);
3995
+ get total_value(): number | undefined;
3996
+ set total_value(value: number | undefined);
3997
+ get credit_type(): string | undefined;
3998
+ set credit_type(value: string | undefined);
3999
+ get created_at(): Date;
4000
+ set created_at(value: Date);
4001
+ }
4002
+
3799
4003
  declare class Profile {
3800
4004
  protected _id: string;
4005
+ protected _active: boolean;
3801
4006
  protected _tenantid: string;
3802
4007
  protected _validFrom: Date;
3803
4008
  protected _validTo: Date | null;
3804
4009
  protected _mainEstablishment: Establishment;
3805
4010
  protected _mainEstablishmentId: string;
3806
4011
  protected _alias: string;
4012
+ protected _taxation_type: TaxationType;
3807
4013
  private _establishments;
3808
4014
  private _reinfSpecializedProfile;
3809
4015
  private _efdContribSpecializedProfile;
3810
4016
  private _ecdSpecializedProfile;
3811
4017
  private _ecfSpecializedProfile;
3812
- protected _taxation_type: TaxationType;
4018
+ private _startingCreditBalance;
3813
4019
  set id(id: string);
4020
+ set active(active: boolean);
3814
4021
  set tenantid(tenantid: string);
3815
4022
  set validFrom(validFrom: Date);
3816
4023
  set validTo(validTo: Date);
3817
4024
  set mainEstablishmentId(mainEstablishmentId: string);
3818
4025
  set alias(alias: string);
3819
4026
  get id(): string;
4027
+ get active(): boolean;
3820
4028
  get tenantid(): string;
3821
4029
  get taxation_type(): TaxationType;
3822
4030
  set taxation_type(taxation_type: TaxationType);
@@ -3828,6 +4036,7 @@ declare class Profile {
3828
4036
  get establishments(): Establishment[];
3829
4037
  set establishments(establishments: Establishment[]);
3830
4038
  findEstablishment(establishment_id: string): Establishment;
4039
+ findEstablishmentByBranchId(branchId: string): Establishment;
3831
4040
  checkValidityDate(generationPeriod: Date | string): boolean;
3832
4041
  get reinfSpecializedProfile(): ReinfSpecializedProfile;
3833
4042
  set setReinfSpecializedProfile(reinfSpecializedProfile: ReinfSpecializedProfile);
@@ -3838,6 +4047,8 @@ declare class Profile {
3838
4047
  set setEcdSpecializedProfile(ecdSpecializedProfile: EcdSpecializedProfile);
3839
4048
  get ecfSpecializedProfile(): EcfSpecializedProfile;
3840
4049
  set setEcfSpecializedProfile(ecfSpecializedProfile: EcfSpecializedProfile);
4050
+ get startingCreditBalance(): StartingCreditBalance[];
4051
+ set startingCreditBalance(startingCreditBalance: StartingCreditBalance[]);
3841
4052
  }
3842
4053
 
3843
4054
  interface IProfileRepository {
@@ -3868,6 +4079,26 @@ interface IProfileServiceUrls {
3868
4079
  ecfBaseServiceUrl?: string;
3869
4080
  efdContribBaseServiceUrl?: string;
3870
4081
  ecdBaseServiceUrl?: string;
4082
+ partnerServiceUrl?: string;
4083
+ }
4084
+ interface IStartingCreditBalance {
4085
+ id: string;
4086
+ tenantid: string;
4087
+ period: string;
4088
+ establishment_id: string;
4089
+ profile_id: string;
4090
+ type: StartingCreditBalanceTypeEnum;
4091
+ credit_balance_previous_period?: number;
4092
+ credit_balance_sub_auditing?: number;
4093
+ credit_balance_previous_period_fcp?: number;
4094
+ uf?: string;
4095
+ credit_balance_control_id?: string;
4096
+ origin_credit?: CreditBalanceOriginCreditTypeEnum;
4097
+ type_regime?: CreditBalanceRegimeTypeEnum;
4098
+ credit_type?: string;
4099
+ total_value?: number;
4100
+ withholding_nature_indicator?: string;
4101
+ created_at: Date;
3871
4102
  }
3872
4103
 
3873
4104
  interface IEstablishment {
@@ -3942,21 +4173,29 @@ interface IEstablishmentEvent {
3942
4173
  declare class ProfileRestRepository implements IProfileRepository {
3943
4174
  private readonly urls;
3944
4175
  private readonly stateSettingsRepository;
3945
- constructor(urls: IProfileServiceUrls, stateSettingsRepository: IStateCollectionSettingsRepository);
4176
+ private readonly masterDataRepository;
4177
+ constructor(urls: IProfileServiceUrls, stateSettingsRepository: IStateCollectionSettingsRepository, masterDataRepository?: Repository);
3946
4178
  getProfileById(profile_id: string, tenantid: string, period?: any): Promise<Profile>;
3947
4179
  private getStateCollectionSettings;
3948
4180
  getProfileRestById(profile_id: string, tenantid: string): Promise<IProfile>;
4181
+ getStartingCreditByProfileId(profile_id: string, tenantid: string): Promise<StartingCreditBalance[]>;
4182
+ private mapDataToStartingCreditBalance;
3949
4183
  getProfileByBranchId(branch_id: string, tenantid: string): Promise<IProfile[]>;
3950
4184
  getEstablishmentByProfileId(profile_id: string, tenantid: string): Promise<Establishment[]>;
3951
4185
  getSignatoryByProfileId(profile_id: string, tenantid: string): Promise<ISignatory[]>;
3952
4186
  getScpByProfileId(profile_id: string, tenantid: string): Promise<IScp[]>;
3953
4187
  getEventsByProfileId(profile_id: string, tenantid: string): Promise<IEstablishmentEvent[]>;
4188
+ private getAllPartners;
3954
4189
  getReinfSpecializedProfile(profile_id: string, tenantid: string): Promise<ReinfSpecializedProfile>;
3955
4190
  getEcdSpecializedProfile(profile_id: string, tenantid: string): Promise<EcdSpecializedProfile>;
3956
4191
  getEcfSpecializedProfile(profile_id: string, tenantid: string): Promise<EcfSpecializedProfile>;
3957
4192
  getEfdContribSpecializedProfile(profile_id: string, tenantid: string): Promise<EfdContribSpecializedProfile>;
3958
4193
  getEfdIcmsIpiSpecializedProfile(profile_id: string, tenantid: string): Promise<EfdIcmsIpiSpecializedProfile[]>;
3959
4194
  private getJsonData;
4195
+ private mountEstablishment;
4196
+ private mountSignatories;
4197
+ private mountSCPs;
4198
+ private mountEvents;
3960
4199
  }
3961
4200
 
3962
4201
  interface IEcfSpecializedProfile {
@@ -4048,6 +4287,7 @@ declare class ProfileDbRepository implements IProfileRepository {
4048
4287
  getProfileById(profile_id: string, tenantid: string, period?: string): Promise<Profile>;
4049
4288
  getEstablishments(profile_id: string, tenantid: string): Promise<Establishment[]>;
4050
4289
  private fetchProfile;
4290
+ private fetchStartingCreditBalance;
4051
4291
  private fetchEstablishments;
4052
4292
  private fetchReinf;
4053
4293
  private fetchEcd;
@@ -4056,6 +4296,7 @@ declare class ProfileDbRepository implements IProfileRepository {
4056
4296
  private fetchEfdIcmsIpi;
4057
4297
  private getEstablishmentsFromPostgres;
4058
4298
  private mapDataToProfile;
4299
+ private mapDataToStartingCreditBalance;
4059
4300
  private mapDataToEstablishments;
4060
4301
  private mapDataToSignatories;
4061
4302
  private mapDataToScps;
@@ -4067,19 +4308,6 @@ declare class ProfileDbRepository implements IProfileRepository {
4067
4308
  private mapDataToEfdIcmsIpi;
4068
4309
  }
4069
4310
 
4070
- declare class CPF implements IdentificationNumber {
4071
- private readonly _value;
4072
- constructor(cpf: string);
4073
- private removeNonDigits;
4074
- isValid(): boolean;
4075
- get rawValue(): string;
4076
- get formattedValue(): string;
4077
- validationErrors(): string[];
4078
- private allDigitsTheSame;
4079
- private calculateDigit;
4080
- private extractActualDigit;
4081
- }
4082
-
4083
4311
  declare const keyCompositionMetadata: unique symbol;
4084
4312
  declare const onDuplicationStrategyMetadata: unique symbol;
4085
4313
  declare const MaximumNumericLength = 19;
@@ -4106,9 +4334,9 @@ interface FieldFormat {
4106
4334
  removeSpecialCharacters: boolean;
4107
4335
  }
4108
4336
  declare enum OnDuplicationStrategy {
4109
- Error = 0,// Default behavior
4110
- Ignore = 1,// Ignore the new register
4111
- Overwrite = 2,// Overwrite the existing register
4337
+ Error = 0,
4338
+ Ignore = 1,
4339
+ Overwrite = 2,
4112
4340
  Duplicate = 3
4113
4341
  }
4114
4342
  declare function Numeric(required?: boolean, fillEntireLength?: boolean, maximumLength?: number): (target: any, propertyKey: any, other?: any) => void;
@@ -4314,21 +4542,6 @@ declare class ConsoleOutput implements OutputWriter {
4314
4542
  save(): void;
4315
4543
  }
4316
4544
 
4317
- /**
4318
- * Optimized in-memory implementation of RegisterPersist.
4319
- * Optimized for fast get(tag) operations while maintaining O(1) for all other operations.
4320
- *
4321
- * Performance characteristics:
4322
- * - add(): O(1) for all duplication strategies (including Overwrite)
4323
- * - getByKey(): O(1)
4324
- * - get(tag): O(1) - returns array reference directly
4325
- * - all(): O(N) where N is total number of registers
4326
- * - set(tag): O(M) where M is number of registers being set
4327
- *
4328
- * Memory optimization:
4329
- * - Registers stored once in arrays grouped by tag
4330
- * - registersByKey maintains reverse index with O(1) lookup and update
4331
- */
4332
4545
  declare class MemoryPersist implements RegisterPersist {
4333
4546
  private readonly registers;
4334
4547
  private readonly registersByKey;
@@ -4457,4 +4670,12 @@ declare function logWithContext<T extends MessageCodeType>(messageCode: T, param
4457
4670
  actionSuggestion: string;
4458
4671
  };
4459
4672
 
4460
- export { ActionTypeEnum, Addition, Address, type AllowedCfopsCreditConfig, Alphanumeric, type AuditTaxCollectionDetails, type AuditTaxCollectionInfo, type AuthTokenExpiredParams, type AuthUnauthorizedParams, Block, BuilderAddition, BuilderAddress, BuilderConversionFactor, BuilderDocument, BuilderImportDeclaration, BuilderItem, BuilderPerson, BuilderTax, CNPJ, CPF, CST, CalculationBasisNatureSetting, type Cloneable, CloseBlock, CloseFile, CodIncTrib, type Cod_ent_ref, CodeStatusEnum, ConfigTypeEnum, ConsoleOutput, ConversionFactor, CounterBlock, CounterRegister, CountryCodeEnum, CprbOption, CteTypeEnum, DEFAULT_LOCALE, type DatabaseConnectionFailedParams, type DatabaseQueryErrorParams, Decimal, DefaultAlphanumericLength, DefaultDecimalLength, DefaultDecimalSeparator, DescriptionStatusEnum, DifalIcmsCategoryEnum, Document, type DocumentRepository, DocumentTypeEnum, DonationIndicatorEnum, EcdSpecializedProfile, EcfSpecializedProfile, EfdContribSpecializedProfile, EfdIcmsIpiSpecializedProfile, Email, EnforceabilityOfISSEnum, Establishment, EstablishmentEvent, Event, EventEnum, FieldDataType, type FieldFormat, type FiltersDocument, FiscalQualificationType, FreightContractedNatureIndicatorEnum, FreightTypeEnum, type GetAuditTaxCollectionQuery, GrossRevenueContributionHeaders, type IAddition, type IAddressMongo, type IBaseHeadersDTO, type ICalculationBasisNatureSetting, type IConversionFactor, type IDocumentMongo, type IEcdSpecializedProfile, type IEcfSpecializedProfile, type IEfdContribSpecializedProfile, type IEfdicmsipiAdditionalFields, type IEstablishment, type IEstablishmentEvent, type IGrossRevenueContributionHeader, type IIcmsAdjustmentExtraInfo, type IIcmsAdjustmentSetting, type IIcmsCreditBaseConfig, type IIcmsCreditConfigLog, type IImportDeclaration, type IItemMongo, type IJudicialProcess, type INatureConfig, type INatureOfIncomeBusinessPartner, type IPersonMongo, type IProfile, type IProfileRepository, type IProfileServiceUrls, type IReinfAdditionalFields, type IRevenueNatureSettings, type IScp, type ISignatory, type IStateCollectionSettingsRepository, type ITable9, type ITaxMongo, type ITaxTypeConfig, type ITaxTypeConfigBase, type ITaxTypeConfigCreateOrUpdate, type ITaxTypeConfigLog, IcmsAdjustmentGroupEnum, IcmsAdjustmentRegistryEnum, IcmsAdjustmentSetting, IcmsAdjustmentTaxTypeEnum, IcmsAdjustmentTypeEnum, IcmsCalculationIndicatorEnum, type IdentificationNumber, ImportDeclaration, IntermediationTypeEnum, type InternalServerErrorParams, InternationalTransportTypeEnum, IssuerIndicatorEnum, Item, ItemTypeEnum, JudicialProcessOriginEnum, Key, type KeyComposition, type KeyFieldDefinition, LayoutDateFormat, type Locale, MaximumNumericLength, MemoryMasterDataRepository, MemoryPersist, MessageCategory, MessageCode, type MessageCodeType, Messages, ModelConverter, ModelRollback, MongoConfig, MongoRepository, MongoToDocumentBuilder, MunicipalObligation, MunicipalObligationIdEnum, MunicipalObligationNameEnum, MunicipalObligationTypeEnum, Municipality, NameCountryEnum, NatureCode, NatureConfig, Numeric, ObligationCodeEnum, OnDuplication, OnDuplicationStrategy, OpenBlock, OperationTypeEnum, OurDate, type OutputWriter, type ParameterTypes, PaymentTypeEnum, Person, PostgresConfig, PostgresRepository, ProductOriginEnum, Profile, ProfileDbRepository, ProfileRestRepository, ProfileTaxTypeEnum, Register, type RegisterDefinition, type RegisterEventData, type RegisterEventNotifier, type RegisterGenerator, type RegisterPersist, type RegisterSubscriber, ReinfSpecializedProfile, type ReportGenerationOptions, ReportGenerator, type Repository, RevenueNatureSettings, RevenueTypeEnum, Scp, ServiceCode, ServiceCodeEnum, type SettingErrorParams, Signatory, SimpleNationalOption, type SimpleReportGenerationOptions, SimpleReportGenerator, State, StateCollectionSettings, StateCollectionSettingsConfigTypeEnum, StateCollectionSettingsTaxTypeEnum, StateEnum, StateRegistrationIndicatorEnum, StatusDocumentEnum, StringArrayOutput, TagCounter, Tax, type TaxCollectionDetails, TaxCollectionType, TaxCollectionTypeEnum, TaxRegimeEnum, type TaxRegimes, type TaxRegisterGenerationOptions, TaxRegisterGenerator, TaxReport, TaxTypeEnum, TaxationType, Uf, type ValidationInvalidInputParams, type ValidationMissingFieldParams, ValueProviderType, ZfmPresumedCreditTypeEnum, buildMongoFilter, calculate_bases_values, formatMessage, keyCompositionMetadata, logWithContext, newRegisterEventData, normalizeServiceCode, onDuplicationStrategyMetadata, parseState };
4673
+ declare function cleanData(obj: any): any;
4674
+
4675
+ declare function isEmptyObject(obj: object): boolean;
4676
+
4677
+ declare function toSafeNumber(value: unknown, fallback?: number): number;
4678
+
4679
+ declare function validationValue(field: any): any;
4680
+
4681
+ export { ActionTypeEnum, Addition, Address, type AllowedCfopsCreditConfig, Alphanumeric, type AuditTaxCollectionDetails, type AuditTaxCollectionInfo, type AuthTokenExpiredParams, type AuthUnauthorizedParams, Block, BuilderAddition, BuilderAddress, BuilderConversionFactor, BuilderDocument, BuilderImportDeclaration, BuilderItem, BuilderPerson, BuilderTax, CNPJ, CPF, CST, CalculationBasisNatureSetting, type Cloneable, CloseBlock, CloseFile, CodIncTrib, type Cod_ent_ref, CodeStatusEnum, ConfigTypeEnum, ConsoleOutput, Contact, ContactTypesEnum, ConversionFactor, CounterBlock, CounterRegister, Country, CountryCodeEnum, CprbOption, CreditBalanceOriginCreditTypeEnum, CreditBalanceRegimeTypeEnum, CteTypeEnum, DEFAULT_LOCALE, type DatabaseConnectionFailedParams, type DatabaseQueryErrorParams, Decimal, DefaultAlphanumericLength, DefaultDecimalLength, DefaultDecimalSeparator, DescriptionStatusEnum, DifalIcmsCategoryEnum, Document, type DocumentRepository, DocumentTypeEnum, DonationIndicatorEnum, EcdSpecializedProfile, EcfSpecializedProfile, EfdContribSpecializedProfile, EfdIcmsIpiSpecializedProfile, Email, EnforceabilityOfISSEnum, Establishment, EstablishmentEvent, Event, EventEnum, FieldDataType, type FieldFormat, type FiltersDocument, FiscalQualificationType, FreightContractedNatureIndicatorEnum, FreightTypeEnum, type GetAuditTaxCollectionQuery, GrossRevenueContributionHeaders, type IAddition, type IAddressMongo, type IBaseHeadersDTO, type ICalculationBasisNatureSetting, type IConversionFactor, type IDocumentMongo, type IEcdSpecializedProfile, type IEcfSpecializedProfile, type IEfdContribSpecializedProfile, type IEfdicmsipiAdditionalFields, type IEstablishment, type IEstablishmentEvent, type IGrossRevenueContributionHeader, type IIcmsAdjustmentExtraInfo, type IIcmsAdjustmentSetting, type IIcmsCreditBaseConfig, type IIcmsCreditConfigLog, type IImportDeclaration, type IItemMongo, type IJudicialProcess, type INatureConfig, type INatureOfIncomeBusinessPartner, type IPersonMongo, type IProfile, type IProfileRepository, type IProfileServiceUrls, type IReinfAdditionalFields, type IRevenueNatureSettings, type IScp, type ISignatory, type IStartingCreditBalance, type IStateCollectionSettingsRepository, type ITable9, type ITaxMongo, type ITaxTypeConfig, type ITaxTypeConfigBase, type ITaxTypeConfigCreateOrUpdate, type ITaxTypeConfigLog, IcmsAdjustmentGroupEnum, IcmsAdjustmentRegistryEnum, IcmsAdjustmentSetting, IcmsAdjustmentTaxTypeEnum, IcmsAdjustmentTypeEnum, IcmsCalculationIndicatorEnum, type IdentificationNumber, ImportDeclaration, IntermediationTypeEnum, type InternalServerErrorParams, InternationalTransportTypeEnum, IssuerIndicatorEnum, Item, ItemTypeEnum, JudicialProcessOriginEnum, Key, type KeyComposition, type KeyFieldDefinition, LayoutDateFormat, type Locale, MaximumNumericLength, MemoryMasterDataRepository, MemoryPersist, MessageCategory, MessageCode, type MessageCodeType, Messages, ModelConverter, ModelRollback, MongoConfig, MongoRepository, MongoToDocumentBuilder, MunicipalObligation, MunicipalObligationIdEnum, MunicipalObligationNameEnum, MunicipalObligationTypeEnum, MunicipalRegistration, Municipality, NameCountryEnum, NatureCode, NatureConfig, Numeric, ObligationCodeEnum, OnDuplication, OnDuplicationStrategy, OpenBlock, OperationTypeEnum, OurDate, type OutputWriter, type ParameterTypes, PaymentTypeEnum, Person, PostgresConfig, PostgresRepository, ProductOriginEnum, Profile, ProfileDbRepository, ProfileRestRepository, ProfileTaxTypeEnum, Register, type RegisterDefinition, type RegisterEventData, type RegisterEventNotifier, type RegisterGenerator, type RegisterPersist, type RegisterSubscriber, ReinfSpecializedProfile, type ReportGenerationOptions, ReportGenerator, type Repository, RevenueNatureSettings, RevenueTypeEnum, Scp, ServiceCode, ServiceCodeEnum, type SettingErrorParams, Signatory, SimpleNationalOption, type SimpleReportGenerationOptions, SimpleReportGenerator, StartingCreditBalance, StartingCreditBalanceTypeEnum, State, StateCollectionSettings, StateCollectionSettingsConfigTypeEnum, StateCollectionSettingsTaxTypeEnum, StateEnum, StateRegistration, StateRegistrationIndicatorEnum, StatusDocumentEnum, StringArrayOutput, TagCounter, Tax, type TaxCollectionDetails, TaxCollectionType, TaxCollectionTypeEnum, TaxRegimeEnum, type TaxRegimes, type TaxRegisterGenerationOptions, TaxRegisterGenerator, TaxReport, TaxTypeEnum, TaxationType, Telephone, Uf, type ValidationInvalidInputParams, type ValidationMissingFieldParams, ValueProviderType, ZfmPresumedCreditTypeEnum, buildMongoFilter, calculate_bases_values, cleanData, formatMessage, isEmptyObject, keyCompositionMetadata, logWithContext, newRegisterEventData, normalizeServiceCode, onDuplicationStrategyMetadata, parseState, toSafeNumber, validationValue };