Mostrar reservas

This commit is contained in:
Juan Pablo Vial
2025-08-12 19:17:32 -04:00
parent 977b5f76f4
commit 27f7d1d579
12 changed files with 967 additions and 113 deletions

View File

@ -35,7 +35,7 @@ class Persona extends Ideal\Service
/**
* @param int $rut
* @return Model\Persona
* @throws Read|Create
* @throws Read
*/
public function getById(int $rut): Model\Persona
{
@ -44,7 +44,11 @@ class Persona extends Ideal\Service
} catch (Implement\Exception\EmptyResult) {
try {
$this->propietarioRepository->fetchById($rut);
return $this->add(compact('rut'));
try {
return $this->add(compact('rut'));
} catch (Create $exception) {
throw new Read(__CLASS__, $exception);
}
} catch (Implement\Exception\EmptyResult $exception) {
throw new Read(__CLASS__, $exception);
}

View File

@ -48,6 +48,20 @@ class Promotion extends Ideal\Service
}
}
/**
* @param int $project_id
* @return array
* @throws Exception\ServiceAction\Read
*/
public function getByProject(int $project_id): array
{
try {
return array_map([$this, 'process'], $this->promotionRepository->fetchByProject($project_id));
} catch (Implement\Exception\EmptyResult $exception) {
throw new Exception\ServiceAction\Read(__CLASS__, $exception);
}
}
/**
* @param int $contract_id
* @return array