<?php

namespace Database\Seeders;

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

class PremiumOvertimePaySettingsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $data = [
            [
                'code' => 'regHolidayPay',
                'name' => 'Regular Holiday Pay',
                'description' => 'Payment on regular holiday',
                'percentage' => 200,
                'isRestday' => false,
                'isOvertime' => false,
                'holiday_type_id' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'spcHolidayPay',
                'name' => 'Special Holiday Pay',
                'description' => 'Payment on special holiday',
                'percentage' => 130,
                'isRestday' => false,
                'isOvertime' => false,
                'holiday_type_id' => 2,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'locHolidayPay',
                'name' => 'Local Holiday Pay',
                'description' => 'Payment on local holiday',
                'percentage' => 130,
                'isRestday' => false,
                'isOvertime' => false,
                'holiday_type_id' => 3,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'restDayDutyPay',
                'name' => 'Rest Day Duty Pay',
                'description' => 'Payment on Restday Duty or Cancelled Day-off',
                'percentage' => 130,
                'isRestday' => true,
                'isOvertime' => false,
                'holiday_type_id' => null,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'regDayOT',
                'name' => 'Regular Day OT',
                'description' => 'Overtime pay on regular day',
                'percentage' => 125,
                'isRestday' => false,
                'isOvertime' => true,
                'holiday_type_id' => null,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'regHolidayOT',
                'name' => 'Regular Holiday OT',
                'description' => 'Overtime pay on regular holiday',
                'percentage' => 260,
                'isRestday' => false,
                'isOvertime' => true,
                'holiday_type_id' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'spcHolidayOT',
                'name' => 'Special Holiday OT',
                'description' => 'Overtime pay on special holiday',
                'percentage' => 169,
                'isRestday' => false,
                'isOvertime' => true,
                'holiday_type_id' => 2,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'locHolidayOT',
                'name' => 'Local Holiday OT',
                'description' => 'Overtime pay on local holiday',
                'percentage' => 169,
                'isRestday' => false,
                'isOvertime' => true,
                'holiday_type_id' => 3,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'restDayOT',
                'name' => 'Restday OT',
                'description' => 'Overtime pay on restday',
                'percentage' => 169,
                'isRestday' => true,
                'isOvertime' => true,
                'holiday_type_id' => null,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'regHolidayRestdayOT',
                'name' => 'Regular Holiday on Restday OT',
                'description' => 'Overtime pay on regular holiday that falls on restday',
                'percentage' => 338,
                'isRestday' => true,
                'isOvertime' => true,
                'holiday_type_id' => 1,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'spcHolidayRestdayOT',
                'name' => 'Special Holiday on Restday OT',
                'description' => 'Overtime pay on special holiday that falls on restday',
                'percentage' => 195,
                'isRestday' => true,
                'isOvertime' => true,
                'holiday_type_id' => 2,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'code' => 'locHolidayRestdayOT',
                'name' => 'Local Holiday on Restday OT',
                'description' => 'Overtime pay on local holiday that falls on restday',
                'percentage' => 195,
                'isRestday' => true,
                'isOvertime' => true,
                'holiday_type_id' => 3,
                'created_at' => now(),
                'updated_at' => now(),
            ],

        ];

        \App\Models\PremiumOvertimePaySetting::insert($data);
    }

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