<?php

namespace Modules\VetClinic\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\VetClinic\Entities\VcVaccineType;

class VaccineTypesSeeder extends Seeder
{
    public function run()
    {
        $vaccines = [
            // Core Vaccines — Dogs
            ['name' => 'Rabies (Dog)',                                      'category' => 'core_vaccine',     'species_target' => ['dog'],          'valid_for_months' => 12],
            ['name' => 'DHPP (Distemper/Hepatitis/Parvo/Parainfluenza)',    'category' => 'core_vaccine',     'species_target' => ['dog'],          'valid_for_months' => 12],
            ['name' => 'Parvovirus',                                        'category' => 'core_vaccine',     'species_target' => ['dog'],          'valid_for_months' => 12],

            // Non-Core Vaccines — Dogs
            ['name' => 'Bordetella (Kennel Cough)',                         'category' => 'non_core_vaccine', 'species_target' => ['dog'],          'valid_for_months' => 6],
            ['name' => 'Leptospirosis',                                     'category' => 'non_core_vaccine', 'species_target' => ['dog'],          'valid_for_months' => 12],
            ['name' => 'Lyme Disease',                                      'category' => 'non_core_vaccine', 'species_target' => ['dog'],          'valid_for_months' => 12],
            ['name' => 'Canine Influenza',                                  'category' => 'non_core_vaccine', 'species_target' => ['dog'],          'valid_for_months' => 12],

            // Core Vaccines — Cats
            ['name' => 'Rabies (Cat)',                                      'category' => 'core_vaccine',     'species_target' => ['cat'],          'valid_for_months' => 12],
            ['name' => 'Feline FVRCP (Distemper)',                          'category' => 'core_vaccine',     'species_target' => ['cat'],          'valid_for_months' => 12],

            // Non-Core Vaccines — Cats
            ['name' => 'Feline Leukemia (FeLV)',                            'category' => 'non_core_vaccine', 'species_target' => ['cat'],          'valid_for_months' => 12],
            ['name' => 'Feline Chlamydophila',                              'category' => 'non_core_vaccine', 'species_target' => ['cat'],          'valid_for_months' => 12],

            // Rabbit
            ['name' => 'Myxomatosis',                                       'category' => 'core_vaccine',     'species_target' => ['rabbit'],       'valid_for_months' => 12],
            ['name' => 'Rabbit Haemorrhagic Disease (RHD)',                 'category' => 'core_vaccine',     'species_target' => ['rabbit'],       'valid_for_months' => 12],

            // Spot-on Treatments
            ['name' => 'Frontline Spot-on (Dog)',                           'category' => 'spot_on',          'species_target' => ['dog'],          'valid_for_months' => 1],
            ['name' => 'Frontline Spot-on (Cat)',                           'category' => 'spot_on',          'species_target' => ['cat'],          'valid_for_months' => 1],
            ['name' => 'Advocate (Dog)',                                     'category' => 'spot_on',          'species_target' => ['dog'],          'valid_for_months' => 1],
            ['name' => 'Advocate (Cat)',                                     'category' => 'spot_on',          'species_target' => ['cat'],          'valid_for_months' => 1],
            ['name' => 'Revolution / Stronghold',                           'category' => 'spot_on',          'species_target' => ['dog', 'cat'],   'valid_for_months' => 1],
            ['name' => 'Bravecto Spot-on',                                  'category' => 'spot_on',          'species_target' => ['dog', 'cat'],   'valid_for_months' => 3],

            // Deworming
            ['name' => 'Milbemax (Dog)',                                    'category' => 'deworming',        'species_target' => ['dog'],          'valid_for_months' => 3],
            ['name' => 'Milbemax (Cat)',                                    'category' => 'deworming',        'species_target' => ['cat'],          'valid_for_months' => 3],
            ['name' => 'Drontal (Dog)',                                     'category' => 'deworming',        'species_target' => ['dog'],          'valid_for_months' => 3],
            ['name' => 'Drontal (Cat)',                                     'category' => 'deworming',        'species_target' => ['cat'],          'valid_for_months' => 3],
            ['name' => 'Panacur / Fenbendazole',                           'category' => 'deworming',        'species_target' => ['dog', 'cat', 'rabbit'], 'valid_for_months' => 3],
            ['name' => 'Interceptor (Heartworm + Intestinal)',              'category' => 'deworming',        'species_target' => ['dog'],          'valid_for_months' => 1],

            // Oral / Preventive
            ['name' => 'Bravecto Oral (Flea & Tick)',                      'category' => 'oral',             'species_target' => ['dog'],          'valid_for_months' => 3],
            ['name' => 'Nexgard (Flea & Tick)',                             'category' => 'oral',             'species_target' => ['dog'],          'valid_for_months' => 1],
            ['name' => 'Simparica',                                         'category' => 'oral',             'species_target' => ['dog'],          'valid_for_months' => 1],
            ['name' => 'Credelio (Flea & Tick)',                            'category' => 'oral',             'species_target' => ['dog', 'cat'],   'valid_for_months' => 1],

            // Nasal
            ['name' => 'Bordetella Intranasal',                             'category' => 'nasal',            'species_target' => ['dog'],          'valid_for_months' => 12],
        ];

        foreach ($vaccines as $v) {
            VcVaccineType::firstOrCreate(
                ['name' => $v['name'], 'business_id' => null],
                array_merge($v, ['status' => 'active', 'business_id' => null])
            );
        }
    }
}
