[add] Endpoint to calculate salary

This commit is contained in:
2018-08-14 04:06:36 -06:00
parent 568c6d23a9
commit caa31136f1
3 changed files with 172 additions and 3 deletions

View File

@@ -103,4 +103,12 @@ $app->post('/api/employee/workday', function ($request, $response) {
return $response->withStatus(200)
->withHeader('Content-Type', 'application/json')
->write(json_encode($this->employeeApplication->SaveNewWorkDay($requestData)));
});
$app->get('/api/employee/salary/{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->calculateSalaryByCode($code)));
});