<?php
namespace Incoviba\Service\Venta;

use Incoviba\Repository;
use Incoviba\Model;

class BonoPie
{
    public function __construct(protected Repository\Venta\BonoPie $bonoPieRepository) {}

    public function add(array $data): Model\Venta\BonoPie
    {
        $filteredData = $this->bonoPieRepository->filterData($data);
        $bono = $this->bonoPieRepository->create($filteredData);
        return $this->bonoPieRepository->save($bono);
    }
    public function getByVenta(int $venta_id): Model\Venta\BonoPie
    {
        return $this->bonoPieRepository->fetchByVenta($venta_id);
    }
}
