<?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_obs', 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->unsignedBigInteger('ob_id')->index();
            $table->date('date')->index();
            $table->time('from_time')->nullable();
            $table->time('to_time')->nullable();
            $table->boolean('meal')->default('0');
            $table->boolean('transportation')->default('0');
            $table->decimal('meal_amount', 5,2)->nullable();
            $table->decimal('transportation_amount')->nullable();
            $table->text('description')->nullable();
            $table->text('destination')->nullable();
            $table->timestamps();
        });
    }

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