CHANGE_ default age ratio : GWM
This commit is contained in:
parent
37db3a9f7a
commit
34bd649827
@ -917,7 +917,19 @@ class EmployeeRestController extends AdminController
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
public function getAgeRange($terms,$familyFloatesValue)
|
||||
{
|
||||
$ageRangeArray = ['self' => ['min' => 18, 'max' => 60] , 'spouse' => ['min' => 18, 'max' => 60] , 'child' => ['min' => 0, 'max' => 25] , 'elders' => ['min' => 18, 'max' => 60] ];
|
||||
|
||||
$ageKey = (preg_replace('/\d/', '', $familyFloatesValue) == 'parent' || preg_replace('/\d/', '', $familyFloatesValue) == 'parent_in_law') ? 'elders' : preg_replace('/\d/', '', $familyFloatesValue);
|
||||
if(isset($terms->age_ratio)){
|
||||
return $terms->age_ratio->$ageKey;
|
||||
}else{
|
||||
return $ageRangeArray[$ageKey];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public function getEmployeePolicy()
|
||||
{
|
||||
try {
|
||||
@ -1022,10 +1034,10 @@ public function getEmployeePolicy()
|
||||
$temp['data']['dob'] = $this->convertDateFormatDMY($value['dob']);
|
||||
$temp['data']['client_policy_id'] = $array->ClientPolicyId;
|
||||
$temp['data']['form_type'] = $dependent;
|
||||
$temp['data']['basic_cover_si'] = $employee_policy->basic_cover_si;
|
||||
$ageKey = ($dependent == 'parent' || $dependent == 'parent_in_law') ? 'elders' : $dependent;
|
||||
|
||||
$temp['data']['age_validation'] = $decodedArray->age_ratio->$ageKey;
|
||||
$temp['data']['basic_cover_si'] = $employee_policy->basic_cover_si;
|
||||
|
||||
|
||||
$temp['data']['age_validation'] = $this->getAgeRange($decodedArray,$familyFloatesValue);
|
||||
|
||||
array_push($data,$temp);
|
||||
unset($empData[$key]);
|
||||
@ -1064,9 +1076,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;
|
||||
|
||||
|
||||
$temp2['data']['age_validation'] = $this->getAgeRange($decodedArray,$familyFloatesValue);
|
||||
|
||||
array_push($data,$temp2);
|
||||
|
||||
@ -1194,8 +1206,8 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id)
|
||||
$temp['data']['client_policy_id'] = $array->ClientPolicyId;
|
||||
$temp['data']['form_type'] = $dependent;
|
||||
$temp['data']['basic_cover_si'] = $employee_policy->basic_cover_si;
|
||||
$ageKey = ($dependent == 'parent' || $dependent == 'parent_in_law') ? 'elders' : $dependent;
|
||||
$temp['data']['age_validation'] = $array->Policy_Terms->age_ratio->$ageKey;
|
||||
$temp['data']['age_validation'] = $this->getAgeRange($array->Policy_Terms,$familyFloatesValue);
|
||||
|
||||
|
||||
array_push($data,$temp);
|
||||
unset($empData[$key]);
|
||||
@ -1232,9 +1244,7 @@ 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;
|
||||
$temp2['data']['age_validation'] = $this->getAgeRange($array->Policy_Terms,$familyFloatesValue);
|
||||
array_push($data,$temp2);
|
||||
|
||||
}
|
||||
@ -1435,7 +1445,9 @@ public function getAddOnPolicy()
|
||||
$temp['data']['client_policy_id'] = $array['id'];
|
||||
$temp['data']['form_type'] = $dependent;
|
||||
$temp['data']['basic_cover_si'] = isset($employee_policy->basic_cover_si) ? $employee_policy->basic_cover_si : null;
|
||||
$temp['data']['premium'] = isset($employee_policy->premium) ? $employee_policy->premium : null;
|
||||
$temp['data']['premium'] = isset($employee_policy->premium) ? $employee_policy->premium : null;
|
||||
$temp['data']['age_validation'] = $this->getAgeRange($decodedArray,$familyFloatesValue);
|
||||
|
||||
array_push($data,$temp);
|
||||
unset($addOnEmployeeData[$key]);
|
||||
$floters = array_diff($floters, [$familyFloatesValue]);
|
||||
@ -1492,9 +1504,8 @@ 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;
|
||||
|
||||
$temp2['data']['age_validation'] = $this->getAgeRange($decodedArray,$familyFloatesValue);
|
||||
|
||||
array_push($data,$temp2);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user