<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

/**
 * Seeder: RModuleDataSeeder
 * 
 * Master seeder that runs all SSHIA module data seeders.
 * Run with: php artisan db:seed --class=RModuleDataSeeder
 * 
 * @author SSHIA Development Team
 * @version 1.0.0
 */
class RModuleDataSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $this->command->info('===========================================');
        $this->command->info('SSHIA Module Data Seeder');
        $this->command->info('===========================================');
        $this->command->newLine();

        // Seed permissions first
        $this->command->info('Seeding Permissions...');
        $this->call(RModulePermissionSeeder::class);
        $this->command->newLine();

        // Seed Research Module Data
        $this->command->info('Seeding Research & Innovation Centre Module...');
        $this->call(RResearchDataSeeder::class);
        $this->command->newLine();

        // Seed Advocacy Module Data
        $this->command->info('Seeding Digital Health Advocacy Module...');
        $this->call(RAdvocacyDataSeeder::class);
        $this->command->newLine();

        // Seed Partnership Module Data
        $this->command->info('Seeding Partnership & Collaboration Portal Module...');
        $this->call(RPartnershipDataSeeder::class);
        $this->command->newLine();

        $this->command->info('===========================================');
        $this->command->info('All SSHIA module data seeded successfully!');
        $this->command->info('===========================================');
        $this->command->newLine();
        
        $this->command->table(
            ['Module', 'Records Created'],
            [
                ['Research & Innovation Centre', '14+ publications, files, reviews'],
                ['Digital Health Advocacy', '12 campaigns, 12 stories, 8 polls'],
                ['Partnership & Collaboration', '14 partners, 5 MOUs, 12 forum threads'],
                ['Permissions', '60+ permissions assigned to 8 roles'],
            ]
        );
    }
}
