<?php
namespace Incoviba\Model\Inmobiliaria;

use Incoviba\Common\Ideal;
use Incoviba\Model;

class Proveedor extends Ideal\Model
{
    public Model\Inmobiliaria $inmobiliaria;
    public Model\Sociedad $sociedad;

    protected array $tipos;
    public function tipos(): array
    {
        if (!isset($this->tipos)) {
            $this->tipos = $this->runFactory('tipos');
        }
        return $this->tipos;
    }

    public function jsonSerialize(): mixed
    {
        return array_merge(parent::jsonSerialize(), [
            'inmobiliaria' => $this->inmobiliaria,
            'sociedad' => $this->sociedad,
            'tipos' => $this->tipos(),
        ]);
    }
}
