<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

/**
 * ModuleOnlyDemoSeeder
 *
 * Used by `demo:refresh --module-only` for module-dedicated SaaS showcase sites.
 *
 * Skipped intentionally (not relevant to a dedicated module site):
 *   - ProductTableSeeder   (generic ecommerce demo products)
 *   - OrderSeeder          (one-time purchase orders for those products)
 *   - SubscriptionSeeder   (subscriptions for SaaS Project Manager / Managed Hosting)
 *   - ReviewSeeder         (product reviews for the generic catalog)
 *
 * Included (useful content for any SaaS demo site):
 *   - DemoUsersSeeder      (required by module demo seeders)
 *   - TicketSeeder         (support ticket history)
 *   - FaqSeeder            (no-op when products absent — harmless)
 *   - Blog seeders         (blog adds depth to the showcase site)
 *   - CouponsTableSeeder   (discount codes are relevant to SaaS billing)
 *   - Module demo seeders  (the actual reason this seeder exists)
 */
class ModuleOnlyDemoSeeder extends Seeder
{
    public function run(): void
    {
        $this->call(DemoUsersSeeder::class);

        $this->call(TicketSeeder::class);
        $this->call(FaqSeeder::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();
        }
    }
}
