-- ============================================
-- MakLinkApp – database/seed.sql
-- Initial data: admin user + default apps
-- ============================================

USE maklinkapp;

-- Default admin user (password: Admin@TFSBD2026)
INSERT IGNORE INTO users (id, name, email, username, password_hash, role, active, mfa_enabled, language)
VALUES (1, 'Md. Alaul Karim Mukul', 'a.karim@tfsbd.com', 'alaul.karim',
        '$2y$12$placeholder_hash_change_before_deploy',
        'admin', 1, 1, 'bi');

-- Default apps
INSERT IGNORE INTO apps (slug, name, name_bn, category, color, status, sort_order, url) VALUES
('trade-lc',     'Trade LC Tool',          'ট্রেড এলসি টুল',       'Finance',       '#E6F1FB', 'live',        1, '/apps/trade-lc/'),
('crm-deals',    'CRM Deals & Prospects',  'সিআরএম ডিলস',          'Sales',         '#EAF3DE', 'live',        2, 'https://hub.tfsbd.com'),
('web-messenger','Web Messenger',          'ওয়েব মেসেঞ্জার',        'Communication', '#F5E9C8', 'live',        3, '/apps/web-messenger/'),
('cell-finder',  'Cell Location Finder',   'সেল লোকেশন ফাইন্ডার', 'Utility',       '#E1F5EE', 'development', 4, '/apps/cell-finder/'),
('doc-manager',  'Document Manager',       'ডকুমেন্ট ম্যানেজার',   'Documents',     '#FBEAF0', 'live',        5, '/apps/doc-manager/'),
('eco-boat',     'Eco-Boat Portal',        'ইকো-বোট পোর্টাল',      'Projects',      '#FAECE7', 'development', 6, '/apps/eco-boat/'),
('rb-media',     'Ruposhi Bangla TV',      'রূপসী বাংলা টিভি',      'Media',         '#EEEDFE', 'live',        7, '/apps/rb-media/');

-- Assign all apps to admin
INSERT IGNORE INTO user_apps (user_id, app_id, pinned)
SELECT 1, id, 1 FROM apps;
