INSERT INTO t_role (kod_role, nama_role, tahap) VALUES
('ADMIN', 'Pentadbir', 100),
('KERANI', 'Kerani', 50),
('USER', 'Pengguna', 10);

INSERT INTO t_sistem (kod_sistem, nama_sistem, url_callback) VALUES
('MYCUKAI', 'myCukai@MBIP', 'https://mycukaitest.mbip.my/sso-callback.php'),
('HR', 'Sistem Sumber Manusia', 'https://hr.mbip.my/sso-callback.php'),
('MYMESYUARAT', 'Sistem Tempahan Mesyuarat', 'https://mesyuarat.mbip.my/sso-callback.php');

-- Password asal untuk demo: Admin@12345
-- Sila tukar password selepas login pertama.
INSERT INTO t_identity
(no_pekerja, nama, emel, katalaluan, jabatan, jawatan, status_aktif, is_admin)
VALUES
('0001', 'Pentadbir Sistem myID MBIP', 'admin@mbip.gov.my', '$2y$10$Kf4QiUfQ2FUi4pADxnmgtu9ezJ2IYxnw4ZklWCaI0wQ2eFrqd1TuS', 'Jabatan Teknologi Maklumat', 'Pentadbir Sistem', 1, 1);

DECLARE @idAdmin INT = (SELECT TOP 1 id_identity FROM t_identity WHERE emel = 'admin@mbip.gov.my');
DECLARE @roleAdmin INT = (SELECT TOP 1 id_role FROM t_role WHERE kod_role = 'ADMIN');

INSERT INTO t_user_role_sistem (id_identity, id_sistem, id_role, assigned_by)
SELECT @idAdmin, id_sistem, @roleAdmin, @idAdmin FROM t_sistem;
