<?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('cars', function (Blueprint $table) {
            $table->enum('rental_status', ['available', 'rented', 'maintenance'])->default('available')->after('status');
            $table->integer('allowed_km_per_day')->nullable()->after('max_mileage_daily');
            $table->decimal('extra_km_price', 10, 2)->nullable()->after('allowed_km_per_day');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('cars', function (Blueprint $table) {
            $table->dropColumn(['rental_status', 'allowed_km_per_day', 'extra_km_price']);
        });
    }
};
