<?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('reservations', function (Blueprint $table) {
            $table->id();
            $table->string('customer_name');
            $table->string('phone')->nullable();
            $table->string('lodging_type'); // 'cabana', 'domo'
            $table->integer('lodging_number');
            $table->integer('adults')->default(0);
            $table->integer('kids_10_15')->default(0);
            $table->integer('kids_5_10')->default(0);
            $table->string('package_type')->nullable(); // Para domos
            $table->decimal('total_cost', 10, 2)->default(0);
            $table->decimal('advance_payment', 10, 2)->default(0);
            $table->decimal('balance', 10, 2)->default(0);
            $table->string('payment_method')->nullable(); // 'qr', 'efectivo'
            $table->date('reservation_date');
            $table->string('status')->default('confirmado'); // confirmado, reprogramado
            $table->timestamps();
        });
    }

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