CHNAGE_SI_FLOW
This commit is contained in:
parent
f80df3f37b
commit
8b72a3c90b
@ -161,7 +161,7 @@ class EmployeeServiceController extends AdminController
|
||||
'format' => null,
|
||||
'allowed_values' => null,
|
||||
'custom' => 'check_si',
|
||||
'params' => ['row', 'policy_terms', 'slab_details']
|
||||
'params' => ['row', 'policy_details', 'slab_details']
|
||||
],
|
||||
'doc' => [
|
||||
'col_idx' => 7,
|
||||
@ -1496,17 +1496,43 @@ class EmployeeServiceController extends AdminController
|
||||
if(!count($existing_endorsements))
|
||||
{
|
||||
//transform data to send
|
||||
|
||||
//get applicable slab rate for current member relation
|
||||
$pre_rack_rate_name = '';
|
||||
$applicable_rack_rate_name = '';
|
||||
$applicable_rack_rate_master = '';
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
if($slab_value['si'] == $row[3])
|
||||
if($pre_rack_rate_name != $slab_value['rack_rate_name'])
|
||||
{
|
||||
$group_key = rand(100000, 999999);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee_policy['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'basic_cover_si','old_value' => $employee_policy['basic_cover_si'],'new_value' => $row[3],'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee_policy['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'premium','old_value' => $employee_policy['premium'],'new_value' => $slab_value['premium'],'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee_policy['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'si_enhancement_date','old_value' => null,'new_value' => change_date_format($row[4],'d-M-Y','Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||
break;
|
||||
$pre_rack_rate_name = $slab_value['rack_rate_name'];
|
||||
$rack_rate_json = json_decode($slab_value['additional_relationship']);
|
||||
if(in_array(strtolower($employee['relationship']), $rack_rate_json) && $rack_rate_json[ strtolower($employee['relationship']) ] != 0 && $rack_rate_json[ strtolower($employee['relationship']) ] != NA)
|
||||
{
|
||||
$applicable_rack_rate_name = $slab_value['rack_rate_name'];
|
||||
$applicable_rack_rate_master = $slab_value['grid_master'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get max age,max count of the familiy
|
||||
$max_age_and_max_count_of_current_member = $this->employeeModel->getFamiliyCountAndMaxage($employee['emp_code']);
|
||||
//transform SI excel row data as inception excel OR premium calculateable fomart
|
||||
|
||||
$data = transform_si_excel_row_to_calculatable_format(employee: $employee,employee_policy: $employee_policy,maxage_and_maxcount: $max_age_and_max_count_of_current_member,slab_details: $slab_details,applicable_slab_name: $applicable_rack_rate_name,augmented_si: $row[3],grid_master: $applicable_rack_rate_master);
|
||||
$policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
|
||||
//grouping slab details by rack rate name
|
||||
$temp_slab_rates = group_slab_rates_basedon_name($slab_details);
|
||||
|
||||
$calculated_data = premium_calculation_manager($data,$policy_terms,$temp_slab_rates,$row[3]);
|
||||
|
||||
$group_key = rand(100000, 999999);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee_policy['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'basic_cover_si','old_value' => $employee_policy['basic_cover_si'],'new_value' => $row[3],'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee_policy['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'premium','old_value' => $employee_policy['premium'],'new_value' => $calculated_data['policy_details']['premium'],'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee_policy['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'si_enhancement_date','old_value' => null,'new_value' => change_date_format($row[4],'d-M-Y','Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general si enhancement','group_key' => $group_key,'file_id' => $file['id'],'status' => 'pending']);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -225,11 +225,19 @@ if(!function_exists('check_employee_band'))
|
||||
|
||||
if(!function_exists('check_si'))
|
||||
{
|
||||
function check_si($row,$policy_terms,$slab_details)
|
||||
function check_si($row,$policy_details,$slab_details)
|
||||
{
|
||||
$return_array = array('status' => true,'error' => '');
|
||||
$is_si_found = false;
|
||||
$is_age_slab_found = false;
|
||||
|
||||
if($policy_details[0]['policy_type_id'] == 1 && $slab_details[0]['policy_grid_id'] == 1 && $slab_details[0]['si_or_bp'] == 2) // GPA && grid type 1 for GPA && sub type is basic pay
|
||||
{
|
||||
$is_si_found = true;
|
||||
$is_age_slab_found = true;
|
||||
$return_array = array('status' => true,'error' => '');
|
||||
}
|
||||
|
||||
if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA','SI','MI']))// check rule only of action column data available
|
||||
{
|
||||
$received_si = $row['current_action'] == 'SI' ? $row[3] : $row[6];
|
||||
@ -868,25 +876,11 @@ if (!function_exists('calculate_premium'))
|
||||
|
||||
if (!function_exists('calculate_premium_new'))
|
||||
{
|
||||
function calculate_premium_new(array $family_data,array $policy_terms,array $slab_details,array $fileArr,string $default_si = null,array $existing_units)
|
||||
function calculate_premium_new(array $family_data,array $policy_terms,array $slab_details,array $fileArr,array $existing_units,string $default_si = null,)
|
||||
{
|
||||
|
||||
//grouping slab details by rack rate name
|
||||
$temp_slab_rates = [];
|
||||
$pre_name = '';
|
||||
$pre_grid_master = [];
|
||||
foreach ($slab_details as $key => $value)
|
||||
{
|
||||
$pre_grid_master = $value['grid_master'];
|
||||
unset($value['grid_master']);
|
||||
if($value['rack_rate_name'] != $pre_name)
|
||||
{
|
||||
$pre_name = $value['rack_rate_name'];
|
||||
$temp_slab_rates[ $value['rack_rate_name'] ]['slab_rates'][] = $value;
|
||||
}
|
||||
$temp_slab_rates[ $value['rack_rate_name'] ]['slab_rates'][] = $value;
|
||||
$temp_slab_rates[ $value['rack_rate_name'] ]['grid_master'] = $pre_grid_master;
|
||||
}
|
||||
$temp_slab_rates = group_slab_rates_basedon_name($slab_details);
|
||||
// dd($temp_slab_rates);
|
||||
/* 1. construct available/incoming family members composition & count */
|
||||
$incoming_familiy_composition = get_familiy_composition($family_data);
|
||||
@ -899,8 +893,8 @@ if (!function_exists('calculate_premium_new'))
|
||||
{
|
||||
// dd($slab);
|
||||
$res = compare_incoming_family_slab_with_configured_slab($slab,$incoming_familiy_composition);
|
||||
kint::dump($key);
|
||||
kint::dump($res);
|
||||
// kint::dump($key);
|
||||
// kint::dump($res);
|
||||
|
||||
if($res['is_applicable'])
|
||||
{
|
||||
@ -972,9 +966,9 @@ if (!function_exists('calculate_premium_new'))
|
||||
|
||||
// // Final combined condition
|
||||
if ($conditions['isEmployeeSourceEnrollment'] || $conditions['isEmployeeSourceExcelFile'] || $primaryGridTypeCondition ) {
|
||||
|
||||
// dd($transformed_familiy_member_data);
|
||||
$transformed_familiy_member_data = premium_calculation_manager($transformed_familiy_member_data,$policy_terms,$temp_slab_rates,$default_si);
|
||||
|
||||
// dd($transformed_familiy_member_data);
|
||||
$result[] = $transformed_familiy_member_data;
|
||||
}
|
||||
|
||||
@ -1041,6 +1035,7 @@ if (!function_exists('transform_excel_data_to_db'))
|
||||
$result['temp'] = [];
|
||||
if(isset($memArr['temp'])) $result['temp'] = array_merge($result['temp'],$memArr['temp']);
|
||||
$result['temp']['grid_type'] = $actionArr['grid_info']['type'];
|
||||
$result['temp']['band'] = $result['band'];
|
||||
$result['temp']['grid_id'] = $actionArr['grid_info']['grid_id'];
|
||||
$result['temp']['action'] = isset($memArr['current_action']) ? $memArr['current_action'] : $current_column_action;
|
||||
$result['temp']['source'] = isset($memArr['temp']['source']) ? $memArr['temp']['source'] : 'excel';
|
||||
@ -1062,7 +1057,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
{
|
||||
function premium_calculation_manager($emp_data,$policy_terms,$slab_details,$default_si = null)
|
||||
{
|
||||
// Kint::dump($emp_data);
|
||||
// Kint::dump($emp_data);die();
|
||||
|
||||
$myLogger = \Config\Services::mylogger();
|
||||
// grid type
|
||||
@ -1143,7 +1138,28 @@ if (!function_exists('premium_calculation_manager'))
|
||||
break;
|
||||
}
|
||||
}
|
||||
//auto calculate of SI and premium for basic pay type
|
||||
if(!$is_match_found)
|
||||
{
|
||||
if($temp_slab_rates[0]['si_or_bp'] == 2)
|
||||
{
|
||||
$temp_si = $emp_data['basic_pay'] * $temp_slab_rates[0]['si_or_bp'];
|
||||
$temp_premium = ($temp_si * $temp_slab_rates[0]['multiplier']) / 1000;
|
||||
|
||||
$emp_data['policy_details']['basic_cover_si'] = $temp_si;
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = (calculate_days_bw_dates($emp_data['policy_details']['date_coverage'],$policy_terms['policy_end_date'])->days + 1);
|
||||
$emp_data['policy_details']['premium'] = $temp_premium;
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($emp_data['policy_details']['premium'],$emp_data['policy_details']['days'],(calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days + 1));
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst/100)),2,'.','');
|
||||
$is_match_found = true;
|
||||
|
||||
$log_message = 'Pre defined SI not found. auto calc SI & premium for -' . $emp_data['emp_code'].' - '. $emp_data['name'].' - '. $temp_si.' - '. $temp_premium;
|
||||
$myLogger->logme('error',$log_message);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
//GPA - Flat Rate for all SI
|
||||
@ -1905,8 +1921,8 @@ if(!function_exists('compare_incoming_family_slab_with_configured_slab'))
|
||||
$configured_familiy_composition = json_decode($slab['slab_rates'][0]['additional_relationship'], true);
|
||||
|
||||
// Remove unnecessary keys
|
||||
kint::dump($incoming_familiy_composition);
|
||||
kint::dump($configured_familiy_composition);
|
||||
// kint::dump($incoming_familiy_composition);
|
||||
// kint::dump($configured_familiy_composition);
|
||||
unset($configured_familiy_composition['either-parents-pil']);
|
||||
unset($configured_familiy_composition['elders_count']);
|
||||
|
||||
@ -2023,4 +2039,59 @@ if(!function_exists('check_unit'))
|
||||
return array('status' => true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('transform_si_excel_row_to_calculatable_format'))
|
||||
{
|
||||
function transform_si_excel_row_to_calculatable_format(array $employee,array$employee_policy,array $maxage_and_maxcount,array $slab_details,string $applicable_slab_name,string $augmented_si,array $grid_master)
|
||||
{
|
||||
$employee['temp'] = [];
|
||||
$employee['temp']['max_age'] = $maxage_and_maxcount[0]['max_age'];
|
||||
$employee['temp']['max_count'] = $maxage_and_maxcount[0]['family_member_count'];
|
||||
$employee['temp']['grid_name'] = $applicable_slab_name;
|
||||
$employee['temp']['grid_master'] = $grid_master;
|
||||
$employee['temp']['acting_self'] = true;
|
||||
$employee['temp']['premium_type'] = $grid_master['premium_type'];
|
||||
$employee['temp']['grid_type'] = $applicable_slab_name;
|
||||
$employee['temp']['grid_id'] = $grid_master['ui_type'];
|
||||
$employee['temp']['action'] = 'SI';
|
||||
$employee['temp']['source'] = 'excel';
|
||||
$employee['temp']['emp_id'] = null;
|
||||
$employee['temp']['emp_policy_id'] = null;
|
||||
$employee['temp']['policy_status'] = null;
|
||||
$employee['temp']['emp_status'] = null;
|
||||
$employee['temp']['rata_premimum'] = null;
|
||||
|
||||
return $employee;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('group_slab_rates_basedon_name'))
|
||||
{
|
||||
function group_slab_rates_basedon_name($slab_details)
|
||||
{
|
||||
// dd($slab_details);
|
||||
//grouping slab details by rack rate name
|
||||
$temp_slab_rates = [];
|
||||
$pre_name = '';
|
||||
$pre_grid_master = [];
|
||||
foreach ($slab_details['slab_rates'] as $key => $value)
|
||||
{
|
||||
$pre_grid_master = $value['grid_master'];
|
||||
unset($value['grid_master']);
|
||||
if($value['rack_rate_name'] != $pre_name)
|
||||
{
|
||||
$pre_name = $value['rack_rate_name'];
|
||||
$temp_slab_rates[ $value['rack_rate_name'] ]['slab_rates'][] = $value;
|
||||
}
|
||||
$temp_slab_rates[ $value['rack_rate_name'] ]['slab_rates'][] = $value;
|
||||
$temp_slab_rates[ $value['rack_rate_name'] ]['grid_master'] = $pre_grid_master;
|
||||
}
|
||||
|
||||
return $temp_slab_rates;
|
||||
}
|
||||
}
|
||||
@ -190,4 +190,24 @@ class EmployeeModel extends Model
|
||||
return ($result);
|
||||
}
|
||||
|
||||
|
||||
public function getFamiliyCountAndMaxage(string $emp_code)
|
||||
{
|
||||
$query = "
|
||||
SELECT emp_code,family_member_count,max_age
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
emp_code,
|
||||
COUNT(*) AS family_member_count,
|
||||
MAX(TIMESTAMPDIFF(YEAR, dob, CURDATE())) AS max_age
|
||||
FROM employees where emp_code = '{$emp_code}'
|
||||
GROUP BY emp_code
|
||||
) AS family_stats
|
||||
ORDER BY family_member_count DESC, max_age DESC
|
||||
LIMIT 1;";
|
||||
$results = $this->db->query($query)->getResult();
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -50,9 +50,9 @@ class PolicesModel extends Model
|
||||
{
|
||||
// echo '2';
|
||||
$policyPremium2Model = new PolicyPremium2Model();
|
||||
$premium_slab_data = $policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1,'rack_rate_type' => 0])->findAll();
|
||||
$premium_slab_data = $policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
|
||||
|
||||
//check any additional rack rate configured
|
||||
// check any additional rack rate configured
|
||||
$additional_premium_slab_data = $policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1,'rack_rate_type' => 1])->findAll();
|
||||
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
</div> -->
|
||||
<div class="col-12" style="text-align: right;">
|
||||
<a href="<?= base_url("employee/endorsement-list"); ?>" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="calculatePremium(event);" >calc</a>
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="addRowToTable(event);">+</a>
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="addRowToTable();">+</a>
|
||||
</div>
|
||||
<!-- <button onclick="addRowToTable()">Add Row</button> -->
|
||||
</div>
|
||||
@ -170,6 +170,10 @@
|
||||
console.log("window loaded");
|
||||
// $('#centermodal').modal('show');
|
||||
fetchClientPolicies();
|
||||
|
||||
addRowToTable(['Ram Kumar','01-Apr-1990','M','Self','500000','',450000,'A','unit1']);
|
||||
addRowToTable(['Sita','01-Apr-1993','F','Spouse','500000','','','A','unit1']);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -483,7 +487,8 @@
|
||||
const suggestionBox = document.getElementById("suggestion-box");
|
||||
const suggestionsList = document.getElementById("suggestions");
|
||||
|
||||
function addRowToTable() {
|
||||
function addRowToTable(default_data = false) {
|
||||
console.log(default_data);
|
||||
const tableBody = document.getElementById("emptablebody");
|
||||
const existingRowCount = tableBody.rows.length;
|
||||
|
||||
@ -507,7 +512,7 @@ const suggestionsList = document.getElementById("suggestions");
|
||||
|
||||
// Name (assuming you want an input field)
|
||||
newCell = document.createElement("td");
|
||||
newCell.innerHTML = '';
|
||||
newCell.innerHTML = (default_data != false ? default_data[0] : '');
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
newRow.appendChild(newCell);
|
||||
@ -517,14 +522,14 @@ const suggestionsList = document.getElementById("suggestions");
|
||||
// DOB (assuming you want a date input field)
|
||||
newCell = document.createElement("td");
|
||||
// newCell.innerHTML = '<input type="date" class="form-control">'; // Adjust for your needs
|
||||
newCell.innerHTML = ''; // Adjust for your needs
|
||||
newCell.innerHTML = (default_data != false ? default_data[1] : ''); // Adjust for your needs
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
newRow.appendChild(newCell);
|
||||
|
||||
// Gender (assuming you want a date input field)
|
||||
newCell = document.createElement("td");
|
||||
newCell.innerHTML = ''; // Adjust for your needs
|
||||
newCell.innerHTML = (default_data != false ? default_data[2] : ''); // Adjust for your needs
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
// newCell.addEventListener("input", handleInput);
|
||||
@ -532,7 +537,7 @@ const suggestionsList = document.getElementById("suggestions");
|
||||
|
||||
// relationship (assuming you want a date input field)
|
||||
newCell = document.createElement("td");
|
||||
newCell.innerHTML = ''; // Adjust for your needs
|
||||
newCell.innerHTML = (default_data != false ? default_data[3] : ''); // Adjust for your needs
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
newCell.addEventListener("input", handleInput);
|
||||
@ -540,33 +545,34 @@ const suggestionsList = document.getElementById("suggestions");
|
||||
|
||||
// SI (assuming you want a date input field)
|
||||
newCell = document.createElement("td");
|
||||
newCell.innerHTML = ''; // Adjust for your needs
|
||||
newCell.innerHTML = (default_data != false ? default_data[4] : ''); // Adjust for your needs
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
newRow.appendChild(newCell);
|
||||
|
||||
// DOC (assuming you want a date input field)
|
||||
newCell = document.createElement("td");
|
||||
newCell.innerHTML = ''; // Adjust for your needs
|
||||
newCell.innerHTML = (default_data != false ? default_data[5] : ''); // Adjust for your needs
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
newRow.appendChild(newCell);
|
||||
|
||||
// BP (assuming you want a date input field)
|
||||
newCell = document.createElement("td");
|
||||
newCell.innerHTML = ''; // Adjust for your needs
|
||||
newCell.innerHTML = (default_data != false ? default_data[6] : '');
|
||||
// Adjust for your needs
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
newRow.appendChild(newCell);
|
||||
// band (assuming you want a date input field)
|
||||
newCell = document.createElement("td");
|
||||
newCell.innerHTML = ''; // Adjust for your needs
|
||||
newCell.innerHTML = (default_data != false ? default_data[7] : ''); // Adjust for your needs
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
newRow.appendChild(newCell);
|
||||
// unit (assuming you want a date input field)
|
||||
newCell = document.createElement("td");
|
||||
newCell.innerHTML = ''; // Adjust for your needs
|
||||
newCell.innerHTML = (default_data != false ? default_data[8] : ''); // Adjust for your needs
|
||||
newCell.contentEditable = "true"; // Make the cell editable (if needed)
|
||||
newCell.style.border = "1px solid";
|
||||
newRow.appendChild(newCell);
|
||||
|
||||
@ -27,58 +27,61 @@ class PremiumCalculationTestNew extends CIUnitTestCase
|
||||
//first slab
|
||||
$primary_relationship = '{"self":1,"spouse":"any","childrens":"any","parents":"NA","parents-in-law":"NA","either-parents-pil":0}';
|
||||
$primary_grid_id = 7;
|
||||
$primary_unit = 'unit1';
|
||||
$primary_grid_type = 2;
|
||||
$primary_max_si = 35000000;
|
||||
$primary_grid_name = 'dependent + age + SI';
|
||||
$primary_grid_master = ['id' => 4,'policy_type' => 'GMC','ui_type' => $primary_grid_id,'policy_grid_type' => $primary_grid_name,'is_dependent_allowed' => 1,'max_dependent_age' => 0,'max_dependent_count' => 1,'basicpay' => 0,'emp_band' => 0];
|
||||
$primary_slabs = [
|
||||
[ 'id' => 322, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 0, 'age_to' => 18, 'grade' => 'A', 'si' => 5000000, 'premium' => 500, 'max_si' => $primary_max_si,'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 323, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 19, 'age_to' => 25, 'grade' => 'B', 'si' => 5000000, 'premium' => 1500, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 26, 'age_to' => 35, 'grade' => 'C', 'si' => 5000000, 'premium' => 2000, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 36, 'age_to' => 45, 'grade' => 'D', 'si' => 5000000, 'premium' => 2500, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 46, 'age_to' => 55, 'grade' => 'E', 'si' => 5000000, 'premium' => 3000, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 56, 'age_to' => 75, 'grade' => 'F', 'si' => 5000000, 'premium' => 3500, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 76, 'age_to' => 85, 'grade' => 'G', 'si' => 5000000, 'premium' => 4000, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 5000000, 'premium' => 4500, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => $primary_max_si, 'premium' => 15000, 'max_si' => 0, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 30000000, 'premium' => 30000, 'max_si' => 0, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship]
|
||||
[ 'id' => 322, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 0, 'age_to' => 18, 'grade' => 'A', 'si' => 5000000, 'premium' => 500, 'max_si' => $primary_max_si,'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 323, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 19, 'age_to' => 25, 'grade' => 'B', 'si' => 5000000, 'premium' => 1500, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 26, 'age_to' => 35, 'grade' => 'C', 'si' => 5000000, 'premium' => 2000, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 36, 'age_to' => 45, 'grade' => 'D', 'si' => 5000000, 'premium' => 2500, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 46, 'age_to' => 55, 'grade' => 'E', 'si' => 5000000, 'premium' => 3000, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 56, 'age_to' => 75, 'grade' => 'F', 'si' => 5000000, 'premium' => 3500, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 76, 'age_to' => 85, 'grade' => 'G', 'si' => 5000000, 'premium' => 4000, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 5000000, 'premium' => 4500, 'max_si' => $primary_max_si, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => $primary_max_si, 'premium' => 15000, 'max_si' => 0, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $primary_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 30000000, 'premium' => 30000, 'max_si' => 0, 'premium_type' => $primary_grid_type, 'relationship' => null,'additional_relationship' => $primary_relationship,'unit' => $primary_unit]
|
||||
];
|
||||
|
||||
//second slab
|
||||
$second_relationship = '{"self":"NA","spouse":"NA","childrens":"NA","parents":"any","parents-in-law":"NA","either-parents-pil":0}';
|
||||
$second_grid_id = 10;
|
||||
$second_unit = 'unit1';
|
||||
$second_grid_type = 1;
|
||||
$second_max_si = 35000000;
|
||||
$second_grid_name = 'max age';
|
||||
$second_grid_master = ['id' => 4,'policy_type' => 'GMC','ui_type' => $second_grid_id,'policy_grid_type' => $second_grid_name,'is_dependent_allowed' => 1,'max_dependent_age' => 0,'max_dependent_count' => 1,'basicpay' => 0,'emp_band' => 0];
|
||||
$second_slabs = [
|
||||
[ 'id' => 322, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 0, 'age_to' => 18, 'grade' => 'A', 'si' => 5000000, 'premium' => 700, 'max_si' => 2500000,'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship ],
|
||||
[ 'id' => 323, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 19, 'age_to' => 25, 'grade' => 'B', 'si' => 5000000, 'premium' => 1400, 'max_si' => 2000000, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 26, 'age_to' => 35, 'grade' => 'C', 'si' => 5000000, 'premium' => 2300, 'max_si' => 1800000, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 36, 'age_to' => 45, 'grade' => 'D', 'si' => 5000000, 'premium' => 2750, 'max_si' => 150000, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 46, 'age_to' => 55, 'grade' => 'E', 'si' => 5000000, 'premium' => 3500, 'max_si' => 130000, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 56, 'age_to' => 75, 'grade' => 'F', 'si' => 5000000, 'premium' => 4250, 'max_si' => 10, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 76, 'age_to' => 85, 'grade' => 'G', 'si' => 5000000, 'premium' => 4950, 'max_si' => 5, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 5000000, 'premium' => 5500, 'max_si' => 5, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship]
|
||||
[ 'id' => 322, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 0, 'age_to' => 18, 'grade' => 'A', 'si' => 5000000, 'premium' => 700, 'max_si' => 2500000,'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship,'unit' => $second_unit ],
|
||||
[ 'id' => 323, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 19, 'age_to' => 25, 'grade' => 'B', 'si' => 5000000, 'premium' => 1400, 'max_si' => 2000000, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship,'unit' => $second_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 26, 'age_to' => 35, 'grade' => 'C', 'si' => 5000000, 'premium' => 2300, 'max_si' => 1800000, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship,'unit' => $second_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 36, 'age_to' => 45, 'grade' => 'D', 'si' => 5000000, 'premium' => 2750, 'max_si' => 150000, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship,'unit' => $second_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 46, 'age_to' => 55, 'grade' => 'E', 'si' => 5000000, 'premium' => 3500, 'max_si' => 130000, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship,'unit' => $second_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 56, 'age_to' => 75, 'grade' => 'F', 'si' => 5000000, 'premium' => 4250, 'max_si' => 10, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship,'unit' => $second_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 76, 'age_to' => 85, 'grade' => 'G', 'si' => 5000000, 'premium' => 4950, 'max_si' => 5, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship,'unit' => $second_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $second_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 5000000, 'premium' => 5500, 'max_si' => 5, 'premium_type' => $second_grid_type, 'relationship' => null,'additional_relationship' => $second_relationship,'unit' => $second_unit]
|
||||
|
||||
];
|
||||
|
||||
// third slab
|
||||
$third_relationship = '{"self":"NA","spouse":"NA","childrens":"NA","parents":1,"parents-in-law":"NA","either-parents-pil":0}';
|
||||
$third_grid_id = 7;
|
||||
$third_unit = 'unit1';
|
||||
$third_grid_type = 1;
|
||||
$third_max_si = 35000000;
|
||||
$third_grid_name = 'age band';
|
||||
$third_grid_master = ['id' => 4,'policy_type' => 'GMC','ui_type' => $third_grid_id,'policy_grid_type' => $third_grid_name,'is_dependent_allowed' => 1,'max_dependent_age' => 0,'max_dependent_count' => 1,'basicpay' => 0,'emp_band' => 0];
|
||||
$third_slabs = [
|
||||
[ 'id' => 322, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 0, 'age_to' => 18, 'grade' => 'A', 'si' => 5000000, 'premium' => 701, 'max_si' => 2500000,'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship ],
|
||||
[ 'id' => 323, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 19, 'age_to' => 25, 'grade' => 'B', 'si' => 5000000, 'premium' => 1401, 'max_si' => 2000000, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 26, 'age_to' => 35, 'grade' => 'C', 'si' => 5000000, 'premium' => 2301, 'max_si' => 1800000, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 36, 'age_to' => 45, 'grade' => 'D', 'si' => 5000000, 'premium' => 2751, 'max_si' => 150000, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 46, 'age_to' => 55, 'grade' => 'E', 'si' => 5000000, 'premium' => 3501, 'max_si' => 130000, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 56, 'age_to' => 75, 'grade' => 'F', 'si' => 5000000, 'premium' => 4251, 'max_si' => 10, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 76, 'age_to' => 85, 'grade' => 'G', 'si' => 5000000, 'premium' => 4951, 'max_si' => 5, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 5000000, 'premium' => 5501, 'max_si' => 5, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship]
|
||||
[ 'id' => 322, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 0, 'age_to' => 18, 'grade' => 'A', 'si' => 5000000, 'premium' => 701, 'max_si' => 2500000,'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship,'unit' => $third_unit ],
|
||||
[ 'id' => 323, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 19, 'age_to' => 25, 'grade' => 'B', 'si' => 5000000, 'premium' => 1401, 'max_si' => 2000000, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship,'unit' => $third_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 26, 'age_to' => 35, 'grade' => 'C', 'si' => 5000000, 'premium' => 2301, 'max_si' => 1800000, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship,'unit' => $third_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 36, 'age_to' => 45, 'grade' => 'D', 'si' => 5000000, 'premium' => 2751, 'max_si' => 150000, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship,'unit' => $third_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 46, 'age_to' => 55, 'grade' => 'E', 'si' => 5000000, 'premium' => 3501, 'max_si' => 130000, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship,'unit' => $third_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 56, 'age_to' => 75, 'grade' => 'F', 'si' => 5000000, 'premium' => 4251, 'max_si' => 10, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship,'unit' => $third_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 76, 'age_to' => 85, 'grade' => 'G', 'si' => 5000000, 'premium' => 4951, 'max_si' => 5, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship,'unit' => $third_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $third_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 5000000, 'premium' => 5501, 'max_si' => 5, 'premium_type' => $third_grid_type, 'relationship' => null,'additional_relationship' => $third_relationship,'unit' => $third_unit]
|
||||
|
||||
];
|
||||
|
||||
@ -86,20 +89,21 @@ class PremiumCalculationTestNew extends CIUnitTestCase
|
||||
// fourth slab
|
||||
$fourth_relationship = '{"self":"NA","spouse":"NA","childrens":"NA","parents":"NA","parents-in-law":2,"either-parents-pil":0}';
|
||||
$fourth_grid_id = 11;
|
||||
$fourth_unit = 'unit1';
|
||||
$fourth_grid_type = 2;
|
||||
$fourth_max_si = 8000000;
|
||||
$fourth_grid_name = 'age band';
|
||||
$fourth_grid_master = ['id' => 4,'policy_type' => 'GMC','ui_type' => $fourth_grid_id,'policy_grid_type' => $fourth_grid_name,'is_dependent_allowed' => 1,'max_dependent_age' => 0,'max_dependent_count' => 1,'basicpay' => 0,'emp_band' => 0];
|
||||
$fourth_slabs = [
|
||||
[ 'id' => 322, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 0, 'age_to' => 18, 'grade' => 'A', 'si' => 5000000, 'premium' => 1111, 'max_si' => $fourth_max_si,'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship ],
|
||||
[ 'id' => 323, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 19, 'age_to' => 25, 'grade' => 'B', 'si' => 5000000, 'premium' => 2222, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 26, 'age_to' => 35, 'grade' => 'C', 'si' => 5000000, 'premium' => 3333, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 36, 'age_to' => 45, 'grade' => 'D', 'si' => 5000000, 'premium' => 4444, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 46, 'age_to' => 55, 'grade' => 'E', 'si' => 5000000, 'premium' => 5555, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 56, 'age_to' => 75, 'grade' => 'F', 'si' => 5000000, 'premium' => 6666, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 76, 'age_to' => 85, 'grade' => 'G', 'si' => 5000000, 'premium' => 7777, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 5000000, 'premium' => 8888, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 8000000, 'premium' => 9999, 'max_si' => 0, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship]
|
||||
[ 'id' => 322, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 0, 'age_to' => 18, 'grade' => 'A', 'si' => 5000000, 'premium' => 1111, 'max_si' => $fourth_max_si,'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit ],
|
||||
[ 'id' => 323, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 19, 'age_to' => 25, 'grade' => 'B', 'si' => 5000000, 'premium' => 2222, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 26, 'age_to' => 35, 'grade' => 'C', 'si' => 5000000, 'premium' => 3333, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 36, 'age_to' => 45, 'grade' => 'D', 'si' => 5000000, 'premium' => 4444, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 46, 'age_to' => 55, 'grade' => 'E', 'si' => 5000000, 'premium' => 5555, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 56, 'age_to' => 75, 'grade' => 'F', 'si' => 5000000, 'premium' => 6666, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 76, 'age_to' => 85, 'grade' => 'G', 'si' => 5000000, 'premium' => 7777, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 5000000, 'premium' => 8888, 'max_si' => $fourth_max_si, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit],
|
||||
[ 'id' => 324, 'client_id' => 61, 'client_policy_id' => 63, 'policy_grid_id' => $fourth_grid_id, 'age_from' => 86, 'age_to' => 100, 'grade' => 'G', 'si' => 8000000, 'premium' => 9999, 'max_si' => 0, 'premium_type' => $fourth_grid_type, 'relationship' => null,'additional_relationship' => $fourth_relationship,'unit' => $fourth_unit]
|
||||
|
||||
];
|
||||
|
||||
@ -113,15 +117,15 @@ class PremiumCalculationTestNew extends CIUnitTestCase
|
||||
|
||||
// Sample family data
|
||||
$family_details = [
|
||||
[2,'TEST001','John Doe', '01-Jan-1988', 'M', 'Self', '5000000', NULL, '', '', 'G', '', '', '', '', '', '',''],
|
||||
[1,'TEST001','Jane Doe', '01-Jan-1985', 'F', 'Spouse', 5000000, '01-Jan-2024', '01-Jan-2020', 50000, 'A', 'Manager', '1234567890', 'john.doe@example.com', '0', '', '', ''],
|
||||
[2,'TEST001','John Doe', '01-Jan-1988', 'M', 'Self', '5000000', NULL, '', '', 'G', '', '', '', '', '', '','','unit1'],
|
||||
[1,'TEST001','Jane Doe', '01-Jan-1985', 'F', 'Spouse', 5000000, '01-Jan-2024', '01-Jan-2020', 50000, 'A', 'Manager', '1234567890', 'john.doe@example.com', '0', '', '', '',''],
|
||||
|
||||
// [3,'TEST001','Peter Doe', '01-Jan-1955', 'M', 'Father', '', NULL, '', '', '', '', '', '', '', '', '',''],
|
||||
[4,'TEST001','Mary Doe', '01-Jan-1953', 'F', 'Mother', '', NULL, '', '', '', '', '', '', '', '', '',''],
|
||||
[5,'TEST001','Grace Doe', '01-Jan-1954', 'F', 'Mother in law', '', NULL, '', '', '', '', '', '', '', '', '',''],
|
||||
//[6,'TEST001','George Doe', '01-Jan-1948', 'M', 'Father in law', '', NULL, '', '', '', '', '', '', '', '', '',''],
|
||||
[7,'TEST001','Alice Doe', '01-Jan-1990', 'F', 'Daughter', 5000000, '01-Jan-2024', '01-Jan-2024', 40000, 'B', 'Supervisor', '9876543210', '', '', '', '',''],
|
||||
[6,'TEST001','Bob Doe', '01-Jan-1993', 'M', 'son', '50000', NULL, '', '', '', '', '', '', '', '', '',''],
|
||||
// [3,'TEST001','Peter Doe', '01-Jan-1955', 'M', 'Father', '', NULL, '', '', '', '', '', '', '', '', '','',''],
|
||||
[4,'TEST001','Mary Doe', '01-Jan-1953', 'F', 'Mother', '', NULL, '', '', '', '', '', '', '', '', '','',''],
|
||||
[5,'TEST001','Grace Doe', '01-Jan-1954', 'F', 'Mother in law', '', NULL, '', '', '', '', '', '', '', '', '','',''],
|
||||
//[6,'TEST001','George Doe', '01-Jan-1948', 'M', 'Father in law', '', NULL, '', '', '', '', '', '', '', '', '','',''],
|
||||
[7,'TEST001','Alice Doe', '01-Jan-1990', 'F', 'Daughter', 5000000, '01-Jan-2024', '01-Jan-2024', 40000, 'B', 'Supervisor', '9876543210', '', '', '', '','',''],
|
||||
[6,'TEST001','Bob Doe', '01-Jan-1993', 'M', 'son', '50000', NULL, '', '', '', '', '', '', '', '', '','',''],
|
||||
];
|
||||
|
||||
// Sample policy terms
|
||||
@ -146,9 +150,13 @@ class PremiumCalculationTestNew extends CIUnitTestCase
|
||||
}
|
||||
// dd($value['slab_rates']);
|
||||
}
|
||||
|
||||
// dd($all_rack_rates);
|
||||
$policy_details = ['base_policy' => null,"policy_start_date" => "2023-02-02","policy_end_date" => "2024-02-02","policy_terms" => json_encode($policy_terms),'gst' => 5];
|
||||
$file = ['id' => null,'client_id' => 10,'policy_id' => 10,'action' => 'inception','client_branch_id' => 1,'created_by' => 1];
|
||||
$data = calculate_premimum_new($family_details,$policy_details,$all_rack_rates,$file);
|
||||
$existing_units = ['unit1'];
|
||||
$data = calculate_premium_new(family_data:$family_details,policy_terms: $policy_details,slab_details : $all_rack_rates,fileArr: $file, existing_units:$existing_units);
|
||||
|
||||
//****************************onboard process*******************
|
||||
// $empServiceController = new EmployeeServiceController();
|
||||
// $empServiceController->employeesOnboardProcess(['familiy_data' => $data,'file' => $file]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user