Add Disnat converter
Added
- โจ New converter: Disnat
Checklist
- [ ] Added relevant changes to README (if applicable)
- [x] Added relevant test(s)
- [x] Updated the GitVersion file (if not done automatically)
Related issue (if applicable)
Fixes #260
Walkthrough
This PR adds support for the Canadian Disnat broker by introducing a new converter that parses CSV exports and normalizes them to Ghostfolio format. The implementation includes: a version bump to 0.32.0, README documentation update reflecting 25 supported brokers, a new DisnatRecord data model for transaction representation, the DisnatConverter class integrating into the converter factory, and comprehensive test coverage validating CSV parsing, transaction normalization, and error handling.
Estimated code review effort
๐ฏ 4 (Complex) | โฑ๏ธ ~50 minutes
- src/converters/disnatConverter.ts โ Dense logic with multiple transformation steps: French number format conversion (comma decimals to floats), transaction type normalization to Ghostfolio equivalents, currency code normalization (CAN โ CAD), security resolution with symbol adjustments (e.g.,
-Cto.TOfor Canadian stocks), and record filtering logic. Requires careful validation of each transformation step. - src/converters/disnatConverter.test.ts โ Comprehensive test suite with mocks and multiple error scenarios; verify test assumptions align with actual converter behavior, especially for edge cases like empty files, mismatched headers, and missing security matches.
- src/converter.ts โ Integration points in createConverter and createAndRunConverter factory methods; ensure DisnatConverter is correctly instantiated and invoked consistently with other converters.
- Date parsing and optional field handling โ The parseDate private method and handling of dash (
-) and empty entries as null/defaults require careful review to ensure data integrity.
Possibly related PRs
- dickwolff/Export-To-Ghostfolio#248 โ Adds InvestEngine broker converter with identical code paths modified (createConverter/createAndRunConverter in src/converter.ts, README, and GitVersion.yml), providing a reference pattern for broker converter implementation.
Pre-merge checks and finishing touches
โ Failed checks (1 warning, 2 inconclusive)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | โ ๏ธ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
| Description check | โ Inconclusive | The PR description addresses the main requirements but has a minor gap: the README checkbox is unchecked while the summary indicates README was updated to reflect increased broker count. | Clarify whether README changes were intentionally deferred or if the checkbox should be checked to match the actual changes made to README.md. |
| Out of Scope Changes check | โ Inconclusive | All changes are properly scoped to implementing the Disnat converter. However, README updates for the new broker appear inconsistently documented in the PR description. | Verify whether README.md updates (broker count and Disnat entry) were intentionally included or represent scope creep, and update the description checklist accordingly. |
โ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | โ Passed | The title 'Add Disnat converter' clearly and specifically identifies the main change: adding support for a new Disnat converter, which is the primary objective of this PR. |
| Linked Issues check | โ Passed | The implementation successfully adds Disnat converter support handling CSV parsing, transaction type normalization, French number formatting, currency conversion, security resolution, and filtering of ignored records as required by issue #260. |
โจ Finishing touches
- [ ] ๐ Generate docstrings
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
feat/add-disnat-converter
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
| Package | Line Rate | Branch Rate | Complexity | Health |
|---|---|---|---|---|
| src | 99% | 97% | 0 | โ |
| src.converters | 98% | 92% | 0 | โ |
| src.helpers | 100% | 100% | 0 | โ |
| Summary | 98% (2089 / 2138) | 92% (1353 / 1471) | 0 | โ |
