Skip to content

feat: keep statement documents as the bank sent them - #44

Open
agiledivider wants to merge 2 commits into
robocode13:mainfrom
agiledivider:feat/raw-statement-documents
Open

agiledivider wants to merge 2 commits into
robocode13:mainfrom
agiledivider:feat/raw-statement-documents

Conversation

@agiledivider

Copy link
Copy Markdown

StatementResponse.rawDocuments holds the CAMT documents (one per booking day) or the MT940 stream exactly as the bank sent them, so callers can run their own parser, e.g. to treat downloaded and uploaded statements alike.

All CAMT documents are decoded before parsing, so they are all present even when the built-in parser fails on one.

Tests: src/tests/rawStatementDocuments.test.ts. Existing tests and the build (tsc, Biome) pass.

StatementResponse.rawDocuments holds the CAMT documents (one per booking
day) or the MT940 stream exactly as the bank sent them, so callers can
run their own parser, e.g. to treat downloaded and uploaded statements
alike. All CAMT documents are decoded before parsing, so they are all
there even when the built-in parser fails on one.
@agiledivider agiledivider changed the title Keep statement documents as the bank sent them feat: keep statement documents as the bank sent them Nov 14, 2026
@fl034

fl034 commented Nov 17, 2026

Copy link
Copy Markdown

+1 for exposing the raw statements. We fetch camt.052 daily for bookkeeping and keep the bank's answer as the retained original (German GoBD), and currently do that with a local patch.

One request for whichever of #44 / #48 lands: please also expose the documents as bytes, before the latin1 → UTF-8 decoding (or the latin1 string, which maps 1:1 to bytes). The decoded string is enough for parsing, but it is not byte-exact for archiving: invalid UTF-8 turns into U+FFFD, and a hash over the re-encoded text can differ from the one over what the bank sent. Something like bytes: Uint8Array next to content would cover both uses.

#44 and #48 overlap; it might help to settle on one shape (#44 also covers MT940).

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.

2 participants