<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('shifts', function (Blueprint $table) {
            $table->boolean('overtime_allowed')->default(false);
            $table->decimal('overtime_rate', 5, 2)->default(1.0); // 1.5x, 2.0x, etc.
            $table->integer('min_overtime_minutes')->default(30);
            $table->integer('max_overtime_minutes')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('shifts', function (Blueprint $table) {
            $table->dropColumn(['overtime_allowed', 'overtime_rate', 'min_overtime_minutes', 'max_overtime_minutes']);
        });
    }
};
