-- version: 10
-- SP14: Payer-Rejected lane acknowledge
-- When the operator reviews a payer-rejected claim, they hit the
-- "Acknowledge" bulk action. We mark the claim with the timestamp so
-- the lane query can filter it out (it stays in the DB for audit but
-- doesn't show up in the operator's working surface).
--
-- Why a separate column instead of clearing payer_rejected_at:
--   * Audit trail: SP11's hash-chained audit_log needs the *original*
--     rejection event intact. Clearing the timestamp would erase the
--     evidence of the payer saying "no" — exactly what auditors want
--     to see.
--   * Reconciliation: future SPs that match payer-rejected claims
--     against appeals (e.g. SP17) can still see the original status
--     code and reason.

ALTER TABLE claims ADD COLUMN payer_rejected_acknowledged_at TEXT;
ALTER TABLE claims ADD COLUMN payer_rejected_acknowledged_actor TEXT;

CREATE INDEX idx_claims_payer_rejected_unack
    ON claims(payer_rejected_at)
    WHERE payer_rejected_acknowledged_at IS NULL;
