feat(sp28): claimAcks slice + useTailStream/useMergedTail dispatch

This commit is contained in:
Nora
2026-07-02 11:31:17 -06:00
parent a97f1d1350
commit c54b2c1867
8 changed files with 326 additions and 6 deletions
+16
View File
@@ -20,6 +20,9 @@
// - SP25: the `id` type is widened to `string | number` because `Ack`
// and `Ta1Ack` use numeric database ids while `Claim` / `Remittance`
// use string ids. Dedup normalizes via `String(...)`.
// - SP28: `ClaimAck` adds another numeric-id slice (`claimAcks` /
// `claimAckOrder`). Same dedup normalization applies — `String(id)`
// keeps the symmetric comparison the hook has always used.
// ---------------------------------------------------------------------------
import { useTailStore } from "@/store/tail-store";
@@ -78,6 +81,19 @@ export function useMergedTail<T extends { id: string | number }>(
}
return out;
}
// SP28: the claim↔ack link slice. Same keyed-by-id shape as
// acks/ta1_acks (numeric id from the `claim_acks` table), so the
// dispatch is symmetric — the page-specific filter (e.g.
// `link.claimId === claimId`) is applied AFTER dedup so the
// base list's rows aren't accidentally dropped.
case "claim-acks": {
const out: unknown[] = [];
for (const id of s.claimAckOrder) {
const v = s.claimAcks[String(id)];
if (v !== undefined) out.push(v);
}
return out;
}
}
});