-- ============================================================
-- Rename platform admin accounts to powdercoatinglogix.com
-- Run once on any environment after deploying the updated seed.
-- Safe to run multiple times (WHERE clause matches old emails only).
-- ============================================================

SET QUOTED_IDENTIFIER ON;

-- SuperAdmin 1: superadmin@powdercoating.com → artemis@powdercoatinglogix.com
UPDATE AspNetUsers SET
    Email              = 'artemis@powdercoatinglogix.com',
    UserName           = 'artemis@powdercoatinglogix.com',
    NormalizedEmail    = 'ARTEMIS@POWDERCOATINGLOGIX.COM',
    NormalizedUserName = 'ARTEMIS@POWDERCOATINGLOGIX.COM'
WHERE Email = 'superadmin@powdercoating.com';

-- SuperAdmin 2: admin@powdercoating.com → ops@powdercoatinglogix.com
UPDATE AspNetUsers SET
    Email              = 'ops@powdercoatinglogix.com',
    UserName           = 'ops@powdercoatinglogix.com',
    NormalizedEmail    = 'OPS@POWDERCOATINGLOGIX.COM',
    NormalizedUserName = 'OPS@POWDERCOATINGLOGIX.COM'
WHERE Email = 'admin@powdercoating.com';

-- Demo company admin: admin@demo.com → demo@powdercoatinglogix.com
UPDATE AspNetUsers SET
    Email              = 'demo@powdercoatinglogix.com',
    UserName           = 'demo@powdercoatinglogix.com',
    NormalizedEmail    = 'DEMO@POWDERCOATINGLOGIX.COM',
    NormalizedUserName = 'DEMO@POWDERCOATINGLOGIX.COM'
WHERE Email = 'admin@demo.com';

-- Verify
SELECT Email, UserName, CompanyRole
FROM AspNetUsers
WHERE Email IN (
    'artemis@powdercoatinglogix.com',
    'ops@powdercoatinglogix.com',
    'demo@powdercoatinglogix.com'
);
