Base de Datos
This commit is contained in:
30
app/src/Model/Venta/Promotion.php
Normal file
30
app/src/Model/Venta/Promotion.php
Normal 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)
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user