<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('room_types', function (Blueprint $table) {
            $table->bigIncrements('id');

            $table->string('tr_name');                                          // Name
            $table->integer('pax_room_limit')->default(1);                      // Limit on the number of guests allowed in rooms.
            $table->decimal('additional_pax_charge', 10, 2)->default(0.00);     // Charge to will apply when the room limit is exceeded
            $table->integer('is_express_type')->default(0);                     // Will the Room Type be use for Express Reservations
            $table->boolean('minimum_express_stay')->default(1);                // Minimum Express Stay (Hours)
            $table->decimal('express_checkout_penalty', 10, 2)->default(0.00);  // Charge to will apply when the express tolerance limit is exceeded

            $table->json('tr_seasons');                     // Local Season & Rates Configuration
            $table->json('tr_pax_seasons')->nullable();     // Local Season & PAX Rates Configuration
            $table->json('tr_express_seasons')->nullable(); // Local Seasons & Express Rates Configuration

            $table->timestamps();
        });
    }

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