<?php

namespace Modules\Bms\Entities;

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

class BmsOfficeVisit extends Model
{
    protected $table = 'bms_office_visits';

    protected $fillable = [
        'business_id', 'lead_id', 'contact_id', 'location_id', 'wizard_session_id',
        'visit_date', 'visit_time', 'status', 'notes', 'created_by',
    ];

    protected $casts = [
        'visit_date' => 'date',
    ];

    public function lead(): BelongsTo
    {
        return $this->belongsTo(BmsLead::class, 'lead_id');
    }

    public function contact(): BelongsTo
    {
        return $this->belongsTo(\App\Contact::class, 'contact_id');
    }
}
