2023-09-12
This commit is contained in:
@ -8,13 +8,23 @@ class Pie
|
||||
{
|
||||
public function __construct(
|
||||
protected Repository\Venta\Pie $pieRepository,
|
||||
protected Repository\Venta\Cuota $cuotaRepository
|
||||
protected Cuota $cuotaService
|
||||
) {}
|
||||
|
||||
public function getById(int $pie_id): Model\Venta\Pie
|
||||
{
|
||||
$pie = $this->pieRepository->fetchById($pie_id);
|
||||
$pie->cuotasArray = $this->cuotaRepository->fetchVigenteByPie($pie_id);
|
||||
$pie->cuotasArray = $this->cuotaService->getVigenteByPie($pie_id);
|
||||
return $pie;
|
||||
}
|
||||
|
||||
public function add(array $data): Model\Venta\Pie
|
||||
{
|
||||
$pie = $this->pieRepository->create($data);
|
||||
return $this->pieRepository->save($pie);
|
||||
}
|
||||
public function addCuota(array $data): Model\Venta\Cuota
|
||||
{
|
||||
return $this->cuotaService->add($data);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user