Repository navigation
feat: keep statement documents as the bank sent them - #44
Open
agiledivider wants to merge 2 commits into
Open
agiledivider wants to merge 2 commits into
agiledivider wants to merge 2 commits into
Conversation
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.
|
+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 #44 and #48 overlap; it might help to settle on one shape (#44 also covers MT940). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StatementResponse.rawDocumentsholds 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.