fava_client.add_account: accept target_file + infer routing from account name #28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Companion to
aiolabs/server-deployledger split. With per-purpose files (accounts/chart.beancountfor static + admin-mutable,accounts/users.beancountfor runtime user opens), libra'sadd_accountmust route itsPUT /api/sourcewrite to the correct file rather than hardcoding the fava-reported root./api/add_entriesdoesn't support Open directives (seefava_client.py:1495docstring), so the routing has to happen in libra; fava's account-regexinsert_entrymechanism only applies to Transactions.Work
fava_client.py:1484— addtarget_file: Optional[str] = Nonetoadd_account_infer_target_file(account_name)helper:target_fileonce before the retry loopGET /api/optionscall (lines 1543–1547) — no longer neededfile_pathat lines 1554 (GET param) and 1602 (PUT payload) withtarget_filetarget_fileas optionalcrud.py:253caller (per-user signup) routes correctly via the inferred defaultviews_api.py:2786, 2902still work — they readmeta["filename"]which Beancount preserves across includes. If fava returns relative paths, no change needed; if absolute, possibly normalise.Acceptance
_infer_target_filecoversAssets:Receivable:User-abc12345(→ users),Liabilities:Payable:User-deadbeef(→ users),Equity:MemberEquity:User-12345678(→ users),Expenses:Other(→ chart),Assets:Bitcoin:Lightning(→ chart)openinaccounts/users.beancount; admin-created chart account lands inaccounts/chart.beancount!-flagged entry →transactions.beancountedited in place,*flag visiblePlan reference:
~/.claude/plans/elegant-bubbling-frog.mdsections B.1 + B.2 + B.4.