-- TAT_3 (program 45) batch2 org-participant user corrections (2026-08-01)
--
-- Run BEFORE batch2's Section A staging populate (in
-- org-insert/2026-07-28-tat3-org-participants-inserts-updates-batch2.sql), so
-- users.email/dob/user_type are correct when the staging table pre-fills
-- from `users`.
--
--   1) Naveen                (8939720011) — fill email + dob
--   2) Parthiban Anthonyraj  (9789102500) — user_type -> 'Org', fill email + dob
--   3) Mano                  (9841042289) — user_type -> 'Org', fill email + dob
--   4) 9791140214 — pull OUT of the org batch: user_type -> 'Seeker'

-- Preview current values before touching anything
SELECT id, legal_full_name, phone_number, email, dob, user_type
FROM users
WHERE phone_number IN ('8939720011', '9789102500', '9841042289', '9791140214');

BEGIN;


UPDATE users
SET user_type = 'Org',
    email = 'parthiban@infinitheism.com',
    dob = '1994-11-28',
    gender = 'Male',
    country_name = 'INDIA',
    address = 'Chennai',
    updated_at = NOW()
WHERE phone_number = '9789102500';

UPDATE users
SET user_type = 'Seeker',
    updated_at = NOW()
WHERE phone_number = '9791140214';

SELECT id, legal_full_name, phone_number, email, dob, user_type
FROM users
WHERE phone_number IN ('8939720011', '9789102500', '9841042289', '9791140214');

-- Review above, then COMMIT; or ROLLBACK;
COMMIT;
