fix(frontend): UnmatchedClaim/UnmatchedRemittance types match store.to_ui_claim_from_orm wire shape

The Reconciliation page crashed with 'c.chargeAmount.toFixed is undefined' because
the TS types declared fields the backend never emitted (chargeAmount vs billedAmount,
patientControlNumber vs patientName, statusCode vs status, totalPaid vs paidAmount).

- UnmatchedClaim: chargeAmount -> billedAmount, patientControlNumber -> patientName,
  payerId/serviceDate now optional (backend omits them)
- UnmatchedRemittance: statusCode -> status, totalPaid -> paidAmount,
  totalCharge/serviceDate/isReversal now optional
- Reconciliation page + test fixtures updated to use the wire shape
- Tests: 124/124 pass
This commit is contained in:
Tyler
2026-06-20 16:59:22 -06:00
parent b980e77cf2
commit f4a545f379
3 changed files with 37 additions and 19 deletions
+8 -7
View File
@@ -95,10 +95,10 @@ describe("ReconciliationPage", () => {
claims: [
{
id: "CLM-1",
patientControlNumber: "PCN-A",
serviceDate: "2026-06-01",
chargeAmount: 100,
patientName: "Patient A",
billedAmount: 100,
providerNpi: "1234567890",
serviceDate: "2026-06-01",
payerId: "P1",
state: "submitted",
},
@@ -107,12 +107,13 @@ describe("ReconciliationPage", () => {
{
id: "CLP-1:b1",
payerClaimControlNumber: "PCN-A",
statusCode: "1",
totalCharge: 100,
totalPaid: 100,
status: "received",
paidAmount: 100,
adjustmentAmount: 0,
serviceDate: "2026-06-01",
receivedDate: "2026-06-01",
isReversal: false,
totalCharge: 100,
serviceDate: "2026-06-01",
batchId: "b1",
},
],
+3 -3
View File
@@ -163,10 +163,10 @@ export function ReconciliationPage() {
>
<div className="display num text-sm">{c.id}</div>
<div className="font-mono text-xs text-muted-foreground">
{c.patientControlNumber}
{c.patientName}
</div>
<div className="text-xs text-muted-foreground mt-0.5">
{c.serviceDate ?? "—"} · ${c.chargeAmount.toFixed(2)} · NPI{" "}
{c.serviceDate ?? "—"} · ${c.billedAmount.toFixed(2)} · NPI{" "}
{c.providerNpi ?? "—"}
</div>
</button>
@@ -205,7 +205,7 @@ export function ReconciliationPage() {
) : null}
</div>
<div className="text-xs text-muted-foreground mt-0.5">
Status {r.statusCode} · ${r.totalPaid.toFixed(2)} paid · $
Status {r.status} · ${r.paidAmount.toFixed(2)} paid · $
{r.adjustmentAmount.toFixed(2)} adj
</div>
</button>