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
+26 -9
View File
@@ -366,26 +366,43 @@ export interface Match {
is_reversal: boolean;
}
// Mirrors `cyclone.store.to_ui_claim_from_orm` (backend/src/cyclone/store.py).
// Fields the backend does not currently emit are optional so the type
// matches the actual wire shape (was previously assumed but never true).
export interface UnmatchedClaim {
id: string;
patientControlNumber: string;
serviceDate: string | null;
chargeAmount: number;
patientName: string;
billedAmount: number;
providerNpi: string | null;
payerId: string | null;
payerName?: string;
payerId?: string | null;
serviceDate?: string | null;
cptCode?: string;
submissionDate?: string;
state: ClaimState;
}
// Mirrors `cyclone.store.list_unmatched` (backend/src/cyclone/store.py) for
// the remittances payload. `status` is the 3-state remittance lifecycle
// ("received" | "posted" | "reconciled"); the previous `statusCode` field
// was a confusion with the 835 claim-status code and never existed on the
// wire. Fields the backend omits are optional.
export interface UnmatchedRemittance {
id: string;
payerClaimControlNumber: string;
statusCode: string;
totalCharge: number;
totalPaid: number;
payerName?: string;
status: string;
paidAmount: number;
adjustmentAmount: number;
serviceDate: string | null;
isReversal: boolean;
batchId: string;
receivedDate?: string;
parsedAt?: string;
claimId?: string;
denialReason?: string | null;
validationWarnings?: string[];
isReversal?: boolean;
totalCharge?: number;
serviceDate?: string | null;
}
export interface UnmatchedResponse {