<?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('vehicle_reservations', function (Blueprint $table) {
            $table->id();
            $table->string('vehicle_name');
            $table->string('vehicle_image');
            $table->integer('bags');
            $table->integer('passengers');
            $table->boolean('air_conditioning')->default(false);
            $table->string('vehicle_class');
            $table->string('lieuDePriseEnCharge');
            $table->string('lieuDeRestitution');
            $table->string('rental_period');
            $table->boolean('driver')->default(false);
            $table->decimal('price', 10, 2);
            $table->decimal('total_price', 10, 2);
            $table->string('username');
            $table->string('phone');
            $table->decimal('amount_paid', 10, 2);
            $table->string('invoice_number');
            $table->foreignId('user_id')->constrained()->onDelete('cascade');
            $table->boolean('is_viewed')->default(false);
            $table->timestamps();
        });
    }

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