UNPKG

@accounter/shaam-uniform-format-generator

Version:

Fully typed application that generates, parses, and validates SHAAM uniform format tax reports (INI.TXT and BKMVDATA.TXT).

230 lines (187 loc) 13.8 kB
# @accounter/shaam-uniform-format-generator ## 0.2.6 ### Patch Changes - [#3440](https://github.com/Urigo/accounter-fullstack/pull/3440) [`1ad8a10`](https://github.com/Urigo/accounter-fullstack/commit/1ad8a10f3dd92b38c04ccea15b90cc7f9dc43887) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.4.2` ↗︎](https://www.npmjs.com/package/zod/v/4.4.2) (from `4.3.6`, in `dependencies`) - [#3454](https://github.com/Urigo/accounter-fullstack/pull/3454) [`0b654ef`](https://github.com/Urigo/accounter-fullstack/commit/0b654ef08495e1632ccc75942d6a1a3142924d9f) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.4.3` ↗︎](https://www.npmjs.com/package/zod/v/4.4.3) (from `4.4.2`, in `dependencies`) - [#3599](https://github.com/Urigo/accounter-fullstack/pull/3599) [`4405b3a`](https://github.com/Urigo/accounter-fullstack/commit/4405b3abf883827c5580131abdeba32552d82196) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Encoding Support**: Added `iconv-lite` to handle Windows-1255 encoding, ensuring correct processing of legacy SHAAM file formats. - [#3673](https://github.com/Urigo/accounter-fullstack/pull/3673) [`a1b5a9a`](https://github.com/Urigo/accounter-fullstack/commit/a1b5a9ad9ddfab18cc747e1f6c25d8b599aaf56a) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Data Parsing Refactoring**: Centralized the data file parsing logic into a dedicated `parseDataFile` utility, improving code modularity and maintainability. - **Type Safety Improvements**: Introduced `ParsedDataRecords` interface to standardize data record structures and removed redundant manual property mapping. - **Error Handling Enhancements**: Implemented robust error handling for date conversions and record parsing, including better reporting of line numbers and unknown record types. - **Validation Logic Updates**: Renamed validation functions to `performRecordsValidation` and `performCrossFileValidation` for better clarity and intent. ## 0.2.5 ### Patch Changes - [#2954](https://github.com/Urigo/accounter-fullstack/pull/2954) [`79fef66`](https://github.com/Urigo/accounter-fullstack/commit/79fef668ca7a7f2b2411ae5f5d4d0bdc5bb2fa2b) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.3.6` ↗︎](https://www.npmjs.com/package/zod/v/4.3.6) (from `4.3.5`, in `dependencies`) - [#3038](https://github.com/Urigo/accounter-fullstack/pull/3038) [`4d4e60d`](https://github.com/Urigo/accounter-fullstack/commit/4d4e60dd85f6c7779c556b513e2de844615dd293) Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Configurable NPM Registry in CI**: The GitHub Actions setup now includes a `registryUrl` input, allowing for flexible specification of the NPM registry during package publishing. - **Deterministic Dependency Installation**: The `yarn install` command in the CI workflow was updated to use `--frozen-lockfile`, ensuring consistent and reproducible builds by preventing modifications to the `yarn.lock` file. - **Standardized Package Metadata**: `package.json` files across several packages were updated to include comprehensive and consistent metadata, such as `description`, `repository` details, `homepage`, `bugs` URL, and `author` information. - **Explicit NPM Registry Configuration**: The `publishConfig` in multiple `package.json` files was modified to explicitly set the `registry` to `https://registry.npmjs.org`, clarifying the target for package publication. ## 0.2.4 ### Patch Changes - [#2816](https://github.com/Urigo/accounter-fullstack/pull/2816) [`6a9926c`](https://github.com/Urigo/accounter-fullstack/commit/6a9926c3948fa736e2c52ce93207b4f35e28f931) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`iconv-lite@0.7.1` ↗︎](https://www.npmjs.com/package/iconv-lite/v/0.7.1) (from `0.7.0`, in `dependencies`) - [#2824](https://github.com/Urigo/accounter-fullstack/pull/2824) [`ca5e62b`](https://github.com/Urigo/accounter-fullstack/commit/ca5e62b91faaf33c99ac178575304797150efe1a) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.2.0` ↗︎](https://www.npmjs.com/package/zod/v/4.2.0) (from `4.1.13`, in `dependencies`) - [#2829](https://github.com/Urigo/accounter-fullstack/pull/2829) [`73b11ba`](https://github.com/Urigo/accounter-fullstack/commit/73b11ba1fd676a21b4ba44fe99e2bfd181e513dc) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.2.1` ↗︎](https://www.npmjs.com/package/zod/v/4.2.1) (from `4.2.0`, in `dependencies`) - [#2873](https://github.com/Urigo/accounter-fullstack/pull/2873) [`eea8a89`](https://github.com/Urigo/accounter-fullstack/commit/eea8a89638a3893814fd9a341e0080922fc703a1) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.3.2` ↗︎](https://www.npmjs.com/package/zod/v/4.3.2) (from `4.2.1`, in `dependencies`) - [#2877](https://github.com/Urigo/accounter-fullstack/pull/2877) [`1c209c8`](https://github.com/Urigo/accounter-fullstack/commit/1c209c8a6045bef747039bbff3780812c6b8678f) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.3.4` ↗︎](https://www.npmjs.com/package/zod/v/4.3.4) (from `4.3.2`, in `dependencies`) - [#2881](https://github.com/Urigo/accounter-fullstack/pull/2881) [`bc3ab26`](https://github.com/Urigo/accounter-fullstack/commit/bc3ab260704b677363561ef1c9403eac704a29aa) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.3.5` ↗︎](https://www.npmjs.com/package/zod/v/4.3.5) (from `4.3.4`, in `dependencies`) - [#2904](https://github.com/Urigo/accounter-fullstack/pull/2904) [`17ae14f`](https://github.com/Urigo/accounter-fullstack/commit/17ae14f2482ad876e1adce23cdbc7cb173b88dfb) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`iconv-lite@0.7.2` ↗︎](https://www.npmjs.com/package/iconv-lite/v/0.7.2) (from `0.7.1`, in `dependencies`) ## 0.2.3 ### Patch Changes - [#2744](https://github.com/Urigo/accounter-fullstack/pull/2744) [`ef68321`](https://github.com/Urigo/accounter-fullstack/commit/ef68321608d60a7208e82a2c413f27beb502e3cc) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.13` ↗︎](https://www.npmjs.com/package/zod/v/4.1.13) (from `4.1.12`, in `dependencies`) ## 0.2.2 ### Patch Changes - [#2543](https://github.com/Urigo/accounter-fullstack/pull/2543) [`65e3c7f`](https://github.com/Urigo/accounter-fullstack/commit/65e3c7f01993eb4f41244a40feefefa08b31a4e6) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.12` ↗︎](https://www.npmjs.com/package/zod/v/4.1.12) (from `4.1.11`, in `dependencies`) ## 0.2.1 ### Patch Changes - [#2291](https://github.com/Urigo/accounter-fullstack/pull/2291) [`633a688`](https://github.com/Urigo/accounter-fullstack/commit/633a68824433dcd4df7be7e9c118ddadbf9a2029) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.0.17` ↗︎](https://www.npmjs.com/package/zod/v/4.0.17) (from `3.25.76`, in `dependencies`) - [#2446](https://github.com/Urigo/accounter-fullstack/pull/2446) [`c56e276`](https://github.com/Urigo/accounter-fullstack/commit/c56e276f6e2addab88cd9fcd11b68fbc15c6f41a) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`iconv-lite@0.7.0` ↗︎](https://www.npmjs.com/package/iconv-lite/v/0.7.0) (from `0.6.3`, in `dependencies`) - [#2456](https://github.com/Urigo/accounter-fullstack/pull/2456) [`3fe961a`](https://github.com/Urigo/accounter-fullstack/commit/3fe961a8338359ed544ce4de5730a1898fb1cc43) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.0` ↗︎](https://www.npmjs.com/package/zod/v/4.1.0) (from `4.0.17`, in `dependencies`) - [#2457](https://github.com/Urigo/accounter-fullstack/pull/2457) [`16b0040`](https://github.com/Urigo/accounter-fullstack/commit/16b0040862d1bf9d65eb9829e8eb33117d60a1c2) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.1` ↗︎](https://www.npmjs.com/package/zod/v/4.1.1) (from `4.1.0`, in `dependencies`) - [#2469](https://github.com/Urigo/accounter-fullstack/pull/2469) [`7176d0d`](https://github.com/Urigo/accounter-fullstack/commit/7176d0d3e1808cc1800e1cabe121b380f0480d63) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.3` ↗︎](https://www.npmjs.com/package/zod/v/4.1.3) (from `4.1.1`, in `dependencies`) - [#2478](https://github.com/Urigo/accounter-fullstack/pull/2478) [`86e628e`](https://github.com/Urigo/accounter-fullstack/commit/86e628e40cc0d8fac239cfea2563326094013df4) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.5` ↗︎](https://www.npmjs.com/package/zod/v/4.1.5) (from `4.1.3`, in `dependencies`) - [#2483](https://github.com/Urigo/accounter-fullstack/pull/2483) [`43760d7`](https://github.com/Urigo/accounter-fullstack/commit/43760d77cb29ea44257d37ca0bc7a97e17aa1c89) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.8` ↗︎](https://www.npmjs.com/package/zod/v/4.1.8) (from `4.1.5`, in `dependencies`) - [#2512](https://github.com/Urigo/accounter-fullstack/pull/2512) [`590823c`](https://github.com/Urigo/accounter-fullstack/commit/590823cf7105b018a3127abc2343ac714f2845ac) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.9` ↗︎](https://www.npmjs.com/package/zod/v/4.1.9) (from `4.1.8`, in `dependencies`) - [#2522](https://github.com/Urigo/accounter-fullstack/pull/2522) [`df6b635`](https://github.com/Urigo/accounter-fullstack/commit/df6b63558a951ae7a318515d1d8b86b1b49a74a0) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`zod@4.1.11` ↗︎](https://www.npmjs.com/package/zod/v/4.1.11) (from `4.1.9`, in `dependencies`) ## 0.2.0 ### Minor Changes - [#2314](https://github.com/Urigo/accounter-fullstack/pull/2314) [`88207b1`](https://github.com/Urigo/accounter-fullstack/commit/88207b1f3fbafbd67b67fe8edca6a576d42e25bd) Thanks [@gilgardosh](https://github.com/gilgardosh)! - Initial package ### Patch Changes - [#2321](https://github.com/Urigo/accounter-fullstack/pull/2321) [`9915dd2`](https://github.com/Urigo/accounter-fullstack/commit/9915dd2c0f7f78103320bc99dabd2de2384bbfbc) Thanks [@gilgardosh](https://github.com/gilgardosh)! - \* **New Integration Test Suite**: I've added a comprehensive integration test suite for validating the uniform format report generation process using real-world fixture files. - **Round-trip Validation**: I've implemented tests to perform a full round-trip: parsing existing `BKMVDATA.txt` and `ini.txt` fixtures, generating new reports from the parsed data, and then re-parsing the generated reports to ensure data integrity and consistency. - **Data Parsing and Generation Coverage**: The tests cover parsing and generation of various record types (A100, B100, B110, C100, D110, D120, M100, Z900 for `BKMVDATA.txt` and A000, A000Sum for `ini.txt`), ensuring broad coverage of the uniform format specification. - **Robustness Testing**: I've included tests for handling edge cases such as different line endings, whitespace, and gracefully skipping invalid or unknown record types during parsing, enhancing the robustness of the parsing logic. - **Monetary Precision Verification**: A test has been added to ensure that monetary values from B100 records are correctly parsed and can be part of the round-trip process, implying that precision is maintained throughout data transformation. - [#2322](https://github.com/Urigo/accounter-fullstack/pull/2322) [`408b287`](https://github.com/Urigo/accounter-fullstack/commit/408b287588f1753776cd98755383fc269d7410fb) Thanks [@gilgardosh](https://github.com/gilgardosh)! - \* **New Client-Side Feature**: I've added a new modal component (`FileDownloadModal`) to the client application, allowing users to select a date range and trigger the generation and download of uniform format files (bkmvdata and ini) directly from the UI. - **Data Model Extension**: The `JournalEntry` and `BusinessMetadata` schemas have been extended to support additional optional fields, such as `batchNumber`, `transactionType`, `referenceDocument`, `currencyCode`, `foreignCurrencyAmount` for journal entries, and `address` details for business metadata. This enriches the data available for reporting. - **Uniform Format Generator Enhancement**: The `generateUniformFormatReport` function in the generator package has been updated to consume and incorporate these new extended fields from the `JournalEntry` and `BusinessMetadata` into the generated uniform format files, ensuring more comprehensive reports. - **Testing**: New unit tests have been added to verify that the uniform format generator correctly handles journal entries with the newly introduced extended fields, ensuring data integrity and proper report generation.