[add] Basic endpoint for workday data

This commit is contained in:
Jose Pabl Domingo Aramburo Sanchez 2018-08-14 11:52:57 -06:00
parent f864e74247
commit 03cbcce59f
2 changed files with 41 additions and 28 deletions

View File

@ -815,6 +815,10 @@ class EmployeeApplication{
return $results[0]['contractType'];
}
function getDataWorkDayByDateAndCode($date, $code){
return array('status' => 'success', 'message' => 'Successfully did the thing.');
}
/**
* Gets all the worked days for an employee and determines how much they're
* getting paid

View File

@ -112,3 +112,12 @@ $app->get('/api/employee/salary/{code}', function (Request $request, Response $r
->withHeader('Content-Type', 'application/json')
->write(json_encode($this->employeeApplication->calculateSalaryByCode($code)));
});
$app->get('/api/employee/salary/date/{date}/code/{code}', function (Request $request, Response $response, array $args) {
$date = $args['date'];
$code = $args['code'];
return $response->withStatus(200)
->withHeader('Content-Type', 'application/json')
->write(json_encode($this->employeeApplication->getDataWorkDayByDateAndCode($date, $code)));
});