-- ============================================================================
-- TTPID Ads Manager - Initial Seed Data
-- ============================================================================

INSERT INTO `users` (`id`, `uuid`, `kliq_user_id`, `auth_provider`, `username`, `email`, `role`, `status`, `email_verified_at`) VALUES
(1, '11111111-1111-4111-8111-111111111111', 1001, 'kliqbd', 'superadmin', 'admin@ttpid.app', 'super_admin', 'active', NOW()),
(2, '22222222-2222-4222-8222-222222222222', 1002, 'kliqbd', 'kliq_publisher', 'publisher@kliqbd.com', 'publisher', 'active', NOW()),
(3, '33333333-3333-4333-8333-333333333333', 1003, 'kliqbd', 'tv24_publisher', 'publisher@24tv.live', 'publisher', 'active', NOW()),
(4, '44444444-4444-4444-8444-444444444444', 1004, 'kliqbd', 'demo_advertiser', 'advertiser@ttpid.app', 'advertiser', 'active', NOW());

INSERT INTO `user_profiles` (`user_id`, `full_name`, `phone`, `company_name`, `country`) VALUES
(1, 'TTPID Super Admin', '+8801700000001', 'TTPID Network', 'Bangladesh'),
(2, 'KLIQBD Media Ops', '+8801700000002', 'KLIQBD', 'Bangladesh'),
(3, '24TV Live Ops', '+8801700000003', '24TV Live', 'Bangladesh'),
(4, 'Demo Advertiser', '+8801700000004', 'Demo Brand BD', 'Bangladesh');

INSERT INTO `wallets` (`id`, `user_id`, `currency`, `available_balance`, `pending_balance`, `total_deposits`) VALUES
(1, 1, 'BDT', 0.0000, 0.0000, 0.0000),
(2, 2, 'BDT', 0.0000, 0.0000, 0.0000),
(3, 3, 'BDT', 0.0000, 0.0000, 0.0000),
(4, 4, 'BDT', 5000.0000, 0.0000, 5000.0000);

INSERT INTO `wallet_transactions` (`txn_ref`, `wallet_id`, `user_id`, `type`, `direction`, `amount`, `balance_before`, `balance_after`, `status`, `description`) VALUES
('TXN-SEED-0001', 4, 4, 'deposit', 'credit', 5000.0000, 0.0000, 5000.0000, 'completed', 'Initial advertiser seed balance');

INSERT INTO `publishers` (`id`, `user_id`, `publisher_uid`, `name`, `api_key_prefix`, `api_key_hash`, `status`) VALUES
(1, 2, 'pub_kliqbd_001', 'KLIQBD Social Platform', 'ttpid_kliq', SHA2('kliqbd_secret_key_change_me', 256), 'active'),
(2, 3, 'pub_24tv_002', '24TV Live News Portal', 'ttpid_24tv', SHA2('24tv_secret_key_change_me', 256), 'active');

INSERT INTO `publisher_domains` (`id`, `publisher_id`, `domain`, `verification_token`, `is_verified`, `ads_enabled`, `revenue_share_pct`, `verified_at`) VALUES
(1, 1, 'kliqbd.com', 'verify_kliqbd_2026', 1, 1, 70.00, NOW()),
(2, 2, '24tv.live', 'verify_24tv_2026', 1, 1, 70.00, NOW());

INSERT INTO `ad_placements` (`id`, `publisher_id`, `domain_id`, `placement_uid`, `name`, `format`, `width`, `height`, `is_active`) VALUES
(1, 1, 1, 'slot_kliqbd_feed_01', 'KLIQBD Main Feed Responsive', 'responsive', NULL, NULL, 1),
(2, 1, 1, 'slot_kliqbd_sidebar_01', 'KLIQBD Sidebar 300x250', 'banner', 300, 250, 1),
(3, 2, 2, 'slot_24tv_header_01', '24TV Top Leaderboard 728x90', 'banner', 728, 90, 1),
(4, 2, 2, 'slot_24tv_article_01', '24TV In-Article Responsive', 'responsive', NULL, NULL, 1);

INSERT INTO `boost_packages` (`name`, `duration_days`, `price`, `weight_multiplier`, `est_impressions_min`, `est_impressions_max`, `est_clicks_min`, `est_clicks_max`) VALUES
('Starter 3-Day Boost', 3, 500.0000, 1.80, 5000, 12000, 80, 250),
('Growth 7-Day Boost', 7, 1200.0000, 2.50, 15000, 35000, 250, 750),
('Prime 14-Day Network Dominator', 14, 2500.0000, 4.00, 40000, 90000, 700, 2000);

INSERT INTO `campaigns` (`id`, `advertiser_id`, `name`, `pricing_model`, `cpc_rate`, `cpm_rate`, `total_budget`, `daily_budget`, `start_date`, `end_date`, `status`, `approved_by`, `approved_at`) VALUES
(1, 4, 'TTPID Network Launch Promo', 'cpc', 2.5000, 60.0000, 3000.0000, 500.0000, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 30 DAY), 'active', 1, NOW());

INSERT INTO `advertisements` (`id`, `campaign_id`, `advertiser_id`, `title`, `description`, `ad_type`, `target_url`, `target_scope`, `status`) VALUES
(1, 1, 4, 'Grow Your Brand Across KLIQBD & 24TV Live', 'Reach thousands of daily readers and creators in Bangladesh with TTPID Ads Manager.', 'responsive', 'https://ads.ttpid.app', 'both', 'active');

INSERT INTO `ad_creatives` (`advertisement_id`, `size_label`, `alt_text`, `cta_text`) VALUES
(1, 'responsive', 'Advertise on TTPID Network', 'Launch Campaign');
