Wire admin add-account endpoint into the UI #46
1 changed files with 5 additions and 1 deletions
fix(accounts): default CreateChartAccount.currencies to None
The UI omits currencies so the Open directive is written unconstrained, but the model defaulted currencies to ["EUR","SATS","USD"], so Pydantic refilled them and the endpoint passed the constraint through — every admin-created account got a currency-constrained Open (which would reject postings in other currencies, the same CAD/GBP/JPY bean-check class we hit on user accounts). Default to None so omission reaches add_account and the directive is unconstrained; an explicit list still works for API callers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
commit
7456574f65
|
|
@ -51,7 +51,11 @@ class CreateAccount(BaseModel):
|
||||||
class CreateChartAccount(BaseModel):
|
class CreateChartAccount(BaseModel):
|
||||||
"""Admin-created chart-of-accounts entry written to accounts/chart.beancount."""
|
"""Admin-created chart-of-accounts entry written to accounts/chart.beancount."""
|
||||||
name: str # Full hierarchical account name, e.g. "Expenses:Services:Domain"
|
name: str # Full hierarchical account name, e.g. "Expenses:Services:Domain"
|
||||||
currencies: list[str] = ["EUR", "SATS", "USD"]
|
# Optional currency constraint. Omitted by the UI: an Open directive needs
|
||||||
|
# no currency list, and constraining it would reject postings in other
|
||||||
|
# currencies (the CAD/GBP/JPY bean-check errors we saw on user accounts).
|
||||||
|
# None → unconstrained Open; a list → explicit constraint for API callers.
|
||||||
|
currencies: Optional[list[str]] = None
|
||||||
description: Optional[str] = None
|
description: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue