-- 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 site_content (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `key` VARCHAR(100) NOT NULL UNIQUE,
  label VARCHAR(180) NOT NULL,
  group_name VARCHAR(40) NOT NULL,
  field_type ENUM('text','textarea') NOT NULL DEFAULT 'text',
  value TEXT,
  sort_order INT DEFAULT 0
) ENGINE=InnoDB;

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);

-- ---------------------------------------------------------------
-- site_content seed (scalar fields: headings, stats, settings)
-- ---------------------------------------------------------------
INSERT INTO site_content (`key`, label, group_name, field_type, value, sort_order) VALUES
-- Home
('home.stat1_number', 'Stat 1 — Number', 'home', 'text', '480', 1),
('home.stat1_suffix', 'Stat 1 — Suffix', 'home', 'text', '+', 2),
('home.stat1_label', 'Stat 1 — Label', 'home', 'text', 'Properties Sold', 3),
('home.stat2_number', 'Stat 2 — Number', 'home', 'text', '10', 4),
('home.stat2_suffix', 'Stat 2 — Suffix', 'home', 'text', '+', 5),
('home.stat2_label', 'Stat 2 — Label', 'home', 'text', 'Investment Districts', 6),
('home.stat3_number', 'Stat 3 — Number', 'home', 'text', '97', 7),
('home.stat3_suffix', 'Stat 3 — Suffix', 'home', 'text', '%', 8),
('home.stat3_label', 'Stat 3 — Label', 'home', 'text', 'Client Satisfaction', 9),
('home.stat4_number', 'Stat 4 — Number', 'home', 'text', '12', 10),
('home.stat4_suffix', 'Stat 4 — Suffix', 'home', 'text', '+', 11),
('home.stat4_label', 'Stat 4 — Label', 'home', 'text', 'Years in Kigali', 12),
('home.featured_eyebrow', 'Featured Listings — Eyebrow', 'home', 'text', 'Featured Listings', 13),
('home.featured_heading', 'Featured Listings — Heading', 'home', 'text', 'Handpicked Properties This Month', 14),
('home.featured_subheading', 'Featured Listings — Subheading', 'home', 'textarea', 'A curated selection of our most exceptional villas, homes and investment opportunities across Kigali.', 15),
('home.category_eyebrow', 'Categories — Eyebrow', 'home', 'text', 'Browse by Category', 16),
('home.category_heading', 'Categories — Heading', 'home', 'text', 'Find the Right Property Type', 17),
('home.category_subheading', 'Categories — Subheading', 'home', 'textarea', 'From architect-designed villas to titled investment land, explore our full portfolio by category.', 18),
('home.locations_eyebrow', 'Investment Locations — Eyebrow', 'home', 'text', 'Investment Locations', 19),
('home.locations_heading', 'Investment Locations — Heading', 'home', 'text', 'Where Kigali is Growing', 20),
('home.why_eyebrow', 'Why Kigali Yacu — Eyebrow', 'home', 'text', 'Why Kigali Yacu', 21),
('home.why_heading', 'Why Kigali Yacu — Heading', 'home', 'text', 'Built on Trust, Backed by Data', 22),
('home.why_subheading', 'Why Kigali Yacu — Subheading', 'home', 'textarea', 'Every listing is independently verified and scored, so you can invest with confidence.', 23),
('home.testimonials_eyebrow', 'Client Stories — Eyebrow', 'home', 'text', 'Client Stories', 24),
('home.testimonials_heading', 'Client Stories — Heading', 'home', 'text', 'Trusted by Buyers Across the Globe', 25),
('home.blog_eyebrow', 'Journal — Eyebrow', 'home', 'text', 'Market Insights', 26),
('home.blog_heading', 'Journal — Heading', 'home', 'text', 'Latest From Our Journal', 27),
('home.cta_eyebrow', 'Bottom CTA — Eyebrow', 'home', 'text', 'Ready When You Are', 28),
('home.cta_heading', 'Bottom CTA — Heading', 'home', 'text', 'Have a Property to Sell or Rent Out?', 29),
('home.cta_text', 'Bottom CTA — Text', 'home', 'textarea', 'Get a free, no-obligation valuation from our advisors and reach thousands of qualified buyers and tenants.', 30),

