Listado de Precios para Contrato Broker
This commit is contained in:
@ -3,9 +3,11 @@ namespace Incoviba\Model\Venta;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common;
|
||||
use Incoviba\Model\Proyecto\Broker;
|
||||
|
||||
class Promotion extends Common\Ideal\Model
|
||||
{
|
||||
public Broker\Contract $contract;
|
||||
public Precio $price;
|
||||
public float $amount;
|
||||
public DateTimeInterface $startDate;
|
||||
@ -13,11 +15,18 @@ class Promotion extends Common\Ideal\Model
|
||||
public DateTimeInterface $validUntil;
|
||||
public int $state;
|
||||
|
||||
public function price(): float
|
||||
{
|
||||
return $this->price->valor * $this->amount;
|
||||
}
|
||||
|
||||
protected function jsonComplement(): array
|
||||
{
|
||||
return [
|
||||
'contract_rut' => $this->contract->id,
|
||||
'price_id' => $this->price->id,
|
||||
'amount' => $this->amount,
|
||||
'price' => $this->price(),
|
||||
'start_date' => $this->startDate->format('Y-m-d'),
|
||||
'end_date' => $this->endDate->format('Y-m-d'),
|
||||
'valid_until' => $this->validUntil->format('Y-m-d'),
|
||||
@ -27,4 +36,4 @@ class Promotion extends Common\Ideal\Model
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user