<?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_daily_work_hours', 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->decimal('work_hours',5,2);
            $table->decimal('holiday_restday_hours',5,2);
            $table->decimal('ot_hours',5,2);
            $table->decimal('leave_hours',5,2);
            $table->timestamps();
        });
    }

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