-- 035: eSign columns for CRTC notification letter signing
--
-- esign_signed_at:       timestamp when the client signed the letter
-- esign_signature_b64:   base64-encoded PNG of the drawn signature
-- esign_signer_email:    email address used to sign (from portal JWT)
-- crtc_letter_minio_key: MinIO object key for the generated CRTC letter PDF
--                        (set by the pipeline at Step 6 so the sign page can
--                         generate a presigned preview URL)

ALTER TABLE canada_crtc_orders
  ADD COLUMN IF NOT EXISTS esign_signed_at      TIMESTAMPTZ,
  ADD COLUMN IF NOT EXISTS esign_signature_b64  TEXT,
  ADD COLUMN IF NOT EXISTS esign_signer_email   TEXT,
  ADD COLUMN IF NOT EXISTS crtc_letter_minio_key TEXT;
