Auth, Login, Home, Venta->Listados->Precios
This commit is contained in:
46
app/src/Model/Venta/Propietario.php
Normal file
46
app/src/Model/Venta/Propietario.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use Incoviba\Common\Ideal\Model;
|
||||
use Incoviba\Model\Direccion;
|
||||
|
||||
class Propietario extends Model
|
||||
{
|
||||
public int $rut;
|
||||
public string $dv;
|
||||
public string $nombres;
|
||||
public array $apellidos;
|
||||
public Datos $datos;
|
||||
public ?Propietario $representante;
|
||||
public ?bool $otro;
|
||||
|
||||
public function rut(): string
|
||||
{
|
||||
return implode('-', [
|
||||
number_format($this->rut, 0, ',', '.'),
|
||||
$this->dv
|
||||
]);
|
||||
}
|
||||
public function nombreCompleto(): string
|
||||
{
|
||||
return implode(' ', [
|
||||
$this->nombres,
|
||||
implode(' ', $this->apellidos)
|
||||
]);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge([
|
||||
'rut' => $this->rut,
|
||||
'dv' => $this->dv,
|
||||
'rut_formateado' => $this->rut(),
|
||||
'nombres' => $this->nombres,
|
||||
'apellidos' => $this->apellidos,
|
||||
'nombre_completo' => $this->nombreCompleto(),
|
||||
], $this->datos->jsonSerialize(), [
|
||||
'representante' => $this->representante ?? '',
|
||||
'otro' => $this->otro ?? ''
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user