fix: align schema 15 settlement tests and integer validation

This commit is contained in:
2026-10-17 15:58:28 +09:00
parent 38a854d525
commit a97548c36b
8 changed files with 76 additions and 144 deletions
@@ -25,7 +25,7 @@ def create_ledger_account(name: str, type: str = "bank", institution: str = "",
if last_balance is not None:
try:
from .account_valuation_service import _strict_int
last_balance = _strict_int(last_balance, "last_balance", allow_none=False)
last_balance = _strict_int(last_balance, "last_balance")
except (ValueError, TypeError) as e:
return fail("validation_error", str(e))
with db(db_path) as conn:
@@ -49,7 +49,7 @@ def update_ledger_account(account_id: str, db_path: str | None = None, **fields:
if balance_update:
try:
from .account_valuation_service import _strict_int
normalized_balance = _strict_int(fields["last_balance"], "last_balance", allow_none=False)
normalized_balance = _strict_int(fields["last_balance"], "last_balance")
except (ValueError, TypeError) as e:
return fail("validation_error", str(e))
normalized_basis = None