From 0696a5a35e8cc40f0afb92f62b00f66026cdace4 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Wed, 11 Jun 2025 16:33:50 +0530 Subject: [PATCH 01/34] HR login api correction : GWM --- app/Controllers/RestAuthenticationController.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index b2ab28b..354fe72 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -283,8 +283,8 @@ class RestAuthenticationController extends AdminController $result = ['user_verification' => true ,'message' => "Verified Successfully"]; return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); } else { - $result = ['user_verification' => false , 'message' => "User not found"]; - return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); + // Call the third-party API function + return $this->callThirdPartyAPI($this->request->getJSON(),'verifyHrWithMobileNumber'); } } catch (\Throwable $th) { @@ -322,9 +322,17 @@ class RestAuthenticationController extends AdminController ->find(); $result = JWTToken::encode($hrData['0']); - return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); + + // Call the third-party API function + $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedHrData'); + return $this->respond(['status' => 'success','code' => 200,'data' => $result , 'post_enrollment'=> json_decode($apiResponse, true)],200); + + } else { - return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200); + + // Call the third-party API function + $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedHrData'); + return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP" , 'post_enrollment'=> json_decode($apiResponse, true)],200); } } catch (\Exception $e) { return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); From e75c769801fb55d3c0547802884c532540e37412 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 13 Jun 2025 09:54:03 +0530 Subject: [PATCH 02/34] GWM : add dependent api --- app/Config/Routes.php | 1 + .../RestAuthenticationController.php | 26 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index eca94e6..6c58447 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -435,6 +435,7 @@ $routes->post("/employeeRest/verifyEmployeeEmailId", "RestAuthenticationControll //HR login api's $routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber"); +$routes->post("/employeeRest/verifyHrWithEmail", "RestAuthenticationController::verifyHrWithEmail"); $routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData"); $routes->group("/api", ["filter" => "authJWT"], function ($routes) { diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 354fe72..aa5ad0d 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -291,6 +291,30 @@ class RestAuthenticationController extends AdminController return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500); } } + + public function verifyHrWithEmail() + { + try { + $email = $this->request->getJSON()->email; + + $HrData = $this->hrModel->where('email', $email) + ->where('contact_type', 'client') + ->where('is_active', 1) + ->first(); + + if ($HrData) { + + $result = ['user_verification' => true ,'message' => "Verified Successfully"]; + return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); + } else { + // Call the third-party API function + return $this->callThirdPartyAPI($this->request->getJSON(),'verifyHrWithEmail'); + + } + } catch (\Throwable $th) { + return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500); + } + } public function getVerifiedHrData() @@ -329,7 +353,7 @@ class RestAuthenticationController extends AdminController } else { - + // Call the third-party API function $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedHrData'); return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP" , 'post_enrollment'=> json_decode($apiResponse, true)],200); From 4479e94e414903f460dfdba35dc26394c3577301 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 13 Jun 2025 10:02:59 +0530 Subject: [PATCH 03/34] GWM : add dependent api --- app/Controllers/EmployeeRestController.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index e6db9c0..7d7b738 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -230,19 +230,23 @@ class EmployeeRestController extends AdminController try { $data = $this->request->getJSON(); - // dd($data); + //enrolment check + $openForEnrollment = $this->findThePolicyIsOpenForEnrollment($data[0]->client_policy_id); + if($openForEnrollment == false){ + return $this->respond(['status' => 'failed','code' => 404,'data' => [],'message' => 'Enrollment closed.'], 404); + } + //dependent duplicate check if ( ! isset($data[0]->id) ) { $validationFailed = $this->employeeHelper->validation_addEmployeeAndDependence($data); if($validationFailed){ - return $this->respond(['status' => 'failed','code' => 404,'data' => "validation_addEmployeeAndDependence failed ..!!"], 404); + return $this->respond(['status' => 'failed','code' => 404,'data' => [],'message' => "Relation already exists."], 404); } } - $openForEnrollment = $this->findThePolicyIsOpenForEnrollment($data[0]->client_policy_id); - if($openForEnrollment == false){ return $this->respond(['status' => 'failed','code' => 404,'data' => 'Enrollment closed'], 404); } + if ($data) { @@ -291,14 +295,14 @@ class EmployeeRestController extends AdminController $this->updatePremiumAmount($data[0]->client_policy_id , $data[0]->emp_code , $data[0]->client_branch_id); $result = []; - return $this->respond(['status' => 'success','code' => 200,'data' => $result], 200); + return $this->respond(['status' => 'success','code' => 200,'data' => $result,'message' => "Successfully updated."], 200); } else { $result = "No Matches"; - return $this->respond(['status' => 'failed','code' => 404,'data' => $result], 404); + return $this->respond(['status' => 'failed','code' => 404,'data' => $result,'message' => "Action failed."], 404); } } } catch (\Exception $e) { - return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500); + return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage(),'message' => "Action failed."], 500); } } From 5194da85f7c8b55cb0225b93ef87704b364cab92 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 13 Jun 2025 10:10:49 +0530 Subject: [PATCH 04/34] GWM : add dependent api --- app/Controllers/EmployeeRestController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 7d7b738..ae77a55 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -233,7 +233,7 @@ class EmployeeRestController extends AdminController //enrolment check $openForEnrollment = $this->findThePolicyIsOpenForEnrollment($data[0]->client_policy_id); if($openForEnrollment == false){ - return $this->respond(['status' => 'failed','code' => 404,'data' => [],'message' => 'Enrollment closed.'], 404); + return $this->respond(['status' => 'failed','code' => 404,'data' => [],'message' => 'Enrollment closed.'], 200); } //dependent duplicate check @@ -241,7 +241,7 @@ class EmployeeRestController extends AdminController $validationFailed = $this->employeeHelper->validation_addEmployeeAndDependence($data); if($validationFailed){ - return $this->respond(['status' => 'failed','code' => 404,'data' => [],'message' => "Relation already exists."], 404); + return $this->respond(['status' => 'failed','code' => 404,'data' => [],'message' => "Relation already exists."], 200); } } @@ -298,7 +298,7 @@ class EmployeeRestController extends AdminController return $this->respond(['status' => 'success','code' => 200,'data' => $result,'message' => "Successfully updated."], 200); } else { $result = "No Matches"; - return $this->respond(['status' => 'failed','code' => 404,'data' => $result,'message' => "Action failed."], 404); + return $this->respond(['status' => 'failed','code' => 404,'data' => $result,'message' => "Action failed."], 200); } } } catch (\Exception $e) { From b0de0e9d8402f9c1e90dd6e6bc9978a92bdcbc29 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 16 Jun 2025 12:12:32 +0530 Subject: [PATCH 05/34] HR api change : GWM --- app/Config/Routes.php | 4 +- app/Controllers/EmployeeRestController.php | 2 +- .../RestAuthenticationController.php | 95 ++++++++++++++++--- 3 files changed, 87 insertions(+), 14 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 6c58447..e702f37 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -450,7 +450,7 @@ $routes->post("calculatePremium", "EmployeeRestController::calculatePremium"); // $routes->post("employeeRest/createOrUpdateEmployeePolicySiAmount", "EmployeeRestController::createOrUpdateEmployeePolicySiAmount"); // $routes->post("employeeRest/calculatePremium", "EmployeeRestController::calculatePremium"); -$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { +// $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { // $routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); @@ -488,7 +488,7 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { $routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy"); $routes->get("getFEContent", "EmployeeRestController::getFEContent"); $routes->get("getAdvertisementImage", "EmployeeRestController::getAdvertisementImage"); -}); +// }); $routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy"); $routes->get("sendPushNotification", "EmployeeRestController::sendPushNotification"); $routes->post("sendEmail", "EmployeeRestController::send_email"); diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index ae77a55..191d356 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2724,7 +2724,7 @@ class EmployeeRestController extends AdminController ->where('client_policy.enrolment_visibility', 1 ) ->orderby('client_policy.id' , 'ASC') ->findAll(); - +dd( $ClientPolicyData); // Retrieve employee and dependents data by passing the employee code $employeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code')) ->where('client_id',$this->request->getGet('client_id')) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index aa5ad0d..2c57f1a 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -75,7 +75,7 @@ class RestAuthenticationController extends AdminController - + // employee auth api's start public function verifyEmployeeWithMobileNumber() { @@ -268,6 +268,11 @@ class RestAuthenticationController extends AdminController } } + // employee auth api's end + + + // HR auth api's start + public function verifyHrWithMobileNumber() { try { @@ -295,17 +300,59 @@ class RestAuthenticationController extends AdminController public function verifyHrWithEmail() { try { - $email = $this->request->getJSON()->email; + + $data = $this->request->getJSON(); + + $email = $data->email; $HrData = $this->hrModel->where('email', $email) ->where('contact_type', 'client') ->where('is_active', 1) ->first(); - + if ($HrData) { - $result = ['user_verification' => true ,'message' => "Verified Successfully"]; - return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); + $otp = random_int(100000, 999999); + + $sql = " + UPDATE level_contacts + SET otp = ? + WHERE email = ? + AND contact_type = 'client' + AND is_active = 1 + "; + + $db = db_connect(); + $update = $db->query($sql, [$otp, $email]); + + if($update) + { + $data->otp = $otp; + $this->callThirdPartyAPI($data, 'updateHROTP'); + + $common = [ + 'login_type' => 'HR login', + 'login_email' => $email, + 'mail_type' => 'otp_mail' + ]; + $subject = 'Nhance user verification - OTP'; + $mail_content = $otp . ' is your verification code for Nhance.'; + $res = MailHelper::send_email(['mail' => $email, 'subject' => $subject, 'common' => $common, 'message' => $mail_content]); + $this->myLogger->logme("info", $res); + + if (json_decode($res)->status == 'success') { + $result = ['user_verification' => true, 'message' => "Verified Successfully"]; + return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result], 200); + } else { + $result = ['user_verification' => false, 'message' => "Mail sending failed , try again"]; + return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200); + } + } else { + + $result = ['user_verification' => false, 'message' => "Verification failed , try again"]; + return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200); + } + } else { // Call the third-party API function return $this->callThirdPartyAPI($this->request->getJSON(),'verifyHrWithEmail'); @@ -320,11 +367,23 @@ class RestAuthenticationController extends AdminController public function getVerifiedHrData() { try { - $mobile_number = $this->request->getJSON()->mobile_number; - $otp_verification = $this->request->getJSON()->otp_verification; + // mobile number + $otp_verification = isset($this->request->getJSON()->otp_verification) ? $this->request->getJSON()->otp_verification : null; + $mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null; + // email id + $otp = isset($this->request->getJSON()->otp) ? $this->request->getJSON()->otp : null; + $email = isset($this->request->getJSON()->email) ? $this->request->getJSON()->email : null; + + if (isset($mobile_number)) + { + $hrData = $this->hrModel->where('mobile', $mobile_number)->where('contact_type', 'client')->first(); + }else{ + $hrData = $this->hrModel->where('email', $email)->where('contact_type', 'client')->where('otp', $otp)->first(); + } + + if ($hrData && $otp_verification == true || $hrData && isset($this->request->getJSON()->otp) ) + { - $hrData = $this->hrModel->where('mobile', $mobile_number)->first(); - if ($hrData && $otp_verification == true) { $auth = HttpRequestHelper::getRequestInfo(); if ($auth) { $data = [ @@ -340,10 +399,24 @@ class RestAuthenticationController extends AdminController } - $hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id') + if(isset($this->request->getJSON()->mobile_number)){ + + $hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id') + ->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left') + ->where('level_contacts.mobile', $mobile_number ) + ->where('level_contacts.contact_type', 'client') + ->find(); + + }else if(isset($this->request->getJSON()->otp)){ + + $this->hrModel->where('email', $email)->where('otp', $otp)->where('contact_type', 'client')->set(['otp'=>null])->update(); + + $hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id') ->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left') - ->where('level_contacts.mobile', $mobile_number ) + ->where('level_contacts.email', $email ) + ->where('level_contacts.contact_type', 'client') ->find(); + } $result = JWTToken::encode($hrData['0']); From fb0426a308f88286a8d93480a1ab719cadd71d18 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 16 Jun 2025 17:27:57 +0530 Subject: [PATCH 06/34] CHANGES_ in hr api's : GWM --- app/Config/Routes.php | 3 +- app/Controllers/EmployeeRestController.php | 92 ++++++++-------------- 2 files changed, 35 insertions(+), 60 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index e702f37..1b552d8 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -477,7 +477,8 @@ $routes->post("calculatePremium", "EmployeeRestController::calculatePremium"); $routes->post("iAgreeForAddOn", "EmployeeRestController::iAgreeForAddOn"); $routes->get("exportDataByClientPolicyId", "EmployeeRestController::exportDataByClientPolicyId"); - $routes->get("getCashDepositData", "EmployeeRestController::getCashDepositData"); + + $routes->get("getPolicyLevelEmployeeSummaryData", "EmployeeRestController::getPolicyLevelEmployeeSummaryData"); $routes->get("exportCashDepositData", "EmployeeRestController::exportCashDepositData"); $routes->get("removeEmpAndEmpPolicyData", "EmployeeRestController::removeEmpAndEmpPolicyData"); diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 191d356..3f03147 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2487,72 +2487,46 @@ class EmployeeRestController extends AdminController } - public function getCashDepositData() + public function getPolicyLevelEmployeeSummaryData() { - $ClientPolicyData = $this->clientPolicyModel->select('client_policy.client_id as clientId , client_policy.insurer_id as insurerId,insurers.name as insurer_name') - ->join('insurers', 'client_policy.insurer_id = insurers.id', 'left') - ->where('client_policy.client_id', $this->request->getGet('client_id') ) - ->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') ) - ->where('client_policy.is_active', 1 ) - ->where('client_policy.policy_status', 1) - ->groupBy('client_policy.insurer_id') - ->findAll(); - $result = []; - - if(count($ClientPolicyData)) - { - foreach ($ClientPolicyData as $key => $value) { - - $data['clientId'] = $value['clientId']; - $data['insurerId'] = $value['insurerId']; - $data['insurerName'] = $value['insurer_name']; - $data['depositData'] = $this->clientPolicyModel->getdepositData($value['clientId'],$value['insurerId']); - $data['balance'] = count($data['depositData']) ? $data['depositData'][0]->balance : 0; - - $data['policyDetails'] = []; - $ClientPolicyData = $this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, client_policy.policy_type_id as policy_type_id, client_policy.is_addon as is_addon , client_policy.open_for_enrollment as OpenForEnrollment , client_policy.inception_type as inception_type ') - - ->where('client_policy.insurer_id', $value['insurerId'] ) - ->where('client_policy.client_id', $this->request->getGet('client_id') ) - ->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') ) - ->where('client_policy.is_active', 1 ) - ->where('client_policy.policy_status', 1) - ->findAll(); - // dd( $ClientPolicyData); - foreach ($ClientPolicyData as $key => $value) + + $ClientPolicyData = $this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, client_policy.policy_type_id as policy_type_id, client_policy.is_addon as is_addon , client_policy.open_for_enrollment as OpenForEnrollment , client_policy.inception_type as inception_type ') + ->where('client_policy.client_id', $this->request->getGet('client_id') ) + ->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') ) + ->where('client_policy.is_active', 1 ) + ->where('client_policy.policy_status', 1) + ->findAll(); + $result = []; + // dd( $ClientPolicyData); + foreach ($ClientPolicyData as $key => $value) + { + $policyTypeData = $this->policyTypeModel->where('id',$value['policy_type_id'])->get()->getRow(); + $value['type'] = $policyTypeData->policy_type; + $value['policy_name'] = $policyTypeData->long_name; + $employeeDetails = $this->employeePolicyModel->getEmployeePolicy( client_id:$value['client_id'],policy_id: $value['client_policy_id'],status:0,branch_id:$this->request->getGet('client_branch_id')); + $enrolledCount = 0; + $draftCount = 0; + if(count($employeeDetails)) { - $policyTypeData = $this->policyTypeModel->where('id',$value['policy_type_id'])->get()->getRow(); - $value['type'] = $policyTypeData->policy_type; - $value['policy_name'] = $policyTypeData->long_name; - $employeeDetails = $this->employeePolicyModel->getEmployeePolicy( client_id:$value['client_id'],policy_id: $value['client_policy_id'],status:0,branch_id:$this->request->getGet('client_branch_id')); - $enrolledCount = 0; - $draftCount = 0; - if(count($employeeDetails)) - { - foreach ($employeeDetails as $item) { - if ($item['emp_status'] === 'enrolled') { - $enrolledCount++; - } elseif ($item['emp_status'] === 'draft') { - $draftCount++; - } + foreach ($employeeDetails as $item) { + if ($item['emp_status'] === 'enrolled') { + $enrolledCount++; + } elseif ($item['emp_status'] === 'draft') { + $draftCount++; } } - - $value['totalMembersCount'] = count($employeeDetails); - $value['membersCountOfEnrolled'] = $enrolledCount; - $value['membersCountOfDraft'] = $draftCount; - - array_push($data['policyDetails'],$value); } - - - array_push($result,$data); - } - } - + $value['totalMembersCount'] = count($employeeDetails); + $value['membersCountOfEnrolled'] = $enrolledCount; + $value['membersCountOfDraft'] = $draftCount; + + array_push($result,$value); + } + + if($result) { @@ -2724,7 +2698,7 @@ class EmployeeRestController extends AdminController ->where('client_policy.enrolment_visibility', 1 ) ->orderby('client_policy.id' , 'ASC') ->findAll(); -dd( $ClientPolicyData); + // Retrieve employee and dependents data by passing the employee code $employeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code')) ->where('client_id',$this->request->getGet('client_id')) From a61c17efa41ac93cdf3f35e3f470a2446dc0831f Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 16 Jun 2025 17:28:22 +0530 Subject: [PATCH 07/34] CHANGES_ in hr api's : GWM --- app/Config/Routes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 1b552d8..67cbf08 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -450,7 +450,7 @@ $routes->post("calculatePremium", "EmployeeRestController::calculatePremium"); // $routes->post("employeeRest/createOrUpdateEmployeePolicySiAmount", "EmployeeRestController::createOrUpdateEmployeePolicySiAmount"); // $routes->post("employeeRest/calculatePremium", "EmployeeRestController::calculatePremium"); -// $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { +$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { // $routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); @@ -489,7 +489,7 @@ $routes->post("calculatePremium", "EmployeeRestController::calculatePremium"); $routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy"); $routes->get("getFEContent", "EmployeeRestController::getFEContent"); $routes->get("getAdvertisementImage", "EmployeeRestController::getAdvertisementImage"); -// }); +}); $routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy"); $routes->get("sendPushNotification", "EmployeeRestController::sendPushNotification"); $routes->post("sendEmail", "EmployeeRestController::send_email"); From 1b0a1c2099a5ef2ae0adb81ed3fc37d2957bba01 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 27 Jun 2025 14:56:52 +0530 Subject: [PATCH 08/34] CHANGES_ HR api Hr access control change : GWM --- app/Controllers/EmployeeRestController.php | 17 +++++++++++++ .../RestAuthenticationController.php | 25 ++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 3f03147..be71528 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2490,12 +2490,29 @@ class EmployeeRestController extends AdminController public function getPolicyLevelEmployeeSummaryData() { + $hr_id = $this->request->getGet('hr_id'); + $restAuthController = new RestAuthenticationController; + //call and get allowed policy data from post enrollment + $queryParams = [ + 'hr_id' => $hr_id, + 'request_for' => 'pre_enrollment' + ]; + $HRAccessRes = $restAuthController->callThirdPartyGETAPI($queryParams,'getHRAccessData'); + $HRAccessData = json_decode($HRAccessRes,true); + if(isset($HRAccessData['data']['allowed_pre_policies'])) + { + $policyId = json_decode($HRAccessData['data']['allowed_pre_policies'],true); + }else{ + $policyId = []; + } + $ClientPolicyData = $this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, client_policy.policy_type_id as policy_type_id, client_policy.is_addon as is_addon , client_policy.open_for_enrollment as OpenForEnrollment , client_policy.inception_type as inception_type ') ->where('client_policy.client_id', $this->request->getGet('client_id') ) ->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') ) ->where('client_policy.is_active', 1 ) ->where('client_policy.policy_status', 1) + ->whereIn('client_policy.id', $policyId) ->findAll(); $result = []; // dd( $ClientPolicyData); diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 2c57f1a..6ebd109 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -73,6 +73,20 @@ class RestAuthenticationController extends AdminController return $response->getBody(); } + public function callThirdPartyGETAPI($queryParams, $endPoint) + { + $client = \Config\Services::curlrequest(); + $url = env('POST_ENROLLMENT_BASEURL') . $endPoint; + + $response = $client->get($url, [ + 'query' => $queryParams, // pass as query parameters + 'http_errors' => false // prevent exception on non-200 status + ]); + + return $response->getBody(); + } + + // employee auth api's start @@ -418,8 +432,17 @@ class RestAuthenticationController extends AdminController ->find(); } + //call and get allowed module data from post enrollment + $queryParams = [ + 'hr_id' => $hrData['0']['id'], + 'request_for' => 'pre_enrollment' + ]; + $HRAccessRes = $this->callThirdPartyGETAPI($queryParams,'getHRAccessData'); + $HRAccessData = json_decode($HRAccessRes,true); + if(isset($HRAccessData['data']['allowed_modules'])){ $hrData['0']['allowed_modules'] = json_decode($HRAccessData['data']['allowed_modules'],true)['pre']; }else{ $hrData['0']['allowed_modules'] = []; } + $result = JWTToken::encode($hrData['0']); - + // Call the third-party API function $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedHrData'); return $this->respond(['status' => 'success','code' => 200,'data' => $result , 'post_enrollment'=> json_decode($apiResponse, true)],200); From 9bf933511c1df2749b45b30dddf4de9221c8d0ac Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 30 Jun 2025 11:29:43 +0530 Subject: [PATCH 09/34] CHANGE_ hr access data empty handled : GWM --- app/Controllers/EmployeeRestController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index be71528..240afca 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2506,6 +2506,11 @@ class EmployeeRestController extends AdminController $policyId = []; } + if(count($policyId) == 0){ + return $this->respond(['status' => 'failed','code' => (count($policyId) ? 200 : 404),'data' => [] ], 200); + } + + $ClientPolicyData = $this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, client_policy.policy_type_id as policy_type_id, client_policy.is_addon as is_addon , client_policy.open_for_enrollment as OpenForEnrollment , client_policy.inception_type as inception_type ') ->where('client_policy.client_id', $this->request->getGet('client_id') ) From 35af3ad88fddb92c9ec3d21fd06f12d94165e947 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Mon, 30 Jun 2025 12:52:48 +0530 Subject: [PATCH 10/34] CHANGE_LOGO : RV --- app/Views/layout/header.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index eb9311d..0a07011 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -91,6 +91,14 @@ min-height: 0; } + body[data-sidebar-size=condensed] .navbar-custom { + left: 155px !important; + } + + body[data-sidebar-size=condensed] .logo-box { + width: 155px !important; + } + .navbar-custom { top: -10px !important; height: 61px !important; @@ -536,7 +544,7 @@