Venta->Listado->Cierres
This commit is contained in:
@ -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
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
21
app/src/Model/Venta/EstadoCierre.php
Normal file
21
app/src/Model/Venta/EstadoCierre.php
Normal 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')
|
||||
]);
|
||||
}
|
||||
}
|
16
app/src/Model/Venta/TipoEstadoCierre.php
Normal file
16
app/src/Model/Venta/TipoEstadoCierre.php
Normal 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
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user