<?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('rooms', function (Blueprint $table) {
            $table->string('floor')->nullable()->after('room_no');
            $table->text('description')->nullable()->after('floor');
            $table->string('capacity')->default('2')->after('description');
            $table->string('amenities')->nullable()->after('capacity');
            $table->decimal('price_per_night', 10, 2)->nullable()->after('amenities');
            $table->enum('room_status', ['Available', 'Occupied', 'Maintenance', 'Booked'])->default('Available')->after('price_per_night');
            $table->timestamp('last_cleaned_at')->nullable()->after('room_status');
            $table->timestamp('last_maintenance_at')->nullable()->after('last_cleaned_at');
            $table->string('assigned_staff_id')->nullable()->after('last_maintenance_at');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('rooms', function (Blueprint $table) {
            $table->dropColumn([
                'floor',
                'description', 
                'capacity',
                'amenities',
                'price_per_night',
                'room_status',
                'last_cleaned_at',
                'last_maintenance_at',
                'assigned_staff_id'
            ]);
        });
    }
};
