Remove the transfer flag
A transfer was a second verdict carried alongside the tag: a boolean set by transfer = true in a rule or by x in the TUI, kept in its own pair of rule_ and manual_ columns, whose one real effect was to hold the row out of the report. The rest of it was display -- a T column in the transaction list, in the rules screen and in money ls. Money moved between your own accounts is now tagged like anything else and counts like anything else. The leg leaving checking is an outflow and the leg arriving in savings is an inflow, so a report over the whole data root roughly nets out while one scoped to a single account or month does not. That is the price of one verdict per transaction instead of two. A rule now needs a tag, and one that set only transfer = true is refused by number on load. A leftover transfer key beside a tag is ignored, as unknown TOML keys always were, and an index built by an older binary drops both columns when it is opened. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -181,7 +181,7 @@ func TestAppendRuleRejectsIncomplete(t *testing.T) {
|
||||
// Globs and tags containing quotes must survive the round trip.
|
||||
func TestAppendRuleQuotesValues(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
if err := AppendRule(root, Rule{Match: `*"ODD" PAYEE*`, Tag: "misc", Transfer: true}); err != nil {
|
||||
if err := AppendRule(root, Rule{Match: `*"ODD" PAYEE*`, Tag: "misc"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
loaded, err := LoadRules(root)
|
||||
@@ -191,9 +191,6 @@ func TestAppendRuleQuotesValues(t *testing.T) {
|
||||
if loaded.Rule[0].Match != `*"ODD" PAYEE*` {
|
||||
t.Errorf("match = %q, want the quotes preserved", loaded.Rule[0].Match)
|
||||
}
|
||||
if !loaded.Rule[0].Transfer {
|
||||
t.Error("transfer flag was not written")
|
||||
}
|
||||
}
|
||||
|
||||
// A note is documentation carried with the rule. It is a key rather than a
|
||||
@@ -267,9 +264,8 @@ tag = "salary"
|
||||
|
||||
# Moving money to myself.
|
||||
[[rule]]
|
||||
match = "*TO SAVINGS*"
|
||||
transfer = true
|
||||
tag = "transfer"
|
||||
match = "*TO SAVINGS*"
|
||||
tag = "transfer"
|
||||
`
|
||||
|
||||
// Deleting must edit the file textually: a user's comments and layout are not
|
||||
|
||||
Reference in New Issue
Block a user