Venta->Listado->Cierres

This commit is contained in:
Juan Pablo Vial
2023-07-25 17:03:57 -04:00
parent 1a7b10ce3c
commit 43cd955061
12 changed files with 596 additions and 5 deletions

View File

@ -13,14 +13,22 @@ class Cierre extends Ideal\Model
public bool $relacionado;
public Propietario $propietario;
public array $estados = [];
public ?EstadoCierre $current = null;
public array $unidades = [];
public function jsonSerialize(): mixed
{
return array_merge(parent::jsonSerialize(), [
'proyecto_id' => $this->proyecto->id,
'proyecto' => $this->proyecto,
'precio' => $this->precio,
'date_time' => $this->dateTime->format('Y-m-d H:i:s'),
'relacionado' => $this->relacionado,
'propietario' => $this->propietario->rut
'propietario' => $this->propietario->rut,
'estados' => $this->estados,
'estado_cierre' => $this->current,
'unidades' => $this->unidades
]);
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace Incoviba\Model\Venta;
use DateTimeInterface;
use Incoviba\Common\Ideal;
class EstadoCierre extends Ideal\Model
{
public Cierre $cierre;
public TipoEstadoCierre $tipoEstadoCierre;
public DateTimeInterface $fecha;
public function jsonSerialize(): mixed
{
return array_merge(parent::jsonSerialize(), [
'cierre_id' => $this->cierre->id,
'tipo_estado_cierre' => $this->tipoEstadoCierre,
'fecha' => $this->fecha->format('Y-m-d')
]);
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace Incoviba\Model\Venta;
use Incoviba\Model;
class TipoEstadoCierre extends Model\Tipo
{
public bool $vigente;
public function jsonSerialize(): mixed
{
return array_merge(parent::jsonSerialize(), [
'vigente' => $this->vigente
]);
}
}