summaryrefslogtreecommitdiffstats
path: root/firefly_cli/resolver.py
AgeCommit message (Collapse)AuthorFilesLines
7 daysfeat(piggy): piggy list/add/remove (v0.6.0)HEADv0.6.0masterDanilo M.1-0/+8
New `piggy` group: - `piggy list` lists piggy banks with saved/target amounts and linked accounts. - `piggy add|remove <name|id> <amount> [--account NAME]` changes the saved amount on a linked account via PUT /piggy-banks/{id}. Firefly syncs the whole account list on that PUT, so every linked account is resent (others without current_amount, which keeps their value) or it would be unlinked. Removing below zero is rejected before any write, and the saved amount is read back so a refused add fails loudly instead of returning 200 unchanged. add/remove currently hit an upstream bug on Firefly III <= 6.7.9: PiggyBankFactory::linkToAccountIds passes the pivot current_amount (an int from the DB) to bcsub() uncast, so any PUT with "accounts" 500s (firefly-iii/firefly-iii#13063). Documented in SKILL.md/README; the live integration test skips on that error and runs once upstream is fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-07-03fix(budget): group help blurb, exact Decimal spent, resolver comment (v0.4.1)v0.4.1Danilo M.1-0/+4
Follow-ups from the v0.4.0 review: - add the missing _GROUP_HELP blurb for the budget group (every other group shows one) + a regression test asserting all groups have one. - _spent_scalar sums with decimal.Decimal instead of float (exact money). - note the numeric-name sniffing tradeoff in resolver.budget(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03feat(resolver): budget name/id resolutionDanilo M.1-0/+13
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02fix: register cmd_add handler correctly for tx add (v0.3.8)v0.3.8Danilo M.1-1/+4
v0.3.7 placed the @registry.command decorator above a helper (_resolve_side) inserted between the decorator and cmd_add, so the registry bound the helper as the "tx add" handler. Unit tests call cmd_add directly and missed it; live CLI dispatch failed with "_resolve_side() missing 2 required positional arguments". Move the helper above the decorator and add a regression test asserting the registered handler is cmd_add. Found by live smoke test against the test instance. Also note in resolver that Firefly returns 401 (not 404) for an unknown account id. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02feat: tx add --from-id/--to-id to disambiguate same-name accounts (v0.3.7)v0.3.7Danilo M.1-0/+6
ISSUES.md #2: two accounts can share a name (e.g. expense id 52 and revenue id 129 both "Nexi"), making --from/--to ambiguous and unresolvable. Add --from-id/--to-id to target an account by numeric id. Per side, exactly one of the name flag or the id flag; sides independent. The id path fetches the account (resolver.account_by_id), validating existence before writing. Name-only callers unchanged; JSON/exit unchanged, so PATCH. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30feat: name-to-id resolver with loud ambiguity errorsDanilo M.1-0/+35