Repository navigation
Conversation
Adds an optional rawCamt?: string[] to StatementResponse with the CAMT documents as received (after latin1->UTF-8 decoding), across all HICAZ segments. Assigned before parsing so the documents survive a parser failure. Gives callers access to fields not mapped to Transaction, e.g. return information (RtrInf) of returned SEPA direct debits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
+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.
getAccountStatements()parses CAMT intoStatement/Transaction, which covers the common fields. Some CAMT data has no place inTransaction, though, and callers currently have no way to reach it. One example is the return information of a returned SEPA direct debit (TxDtls/RtrInf/Rsn/Cd, e.g.MS03,AC04). Another is bank-specific remittance tags such asOAMT+…/COAM+…/CHGS+….This PR adds an optional
rawCamt?: string[]toStatementResponse:Tests (in
partedResponse.test.ts):Checked locally:
vitest run(179/179),tsc --noEmit,biome check.🤖 Generated with Claude Code