<?php

namespace App\Models;

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

class Broker extends Model
{
    protected $table = 'brokers';

    protected $fillable = [
        'tenant_id',
        'ruc',
        'razon_social',
        'telefono',
        'email',
        'contacto',
        'activo',
    ];

    protected $casts = [
        'activo' => 'boolean',
    ];

    public function tenant(): BelongsTo
    {
        return $this->belongsTo(Tenant::class);
    }

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