From 231c2ec4d72614909b16682dfef59396d3113b3d Mon Sep 17 00:00:00 2001 From: bitbucket Date: Wed, 15 May 2024 11:48:12 +0530 Subject: [PATCH 1/2] CHANGE_ in age validation : GWM --- app/Controllers/EmployeeRestController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 84079452..50d080ee 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1049,6 +1049,9 @@ public function getEmployeePolicy() $temp2['data']['client_policy_id'] = $array->ClientPolicyId; $temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue))); $temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue); + $ageKey = (preg_replace('/\d/', '', $familyFloatesValue) == 'parent' || preg_replace('/\d/', '', $familyFloatesValue) == 'parent_in_law') ? 'elders' : preg_replace('/\d/', '', $familyFloatesValue); + + $temp2['data']['age_validation'] = $decodedArray->age_ratio->$ageKey; array_push($data,$temp2); @@ -1214,7 +1217,9 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id) $temp2['data']['client_policy_id'] = $array->ClientPolicyId; $temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue))); $temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue); - + $ageKey = (preg_replace('/\d/', '', $familyFloatesValue) == 'parent' || preg_replace('/\d/', '', $familyFloatesValue) == 'parent_in_law') ? 'elders' : preg_replace('/\d/', '', $familyFloatesValue); + + $temp2['data']['age_validation'] = $array->Policy_Terms->age_ratio->$ageKey; array_push($data,$temp2); } @@ -1472,6 +1477,9 @@ public function getAddOnPolicy() $temp2['data']['client_policy_id'] = $array['id']; $temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue))); $temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue); + $ageKey = (preg_replace('/\d/', '', $familyFloatesValue) == 'parent' || preg_replace('/\d/', '', $familyFloatesValue) == 'parent_in_law') ? 'elders' : preg_replace('/\d/', '', $familyFloatesValue); + + $temp2['data']['age_validation'] = $decodedArray->age_ratio->$ageKey; array_push($data,$temp2); From 37db3a9f7a5c42e7e346bbb6848b6f0e9bce59b0 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Wed, 15 May 2024 12:24:22 +0530 Subject: [PATCH 2/2] CHANGE_ in age validation : GWM --- 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 6ef57201..b49b37d6 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -960,7 +960,7 @@ public function getEmployeePolicy() // Construct value for policy type GPA - if($getSlabAndGridData['grid_master']['policy_type'] == "GPA"){ + if($getSlabAndGridData['grid_master']['policy_type'] == "GPA" && $this->request->getGet('policy') == 'GPA'){ // Filter employee data where the family_floater_key is 'self' $selfData = array_filter($empData, fn($arr) => trim(strtolower($arr['family_floater_key'])) === 'self'); @@ -985,7 +985,7 @@ public function getEmployeePolicy() } // Construct value for policy type GMC - }else if($getSlabAndGridData['grid_master']['policy_type'] == "GMC"){ + }else if($getSlabAndGridData['grid_master']['policy_type'] == "GMC" && $this->request->getGet('policy') == 'GMC' ){ @@ -1035,7 +1035,7 @@ public function getEmployeePolicy() } } } - // dd($data); + // Remove Unwanted floter key from floters array based on either-parents-pil term value