-- =============================================================
-- SNP Connection Monitoring - 초기 데이터
-- 스키마: common
-- =============================================================

SET search_path TO common;

-- 기본 테넌트
INSERT INTO snp_tenant (tenant_code, tenant_name, description, is_active)
VALUES ('DEFAULT', '기본 테넌트', 'SNP Connection Monitoring 기본 테넌트', TRUE)
ON CONFLICT (tenant_code) DO NOTHING;

-- 관리자 계정 (password: admin123, BCrypt 해시)
INSERT INTO snp_user (tenant_id, login_id, password_hash, user_name, email, role, is_active)
VALUES (
    (SELECT tenant_id FROM snp_tenant WHERE tenant_code = 'DEFAULT'),
    'admin',
    '$2b$10$res6.RkRwakcEui0XbCpOOxYzwQiT07/J0Jl4cKlMtaDZFRyDt1EC',
    '시스템 관리자',
    'admin@gcsc.com',
    'ADMIN',
    TRUE
)
ON CONFLICT (login_id) DO NOTHING;
