feat(sp28): claimAcks slice + useTailStream/useMergedTail dispatch
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user