This commit is contained in:
2023-11-23 00:53:49 -03:00
parent 9ab0515954
commit bf03e85975
32 changed files with 599 additions and 314 deletions

View File

@ -16,7 +16,16 @@ class Subsidio extends Ideal\Repository
public function create(?array $data = null): Model\Venta\Subsidio
{
$map = new Implement\Repository\MapperParser(['pago', 'subsidio']);
$map = (new Implement\Repository\MapperParser())
->register('pago', (new Implement\Repository\Mapper())
->setProperty('ahorro')
->setFunction(function($data) {
return $this->pagoRepository->fetchById($data['pago']);
}))
->register('subsidio', (new Implement\Repository\Mapper())
->setFunction(function($data) {
return $this->pagoRepository->fetchById($data['subsidio']);
}));
return $this->parseData(new Model\Venta\Subsidio(), $data, $map);
}
public function save(Define\Model $model): Model\Venta\Subsidio