[add] Emṕloyee data by code
This commit is contained in:
parent
1390427ec0
commit
dadea504d0
@ -269,6 +269,16 @@ class EmployeeApplication{
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $code string
|
||||
* @return array
|
||||
*/
|
||||
function getEmployeeDataByCode($code){
|
||||
$idEmployee = $this->getIdEmployeeTypeByCode($code);
|
||||
|
||||
return $this->proxyGetEmployeeDataById($idEmployee);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $idPerson integer
|
||||
* @param $firstName binary
|
||||
|
@ -79,10 +79,18 @@ $app->get('/api/employee/type/{code}', function (Request $request, Response $res
|
||||
->write(json_encode($this->employeeApplication->getIdEmployeeTypeByCode($code)));
|
||||
});
|
||||
|
||||
$app->get('/api/employee/{idEmployee}', function (Request $request, Response $response, array $args) {
|
||||
$app->get('/api/employee/id/{idEmployee}', function (Request $request, Response $response, array $args) {
|
||||
$idEmployee = $args['idEmployee'];
|
||||
|
||||
return $response->withStatus(200)
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->write(json_encode($this->employeeApplication->proxyGetEmployeeDataById($idEmployee)));
|
||||
});
|
||||
|
||||
$app->get('/api/employee/code/{code}', function (Request $request, Response $response, array $args) {
|
||||
$code = $args['code'];
|
||||
|
||||
return $response->withStatus(200)
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->write(json_encode($this->employeeApplication->getEmployeeDataByCode($code)));
|
||||
});
|
@ -43,7 +43,7 @@ return [
|
||||
|
||||
// Employee settings
|
||||
'employee' => [
|
||||
'codeLength' => '5',
|
||||
'codeLength' => '3',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user