<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('attendance_settings', function (Blueprint $table) {
            $table->unsignedInteger('late_minute_price')->default(0)->after('allowed_radius');
            $table->unsignedTinyInteger('absence_deduction_days')->default(1)->after('late_minute_price');
            $table->unsignedTinyInteger('unpaid_leave_deduction_days')->default(1)->after('absence_deduction_days');
        });
    }

    public function down(): void
    {
        Schema::table('attendance_settings', function (Blueprint $table) {
            $table->dropColumn([
                'late_minute_price',
                'absence_deduction_days',
                'unpaid_leave_deduction_days',
            ]);
        });
    }
};
