<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Room extends Model
{
    use HasFactory;

    protected $fillable = [
        'code',
        'title',
        'capacity_adults',
        'capacity_children_under_2',
        'view_type',
        'is_active',
        'sort_order',
    ];

    protected function casts(): array
    {
        return [
            'capacity_adults' => 'integer',
            'capacity_children_under_2' => 'integer',
            'is_active' => 'boolean',
            'sort_order' => 'integer',
        ];
    }

    public function bookings()
    {
        return $this->hasMany(Booking::class);
    }

    public function dailyRates()
    {
        return $this->hasMany(DailyRoomRate::class);
    }
}

