Base de Datos

This commit is contained in:
Juan Pablo Vial
2025-02-18 16:02:10 -03:00
parent 8b386b8b44
commit 9d135e2c26
25 changed files with 1091 additions and 1 deletions

View File

@ -0,0 +1,30 @@
<?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)
]
];
}
}