-- =====================================================
-- PT_PAP — logo_url / banner_url update (program_type_v1)
-- 2026-08-08
-- DRAFT ONLY — not executed against any database, not yet reviewed/approved.
-- Config only. Idempotent (plain UPDATE).
-- =====================================================
--
-- Uncomment ONLY the block for the environment you're deploying to, then run.
--
-- NOTE: 2026-08-07-01-pt-pap-program-type-workflow.sql's own INSERT now bakes in the Dev
-- URLs for logo_url/banner_url directly (no longer the HDB/MSD placeholder) — so the Dev
-- block below is redundant for a fresh run of that migration. It's kept here only to fix a
-- PT_PAP row created by an EARLIER run of 01 (before that edit landed), and as the template
-- QA/UAT/Prod are built from.
--
-- Replaces the placeholder HDB/MSD logo/banner asset URLs that
-- 2026-08-07-01-pt-pap-program-type-workflow.sql flagged as "must be swapped for
-- PAP-specific branding before go-live" (see that file's §1 comments on logo_url/banner_url).
--
-- NOTE — pap-animation.mp4 (banner animation/video) is NOT included below: there is no
-- animation/video column on program_type_v1 at all. The only place `banner_animation_url`
-- exists in this schema is on program_v1 and program_session (added by
-- database/date-wise-scripts.sql:4112-4121), i.e. per-PROGRAM, not per-program-type — and
-- program_type_v1.banner_url only ever feeds program.bannerImageUrl as a fallback default
-- at program-create time (program.service.ts:1315: `createDto.bannerImageUrl ||
-- programType.bannerUrl`), with no equivalent fallback wired up for an animation URL. So the
-- animation URL can't be set here — it would need to be supplied per-PAP-program at program
-- creation time (via the program's own banner_animation_url), OR, if a program-type-level
-- default is wanted (mirroring how banner_url/logo_url work), that requires an actual schema
-- change (ALTER TABLE program_type_v1 ADD COLUMN banner_animation_url ...) plus a
-- program.service.ts change to read it as a fallback — flagging as a separate, explicit
-- follow-up rather than assuming it's wanted.
-- =====================================================

-- ── Dev ──────────────────────────────────────────────
UPDATE program_type_v1
SET logo_url    = 'https://infinitheism-serverless.s3.ap-south-1.amazonaws.com/static-images/logo/pap-logo.png',
    banner_url  = 'https://infinitheism-serverless.s3.ap-south-1.amazonaws.com/static-images/banner/pap-banner.png',
    updated_at  = NOW(),
    updated_by  = -2
WHERE key = 'PT_PAP'
  AND deleted_at IS NULL;

-- ── QA ───────────────────────────────────────────────
-- UPDATE program_type_v1
-- SET logo_url    = 'https://infinitheism-portal-qa-assets.s3.ap-south-1.amazonaws.com/static-images/logo/pap-logo.png',
--     banner_url  = 'https://infinitheism-portal-qa-assets.s3.ap-south-1.amazonaws.com/static-images/banner/pap-banner.png',
--     updated_at  = NOW(),
--     updated_by  = -2
-- WHERE key = 'PT_PAP'
--   AND deleted_at IS NULL;

-- ── UAT ──────────────────────────────────────────────
-- UPDATE program_type_v1
-- SET logo_url    = 'https://infinitheism-portal-uat-assets.s3.ap-south-1.amazonaws.com/static-images/logo/pap-logo.png',
--     banner_url  = 'https://infinitheism-portal-uat-assets.s3.ap-south-1.amazonaws.com/static-images/banner/pap-banner.png',
--     updated_at  = NOW(),
--     updated_by  = -2
-- WHERE key = 'PT_PAP'
--   AND deleted_at IS NULL;

-- ── Prod ─────────────────────────────────────────────
-- UPDATE program_type_v1
-- SET logo_url    = 'https://infinitheism-portal-prod-assets.s3.ap-south-1.amazonaws.com/static-images/logo/pap-logo.png',
--     banner_url  = 'https://infinitheism-portal-prod-assets.s3.ap-south-1.amazonaws.com/static-images/banner/pap-banner.png',
--     updated_at  = NOW(),
--     updated_by  = -2
-- WHERE key = 'PT_PAP'
--   AND deleted_at IS NULL;
