ENGINEERING NOTE 45 / 50 · CARD
Choose stable keys for card CSV reconciliation
Row order, merchant name and formatted amount are weak matching keys. Use stable transaction references and explicit lifecycle relationships whenever available.
Published by OPEN RAMBO. The engineering patterns and pseudocode illustrate designs, not a documented product API. Numerical examples are illustrative.
Normalize before matching
Parse timestamps with their timezone and amounts with their currency precision. Keep original text alongside normalized values in the processing workspace when needed for debugging. Never strip meaningful leading zeros from identifiers by importing them as numbers.
Use a hierarchy of evidence
Exact processor references should outrank fuzzy merchant-date matching. Ambiguous matches enter a review queue. Two same-value purchases on the same day are a normal case, not an excuse to merge rows.
Make reruns deterministic
Deduplicate imports with file identity and transaction-event keys. A repeated file should not create new ledger entries. Save a reconciliation summary showing matched, unmatched and ambiguous counts plus total amounts by currency.
Illustrative implementation
match_key = (processor_reference, event_type, currency)
# Ambiguous fallbacks require review, never automatic merging.Acceptance check
Import the same file twice and shuffle its rows. Matched counts and financial totals must remain unchanged.