From 1ba4618a099d732678d96c29f092509c16b486a0 Mon Sep 17 00:00:00 2001 From: Venba Date: Thu, 11 Jul 2024 06:11:54 +0000 Subject: [PATCH 01/10] FIX_ECARD_CLIENTID_ADDED --- app/Controllers/EmployeeController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index ec8467e6..4a7900d6 100644 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -916,7 +916,7 @@ class EmployeeController extends AdminController try { $get_emp_code_and_client_policy_id = $this->employeePolicyModel - ->select('employee_polices.client_policy_id, employees.emp_code, tpa.short_name') + ->select('employee_polices.client_policy_id, employees.emp_code, tpa.short_name,employees.client_id') ->join('client_policy', 'client_policy.id = employee_polices.client_policy_id') ->join('employees', 'employees.id = employee_polices.employee_id') ->join('tpa', 'tpa.id = client_policy.tpa_id') @@ -940,10 +940,10 @@ class EmployeeController extends AdminController $emp_code = $get_emp_code_and_client_policy_id['emp_code']; - $data = $this->employeePolicyModel->getECardDataUsingMd5($client_policy_id, $emp_code); + $data = $this->employeePolicyModel->getECardDataUsingMd5($client_policy_id, $emp_code,$client_id); if($people == 0){ - $data = $this->employeePolicyModel->getECardSingleData($rand_string, $emp_code); + $data = $this->employeePolicyModel->getECardSingleData($rand_string, $emp_code,$client_id); } // dd($data); From 1b3a7c85c0919f5f36e6a34aa6b988842da19b68 Mon Sep 17 00:00:00 2001 From: Venba Date: Thu, 11 Jul 2024 06:16:08 +0000 Subject: [PATCH 02/10] FIX_ECARD_CLIENTID_ADDED_IN_MODEL --- app/Models/EmployeePolicyModel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 160eb71e..a94410f5 100644 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -814,7 +814,7 @@ class EmployeePolicyModel extends Model ->get()->getResultArray(); } - public function getECardDataUsingMd5($client_policy_id, $emp_code){ + public function getECardDataUsingMd5($client_policy_id, $emp_code,$client_id){ $result = $this->db->table('employees e') ->select('e.id, @@ -829,7 +829,7 @@ class EmployeePolicyModel extends Model e.doj, e.band, TIMESTAMPDIFF(YEAR, e.dob, CURDATE()) AS emp_age, - (SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ') AS self, + (SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ' and client_id = '.$client_id.') AS self, ep.tpa_id, @@ -881,7 +881,7 @@ class EmployeePolicyModel extends Model } - public function getECardSingleData($rand_string, $emp_code){ + public function getECardSingleData($rand_string, $emp_code,$client_id){ $result = $this->db->table('employees e') ->select('e.id, @@ -896,7 +896,7 @@ class EmployeePolicyModel extends Model e.doj, e.band, TIMESTAMPDIFF(YEAR, e.dob, CURDATE()) AS emp_age, - (SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ') AS self, + (SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ' and client_id = '.$client_id.') AS self, ep.tpa_id, From 8a36f96d052212e0996296ad6a7f2ed62afbb5d5 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Thu, 11 Jul 2024 11:49:29 +0530 Subject: [PATCH 03/10] CHANGE_ mpin : GWM --- app/Config/Routes.php | 6 +- .../RestAuthenticationController.php | 99 +++++++++++++++++++ app/Models/EmployeeModel.php | 3 +- 3 files changed, 105 insertions(+), 3 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 77cf4c62..f4df6e62 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -271,6 +271,7 @@ $routes->get("processjob", "JobWorker::processJob"); //Employee login api's $routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber"); $routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); +$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin"); //HR login api's $routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber"); $routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData"); @@ -282,10 +283,11 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) { -$routes->get("getEmployeePolicy", "EmployeeRestController::getEmployeePolicy"); -$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy"); + $routes->get("getChatResponse", "ChatBotController::getChatResponse"); $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { + $routes->post("saveMpin", "RestAuthenticationController::saveMpin"); + $routes->post("updateMpin", "RestAuthenticationController::updateMpin"); $routes->get("getChatResponse", "ChatBotController::getChatResponse"); $routes->get("getEmployeeProfile", "EmployeeRestController::getEmployeeProfile"); $routes->post("employeeUpload", "EmployeeRestController::employeeUpload"); diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 56fb00c5..4e5cf279 100644 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -212,5 +212,104 @@ class RestAuthenticationController extends AdminController } + public function saveMpin() + { + try { + $mobile_number = $this->request->getJSON()->mobile_number; + $mpin = $this->request->getJSON()->mpin; + + + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + + if ($employeeData) { + $id= $employeeData["id"]; + $updateMpin = $this->employeeModel->where('id', $id)->set('mpin', $mpin)->update(); + if($updateMpin){ + $result = ['user_verification' => true , 'message' => "Mpin Updated"]; + return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); + }else{ + $result = ['user_verification' => true , 'message' => "Mpin Not Updated"]; + return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); + } + + + } else { + $result = ['user_verification' => false , 'message' => "User not found"]; + return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); + + } + } catch (\Throwable $th) { + return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500); + } + } + + public function updateMpin() + { + try { + $mobile_number = $this->request->getJSON()->mobile_number; + $old_mpin = $this->request->getJSON()->old_mpin; + $mpin = $this->request->getJSON()->new_mpin; + + + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('mpin', $old_mpin)->where('relationship', 'self')->first(); + + if ($employeeData) { + $id= $employeeData["id"]; + $updateMpin = $this->employeeModel->where('id', $id)->set('mpin', $mpin)->update(); + if($updateMpin){ + $result = ['mpin_verification' => true , 'message' => "Mpin Updated"]; + return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); + }else{ + $result = ['mpin_verification' => true , 'message' => "Mpin Not Updated"]; + return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); + } + + + } else { + $result = ['mpin_verification' => false , 'message' => "Wrong Mpin"]; + return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); + + } + } catch (\Throwable $th) { + return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500); + } + } + + public function verifyMpin() + { + try { + $mobile_number = $this->request->getJSON()->mobile_number; + $mpin = $this->request->getJSON()->mpin; + + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + + if ($employeeData && $mpin == $employeeData["mpin"]) { + $auth = HttpRequestHelper::getRequestInfo(); + if ($auth) { + $data = [ + 'user_id' => $employeeData['id'], + 'user_type' => 'employee', + 'ip' => $auth['ip'], + 'platform' => $auth['platform'], + 'broswer' => $auth['browser'], + ]; + + $authdata= $this->authHistoryModel->insert($data); + + } + + + + $result = JWTToken::encode($employeeData); + return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); + } else { + return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200); + } + } catch (\Exception $e) { + return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); + } + } + + } \ No newline at end of file diff --git a/app/Models/EmployeeModel.php b/app/Models/EmployeeModel.php index adffe7ff..13a1e5e7 100644 --- a/app/Models/EmployeeModel.php +++ b/app/Models/EmployeeModel.php @@ -40,7 +40,8 @@ class EmployeeModel extends Model "is_createdby_hr", "client_branch_id", "token_time_out", - "emp_type" + "emp_type", + "mpin" ]; // Callbacks From d936ef6985621dea8273eff75d8322bd1f7c7273 Mon Sep 17 00:00:00 2001 From: Venba Date: Thu, 11 Jul 2024 06:30:55 +0000 Subject: [PATCH 04/10] FIX_ENROLLMENT_CLIENT_POLICYID_ADDED --- app/Controllers/EmployeeServiceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index fdeca4c1..31e23163 100644 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -1206,7 +1206,7 @@ class EmployeeServiceController extends AdminController // $file = ['id' => null,'client_id' => $client_id,'policy_id' => $client_policy_id,'action' => 'inception']; - $file = ['id' => null,'client_id' => $client_id,'policy_id' => $client_policy_id,'action' => 'inception','created_by' => get_session_userid()]; + $file = ['id' => null,'client_id' => $client_id,'policy_id' => $client_policy_id,'action' => 'inception','created_by' => get_session_userid(),'client_branch_id' => $params['client_branch_id']]; // dd($this->employeeModel->getLastQuery()); // Kint::dump($existing_famility_details);die(); $employee_data_group_by_family = data_group_by_family($existing_famility_details,$data_source = 'db'); From 18178a989dda92f021c41d6d33a19ce3babc8c8f Mon Sep 17 00:00:00 2001 From: Venba Date: Thu, 11 Jul 2024 06:33:49 +0000 Subject: [PATCH 05/10] FIX_ENROLLMENT_CLIENT_POLICYID_ADDED_IN_CON --- app/Controllers/EmployeeController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 4a7900d6..050df9cc 100644 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -674,14 +674,14 @@ class EmployeeController extends AdminController // client_policy_id pull draft and enrolled status employees and proceed to calculatin and make entry in DB public function initiateManualEmployeesOnboardProcess($client_policy_id) { - $client_data = $this->clientPolicyModel->select('clients.client_name as client_name, policies.name as policy_name') + $client_data = $this->clientPolicyModel->select('clients.client_name as client_name, policies.name as policy_name,client_branch_id') ->join('clients', 'clients.id = client_policy.client_id') ->join('policies', 'policies.id = client_policy.policy_id') ->where('client_policy.id', $client_policy_id) ->first(); $empServiceController = new EmployeeServiceController(); - $res = $empServiceController->employeesOnboardPreprocess(['client_policy_id' => $client_policy_id]); + $res = $empServiceController->employeesOnboardPreprocess(['client_policy_id' => $client_policy_id,',client_branch_id' => $client_data['client_branch_id']]); // dd($res); $count = count($res); From 14102e3e493cea62564ed9a8c4d8ccc9e3c8c383 Mon Sep 17 00:00:00 2001 From: Venba Date: Thu, 11 Jul 2024 08:28:54 +0000 Subject: [PATCH 06/10] FIX_ADD_ON_VARIABLE_ADDED_SNDMAIL_HELPER --- app/Helpers/sendMailNotification.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 84c8a13d..91bd81d9 100644 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -182,7 +182,7 @@ class sendMailNotification $table_content .= $policy_name.''; $table_content .= $temp_data; $table_content .= '
NameMobile NumberSum InsureDate Of Birth
'; - + $Addon_list = []; if ($is_addon == 2 || $is_addon == 3) { $addon_list_array = [ 'policy_name'=>$policy_name, @@ -288,7 +288,7 @@ class sendMailNotification $table_content .= $policy_name.''; $table_content .= $temp_data; $table_content .= '
NameMobile NumberSum InsureDate Of Birth
'; - + $Addon_list = []; if ($is_addon == 2 || $is_addon == 3) { $addon_list_array = [ 'policy_name'=>$policy_name, @@ -395,7 +395,7 @@ class sendMailNotification $table_content .= $policy_name.''; $table_content .= $temp_data; $table_content .= '
NameMobile NumberSum InsureDate Of Birth
'; - + $Addon_list = []; if ($is_addon == 2 || $is_addon == 3) { $addon_list_array = [ 'policy_name'=>$policy_name, From 277c156035e9a41f9a70658a286b3c9b9e3d5e26 Mon Sep 17 00:00:00 2001 From: Venba Date: Thu, 11 Jul 2024 08:56:19 +0000 Subject: [PATCH 07/10] FIX_UNWANTED_CHAR_REMOVED --- app/Controllers/EmployeeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 050df9cc..db9b306c 100644 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -681,7 +681,7 @@ class EmployeeController extends AdminController ->first(); $empServiceController = new EmployeeServiceController(); - $res = $empServiceController->employeesOnboardPreprocess(['client_policy_id' => $client_policy_id,',client_branch_id' => $client_data['client_branch_id']]); + $res = $empServiceController->employeesOnboardPreprocess(['client_policy_id' => $client_policy_id,'client_branch_id' => $client_data['client_branch_id']]); // dd($res); $count = count($res); From ce4312fc8db9959b084fbe327554294b3f6f4760 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Thu, 11 Jul 2024 14:58:30 +0530 Subject: [PATCH 08/10] CHANGE_ mpin status api : GWM --- app/Config/Routes.php | 1 + .../RestAuthenticationController.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index f4df6e62..4778427f 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -272,6 +272,7 @@ $routes->get("processjob", "JobWorker::processJob"); $routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber"); $routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); $routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin"); +$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin"); //HR login api's $routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber"); $routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData"); diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 4e5cf279..7c7358f7 100644 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -310,6 +310,25 @@ class RestAuthenticationController extends AdminController } } + public function checkMpin() + { + try { + $mobile_number = $this->request->getJSON()->mobile_number; + + + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + + if ($employeeData && $employeeData["mpin"] != null) { + + return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist"],200); + } else { + return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found"],200); + } + } catch (\Exception $e) { + return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); + } + } + } \ No newline at end of file From ecfda34fbca9e9dfe827e70a1e23bd470815a05c Mon Sep 17 00:00:00 2001 From: bitbucket Date: Mon, 15 Jul 2024 12:07:55 +0530 Subject: [PATCH 09/10] CHANGE_ mpin check api change : GWM --- app/Controllers/RestAuthenticationController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 7c7358f7..6efaa163 100644 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -320,9 +320,9 @@ class RestAuthenticationController extends AdminController if ($employeeData && $employeeData["mpin"] != null) { - return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist"],200); + return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist" , 'Mpin' =>$employeeData["mpin"]],200); } else { - return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found"],200); + return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found", 'Mpin' =>null],200); } } catch (\Exception $e) { return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); From f19ccf660167c5fb31ccae49cff044f92762f853 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Tue, 16 Jul 2024 15:13:03 +0530 Subject: [PATCH 10/10] CHANGE_ in getEmployeePolicy model function : GWM --- app/Models/EmployeePolicyModel.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index a94410f5..3dfe16ec 100644 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -101,6 +101,9 @@ class EmployeePolicyModel extends Model 'emp.emp_status', 'emp.is_active as emp_is_active', 'emp.mobile as mobile', + 'emp.doj', + 'emp.basic_pay', + 'emp.band as grade', 'policy_type.policy_type', 'cp.policy_no', ])