-- Makes the remaining hardcoded page copy editable from the admin panel.
-- Run after schema.sql + migration_developments.sql:
-- mysql --default-character-set=utf8mb4 -u root kigaliyacu < sql/migration_cms_content.sql

USE kigaliyacu;

CREATE TABLE IF NOT EXISTS content_blocks (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  page VARCHAR(40) NOT NULL,
  section VARCHAR(40) NOT NULL,
  icon VARCHAR(40) DEFAULT '',
  title VARCHAR(200) NOT NULL,
  description TEXT,
  link_url VARCHAR(255) DEFAULT '',
  link_label VARCHAR(80) DEFAULT '',
  sort_order INT DEFAULT 0
) ENGINE=InnoDB;

-- ---------------------------------------------------------------
-- content_blocks seed (mirrors today's hardcoded arrays exactly)
-- ---------------------------------------------------------------
INSERT INTO content_blocks (page, section, icon, title, description, link_url, link_label, sort_order) VALUES
('services', 'list', 'compass', 'Buy a Property', 'End-to-end guidance for buyers — from shortlisting and viewings to title verification and notarised transfer, including full remote support for diaspora clients.', '/properties?status=sale', 'Learn more', 1),
('services', 'list', 'trending-up', 'Sell Your Property', 'A free valuation, professional photography and access to our qualified buyer network to sell at the right price, on your timeline.', '/valuation', 'Learn more', 2),
('services', 'list', 'building', 'Rent a Property', 'Curated rental listings across Kigali''s top districts, with lease drafting and move-in coordination handled for you.', '/properties?status=rent', 'Learn more', 3),
('services', 'list', 'house-build', 'Buy & Build', 'We partner with trusted construction companies to help you build your dream home. Once you purchase land through us, we connect you with reliable professionals and guide you through every requirement needed to begin construction.', '/buy-and-build', 'Learn more', 4),
('services', 'list', 'calculator', 'Property Valuation', 'We provide accurate property valuation services through our team of licensed and professional property valuers. Whether you are buying, selling, investing, or seeking financing, our expert valuations help you make informed decisions.', '/valuation', 'Learn more', 5),
('services', 'list', 'document', 'Title & Legal Due Diligence', 'Independent verification of land titles and sale agreements — for our own listings or properties you are buying elsewhere.', '/contact', 'Learn more', 6),

('home', 'why_choose_us', 'shield', 'Verified Titles', 'Every property is checked against official land records before it is listed.', '', '', 1),
('home', 'why_choose_us', 'trending-up', 'Investment Scoring', 'A transparent 0–100 score blends location, yield and documentation quality.', '', '', 2),
('home', 'why_choose_us', 'compass', 'Local Expertise', 'Advisors who know every hill, sector and growth corridor in Kigali.', '', '', 3),
('home', 'why_choose_us', 'whatsapp', 'Always Reachable', 'Speak to a real advisor by phone or WhatsApp — no chatbots, no hold music.', '', '', 4),

('about', 'values', 'shield', 'Transparency', 'Every title is independently verified, every fee disclosed upfront — no hidden commissions, ever.', '', '', 1),
('about', 'values', 'compass', 'Local Expertise', 'Our advisors live in the districts they cover, tracking every road project and market shift firsthand.', '', '', 2),
('about', 'values', 'user', 'Client-First Service', 'From remote diaspora purchases to first-time local buyers, every client gets the same white-glove attention.', '', '', 3),

('buy_build', 'how_it_works', '', 'Land Acquisition', 'We help you identify and secure a titled plot that fits your budget, lifestyle and future resale value.', '', '', 1),
('buy_build', 'how_it_works', '', 'Architecture & Design', 'Our partner architects translate your brief into detailed drawings and a realistic construction budget.', '', '', 2),
('buy_build', 'how_it_works', '', 'Contractor & Permits', 'We shortlist vetted contractors, manage tendering, and handle all permitting with local authorities.', '', '', 3),
('buy_build', 'how_it_works', '', 'Build & Handover', 'Regular site supervision and milestone reporting keep your build on track, budget and quality, through to handover.', '', '', 4),

('buy_build', 'why_bullets', 'check', 'Total control over layout, finishes and room count — no compromises', '', '', '', 1),
('buy_build', 'why_bullets', 'check', 'Typically 15–25% more house value for the same total spend versus buying complete', '', '', '', 2),
('buy_build', 'why_bullets', 'check', 'Independent quality inspections at every construction milestone', '', '', '', 3),
('buy_build', 'why_bullets', 'check', 'Transparent, itemised budgeting with no surprise cost overruns', '', '', '', 4),
('buy_build', 'why_bullets', 'check', 'A single point of contact from land purchase through to move-in day', '', '', '', 5);
