<?php

namespace Modules\SystemCore\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\SystemCore\App\Models\CoreTaxConfiguration;

class TaxConfigurationSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $taxes = [
            ['name' => 'No Tax', 'code' => 'NOTAX', 'rate' => 0.00],
            ['name' => 'VAT 5%', 'code' => 'VAT5', 'rate' => 5.00],
            ['name' => 'VAT 10%', 'code' => 'VAT10', 'rate' => 10.00],
            ['name' => 'VAT 15%', 'code' => 'VAT15', 'rate' => 15.00],
            ['name' => 'VAT 18%', 'code' => 'VAT18', 'rate' => 18.00],
            ['name' => 'GST 5%', 'code' => 'GST5', 'rate' => 5.00],
            ['name' => 'GST 12%', 'code' => 'GST12', 'rate' => 12.00],
            ['name' => 'GST 18%', 'code' => 'GST18', 'rate' => 18.00],
        ];

        foreach ($taxes as $tax) {
            CoreTaxConfiguration::firstOrCreate(
                ['code' => $tax['code']],
                $tax
            );
        }
    }
}
