How orochasamuel/fiscalbr-net works
Main Components
• Core Library (FiscalBr.Common):
• Acts as the heart of the system.
• Contains shared classes, constants, enums, helper methods, attributes, and value objects that are inherited and used by the specialized libraries.
• Specialized Libraries/Modules:
• FiscalBr.Dimob: Manages DIMOB-related file headers and records.
• FiscalBr.ECF: Contains implementations for various “blocos” (sections) of the ECF (Escrituração Contábil Fiscal).
• FiscalBr.EFDContribuicoes: Handles the EFD Contribuições (formerly SPED Pis/Cofins).
• FiscalBr.EFDFiscal: Implements the structure for the EFD Fiscal, including many filing blocks.
• FiscalBr.Sintegra: Deals with Sintegra file formats.
• Test Suite:
• Located under the ‘tests’ folder, it ensures that each module and its interactions function as expected.
Relationships and Interactions
• The specialized libraries directly depend on and extend the core functionalities provided by FiscalBr.Common.
• Each fiscal module (Dimob, ECF, EFDContribuicoes, EFDFiscal, Sintegra) encapsulates its logic for generating file-specific records.
• The tests validate these modules by simulating the generation of files and verifying the outputs and error handling.
Important Architectural Patterns and Design Principles
• Layered Architecture:
• Base layer: FiscalBr.Common (domain definitions, common entities and base methods).
• Application layers: Each specialized fiscal module implements its own logic using the base layer.
• A separate testing layer validates each module.
• Use of Attributes and Interfaces:
• There are numerous attribute classes (for example, SpedCamposAttribute, DimobCamposAttribute) and interfaces (in the Sped folder) to enforce consistency in how records are created and written, ensuring loose coupling and extensibility.
• Separation of Concerns:
• Each project (or NuGet package) focuses on a specific domain of fiscal output, easing maintenance and independent versioning.
Relevant Technologies, Frameworks, or Libraries
• .NET platform (the solution is built in .NET, indicated by .csproj and solution files).
• NuGet: For packaging and distributing each library module.
• GitHub Actions/Workflows: For CI/CD (build-and-test, release-to-nuget), as seen in the .github folder.
• Unit testing frameworks integrated within the ‘tests’ directory.