<?php

namespace App\Models\Room;

use App\Traits\BelongsToStore;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class RoomType extends Model
{
    use BelongsToStore;

    protected $fillable = [
        'store_id', 'name', 'price', 'description',
        'images', 'facilities', 'sort', 'status',
    ];

    protected function casts(): array
    {
        return [
            'price' => 'decimal:2',
            'images' => 'array',
            'facilities' => 'array',
            'sort' => 'integer',
            'status' => 'integer',
        ];
    }

    public function rooms(): HasMany
    {
        return $this->hasMany(Room::class);
    }
}
