@seidor-cloud-produtos/tax-core 0.0.77 → 0.0.78

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
@@ -59,6 +59,7 @@ export { InternationalTransportTypeEnum } from './documents/enums/international-
59
59
  export { IntermediationTypeEnum } from './documents/enums/intermediation-type.enum.mjs';
60
60
  export { default as ImportDeclaration } from './documents/ImportDeclaration.class.mjs';
61
61
  export { default as Addition } from './documents/AdditionImportDeclaration.class.mjs';
62
+ export { SimpleReportGenerator } from './taxReport/SimpleReportGenerator.mjs';
62
63
  import './taxReport/TagCounter.mjs';
63
64
  import './documents/interfaces/cloneable.interface.mjs';
64
65
  import 'mongodb';
package/dist/index.d.ts CHANGED
@@ -59,6 +59,7 @@ export { InternationalTransportTypeEnum } from './documents/enums/international-
59
59
  export { IntermediationTypeEnum } from './documents/enums/intermediation-type.enum.js';
60
60
  export { default as ImportDeclaration } from './documents/ImportDeclaration.class.js';
61
61
  export { default as Addition } from './documents/AdditionImportDeclaration.class.js';
62
+ export { SimpleReportGenerator } from './taxReport/SimpleReportGenerator.js';
62
63
  import './taxReport/TagCounter.js';
63
64
  import './documents/interfaces/cloneable.interface.js';
64
65
  import 'mongodb';
package/dist/index.js CHANGED
@@ -92,6 +92,7 @@ __export(index_exports, {
92
92
  Register: () => Register,
93
93
  RevenueTypeEnum: () => RevenueTypeEnum,
94
94
  ServiceCodeEnum: () => ServiceCodeEnum,
95
+ SimpleReportGenerator: () => SimpleReportGenerator,
95
96
  StateRegistrationIndicatorEnum: () => StateRegistrationIndicatorEnum,
96
97
  StatusDocumentEnum: () => StatusDocumentEnum,
97
98
  StringArrayOutput: () => StringArrayOutput,
@@ -55054,6 +55055,79 @@ var MongoRepository = class {
55054
55055
  return new MongoToDocumentBuilder().build(data);
55055
55056
  }
55056
55057
  };
55058
+
55059
+ // lib/taxReport/SimpleReportGenerator.ts
55060
+ var SimpleReportGenerator = class _SimpleReportGenerator {
55061
+ constructor(options) {
55062
+ __publicField(this, "_options");
55063
+ this._options = options;
55064
+ }
55065
+ static defaultOptions(openFileRegister, registerGenerator) {
55066
+ return {
55067
+ openFileRegister,
55068
+ registerGenerator
55069
+ };
55070
+ }
55071
+ static newWithDefaultOptions(openFileRegister) {
55072
+ return this.newWithOptions(
55073
+ this.defaultOptions(
55074
+ openFileRegister,
55075
+ TaxRegisterGenerator.newWithDefaultOptions()
55076
+ )
55077
+ );
55078
+ }
55079
+ static newWithOptions(options) {
55080
+ return new _SimpleReportGenerator(options);
55081
+ }
55082
+ beforeGeneration(taxReport) {
55083
+ if (this._options.openFileRegister) {
55084
+ this.addRegister(this._options.openFileRegister);
55085
+ }
55086
+ }
55087
+ generation(taxReport) {
55088
+ const blocks = taxReport.Blocks;
55089
+ for (const block of blocks) {
55090
+ this.addBlock(block);
55091
+ }
55092
+ }
55093
+ afterGeneration(taxReport) {
55094
+ }
55095
+ beforeBlockGeneration(block) {
55096
+ }
55097
+ blockGeneration(block) {
55098
+ for (const register of block.registers) {
55099
+ this.addRegister(register);
55100
+ }
55101
+ }
55102
+ beforeRegisterGeneration(register) {
55103
+ }
55104
+ registerGeneration(register) {
55105
+ this._options.registerGenerator.generate(register);
55106
+ for (const child of register.getChildren()) {
55107
+ this.addRegister(child);
55108
+ }
55109
+ }
55110
+ afterRegisterGeneration(register) {
55111
+ }
55112
+ afterBlockGeneration(block) {
55113
+ }
55114
+ addBlock(block) {
55115
+ this.beforeBlockGeneration(block);
55116
+ this.blockGeneration(block);
55117
+ this.afterBlockGeneration(block);
55118
+ }
55119
+ addRegister(register) {
55120
+ this.beforeRegisterGeneration(register);
55121
+ this.registerGeneration(register);
55122
+ this.afterRegisterGeneration(register);
55123
+ }
55124
+ generateFile(taxReport) {
55125
+ this.beforeGeneration(taxReport);
55126
+ this.generation(taxReport);
55127
+ this.afterGeneration(taxReport);
55128
+ this._options.registerGenerator.save();
55129
+ }
55130
+ };
55057
55131
  // Annotate the CommonJS export names for ESM import in node:
55058
55132
  0 && (module.exports = {
55059
55133
  Addition,
@@ -55109,6 +55183,7 @@ var MongoRepository = class {
55109
55183
  Register,
55110
55184
  RevenueTypeEnum,
55111
55185
  ServiceCodeEnum,
55186
+ SimpleReportGenerator,
55112
55187
  StateRegistrationIndicatorEnum,
55113
55188
  StatusDocumentEnum,
55114
55189
  StringArrayOutput,