fix(ledger): split dividend response schema and harden decimal tests

Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-09 13:21:24 +00:00
committed by GitHub
co-authored by genichin
parent d3601d32dc
commit e261a41b7f
4 changed files with 120 additions and 37 deletions
+6 -3
View File
@@ -981,9 +981,12 @@ def test_unified_ledger_openapi_contains_nullable_amount() -> None:
response = client.get("/openapi.json")
assert response.status_code == 200
schemas = response.json()["components"]["schemas"]
assert "amount" in schemas["LedgerHistoryItem"]["properties"]
amount_schema = schemas["ManualLedgerResponse"]["properties"]["amount"]
assert any(option.get("type") == "number" for option in amount_schema.get("anyOf", []))
manual_amount_types = {option.get("type") for option in schemas["ManualLedgerResponse"]["properties"]["amount"]["anyOf"]}
assert manual_amount_types == {"number", "null"}
assert schemas["DividendManualLedgerResponse"]["properties"]["amount"]["type"] == "string"
history_amount_types = {option.get("type") for option in schemas["LedgerHistoryItem"]["properties"]["amount"]["anyOf"]}
assert history_amount_types == {"number", "null"}
assert schemas["DividendLedgerHistoryItem"]["properties"]["amount"]["type"] == "string"
def test_reversal_rejects_fee_tax_and_missing_target() -> None: