<?php

namespace Modules\Bms\Entities;

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

class BmsTransferRequest extends Model
{
    protected $table = 'bms_transfer_requests';

    protected $fillable = [
        'business_id', 'type', 'from_location_id', 'from_hall_id', 'to_hall_id',
        'to_location_id', 'booking_id', 'status', 'requested_by', 'accepted_by',
        'accepted_at', 'notes', 'stock_refs',
    ];

    protected $casts = [
        'accepted_at' => 'datetime',
        'stock_refs'  => 'array',
    ];

    public function items(): HasMany
    {
        return $this->hasMany(BmsTransferItem::class, 'transfer_id');
    }
}
