Revisiones

This commit is contained in:
Juan Pablo Vial
2025-06-25 12:22:01 -04:00
parent ca1ed3f870
commit 9edf0d9120
8 changed files with 114 additions and 5 deletions

View File

@ -23,7 +23,6 @@ class Unidad extends Ideal\Repository
->register('pt', (new Implement\Repository\Mapper())
->setProperty('proyectoTipoUnidad')
->setFunction(function($data) {
var_dump($data['pt']);
return $this->proyectoTipoUnidadService->getById($data['pt']);
}));
return $this->parseData(new Model\Venta\Unidad(), $data, $map);

View File

@ -9,6 +9,7 @@ use Psr\Log\LoggerInterface;
use Incoviba\Common\Ideal;
use Incoviba\Common\Implement\Exception\EmptyResult;
use Incoviba\Exception\ServiceAction\Create;
use Incoviba\Exception\ServiceAction\Read;
use Incoviba\Repository;
use Incoviba\Model;
@ -23,6 +24,20 @@ class Cuota extends Ideal\Service
parent::__construct($logger);
}
/**
* @param int $cuota_id
* @return Model\Venta\Cuota
* @throws Read
*/
public function getById(int $cuota_id): Model\Venta\Cuota
{
try {
return $this->process($this->cuotaRepository->fetchById($cuota_id));
} catch (EmptyResult $exception) {
throw new Read(__CLASS__, $exception);
}
}
public function pendientes(): array
{
$cuotas = $this->cuotaRepository->fetchPendientes();
@ -130,4 +145,9 @@ class Cuota extends Ideal\Service
throw new Create(__CLASS__, $exception);
}
}
protected function process(Model\Venta\Cuota $cuota): Model\Venta\Cuota
{
return $cuota;
}
}