<?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('attendances', function (Blueprint $table) {
            $table->enum('work_mode', ['office', 'remote'])->default('office')->after('status');
            $table->timestamp('break_start')->nullable()->after('work_mode');
            $table->integer('total_break_seconds')->default(0)->after('break_start');
            $table->decimal('overtime_hours', 8, 2)->default(0)->after('total_break_seconds');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('attendances', function (Blueprint $table) {
            $table->dropColumn(['work_mode', 'break_start', 'total_break_seconds', 'overtime_hours']);
        });
    }
};
