<?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::create('processed_schedules', function (Blueprint $table) {
            $table->string('header_id')->index()->nullable();
            $table->string('employee_id')->index();
            $table->unsignedMediumInteger('company_id')->index();
            $table->unsignedMediumInteger('dealership_id')->index();
            $table->unsignedMediumInteger('department_id')->index()->nullable();
            $table->date('payroll_date')->index();
            $table->date('date')->index();
            $table->string('schedule_in')->nullable();
            $table->string('schedule_out')->nullable();
            $table->boolean('cws')->default(false);
            $table->boolean('wfh')->default(false);
            $table->boolean('restday')->default(false);
            $table->unsignedSmallInteger('duty_hours')->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('processed_schedules');
    }
};
