Skip to content

fix(bank-tx): count bank account fee bookings in the monthly bank cost#4216

Merged
TaprootFreak merged 3 commits into
developfrom
fix/change-log-bank-account-fees
Jul 15, 2026
Merged

fix(bank-tx): count bank account fee bookings in the monthly bank cost#4216
TaprootFreak merged 3 commits into
developfrom
fix/change-log-bank-account-fees

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

Summary

getBankTxFee sums chargeAmountChf only — a field the statement import stopped populating with the bank migration in December 2025. The monthly minus.bank figure in the financial change log has read zero ever since, while the real bank costs arrive as dedicated BankAccountFee rows (several hundred EUR per day).

  • BankAccountFee rows since the month start aggregate per currency: debits count as cost, credits (fee refunds) net against them
  • each currency sum converts to CHF via the pricing service and adds to the legacy per-tx charge sum, so the caller contract (CHF number) is unchanged
  • a missing price throws instead of silently dropping the position
  • no DTO change needed — minus.bank already exists and re-appears with real values

Test plan

  • new unit tests: debit aggregation + CHF conversion, credit netting, legacy charge sum still included, missing price throws, no fee rows behaves as before
  • full jest run green, format:check / lint / type-check clean

@TaprootFreak

Copy link
Copy Markdown
Collaborator Author

Two review passes (conventions + correctness) until both tracks came back clean. The first pass surfaced one design issue worth noting: the new fail-loud price conversion ran inside the every-minute log job whose outer catch arms the safety mode - the change log now runs after the equity path in its own try/catch, so a reporting price failure logs and skips the minute's entry instead of arming the equity protection. Also: server-side aggregation with a new composite index on bank_tx (type, created), rounding, and per-currency non-unit price tests.

@TaprootFreak TaprootFreak marked this pull request as ready for review July 15, 2026 12:34
getBankTxFee summed chargeAmountChf only, a field the statement import
stopped populating with the bank migration in December 2025 - the monthly
bank cost has read zero ever since while the real fees arrive as dedicated
BankAccountFee rows. Those rows now aggregate per currency (debits as
cost, credits netted) and convert to CHF alongside the legacy per-tx
charge sum; a missing price throws instead of hiding the position.
…tion, rounding)

- the change log moved behind the equity path and runs in its own
  try/catch: a reporting price failure logs and skips the minute's changes
  entry instead of arming the equity safety mode and suppressing the
  financial data log
- bank account fee rows aggregate server-side (GROUP BY currency and
  indicator) with a new composite index on bank_tx (type, created) instead
  of hydrating full entities every minute
- the CHF total rounds like its sepa-parser sibling; conversion tests use
  distinct non-unit prices per currency so direction and mapping errors
  fail
@TaprootFreak TaprootFreak force-pushed the fix/change-log-bank-account-fees branch from b5b7c9c to 3bb4658 Compare July 15, 2026 13:43
…ruction

develop added BankTxFrickService to the constructor; the spec built the
service positionally and fell one argument short.
@github-actions

Copy link
Copy Markdown

❌ TypeScript: 1 errors

@TaprootFreak TaprootFreak merged commit 34120cd into develop Jul 15, 2026
8 checks passed
@TaprootFreak TaprootFreak deleted the fix/change-log-bank-account-fees branch July 15, 2026 14:09
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