FIX_HR_SMPL_DOWNLOAD_LINK

This commit is contained in:
VENKATESHWARAN 2025-11-13 16:28:34 +05:30
parent 61a2a67e0b
commit d38e253fbc
2 changed files with 26 additions and 6 deletions

View File

@ -462,6 +462,8 @@ $routes->post("employeeRest/changePassword", "RestAuthenticationController::chan
$routes->post("employeeRest/verifyPassword", "RestAuthenticationController::verifyPassword");
$routes->post("employeeRest/verifyOtp", "RestAuthenticationController::verifyOtp");
$routes->post("employeeRest/checkPassword", "RestAuthenticationController::checkPassword");
$routes->get("employeeRest/downloadSampleExcel/(:any)", "EmployeeController::downloadSampleExcelFile/$1");
// $routes->post("employeeRest/createOrUpdateEmployeePolicySiAmount", "EmployeeRestController::createOrUpdateEmployeePolicySiAmount");

View File

@ -800,9 +800,17 @@ class EmployeeRestController extends AdminController
$empServiceController = new EmployeeServiceController();
$result = $empServiceController->excelFileFormatValidation(['file_id' => $file_id]);
if(isset($result['error_summary']) && count($result['error_summary']))
{
$result = $empServiceController->getExcelErrorData($file_id);
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "file upload failed with errors",'data' => $result], 200);
{
if(isset($result['error_type'])){
$result = $empServiceController->getExcelErrorData($file_id);
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "file upload failed with errors",'data' => $result], 200);
}else {
$message = "file upload failed with errors";
if(isset($result['error_data'])){
$message = $result['error_data'];
}
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => $message,'data' => $result], 200);
}
}
@ -1094,9 +1102,19 @@ class EmployeeRestController extends AdminController
}else{
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Client id and Client Policy id is Not Match!" ], 404);
}
} catch (\Exception $e) {
$this->myLogger->logme("error", ($e->getMessage().' --- '.$e->getLine() . '----' . $e->getTraceAsString()));
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
} catch (\Throwable $th) {
$this->myLogger->logme("error", ($th->getMessage().' --- '.$th->getLine() . '----' . $th->getTraceAsString()));
$errorData = [
'message' => $th->getMessage(),
'file' => $th->getFile(),
'line' => $th->getLine(),
'code' => $th->getCode(),
'trace' => $th->getTraceAsString(),
'trace_array' => $th->getTrace(), // full array version (optional)
'function' => $th->getTrace()[0]['function'] ?? null,
'class' => $th->getTrace()[0]['class'] ?? null,
];
return $this->respond(['status' => 'failed','code' => 500,'data' => $th->getMessage(), 'error_data' => $errorData], 500);
}