-- About
('about.story_paragraph1', 'Story — Paragraph 1', 'about', 'textarea', 'Kigali Yacu Properties was founded to bring transparency, verified data and genuine local expertise to a market that too often relies on word of mouth. Today we manage a curated portfolio spanning ten Kigali districts, from established diplomatic enclaves to emerging growth corridors like Bugesera.', 1),
('about.story_paragraph2', 'Story — Paragraph 2', 'about', 'textarea', 'Every listing on this platform is checked against official land records before it goes live, and every advisor on our team lives and works in the neighbourhoods they represent. Whether you are a first-time buyer, a diaspora investor purchasing remotely, or a family selling a long-held property, our goal is the same: a transaction you can trust from first enquiry to final handover.', 2),
('about.stat1_number', 'Stat 1 — Number', 'about', 'text', '480', 3),
('about.stat1_suffix', 'Stat 1 — Suffix', 'about', 'text', '+', 4),
('about.stat1_label', 'Stat 1 — Label', 'about', 'text', 'Properties Sold or Rented', 5),
('about.stat2_number', 'Stat 2 — Number', 'about', 'text', '10', 6),
('about.stat2_suffix', 'Stat 2 — Suffix', 'about', 'text', '+', 7),
('about.stat2_label', 'Stat 2 — Label', 'about', 'text', 'Districts Covered', 8),
('about.stat3_number', 'Stat 3 — Number', 'about', 'text', '12', 9),
('about.stat3_suffix', 'Stat 3 — Suffix', 'about', 'text', '+', 10),
('about.stat3_label', 'Stat 3 — Label', 'about', 'text', 'Years of Local Expertise', 11),
('about.stat4_number', 'Stat 4 — Number', 'about', 'text', '97', 12),
('about.stat4_suffix', 'Stat 4 — Suffix', 'about', 'text', '%', 13),
('about.stat4_label', 'Stat 4 — Label', 'about', 'text', 'Client Satisfaction', 14),
('about.team_eyebrow', 'Team — Eyebrow', 'about', 'text', 'Our Team', 15),
('about.team_heading', 'Team — Heading', 'about', 'text', 'Meet Your Advisors', 16),

-- Buy & Build
('buy_build.how_it_works_eyebrow', 'How It Works — Eyebrow', 'buy_build', 'text', 'How It Works', 1),
('buy_build.how_it_works_heading', 'How It Works — Heading', 'buy_build', 'text', 'A Managed Process, Start to Handover', 2),
('buy_build.why_eyebrow', 'Why Buy & Build — Eyebrow', 'buy_build', 'text', 'Why Buy & Build', 3),
('buy_build.why_heading', 'Why Buy & Build — Heading', 'buy_build', 'text', 'Build Equity From the Ground Up', 4),
('buy_build.consultant_eyebrow', 'Consultant — Eyebrow', 'buy_build', 'text', 'Your Buy & Build Consultant', 5),
('buy_build.consultant_heading', 'Consultant — Heading', 'buy_build', 'text', 'Meet the Team Behind Your Build', 6),
('buy_build.cta_heading', 'Bottom CTA — Heading', 'buy_build', 'text', 'Ready to Build Your Home in Kigali?', 7),
('buy_build.cta_text', 'Bottom CTA — Text', 'buy_build', 'textarea', 'Book a free consultation and receive an initial budget estimate within 3 business days.', 8),

-- Settings (admin-role only)
('settings.phone', 'Phone Number', 'settings', 'text', '+250 788 217102', 1),
('settings.email', 'Email Address', 'settings', 'text', 'info@kigaliyacuproperty.co.rw', 2),
('settings.address', 'Office Address', 'settings', 'text', 'KG 7 Ave, Kigali, Rwanda', 3),
('settings.whatsapp', 'WhatsApp Number (digits only, with country code)', 'settings', 'text', '250788217102', 4),
('settings.tagline', 'Site Tagline', 'settings', 'text', 'Rwanda''s Premier Luxury Real Estate Marketplace', 5),
('settings.office_hours', 'Office Hours', 'settings', 'text', 'Monday – Saturday, 8:00 AM – 6:00 PM (Kigali time)', 6),
('settings.facebook', 'Facebook URL', 'settings', 'text', 'https://facebook.com/kigaliyacuproperty', 7),
('settings.instagram', 'Instagram URL', 'settings', 'text', 'https://instagram.com/kigaliyacuproperty', 8),
('settings.linkedin', 'LinkedIn URL', 'settings', 'text', 'https://linkedin.com/company/kigaliyacuproperty', 9),
('settings.twitter', 'Twitter / X URL', 'settings', 'text', 'https://x.com/kigaliyacuprop', 10),
('settings.youtube', 'YouTube URL', 'settings', 'text', 'https://youtube.com/@kigaliyacuproperty', 11);
