<?php

namespace Database\Seeders;

use App\Models\ContentPage;
use Illuminate\Database\Seeder;

class ContentPageSeeder extends Seeder
{
    public function run(): void
    {
        $pages = [
            ContentPage::TERMS => [
                'title' => 'Terms and Conditions',
                'body_html' => '<h2>Terms and Conditions</h2><p>These terms explain how customers can use 8Stores, place orders, and interact with our services.</p><ul><li>Orders are processed after payment review.</li><li>Product availability may change without notice.</li><li>Customers must provide accurate delivery details.</li></ul>',
            ],
            ContentPage::FAQS => [
                'title' => 'FAQs',
                'body_html' => '<h2>Frequently Asked Questions</h2><h3>How do I place an order?</h3><p>Add products to your bag, checkout, and upload your IBFT payment screenshot.</p><h3>How is payment approved?</h3><p>Admin reviews the payment screenshot before processing the order.</p>',
            ],
            ContentPage::PRIVACY => [
                'title' => 'Privacy Policy',
                'body_html' => '<h2>Privacy Policy</h2><p>8Stores uses customer information to process orders, manage accounts, and provide support.</p><p>We do not sell customer personal information.</p>',
            ],
        ];

        foreach ($pages as $slug => $page) {
            ContentPage::query()->updateOrCreate(
                ['slug' => $slug],
                [...$page, 'is_active' => true]
            );
        }
    }
}
