<?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()
{
    Schema::create('reservations', function (Blueprint $table) {
        $table->id();
        $table->string('reservation_number')->unique();
        $table->foreignId('guest_id')->constrained();
        $table->foreignId('room_id')->constrained();
        $table->date('check_in');
        $table->date('check_out');
        $table->integer('number_of_guests');
        $table->decimal('total_amount', 10, 2);
        $table->decimal('paid_amount', 10, 2)->default(0);
        $table->enum('status', ['confirmed', 'pending', 'checked_in', 'checked_out', 'cancelled'])->default('confirmed');
        $table->text('special_requests')->nullable();
        $table->foreignId('created_by')->constrained('users');
        $table->timestamps();
    });
}

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