Listado proyectos
This commit is contained in:
@ -21,6 +21,13 @@ class Inmobiliaria extends Model
|
||||
$this->dv
|
||||
]);
|
||||
}
|
||||
public function nombreCompleto(): string
|
||||
{
|
||||
return implode(' ', [
|
||||
$this->razon,
|
||||
$this->tipoSociedad->descripcion
|
||||
]);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ class Proyecto extends Ideal\Model
|
||||
public float $corredor;
|
||||
public int $pisos;
|
||||
public int $subterraneos;
|
||||
protected Proyecto\Etapa $etapa;
|
||||
|
||||
public function inmobiliaria(): Inmobiliaria
|
||||
{
|
||||
|
30
app/src/Model/Proyecto/EstadoProyecto.php
Normal file
30
app/src/Model/Proyecto/EstadoProyecto.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Proyecto;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Model;
|
||||
|
||||
class EstadoProyecto extends Ideal\Model
|
||||
{
|
||||
protected ?Model\Proyecto $proyecto;
|
||||
public TipoEstadoProyecto $tipoEstadoProyecto;
|
||||
public DateTimeInterface $fecha;
|
||||
|
||||
public function proyecto(): Model\Proyecto
|
||||
{
|
||||
if (!isset($this->proyecto)) {
|
||||
$this->proyecto = $this->runFactory('proyecto');
|
||||
}
|
||||
return $this->proyecto;
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'proyecto' => $this->proyecto(),
|
||||
'tipo_estado_proyecto' => $this->tipoEstadoProyecto,
|
||||
'fecha' => $this->fecha
|
||||
]);
|
||||
}
|
||||
}
|
18
app/src/Model/Proyecto/Etapa.php
Normal file
18
app/src/Model/Proyecto/Etapa.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Proyecto;
|
||||
|
||||
use Incoviba\Common\Ideal;
|
||||
|
||||
class Etapa extends Ideal\Model
|
||||
{
|
||||
public string $descripcion;
|
||||
public int $orden;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'descripcion' => $this->descripcion,
|
||||
'orden' => $this->orden
|
||||
]);
|
||||
}
|
||||
}
|
18
app/src/Model/Proyecto/TipoEstadoProyecto.php
Normal file
18
app/src/Model/Proyecto/TipoEstadoProyecto.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Proyecto;
|
||||
|
||||
use Incoviba\Model\Tipo;
|
||||
|
||||
class TipoEstadoProyecto extends Tipo
|
||||
{
|
||||
public int $orden;
|
||||
public Etapa $etapa;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'orden' => $this->orden,
|
||||
'etapa' => $this->etapa
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user