<?php

namespace Database\Seeders;

use App\Models\PhicTable;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class PhicTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $salary_range = 10000;
        $premium_contribution = 500;
        $employee_share = 250;
        $employer_share = 250;

        for($i = 1; $i <= 10; $i++){

            $phicData = [
                'salary_range' => $salary_range,
                'contribution_rate' => 5,
                'premium_contribution' => $premium_contribution,
                'employee_share' => $employee_share,
                'employer_share' => $employer_share,
            ];

            $salary_range += 10000;
            $premium_contribution += 500;
            $employee_share += 250;
            $employer_share += 250;

            PhicTable::insert($phicData);
        }
        
    }

    public function reset()
    {
        PhicTable::truncate();
    }
}
