Skip to content

fix(import): reconcile unit price when CSV amount disagrees with qty*price#768

Merged
afadil merged 1 commit intomainfrom
feature/modest-rosalind
Mar 19, 2026
Merged

fix(import): reconcile unit price when CSV amount disagrees with qty*price#768
afadil merged 1 commit intomainfrom
feature/modest-rosalind

Conversation

@afadil
Copy link
Owner

@afadil afadil commented Mar 19, 2026

Changes

  • Added logic to detect and reconcile unit price discrepancies in BUY/SELL activities
  • When computed amount (qty × price) exceeds CSV amount by >2%, trust the CSV amount as authoritative
  • Recalculate unit price as csvAmount / quantity to handle bonds and securities priced as percentage-of-par
  • Added comprehensive test coverage for reconciliation scenarios

Context

Brokers may report prices in different conventions (e.g., bonds as percentage-of-par vs. absolute value). This change ensures accurate price calculation by using the CSV amount as the source of truth when a significant mismatch is detected.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…price

Brokers report bond prices as percentage-of-par (e.g. 97.05) but the app
needs fraction-of-par (0.9705). When the computed amount (qty*price)
significantly exceeds the CSV-provided amount (>2% ratio), trust the CSV
amount and derive the correct unit price from it.

Closes #755
@afadil afadil force-pushed the feature/modest-rosalind branch from f8aeb45 to f6f8178 Compare March 19, 2026 17:38
@afadil afadil merged commit 84b476a into main Mar 19, 2026
1 of 2 checks passed
@afadil afadil deleted the feature/modest-rosalind branch March 19, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant