<?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_absences', 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('no_of_days',5,2);
            $table->string('schedule_in')->nullable();
            $table->string('schedule_out')->nullable();
            $table->time('time_in')->nullable();
            $table->time('time_out')->nullable();
            $table->datetime('posted_at')->nullable();
            $table->timestamps();
        });
    }

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