Export-To-Ghostfolio icon indicating copy to clipboard operation
Export-To-Ghostfolio copied to clipboard

Add Disnat converter

Open dickwolff opened this issue 2 months ago โ€ข 3 comments

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

dickwolff avatar Nov 08 '25 09:11 dickwolff

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., -C to .TO for 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.

โค๏ธ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Nov 08 '25 09:11 coderabbitai[bot]

Code Coverage

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 โœ”

github-actions[bot] avatar Nov 08 '25 09:11 github-actions[bot]

Quality Gate Failed Quality Gate failed

Failed conditions
7.0% Duplication on New Code (required โ‰ค 3%)

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Nov 08 '25 09:11 sonarqubecloud[bot]