test(api)+docs: assert matchedRemittance=null; fail-loud on fixture drift; tighten docstring

This commit is contained in:
Tyler
2026-06-20 09:56:24 -06:00
parent 129599f0f4
commit 14d61f82b8
2 changed files with 23 additions and 14 deletions
+8 -12
View File
@@ -714,20 +714,16 @@ def list_claims(
@app.get("/api/claims/{claim_id}")
def get_claim_detail_endpoint(claim_id: str) -> dict:
"""Return one claim with full drawer context.
"""Return one claim with full drawer context (SP4).
SP4 detail-drawer endpoint. The body is the spec-shaped dict
produced by :meth:`CycloneStore.get_claim_detail` — header, state,
service lines, diagnoses, parties, validation, raw segments,
``stateHistory`` (most-recent-first, capped at 50), and a
populated ``matchedRemittance`` block if the claim is paired.
Body shape is produced by :meth:`CycloneStore.get_claim_detail`:
header, state, service lines, diagnoses, parties, validation,
raw segments, ``stateHistory`` (most-recent-first, capped at 50),
and a populated ``matchedRemittance`` block when paired.
Path param is ``claim_id`` (not ``id``) to avoid shadowing
FastAPI's internal ``id`` name and to keep OpenAPI docs self-
describing (matches the ``/api/acks/{ack_id}`` convention from
SP3). Returns 404 when the claim is missing — never 500 — so the
UI can distinguish "claim doesn't exist" from a transient fetch
failure.
Path param is ``claim_id`` (matches the SP3 ``/api/acks/{ack_id}``
convention). Returns 404 — never 500 — on a missing claim so the
UI can distinguish "doesn't exist" from a transient fetch error.
"""
body = store.get_claim_detail(claim_id)
if body is None: