<?php

namespace Modules\Bms\Entities;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class BmsBookingHall extends Model
{
    protected $table = 'bms_booking_halls';

    protected $fillable = [
        'business_id', 'booking_id', 'hall_id', 'event_date', 'slot',
        'start_time', 'end_time', 'package_id', 'addons', 'package_items', 'price',
    ];

    protected $casts = [
        'event_date'    => 'date',
        'addons'        => 'array',
        'package_items' => 'array',
        'price'         => 'decimal:2',
    ];

    public function booking(): BelongsTo
    {
        return $this->belongsTo(BmsBooking::class, 'booking_id');
    }

    public function hall(): BelongsTo
    {
        return $this->belongsTo(BmsHall::class, 'hall_id');
    }

    public function package(): BelongsTo
    {
        return $this->belongsTo(BmsPackage::class, 'package_id');
    }
}
