-- A payment that is no longer owed.
--
-- Separate from V28 for the same reason V23 is separate from V24: Postgres will
-- not let a value added by ALTER TYPE be used in the same transaction, and
-- Flyway wraps each migration in one. The release routine V28's settings table
-- switches on writes this value.

-- The editor turned the payment section off while this fee was still open, so
-- nobody owes it any more.
--
-- Distinct from REJECTED, which is a human judgement that a *declared* payment
-- could not be found and which the author may correct and re-declare.
-- Distinct from FAILED, which means a gateway declined the transaction.
-- CANCELLED is neither party's fault and is terminal: the author is never asked
-- to act on it again.
--
-- The alternative was leaving these rows PENDING. That is a live bug: switching
-- payments back on would resurrect a "pay now" banner and a working UPI link on
-- a paper that is by then under review, and declare() would accept real money
-- against a fee that no longer exists.
ALTER TYPE payment_status ADD VALUE IF NOT EXISTS 'CANCELLED';
