Contratos desde proyectos

This commit is contained in:
Juan Pablo Vial
2025-03-03 21:46:53 -03:00
parent aeeca65d94
commit 8ea4995f6b
3 changed files with 38 additions and 0 deletions

View File

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