<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

/**
 * DemoSeeder
 *
 * Orchestrates all demo-only sub-seeders in the correct order for the full
 * multi-product platform demo. For a module-dedicated SaaS site use
 * ModuleOnlyDemoSeeder (via `demo:refresh --module-only`) instead.
 *
 * Demo Accounts:
 *   customer@demo.com  / demo1234  (Standard customer — orders, tickets, reviews)
 *   pro@demo.com       / demo1234  (Pro customer — subscriptions, licenses, tickets)
 */
class DemoSeeder extends Seeder
{
    public function run(): void
    {
        $this->call(DemoUsersSeeder::class);

        // Ensures product gallery images from storage/demo/ are attached on every refresh.
        // Product creation methods are idempotent (skip if already exist).
        $this->call(ProductTableSeeder::class);

        $this->call(OrderSeeder::class);
        $this->call(SubscriptionSeeder::class);
        $this->call(TicketSeeder::class);
        $this->call(FaqSeeder::class);
        $this->call(ReviewSeeder::class);
        $this->call(BlogCategoryTableSeeder::class);
        $this->call(BlogPostTableSeeder::class);
        $this->call(PostCategoryTableSeeder::class);
        $this->call(PostCommentTableSeeder::class);
        $this->call(CouponsTableSeeder::class);

        // Module demo seeders — only called when the module is installed.
        if (class_exists(\Modules\SeoAgents\Database\Seeders\SeoAgentsDemoSeeder::class)) {
            (new \Modules\SeoAgents\Database\Seeders\SeoAgentsDemoSeeder())->run();
        }
    }
}
