Files
oficial/app/src/Model/Venta/Promotion.php
Juan Pablo Vial 9d135e2c26 Base de Datos
2025-02-18 16:02:10 -03:00

30 lines
831 B
PHP

<?php
namespace Incoviba\Model\Venta;
use DateTimeInterface;
use Incoviba\Common;
class Promotion extends Common\Ideal\Model
{
public Precio $price;
public float $amount;
public DateTimeInterface $startDate;
public DateTimeInterface $endDate;
public DateTimeInterface $validUntil;
public int $state;
protected function jsonComplement(): array
{
return [
'price_id' => $this->price->id,
'amount' => $this->amount,
'start_date' => $this->startDate->format('Y-m-d'),
'end_date' => $this->endDate->format('Y-m-d'),
'valid_until' => $this->validUntil->format('Y-m-d'),
'state' => [
'id' => $this->state,
'description' => Promotion\State::name($this->state)
]
];
}
}