Drop counterparty, the generic parsers and .money/
counterparty was a structured field only nlb could fill honestly. revolut and traderepublic invented one by running an IBAN-shaped regex over the description they had just built, and the two spellings disagreed -- SI56 1234 5678 9012 345 against SI56123456789012345 -- so a literal rule pattern that worked on one account silently matched nothing on another. It is gone from the model, the index, the rule keys, ls --wide and the rules screen. nlb now appends its IBAN column to the end of the description, where the other two already keep theirs, so match = "*SI56*" works everywhere. That changes those descriptions and with them their fingerprints, so a statement overlapping an already-imported period will re-add rather than dedupe those rows until the index is rebuilt. An index built by an older binary drops the column when it is opened. The index itself moves from .money/index.db up to index.db beside rules.toml. Nothing looks in the old location, so an existing one has to be moved by hand -- otherwise the tool quietly starts a fresh index and the manual tags in the old file, the only thing statements cannot reproduce, stay behind in it. The csv and cmd parsers are gone along with the [csv] and [cmd] config they carried. cmd shelled out to the Python extractors, which were ported to Go and deleted, so it bridged to nothing; csv was a generic column-mapped fallback that no account used, and between them they were the largest configuration surface in the tool. A bank is now described in Go, where it can be tested. The importer tests register their own three-column parser rather than borrow a bank's, so they stay about the directory walk, dedupe and per-file error reporting. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ cmd/money/main.go subcommands; the TUI is the default
|
||||
internal/config rules.toml, account.toml, XDG config, data-root resolution
|
||||
internal/model Account, Transaction, amount formatting, description normalisation
|
||||
internal/glob the `*` / `?` matcher used by rules (linear time, no backtracking)
|
||||
internal/parser Parser interface + registry; csv, cmd, nlb, revolut, traderepublic
|
||||
internal/parser Parser interface + registry; nlb, revolut, traderepublic
|
||||
internal/store SQLite index (modernc.org/sqlite, no cgo)
|
||||
internal/importer directory walk, dedupe, balance checks
|
||||
internal/rules applies ordered rules to rule_* columns only
|
||||
@@ -32,8 +32,8 @@ any time, and it is the first thing to preserve when touching the schema or the
|
||||
rules engine. Covered by `TestManualTagSurvivesRetag`.
|
||||
|
||||
**Statements are the source of truth; the index is disposable.** Deleting
|
||||
`.money/index.db` and re-importing must reproduce everything except manual tags
|
||||
and manual transfer marks.
|
||||
`index.db` at the root of the data directory and re-importing must reproduce
|
||||
everything except manual tags and manual transfer marks.
|
||||
|
||||
**Dedupe is by fingerprint**: `sha256(date | amount | normalised description |
|
||||
ordinal)`, where the ordinal distinguishes identical lines *within one
|
||||
@@ -46,7 +46,7 @@ milliseconds. That is the checksum skip working, not a failure.
|
||||
conversion, and totals are never summed across currencies.
|
||||
|
||||
**First matching rule wins**, so transfer rules belong above general tag rules.
|
||||
A rule setting several of `match` / `counterparty` / `type` requires all of them.
|
||||
A rule setting both `match` and `type` requires both of them.
|
||||
`config.AppendRule` therefore appends — never prepends — so saving from the
|
||||
rule builder cannot shadow a rule the user wrote by hand.
|
||||
|
||||
@@ -100,6 +100,15 @@ compresses runs of spaces, so columns shift with font and page size — derive
|
||||
positions from the header line (`traderepublic`) or from the line being parsed
|
||||
(`nlb`).
|
||||
|
||||
**The other side's account number belongs in the description, not in a field
|
||||
of its own.** There used to be a `Counterparty` field; only `nlb` could fill it
|
||||
honestly, `revolut` and `traderepublic` invented it with an IBAN-shaped regex
|
||||
over the description, and the two disagreed on spacing, so one rule pattern
|
||||
could not serve both. Now `nlb` appends its IBAN column to the end of the
|
||||
description — at the end, and not in the position it held on the page, so an
|
||||
IBAN wrapped across continuation lines stays contiguous for a glob to match.
|
||||
A new parser must do the same rather than reintroduce a structured field.
|
||||
|
||||
## Verifying
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user