From 50cb852130986249cacec411e23392a8610e12f1 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 5 Jul 2026 19:17:04 +0200 Subject: feat(budget): tx edit --budget and budget update (v0.5.0) Add two deferred budget follow-ups: - tx edit --budget: re-assign a budget on an existing transaction, mirroring the existing tx add --budget flag (name/id resolved, hard error on miss). Resolves the ISSUES.md backfill wish. - budget update: rename a budget and/or edit its auto-budget fields via PUT /budgets/{id}; only fields passed are sent, empty is a hard error. New command adds to the CLI surface without breaking callers, so this is a MINOR bump (0.4.1 -> 0.5.0). Docs (README, SKILL.md), completion, and TODO synced. The tx add --budget-id item stays open (still YAGNI). Co-Authored-By: Claude Opus 4.8 --- firefly_cli/commands/transaction.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'firefly_cli/commands/transaction.py') diff --git a/firefly_cli/commands/transaction.py b/firefly_cli/commands/transaction.py index 9f8e130..1772d87 100644 --- a/firefly_cli/commands/transaction.py +++ b/firefly_cli/commands/transaction.py @@ -109,6 +109,8 @@ def _edit_args(p): p.add_argument("--to", dest="dest", default=None, help="destination account") p.add_argument("--category", default=None) p.add_argument("--tags", default=None, help="comma-separated") + p.add_argument("--budget", default=None, + help="budget name or id to (re)assign (must already exist)") p.add_argument("--type", default=None, help="withdrawal|deposit|transfer") # ponytail: single-split journals only; multi-split edits need transaction_journal_id per row. @@ -129,6 +131,9 @@ def cmd_edit(args, ctx): split["category_name"] = args.category if args.tags is not None: split["tags"] = [t.strip() for t in args.tags.split(",") if t.strip()] + if args.budget is not None: + # Budgets must pre-exist; resolve name/id -> id (hard error on miss). + split["budget_id"] = ctx.resolver.budget(args.budget)["id"] if args.type is not None: split["type"] = args.type if not split: -- cgit v1.2.3