feat(sp7): claim detail includes lineReconciliation slim projection
This commit is contained in:
@@ -211,4 +211,26 @@ def test_get_claim_detail_matched_remit_inlines_summary(seeded_store_with_pair):
|
||||
assert mr["status"] in {"received", "reconciled"}
|
||||
# ISO timestamp must end in Z — the spec contract that lets the
|
||||
# UI render the time without a tz suffix shim.
|
||||
assert mr["receivedAt"].endswith("Z"), mr["receivedAt"]
|
||||
assert mr["receivedAt"].endswith("Z"), mr["receivedAt"]
|
||||
|
||||
|
||||
def test_get_claim_detail_includes_line_reconciliation_slim_projection(seeded_store):
|
||||
"""SP7 §5.2: claim detail exposes a `lineReconciliation` slim list
|
||||
parallel to `serviceLines`, indexed by line number. The values are
|
||||
strings (Decimals serialized) or nulls when the line is unmatched."""
|
||||
cid = seeded_store.get("/api/claims", headers=JSON).json()["items"][0]["id"]
|
||||
resp = seeded_store.get(f"/api/claims/{cid}")
|
||||
assert resp.status_code == 200, resp.text
|
||||
body = resp.json()
|
||||
assert "lineReconciliation" in body
|
||||
lr_list = body["lineReconciliation"]
|
||||
assert isinstance(lr_list, list)
|
||||
# No 835 was ingested in this fixture, so every line is unmatched
|
||||
# on the 835 side — the default for an unpaired claim.
|
||||
for row in lr_list:
|
||||
assert "lineNumber" in row
|
||||
assert "status" in row
|
||||
assert "paid" in row
|
||||
assert "adjustmentsSum" in row
|
||||
# One entry per service line.
|
||||
assert len(lr_list) == len(body["serviceLines"])
|
||||
Reference in New Issue
Block a user