diff --git a/.gitignore b/.gitignore index 3d6e6ab3..1f8cb67a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,7 @@ writable/**/*.sqlite vendor/ +build/ composer.lock .env +.phpunit* diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b14c375b..8bbe79e1 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -2,9 +2,14 @@ use CodeIgniter\Router\RouteCollection; + /** * @var RouteCollection $routes */ + + $routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']); + + // $routes->get('/', 'LoginController::index'); $routes->get('/test', 'Home::index'); $routes->get('/login', 'LoginController::index');///auth/google @@ -214,7 +219,6 @@ $routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfi -$routes->post("employeeUpload", "EmployeeRestController::employeeUpload"); $routes->group("employeeRest", ["filter" => "authJWT"], function($routes){ $routes->post("employeeUpload", "EmployeeRestController::employeeUpload"); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 1147796d..dc1688f5 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -941,23 +941,85 @@ class ClientController extends AdminController public function policyGMCTerms() { - try { - + // print_r($this->request->getPost('family_floaters'));die; $this->myLogger->logme('error','Terms CREATE function called'); - /*** Client Policy Table Primary Key(ID) ***/ $client_policy_id = $this->request->getPost("client_policy_id"); $data['sum_insured'] =str_replace(',', '',$this->request->getPost("sum_insured")); $data['family_floater'] =$this->request->getPost("family_floater"); - $data['corporatebuffer'] = $this->request->getPost("corporatebuffer"); - $data['family_floaters'] = $this->request->getPost("family_floaters") ?? []; + $data['corporatebuffer'] = $this->request->getPost("corporatebuffer"); + $data['family_floaters'] = $this->request->getPost("family_floaters") ?? []; + + // if (!in_array("self", $data['family_floaters'])) { + // array_unshift($data['family_floaters'], "self"); + // } + $temp_family_floaters = $data['family_floaters']; + $data['family_floaters'] =[]; + if (in_array("self",$temp_family_floaters) == 1) { + $data['family_floaters']['self'] =1; + }else{ + $data['family_floaters']['self'] =0; + } + + if (in_array("spouse",$temp_family_floaters) == 1) { + $data['family_floaters']['spouse'] =1; + }else{ + $data['family_floaters']['spouse'] =0; + } + + // $data['family_floaters']['either-parents-pil'] =0; + + if (count($temp_family_floaters)) { + $children_value = 0; + $value = 0; + + if(count($temp_family_floaters) == 2){ + $children_value = 0; + $value = 1; + }else if(count($temp_family_floaters) == 3){ + $children_value = 1; + $value = 2; + }else{ + $children_value = 2; + $value = 3; + } + $data['family_floaters']['childrens'] =(int)$temp_family_floaters[$children_value]; + + if ($temp_family_floaters[$value] == '1P') { + $data['family_floaters']['parents'] =1; + $data['family_floaters']['parents-in-law'] =0; + $data['family_floaters']['either-parents-pil'] =0; + }else if($temp_family_floaters[$value] == '2P'){ + $data['family_floaters']['parents'] =2; + $data['family_floaters']['parents-in-law'] =0; + $data['family_floaters']['either-parents-pil'] =0; + }else if($temp_family_floaters[$value] == '1PIL'){ + $data['family_floaters']['parents'] =0; + $data['family_floaters']['parents-in-law'] =1; + $data['family_floaters']['either-parents-pil'] =0; + }else if($temp_family_floaters[$value] == '2PIL'){ + $data['family_floaters']['parents'] =0; + $data['family_floaters']['parents-in-law'] =2; + $data['family_floaters']['either-parents-pil'] =0; + }else if($temp_family_floaters[$value] == '2EPORPIL'){ + $data['family_floaters']['parents'] =1; + $data['family_floaters']['parents-in-law'] =1; + $data['family_floaters']['either-parents-pil'] =0; + }else if($temp_family_floaters[$value] == 'EPORPIL'){ + $data['family_floaters']['parents'] =0; + $data['family_floaters']['parents-in-law'] =0; + $data['family_floaters']['either-parents-pil'] =1; + }else if($temp_family_floaters[$value] == '4EPORPIL'){ + $data['family_floaters']['parents'] =2; + $data['family_floaters']['parents-in-law'] =2; + $data['family_floaters']['either-parents-pil'] =0; + } + } + - if (!in_array("self", $data['family_floaters'])) { - array_unshift($data['family_floaters'], "self"); - } $data['waiverofpreexistingdiseases'] =$this->request->getPost("waiverofpreexistingdiseases"); if ($data['waiverofpreexistingdiseases'] == 1) { $data['maternitycoverage'] =str_replace(',', '',$this->request->getPost("maternitycoverage")); @@ -1004,7 +1066,6 @@ class ClientController extends AdminController $data['special_condition_label'] = str_replace(',', '',$this->request->getPost("special_condition_label")) ?? []; $data['special_condition_input'] = str_replace(',', '',$this->request->getPost("special_condition_input")) ?? []; - $jsonData = json_encode($data); $dataa = array( 'policy_terms' => $jsonData, @@ -1012,6 +1073,7 @@ class ClientController extends AdminController $record = $this->clientPolicyModel->where('id', $client_policy_id)->first(); + // print_r($data);die; if ($record) { $update = $this->clientPolicyModel->update($client_policy_id, $dataa); if ($update) { diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 0c72a75e..5c76efe6 100644 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -125,11 +125,27 @@ class EmployeeController extends AdminController // print_r($this->request->getPost('upload-action-type')); // die(); // $empServiceController = new EmployeeServiceController(); - // $res = $empServiceController->excelFileFormatValidation(['file_id' => '34']); + // $res = $empServiceController->excelFileFormatValidation(['file_id' => '38']); // dd($res); // $empServiceController = new EmployeeServiceController(); - // $res = $empServiceController->excelFileDataValidation(['file_id' => '12']); + // $res = $empServiceController->excelFileDataValidation(['file_id' => '38']); + // dd($res); + // $existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: '2'); + // dd($existing_famility_details); + // $empServiceController = new EmployeeServiceController(); + // $res = $empServiceController->employeesSIEnhanceProcess(['file_id' => '38']); + // dd($res); + + // $empServiceController = new EmployeeServiceController(); + // $res = $empServiceController->employeesCorrectionProcess(['file_id' => '37']); + // // dd($res); + // $empServiceController = new EmployeeServiceController(); + // $res = $empServiceController->employeesOnboardPreprocess(['client_policy_id' => '3']); + // dd($res); + + // $empServiceController = new EmployeeServiceController(); + // $res = $empServiceController->employeeDisembark(['file_id' => '36']); // dd($res); // if(isset($res['error_summary']) && count($res['error_summary'])) @@ -173,7 +189,7 @@ class EmployeeController extends AdminController $action = $this->request->getPost('upload-action-type'); $status = 'inprogress'; - $file_id = $this->fileModel->insert(['file_name' => $filename,'client_id' => $client_id,'policy_id' => $policy_id,'created_by' => $loggedInUserID,'status' => $status,'action' => $action]); + $file_id = $this->fileModel->insert(['file_name' => $filename,'client_id' => $client_id,'policy_id' => $policy_id,'created_by' => $loggedInUserID,'status' => $status,'action' => $action]);//here field policy_id have client_policy_id and not policy id from policy master $this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); //start validation process @@ -190,16 +206,21 @@ class EmployeeController extends AdminController } - $data['actions'] = ['inception' => 'Inception + Addition + Deletion','correction' =>'Correction','si_enhancement' =>'SI Enhancement']; + + $data['events'] = ['inception' => 'Inception (Employee + Dependents)','addition' => 'Addition (Employee + Dependents)','dependent_addition' => 'Dependent Addition (Only Dependents)','deletion' => 'Deletion','correction' =>'Correction','si_enhancement' =>'SI Enhancement']; + $data['actions'] = ['inception' => 'Inception (Employee + Dependents)','addition' => 'Addition (Employee + Dependents)','dependent_addtion' => 'Dependent Addition (Only Dependents)','deletion' => 'Deletion','correction' =>'Correction','si_enhancement' =>'SI Enhancement']; + $data['import_or_export'] = ['import' => 'Import','export' =>'Export']; $data['insurer_or_tpa'] = ['insurer' => 'Insurer','tpa' =>'TPA']; + $data['fileList'] = $this->fileModel ->select(['files.*','up.emp_code','up.first_name','pm.name as policy_name','c.short_name']) ->join('user_profiles up','files.created_by = up.id') - ->join('policies pm','files.policy_id = pm.id') - ->join('clients c','files.client_id = c.id') - ->where('files.created_by',8)->orderBy('files.created_at','desc')->findAll(); + ->join('client_policy cp','files.policy_id = cp.id') + ->join('policies pm','cp.policy_id = pm.id') + ->join('clients c','files.client_id = c.id and files.client_id = cp.client_id') + ->where('files.created_by',get_session_userid())->orderBy('files.created_at','desc')->findAll(); $data['batch_list'] = $this->batchFileModel->select('batch_files.*, policies.name as policy_name, clients.short_name as client_short_name') ->join('client_policy', 'client_policy.id = batch_files.client_policy_id') @@ -208,6 +229,7 @@ class EmployeeController extends AdminController ->orderBy('batch_files.id','desc') ->findAll(); + // dd($data['fileList']);die(); if($this->request->getMethod() == "get") { diff --git a/app/Controllers/EmployeeModel.php b/app/Controllers/EmployeeModel.php deleted file mode 100644 index 52382dc1..00000000 --- a/app/Controllers/EmployeeModel.php +++ /dev/null @@ -1,57 +0,0 @@ -db->table('employee_polices') - ->select(' policies.name as Policy_Name , client_policy.policy_terms as Policy_Terms, client_policy.client_id as ClientId, client_policy.policy_id as PolicyId,client_policy.id as ClientPolicyId, client_policy.open_for_enrollment as OpenForEnrollment') // Select all columns from both tables - ->join('client_policy', 'client_policy.id = employee_polices.client_policy_id') - ->join('policies', 'policies.id = client_policy.policy_id') - ->where('employee_polices.employee_id', $id) - ->get() - ->getResult(); - } - - - - - // for EMP rest API process do not change - public function checkExistingEmpEntrollment($arr) - { - return $this->where('emp_code',$arr['emp_code'])->where('name',$arr['name'])->first(); - } - -} diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 1f26e4b9..33222923 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -17,6 +17,7 @@ use App\Models\PolicesModel; use App\Models\RelationshipModel; use App\Models\FileModel; use App\Models\ClientPolicyModel; +use App\Models\PolicyPremium1Model; use App\Models\PolicyPremium2Model; use App\Controllers\Jobs ; @@ -44,6 +45,7 @@ class EmployeeRestController extends AdminController protected $policesModel; protected $relationshipModel; protected $clientPolicyModel; + protected $policyPremium1Model; protected $policyPremium2Model; public function __construct() @@ -58,6 +60,7 @@ class EmployeeRestController extends AdminController $this->relationshipModel = new RelationshipModel(); $this->fileModel= new FileModel(); $this->clientPolicyModel = new ClientPolicyModel(); + $this->policyPremium1Model = new PolicyPremium1Model(); $this->policyPremium2Model = new PolicyPremium2Model(); } @@ -139,6 +142,7 @@ class EmployeeRestController extends AdminController $data = $this->request->getJSON(); if ($data) { $updatedCount = 0; + foreach ($data as $item) { $id = $item->id; $item->dob = $this->convertDateFormat($item->dob); @@ -156,8 +160,8 @@ class EmployeeRestController extends AdminController return $this->respond(['status' => 'failed','code' => 404,'data' => $result], 404); } } - } catch (\Throwable $th) { - return $this->respond(['status' => 'failed','code' => 500,'data' => $th], 500); + } catch (\Exception $e) { + return $this->respond(['status' => 'failed','code' => 500,'data' => $e], 500); } } @@ -237,6 +241,7 @@ class EmployeeRestController extends AdminController public function deleteDependence() { try { + print_r($this->rquest);die; if($this->request->getGet('id')) { $delete = $this->employeeModel->where('id', $this->request->getGet('id'))->delete(); @@ -489,273 +494,281 @@ class EmployeeRestController extends AdminController // Upload the Employee Detail in DB by Sheet Data public function employeeUpload() { - $file = $this->request->getFile('file'); - $client_id = $this->request->getPost('client_id'); - $policy_id = $this->request->getPost('policy_id'); + try { + $file = $this->request->getFile('file'); + $client_id = $this->request->getPost('client_id'); + // $client_id = $this->request->getJSON('client_id'); + $policy_id = $this->request->getPost('policy_id'); + // $policy_id = $this->request->getJSON('policy_id'); - $client_policy = $this->clientPolicyModel->where('id', $policy_id)->first(); - $policy = $this->policesModel->where('id', $client_policy['policy_id'])->first(); + $client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->first(); - $policy_permium = $this->policyPremium2Model->where(['client_id' => $client_id , 'client_policy_id' => $policy_id,'is_active' =>1])-> first(); + if ($client_policy) { + $policy = $this->policesModel->where('id', $client_policy['policy_id'])->first(); + $policy_permium_1 = $this->policyPremium1Model->where(['client_id' => $client_id , 'client_policy_id' => $policy_id,'is_active' =>1])-> first(); + $policy_permium_2 = $this->policyPremium2Model->where(['client_id' => $client_id , 'client_policy_id' => $policy_id,'is_active' =>1])-> first(); + $sum_insured_amount_for_check_employee_1 = $policy_permium_1['si']; + $sum_insured_amount_for_check_employee_2 = $policy_permium_2['si']; - $is_moved = $file->move(WRITEPATH . 'uploads/import_excel'); - $filename = $file->getName(); - $file_name_with_path = WRITEPATH."/uploads/import_excel/".$filename; + $is_moved = $file->move(WRITEPATH . 'uploads/import_excel'); + $filename = $file->getName(); + $file_name_with_path = WRITEPATH."/uploads/import_excel/".$filename; - //check the file exist or not - if(!file_exists($file_name_with_path)) - { - session()->setFlashdata('error', 'File not found'); - return redirect()->to(base_url('employee/upload')); - } - // Load the Excel file - $spreadsheet = IOFactory::load($file_name_with_path); - - // Get the active sheet - $sheet = $spreadsheet->getActiveSheet(); - - // Get the highest row and column numbers - $highestRow = $sheet->getHighestRow(); - $highestColumn = $sheet->getHighestColumn(); - - $highestRowAndColumn = $sheet->getHighestRowAndColumn(); - $data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); - // print_r($excel_data);die(); - // $data = []; - // $data[] =$excel_data; - - // print_r($data);die; - // Iterate through each row - // for ($row = 1; $row <= $highestRow; $row++) { - // // Initialize the row data array - // $rowData = []; - - // // Iterate through each column in the row - // for ($col = 'A'; $col <= $highestColumn; $col++) { - // // Get the cell value - // $value = $sheet->getCell($col . $row)->getValue(); - // // print_r($value); - // // Add the cell value to the row data array - // $rowData[] = $value; - // } - - // // Add the row data to the main data array - // $data[] = $rowData; - // } - // print_r($data);die; - - $extractData['file_name']= $filename; - $extractData['client_id']= $client_id; - $extractData['status']= 'success'; - $extractData['policy_id']= $policy_id; - $extractData['action']= 'enrollment'; - // $extractData['created_by']=set_session_context('Employee'); - - $file_data =$this->fileModel->insert($extractData); - - $extra = []; - //this change the column name into index number - for ($i = 0; $i < count($data[0]); $i++) { - $data[0][$i] = $i; - } - for ($i = 0; $i < count($data); $i++) { - if ($i == 0) { - // Loop through the first row to extract keys - for ($j = 0; $j < count($data[$i]); $j++) { - $extra[$data[$i][$j]] = []; // Initialize keys with empty array + //check the file exist or not + if(!file_exists($file_name_with_path)) + { + session()->setFlashdata('error', 'File not found'); + return redirect()->to(base_url('employee/upload')); } - } else { - // Loop through subsequent rows - for ($j = 0; $j < count($data[$i]); $j++) { - // Append values to corresponding keys in $extra - if (isset($extra[$data[0][$j]])) { - // Make sure the key exists in the $extra array - $extra[$data[0][$j]][] = $data[$i][$j]; + // Load the Excel file + $spreadsheet = IOFactory::load($file_name_with_path); + + // Get the active sheet + $sheet = $spreadsheet->getActiveSheet(); + + // Get the highest row and column numbers + $highestRow = $sheet->getHighestRow(); + $highestColumn = $sheet->getHighestColumn(); + + $highestRowAndColumn = $sheet->getHighestRowAndColumn(); + $data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); + + $extractData['file_name']= $filename; + $extractData['client_id']= $client_id; + $extractData['status']= 'success'; + $extractData['policy_id']= $policy_id; + $extractData['action']= 'enrollment'; + // $extractData['created_by']=set_session_context('Employee'); + + $file_data =$this->fileModel->insert($extractData); + + $extra = []; + if (count($data[0]) == 10) { + $value = ['S.No','Emp Code','Name','DOJ','Gender','Relation','DOB','Mail','Mobile','SI']; + $check_miss_match = []; + for ($i=0; $i 0) { + return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Column Name's are miss Match's!", 'data'=> $check_miss_match], 404); } } - } - } - $dataToInsert = []; - $basic_cover_si= []; - foreach ($extra['0'] as $index => $id) { - $relation =''; - if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') { - $relation = 'parent'; - } else if($extra['5'][$index] === 'Son' || $extra['5'][$index] === 'Daughter'){ - $relation = 'child'; - }else if($extra['5'][$index] === 'Father in Law' || $extra['5'][$index] === 'Mother in Law'){ - $relation = 'parent_in_law'; - }else if($extra['5'][$index] === 'Spouse'){ - $relation = 'spouse'; - }else{ - $relation = 'self'; - } - - // Simplified formatDate function + if(count($data[0]) != 10){ + return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Uploaded file row count is Not Match!" ], 404); + } - // Assigning formatted dates - // print_r($extra['3']);die; - $doj = $extra['3'][$index] ; - $dob = $extra['6'][$index] ; - - - // Change date format for $doj - $doj_new_format = date('Y-m-d', strtotime($doj)); // $doj_new_format will be "2001-02-12" - - // Change date format for $dob - $dob_new_format = date('Y-m-d', strtotime($dob)); - - // Your existing code here - - $emp_code =isset($extra['1'][$index]) ? $extra['1'][$index] : 0; - $name = $extra['2'][$index]; - - // print_r("--" . $emp_code. "---"); - // print_r( $emp_code != 0 ); - if($emp_code != 0 && $name != '' || $name != null){ - $record = [ - // 'id' => $id, - 'emp_code' => $emp_code, - 'name' => $name, - // Check if the 'doj' key exists before accessing it - 'doj' => $doj_new_format, - 'gender' => $extra['4'][$index], - 'relationship' => ucfirst($extra['5'][$index]), - 'family_floater_key' => $relation, - 'dob' => $dob_new_format, - 'email_corporate' => $extra['7'][$index], - 'mobile'=> $extra['8'][$index], - 'client_id' => $client_id, - 'emp_status'=>'draft' - - ]; - - $basic_cover_si_value = null; - - //Grid id is 10 and 11 sum insure value add only for self other grid type self sum insure is for the dependence - // if ($policy['policy_type_id'] != 1) { - if ($policy_permium['policy_grid_id'] == 10 || $policy_permium['policy_grid_id'] == 11) { - if (strtolower($extra['5'][$index]) == 'self') { - $basic_cover_si_value = $extra['9'][$index]; - }else{ - $basic_cover_si_value = null; + //this change the column name into index number + for ($i = 0; $i < count($data[0]); $i++) { + $data[0][$i] = $i; + } + for ($i = 0; $i < count($data); $i++) { + if ($i == 0) { + // Loop through the first row to extract keys + for ($j = 0; $j < count($data[$i]); $j++) { + $extra[$data[$i][$j]] = []; // Initialize keys with empty array } + } else { + // Loop through subsequent rows + for ($j = 0; $j < count($data[$i]); $j++) { + // Append values to corresponding keys in $extra + if (isset($extra[$data[0][$j]])) { + // Make sure the key exists in the $extra array + $extra[$data[0][$j]][] = $data[$i][$j]; + } + } + } + } + $dataToInsert = []; + $basic_cover_si= []; + if ($extra[9]) { + $new_array = []; + for ($i=0; $i < count($extra[9]); $i++) { + if ($sum_insured_amount_for_check_employee_2 != $extra[9][$i] || $sum_insured_amount_for_check_employee_1 != $extra[9][$i]) { + $new_array[] = $i+1; + } + } + if (count($new_array) > 0) { + $count =count($new_array); + return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "$count Employee Sum Insured is Not Match.. " , 'data' => $new_array], 404); + } + } + foreach ($extra['0'] as $index => $id) { + $relation =''; + if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') { + $relation = 'parent'; + } else if($extra['5'][$index] === 'Son' || $extra['5'][$index] === 'Daughter'){ + $relation = 'child'; + }else if($extra['5'][$index] === 'Father in Law' || $extra['5'][$index] === 'Mother in Law'){ + $relation = 'parent_in_law'; + }else if($extra['5'][$index] === 'Spouse'){ + $relation = 'spouse'; }else{ - if (strtolower($extra['5'][$index]) == 'self') { - $basic_cover_si_value = $extra['9'][$index]; - }else{ - for ($i=0; $i < count($extra['1']) ; $i++) { - - if ($extra['1'][$i] == $extra['1'][$index]) { - if (strtolower($extra['5'][$i]) == 'self') { - $basic_cover_si_value = $extra['9'][$i]; + $relation = 'self'; + } + // Simplified formatDate function + + // Assigning formatted dates + $doj = $extra['3'][$index] ; + $dob = $extra['6'][$index] ; + + // Change date format for $doj + $doj_new_format = date('Y-m-d', strtotime($doj)); // $doj_new_format will be "2001-02-12" + + // Change date format for $dob + $dob_new_format = date('Y-m-d', strtotime($dob)); + + // Your existing code here + $emp_code =isset($extra['1'][$index]) ? $extra['1'][$index] : 0; + $name = $extra['2'][$index]; + + if($emp_code != 0 && $name != '' || $name != null){ + $record = [ + // 'id' => $id, + 'emp_code' => $emp_code, + 'name' => $name, + // Check if the 'doj' key exists before accessing it + 'doj' => $doj_new_format, + 'gender' => $extra['4'][$index], + 'relationship' => ucfirst($extra['5'][$index]), + 'family_floater_key' => $relation, + 'dob' => $dob_new_format, + 'email_corporate' => $extra['7'][$index], + 'mobile'=> $extra['8'][$index], + 'client_id' => $client_id, + 'emp_status'=>'draft' + + ]; + $basic_cover_si_value = null; + + //Grid id is 10 and 11 sum insure value add only for self other grid type self sum insure is for the dependence + if ($policy_permium_2['policy_grid_id'] == 10 || $policy_permium_2['policy_grid_id'] == 11) { + if (strtolower($extra['5'][$index]) == 'self') { + $basic_cover_si_value = $extra['9'][$index]; + }else{ + $basic_cover_si_value = null; + } + }else{ + if (strtolower($extra['5'][$index]) == 'self') { + $basic_cover_si_value = $extra['9'][$index]; + }else{ + for ($i=0; $i < count($extra['1']) ; $i++) { + + if ($extra['1'][$i] == $extra['1'][$index]) { + if (strtolower($extra['5'][$i]) == 'self') { + $basic_cover_si_value = $extra['9'][$i]; + } + } } } } - } - } - // } - - $record2 = [ - 'basic_cover_si' => $basic_cover_si_value, - ]; - // print_r($basic_cover_si);die; - $dataToInsert[] = $record; - $basic_cover_si[]= $basic_cover_si_value; - } - } - for ($a=0; $a employeeModel->checkExistingEmployee($dataToInsert[$a]); - $emp_id =0; - - $data_after_gpa_or_gmc =[]; - // print_r($policy);die; - if ($policy['policy_type_id'] == 1) { - if (strtolower($dataToInsert[$a]['relationship']) == 'self') { - $data_after_gpa_or_gmc = $dataToInsert[$a]; - } - }else{ - $data_after_gpa_or_gmc = $dataToInsert[$a]; - } - - - date_default_timezone_set('Asia/Kolkata'); - $current_timestamp = time(); - $formatted_date_time = date('Y-m-d H:i:s', $current_timestamp); - - if ($employee) { - - $emp_id =$employee['id']; - $id =$emp_id; - $data_after_gpa_or_gmc['id'] = $id; - $data_after_gpa_or_gmc['updated_at'] = $formatted_date_time; - $result = $this->employeeModel->save($data_after_gpa_or_gmc); - if ($result) { - $log_message = 'Update Employee - '.$employee['name'].'('.$employee['emp_code'].') with PK '.$employee['id']; - $this->myLogger->logme('error',('Update - ' . $employee['id'].' - '. $employee['emp_code'] .' - '.$employee['name'])); - } - }else{ - if ($dataToInsert[$a]['emp_code'] != 0) { - $result =false; - if (count($data_after_gpa_or_gmc) != 0) { - $result = $this->employeeModel->insert($data_after_gpa_or_gmc); - } - $emp_id =$result; - if ($result) { - $emp = $this->employeeModel->where('id', $result)->get()->getResult(); - - $policy_name = $this->employeePolicyModel->where('employee_id', $result)->get()->getResult();; - - - $log_message = 'Insert Employee- '.$dataToInsert[$a]['name'] .'('.$dataToInsert[$a]['emp_code'] .') with PK '; - $this->myLogger->logme('error',('Insert - ' . $dataToInsert[$a]['emp_code'] .' - '. $dataToInsert[$a]['name'])); - } - } + $record2 = [ + 'basic_cover_si' => $basic_cover_si_value, + ]; + $dataToInsert[] = $record; + $basic_cover_si[]= $basic_cover_si_value; } - $emp_policy_data =[ - 'employee_id'=>$emp_id, - 'client_policy_id'=>$policy_id, - 'status'=> 'draft', - 'basic_cover_si'=>isset($basic_cover_si[$a]) ? $basic_cover_si[$a] : null - ]; + } + for ($a=0; $a employeeModel->checkExistingEmployee($dataToInsert[$a]); + $emp_id =0; + + $data_after_gpa_or_gmc =[]; + if ($policy['policy_type_id'] == 1) { + if (strtolower($dataToInsert[$a]['relationship']) == 'self') { + $data_after_gpa_or_gmc = $dataToInsert[$a]; + } + }else{ + $data_after_gpa_or_gmc = $dataToInsert[$a]; + } + date_default_timezone_set('Asia/Kolkata'); + $current_timestamp = time(); + $formatted_date_time = date('Y-m-d H:i:s', $current_timestamp); - $employee_policy = $this->employeePolicyModel->checkExistingEmpPolicy(['employee_id' => $emp_id,'client_policy_id' => $policy_id]); - if ($employee_policy) { - foreach ($employee_policy as $existing_policy) { - $emp_policy_data['id']= $existing_policy['id']; - $emp_policy_data['updated_at'] = $formatted_date_time; - $this->employeePolicyModel->save($emp_policy_data); - } - } else { - $emp_policy = $this->employeePolicyModel->insert($emp_policy_data); - } + if ($employee) { + + + $emp_id =$employee['id']; + $id =$emp_id; + $data_after_gpa_or_gmc['id'] = $id; + $data_after_gpa_or_gmc['updated_at'] = $formatted_date_time; + $result = $this->employeeModel->save($data_after_gpa_or_gmc); + if ($result) { + $log_message = 'Update Employee - '.$employee['name'].'('.$employee['emp_code'].') with PK '.$employee['id']; + $this->myLogger->logme('error',('Update - ' . $employee['id'].' - '. $employee['emp_code'] .' - '.$employee['name'])); + } + }else{ + if ($dataToInsert[$a]['emp_code'] != 0) { + $result =false; + if (count($data_after_gpa_or_gmc) != 0) { + $result = $this->employeeModel->insert($data_after_gpa_or_gmc); + } + $emp_id =$result; + if ($result) { + $emp = $this->employeeModel->where('id', $result)->get()->getResult(); + + $policy_name = $this->employeePolicyModel->where('employee_id', $result)->get()->getResult();; + + + $log_message = 'Insert Employee- '.$dataToInsert[$a]['name'] .'('.$dataToInsert[$a]['emp_code'] .') with PK '; + $this->myLogger->logme('error',('Insert - ' . $dataToInsert[$a]['emp_code'] .' - '. $dataToInsert[$a]['name'])); + } + } + } + $emp_policy_data =[ + 'employee_id'=>$emp_id, + 'client_policy_id'=>$policy_id, + 'status'=> 'draft', + 'basic_cover_si'=>isset($basic_cover_si[$a]) ? $basic_cover_si[$a] : null + ]; + + $employee_policy = $this->employeePolicyModel->checkExistingEmpPolicy(['employee_id' => $emp_id,'client_policy_id' => $policy_id]); + if ($employee_policy) { + foreach ($employee_policy as $existing_policy) { + $emp_policy_data['id']= $existing_policy['id']; + $emp_policy_data['updated_at'] = $formatted_date_time; + $this->employeePolicyModel->save($emp_policy_data); + } + } else { + $emp_policy = $this->employeePolicyModel->insert($emp_policy_data); + } - //trigger - // print_r($dataToInsert[$a]['email_personal']);die; - - $mail = $dataToInsert[$a]['email_corporate']; - $subject = 'Welcome, Employee Benefit Program Enrolment'; - // $message = 'Dear ' . $dataToInsert[$a]['name'] . ",
We are glad to welcome you to the employee benefit program ," .$policy_name['name'] ."offered by your employer,


Click on the link below to review your personal and family details:
Review Details" ; - $data['employee_name']=$dataToInsert[$a]['name']; - $data['policy_name']=$policy['name']; - - $message = view('mail_welcome', $data); - // if ($dataToInsert[$a]['email_corporate'] != null || $dataToInsert[$a]['email_corporate'] != '' && $dataToInsert[$a]['relationship'] == 'Self') { - // $job_details = new Jobs(); - // $r = Jobs::addJob(['job_name' => 'send_email','payload' => ['mail' => $mail, 'subject' => $subject,'message'=> $message]]); - // } - - // print_r($r);//die(); - // $jobWorker = new JobWorker(); - //JobWorker::processJob($r); - // $return_log = MailHelper::send_email($mail,$subject, $message); - // $return_log = json_decode($return_log); - // $this->myLogger->logme('info', "Email Status : {mail_status}, Sender Email:{email}", ['mail_status' => $return_log->status, 'email'=> $return_log->data]); + //trigger + $mail = $dataToInsert[$a]['email_corporate']; + $subject = 'Welcome, Employee Benefit Program Enrolment'; + // $message = 'Dear ' . $dataToInsert[$a]['name'] . ",
We are glad to welcome you to the employee benefit program ," .$policy_name['name'] ."offered by your employer,


Click on the link below to review your personal and family details:
Review Details" ; + $data['employee_name']=$dataToInsert[$a]['name']; + $data['policy_name']=$policy['name']; + + $message = view('mail_welcome', $data); + // if ($dataToInsert[$a]['email_corporate'] != null || $dataToInsert[$a]['email_corporate'] != '' && $dataToInsert[$a]['relationship'] == 'Self') { + // $job_details = new Jobs(); + // $r = Jobs::addJob(['job_name' => 'send_email','payload' => ['mail' => $mail, 'subject' => $subject,'message'=> $message]]); + // } + + // print_r($r);//die(); + // $jobWorker = new JobWorker(); + //JobWorker::processJob($r); + // $return_log = MailHelper::send_email($mail,$subject, $message); + // $return_log = json_decode($return_log); + // $this->myLogger->logme('info', "Email Status : {mail_status}, Sender Email:{email}", ['mail_status' => $return_log->status, 'email'=> $return_log->data]); + } + }else{ + return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Client id and Client Policy id is Not Match!" ], 404); + } + } catch (\Exception $e) { + return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500); } + + + + } diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index ccf52ee4..ed5c0a4b 100644 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -12,11 +12,14 @@ use App\Models\EmployeeModel; use App\Models\EmployeePolicyModel; use App\Models\ClientModel; use App\Models\ClientPolicyModel; +use App\Models\PolicesModel; use App\Models\FileModel; +use App\Models\EmpEndorsementModel; use App\Controllers\Jobs ; use PhpOffice\PhpSpreadsheet\Spreadsheet; +use Kint\Kint; class EmployeeServiceController extends AdminController { @@ -27,9 +30,18 @@ class EmployeeServiceController extends AdminController protected $clientModel; protected $fileModel; protected $clientPolicyModel; + protected $policiesModel; + protected $empEndorsementModel; protected $general_relationships = ['self' => ['name' => 'Self', 'gender' => 'M','age_min' => 18,'age_max' => null], 'spouse' => ['name' => 'Spouse', 'gender' => 'F','age_min' => 18,'age_max' => null], 'son' => ['name' => 'Son', 'gender' => 'M','age_min' => null,'age_max' => 25], 'daughter' => ['name' => 'Daughter', 'gender' => 'F','age_min' => null,'age_max' => 25], 'father' => ['name' => 'Father', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother' => ['name' => 'Mother', 'gender' => 'F','age_min' => 18,'age_max' => null], 'father-in-law' => ['name' => 'Father in Law', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother-in-law' => ['name' => 'Mother in Law', 'gender' => 'F','age_min' => 18,'age_max' => null]]; - protected $inception_excel_columns = ['sno' => ['col_idx' => 0,'col_cell_name' => 'A','col_name' => 'S.No','is_mandatory' => true,'data_type' => 'str','format' => null,'allowed_values' => null],'emp_id' => ['col_idx' => 1,'col_cell_name' => 'B','col_name' => 'EMP ID','is_mandatory' => true,'data_type' => 'str','format' => null,'allowed_values' => null],'name_of_emp_dep' => ['col_idx' => 2,'col_cell_name' => 'C','col_name' => 'NAME OF EMP/DEP','is_mandatory' => true,'data_type' => 'str','format' => null,'allowed_values' => null],'dob' => ['col_idx' => 3,'col_cell_name' => 'D','col_name' => 'DOB','is_mandatory' => ['I','A','DA'],'data_type' => 'str','format' => 'd-M-Y','allowed_values' => null,'custom' => 'check_dob_diff','params' => ['row','relationship']],'gender' => ['col_idx' => 4,'col_cell_name' => 'E','col_name' => 'Gender','is_mandatory' => ['I','A','DA'],'data_type' => 'str','format' => null,'allowed_values' => ['M','F']],'relationship' => ['col_idx' => 5,'col_cell_name' => 'F','col_name' => 'RELATIONSHIP','is_mandatory' => ['I','A','DA'],'data_type' => 'str','format' => null,'allowed_values' => null,'custom' => 'check_relationship','params' => ['row','relationship']],'basic_cover_si' => ['col_idx' => 6,'col_cell_name' => 'G','col_name' => 'BASIC COVER SI','is_mandatory' => ['I','A','DA'],'data_type' => 'str','format' => null,'allowed_values' => null],'doj' => ['col_idx' => 7,'col_cell_name' => 'H','col_name' => 'DOJ','is_mandatory' => false,'data_type' => 'str','format' => 'd-M-Y','allowed_values' => null,'custom' => 'check_doj','params' => ['row']],'basic_pay' => ['col_idx' => 8,'col_cell_name' => 'I','col_name' => 'Basic Pay','is_mandatory' => false,'data_type' => 'str','format' => null,'allowed_values' => null,'custom' => 'check_basic_pay','params' => ['row']],'band_grade' => ['col_idx' => 9,'col_cell_name' => 'J','col_name' => 'Band/Grade','is_mandatory' => false,'data_type' => 'str','format' => null,'allowed_values' => null,'custom' => 'check_employee_band','params' => ['row']],'designation' => ['col_idx' => 10,'col_cell_name' => 'K','col_name' => 'Designation','is_mandatory' => false,'data_type' => 'str','format' => null,'allowed_values' => null],'phone' => ['col_idx' => 11,'col_cell_name' => 'L','col_name' => 'Phone','is_mandatory' => false,'data_type' => 'str','format' => null,'allowed_values' => null],'email' => ['col_idx' => 12,'col_cell_name' => 'M','col_name' => 'Email','is_mandatory' => false,'data_type' => 'str','format' => null,'allowed_values' => null],'pre_existing_ailments' => ['col_idx' => 13,'col_cell_name' => 'N','col_name' => 'PRE EXISTING AILMENTS','is_mandatory' => ['I','A','DA'],'data_type' => 'str','format' => null,'allowed_values' => ['0','1']],'change_event' => ['col_idx' => 14,'col_cell_name' => 'O','col_name' => 'Change event','is_mandatory' => ['A','DA','D'],'data_type' => 'str','format' => null,'allowed_values' => null],'date_of_exit' => ['col_idx' => 15,'col_cell_name' => 'P','col_name' => 'Date of exit','is_mandatory' => ['D'],'data_type' => 'str','format' => 'd-M-Y','allowed_values' => null],'reason_for_exit' => ['col_idx' => 16,'col_cell_name' => 'Q','col_name' => 'Reason for exit','is_mandatory' => ['D'],'data_type' => 'str','format' => null,'allowed_values' => null],'action' => ['col_idx' => 17,'col_cell_name' => 'R','col_name' => 'Action','is_mandatory' => true,'data_type' => 'str','format' => null,'allowed_values' => ['I','A','D','DA'] ]]; + protected $inception_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'dob'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'DOB','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_dob_diff','params'=>['row','relationship']],'gender'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Gender','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['M','F']],'relationship'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'RELATIONSHIP','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_relationship','params'=>['row','relationship']],'basic_cover_si'=>['col_idx'=>6,'col_cell_name'=>'G','col_name'=>'BASIC COVER SI','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_si','params' => ['row','policy_terms','slab_details']],'doc'=>['col_idx'=>7,'col_cell_name'=>'H','col_name'=>'Date of Coverage','is_mandatory'=>['A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'params'=>['row']],'doj'=>['col_idx'=>8,'col_cell_name'=>'I','col_name'=>'DOJ','is_mandatory'=>false,'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_doj','params'=>['row']],'basic_pay'=>['col_idx'=>9,'col_cell_name'=>'J','col_name'=>'Basic Pay','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_basic_pay','params'=>['row','policy_terms','slab_details']],'band_grade'=>['col_idx'=>10,'col_cell_name'=>'K','col_name'=>'Band/Grade','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_employee_band','params'=>['row','policy_terms','slab_details']],'designation'=>['col_idx'=>11,'col_cell_name'=>'L','col_name'=>'Designation','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'phone'=>['col_idx'=>12,'col_cell_name'=>'M','col_name'=>'Phone','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'email'=>['col_idx'=>13,'col_cell_name'=>'N','col_name'=>'Email','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'pre_existing_ailments'=>['col_idx'=>14,'col_cell_name'=>'O','col_name'=>'PRE EXISTING AILMENTS','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['0','1']],'change_event'=>['col_idx'=>15,'col_cell_name'=>'P','col_name'=>'Change event','is_mandatory'=>['A','DA','D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>16,'col_cell_name'=>'Q','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>17,'col_cell_name'=>'R','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]]; + + protected $deletion_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'change_event'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'Change event','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]]; + + protected $correction_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'field'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'Field','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>['name','dob','relationship']],'value'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Value','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_correction'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'Date of Correction','is_mandatory'=>true,'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'change_event'=>['col_idx'=>6,'col_cell_name'=>'G','col_name'=>'Change event','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'remarks'=>['col_idx'=>7,'col_cell_name'=>'H','col_name'=>'Remarks','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null]]; + + protected $si_enhance_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'augmented_si'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'Augmented SI','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_si','params' => ['row','policy_terms','slab_details']],'date_of_enhancement'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Date of SI Enhancement','is_mandatory'=>true,'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null]]; + public function __construct() { // helper('utility'); @@ -40,6 +52,8 @@ class EmployeeServiceController extends AdminController $this->clientModel = new ClientModel(); $this->fileModel = new FileModel(); $this->clientPolicyModel = new ClientPolicyModel(); + $this->policiesModel = new PolicesModel(); + $this->empEndorsementModel = new EmpEndorsementModel(); } public function excelFileFormatValidation($params) @@ -74,28 +88,21 @@ class EmployeeServiceController extends AdminController $sheet = $spreadsheet->getActiveSheet(); $highestRowAndColumn = $sheet->getHighestRowAndColumn(); - // $highestRow = $sheet->getHighestDataRow(); // 1048576, should be 2 - // $highestColumn = $sheet->getHighestDataColumn(); // L, should be B - // print_r($highestRowAndColumn); - // echo $highestRow;echo ' - ' . $highestColumn; + $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); - // $data = array_filter($data); - // echo '
'; 
-        // dd($excel_data);
-        // echo "
";die(); - // foreach ($excel_data as $key => $value) - // { - - // } - - + // dd($this->si_enhance_excel_columns); $columns_to_check = []; if($file['action'] == 'inception'){ $columns_to_check = $this->inception_excel_columns; } + if($file['action'] == 'addition'){ $columns_to_check = $this->inception_excel_columns; } + if($file['action'] == 'dependent_addition'){ $columns_to_check = $this->inception_excel_columns; } + if($file['action'] == 'deletion'){ $columns_to_check = $this->deletion_excel_columns; } + if($file['action'] == 'correction'){ $columns_to_check = $this->correction_excel_columns; } + if($file['action'] == 'si_enhancement'){ $columns_to_check = $this->si_enhance_excel_columns; } //check no of columns in excel $total_defined_columns = count($columns_to_check); $excel_columns = ($excel_data[0]); - // var_dump($excel_columns);die(); + // var_dump($total_defined_columns);die(); $excel_columns_count = count($excel_columns); if($total_defined_columns != $excel_columns_count) { @@ -124,7 +131,15 @@ class EmployeeServiceController extends AdminController //start other checks $result = ['error_type' => 1,'error_summary' => [], 'error_data' => [] ]; $keys = array_keys($columns_to_check); - // print_r($keys);die(); + // dd($columns_to_check);die(); + + // get policy and rack details + $policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']); + $policy_terms = (array) $policy_terms[0];// convert obj to array + + //get policy slab rates + $slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']); + // dd($slab_details); //remove header unset($excel_data[0]); @@ -134,7 +149,12 @@ class EmployeeServiceController extends AdminController //define row wise action/event in temporary variable $current_column_action = null; - if($file['action'] == 'inception'){ $current_column_action = $row[17]; } + if($file['action'] == 'inception'){ $current_column_action = 'I'; } + else if($file['action'] == 'addition'){ $current_column_action = 'A'; } + else if($file['action'] == 'dependent_addition'){ $current_column_action = 'DA'; } + else if($file['action'] == 'deletion'){ $current_column_action = 'D'; } + else if($file['action'] == 'correction'){ $current_column_action = 'C'; } + else if($file['action'] == 'si_enhancement'){ $current_column_action = 'SI'; } //1. avoid empty rows if(check_row_is_empty_or_null($row)) { @@ -144,15 +164,15 @@ class EmployeeServiceController extends AdminController foreach ($row as $col_key => $col) { - $is_mandatory = $this->inception_excel_columns[$keys[$col_key]]['is_mandatory']; - $format = $this->inception_excel_columns[$keys[$col_key]]['format']; - $allowed_values = $this->inception_excel_columns[$keys[$col_key]]['allowed_values']; - $custom_function = isset($this->inception_excel_columns[$keys[$col_key]]['custom']) ? $this->inception_excel_columns[$keys[$col_key]]['custom'] : null; - $binding_params = isset($this->inception_excel_columns[$keys[$col_key]]['params']) ? $this->inception_excel_columns[$keys[$col_key]]['params'] : null; - $column_dispaly_name = $this->inception_excel_columns[$keys[$col_key]]['col_name']; - $column_index = $this->inception_excel_columns[$keys[$col_key]]['col_idx']; - $column_cell = $this->inception_excel_columns[$keys[$col_key]]['col_cell_name']; - + $is_mandatory = $columns_to_check[$keys[$col_key]]['is_mandatory']; + $format = $columns_to_check[$keys[$col_key]]['format']; + $allowed_values = $columns_to_check[$keys[$col_key]]['allowed_values']; + $custom_function = isset($columns_to_check[$keys[$col_key]]['custom']) ? $columns_to_check[$keys[$col_key]]['custom'] : null; + $binding_params = isset($columns_to_check[$keys[$col_key]]['params']) ? $columns_to_check[$keys[$col_key]]['params'] : null; + $column_dispaly_name = $columns_to_check[$keys[$col_key]]['col_name']; + $column_index = $columns_to_check[$keys[$col_key]]['col_idx']; + $column_cell = $columns_to_check[$keys[$col_key]]['col_cell_name']; + $row['current_action'] = $current_column_action; //mandatory check if(is_bool($is_mandatory) && $is_mandatory === true) @@ -169,7 +189,7 @@ class EmployeeServiceController extends AdminController //if is_mandatory is array (action based mandatory check) if($current_column_action != null && is_array($is_mandatory) && in_array(strtoupper(trim($current_column_action)),$is_mandatory)) { - $allowed_actions = $this->inception_excel_columns[$keys[$col_key]]['is_mandatory']; + $allowed_actions = $columns_to_check[$keys[$col_key]]['is_mandatory']; if($col == "" || $col == NULL) { array_push($result['error_summary'],1); @@ -196,7 +216,7 @@ class EmployeeServiceController extends AdminController if($is_mandatory === true && isset($allowed_values) && is_array($allowed_values)) { - if(!in_array(trim($col),$allowed_values)) + if(!in_array(strtolower(trim($col)),$allowed_values)) { array_push($result['error_summary'],3); $result['error_data'][$row_key][$keys[$col_key]]['col_name'] = $column_dispaly_name; //push column name @@ -280,11 +300,16 @@ class EmployeeServiceController extends AdminController return array('error_summary' => [5], 'error_data' => $message); } - $columns_to_check = []; + $columns_to_check = []; if($file['action'] == 'inception'){ $columns_to_check = $this->inception_excel_columns; } + if($file['action'] == 'addition'){ $columns_to_check = $this->inception_excel_columns; } + if($file['action'] == 'dependent_addition'){ $columns_to_check = $this->inception_excel_columns; } + if($file['action'] == 'deletion'){ $columns_to_check = $this->deletion_excel_columns; } + if($file['action'] == 'correction'){ $columns_to_check = $this->correction_excel_columns; } + if($file['action'] == 'si_enhancement'){ $columns_to_check = $this->si_enhance_excel_columns; } // get policy and rack details - $policy_terms = $this->clientPolicyModel->getPolicyTermsJson($file['client_id'],$file['policy_id']); + $policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']); // dd($policy_terms); $policy_terms = json_decode($policy_terms[0]->policy_terms); $policy_terms = (array) $policy_terms;// convert obj to array @@ -306,78 +331,567 @@ class EmployeeServiceController extends AdminController $employee_data_group_by_family = data_group_by_family($excel_data); // dd($employee_data_group_by_family); - foreach ($employee_data_group_by_family as $emp_id => $family) - { + foreach ($employee_data_group_by_family as $emp_id => $family) + { - - //check name dup within a family - $res = name_dup_check_within_family($family); - if(count($res)) - { - foreach($res as $k => $rowid) + //if action is DA then get all familiy members,transfrom them into excel array, addd data source as db or excel + if($file['action'] == 'dependent_addition') { - array_push($result['error_summary'],7); // dup entry in excel file - $result['error_data'][$rowid]['name_of_emp_dep']['error'][] = "Twofold Name found within family"; + $existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $emp_id,client_id: $file['client_id'],client_policy_id: $file ['policy_id'],emp_status: 'active'); + // dd($existing_famility_details); + //transsform familiy details from db columns to exxcel row with column indexs for checking remaining functionalitites + $existing_famility_details = transform_db_data_to_excel($existing_famility_details,$file); + // dd($existing_famility_details); + $family = array_merge($family,$existing_famility_details); } - } - //check allowed dependent count and relationship conflict within family at policy level - // if($policy_terms['family_floater'] == true) - // { - // dd($policy_terms['family_floaters']); - // } - // die('check'); - $res = check_dependent_conflict($family,$policy_terms); - // dd($res); - if(!$res['status']) - { - foreach($res['error_data'] as $key => $value) + // kint::dump($family);die(); + //check name dup within a family + + if($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'dependent_addition') { - array_push($result['error_summary'],$value['code']); //record not avail for deletion - $result['error_data'][$rowid][($value['col_name'])]['error'][] = $value['msg']; + $res = name_dup_check_within_family($family,$file['action']); + // dd($res); + if(count($res)) + { + foreach($res as $k => $rowid) + { + array_push($result['error_summary'],7); // dup entry in excel file + $result['error_data'][$rowid]['name_of_emp_dep']['error'][] = "Twofold Name found within family"; + } + } + } + + + if($file['action'] == 'dependent_addition' || $file['action'] == 'addition' || $file['action'] == 'inception') + { + $res = check_dependent_conflict($family,$policy_terms,$file['action']); + // dd($res); + if(!$res['status']) + { + foreach($res['error_data'] as $key => $value) + { + array_push($result['error_summary'],$value['code']); + $result['error_data'][ $value['row_id'] ][($value['col_name'])]['error'][] = $value['msg']; + } + } + } + + //check dup with empid and name with db + $res = name_and_empid_check_in_db($family,$file); + // dd($file); + // echo '
'; + // print_r($res); + if(count($res['del'])) + { + foreach($res['del'] as $k => $rowid) + { + array_push($result['error_summary'],10); //record not avail for deletion + $result['error_data'][$rowid]['name_of_emp_dep']['error'][] = "Record Not found "; + } + } + if(count($res['i'])) + { + foreach($res['i'] as $k => $rowid) + { + array_push($result['error_summary'],9); //dup entry + $result['error_data'][$rowid]['name_of_emp_dep']['error'][] = "Record already exists"; + } } } - //check dup with empid and name with db - $res = name_and_empid_check_in_db($family,$file['client_id'],$file['policy_id']); - // print_r($result); - // echo '
'; - // print_r($res); - if(count($res['del'])) - { - foreach($res['del'] as $k => $rowid) - { - array_push($result['error_summary'],10); //record not avail for deletion - $result['error_data'][$rowid]['name_of_emp_dep']['error'][] = "Record Not found for deletion"; - } - } - if(count($res['i'])) - { - foreach($res['i'] as $k => $rowid) - { - array_push($result['error_summary'],9); //dup entry - $result['error_data'][$rowid]['name_of_emp_dep']['error'][] = "Record already exists"; - } - } - } - - // dd($result); - if(isset($result['error_summary']) && count($result['error_summary'])) - { - $result['error_summary'] = array_count_values($result['error_summary']); - $status = 'failed'; - $failure_reason = ((json_encode($result))); - $this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update(); - $this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]); - //return $this->respond(['dataStatus' => true,'code' => 404,'data' => 'file upload failed with errors'], 200); - // dd($failure_reason); - - - - } - return $result; + // s($result); + // die(); + if(isset($result['error_summary']) && count($result['error_summary'])) + { + $result['error_summary'] = array_count_values($result['error_summary']); + $status = 'failed'; + $failure_reason = ((json_encode($result))); + $this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update(); + $this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]); + //return $this->respond(['dataStatus' => true,'code' => 404,'data' => 'file upload failed with errors'], 200); + // dd($failure_reason); + } + else if($file['action'] == 'deletion') + { + //proceed next data level validation in JOB queue + $job_details = new Jobs(); + + $r = Jobs::addJob(['job_name' => 'employeeDisembark','payload' => ['file_id' => $file_id]]); + } + else if ($file['action'] == 'si_enhancement') + { + //proceed next data level validation in JOB queue + $job_details = new Jobs(); + + $r = Jobs::addJob(['job_name' => 'employeesSIEnhanceProcess','payload' => ['file_id' => $file_id]]); + } + else if ($file['action'] == 'correction') + { + //proceed next data level validation in JOB queue + $job_details = new Jobs(); + + $r = Jobs::addJob(['job_name' => 'employeesCorrectionProcess','payload' => ['file_id' => $file_id]]); + } + else //inception OR addition OR dependent addition + { + //proceed next data level validation in JOB queue + $job_details = new Jobs(); + + $r = Jobs::addJob(['job_name' => 'employeesOnboardPreprocess','payload' => ['file_id' => $file_id]]); + } + return $result; } + + + // calculate data points and premium + public function employeesOnboardPreprocess($params) + { + helper('excel_util_helper'); + // dd($params); + if(isset($params['file_id']))//handle data from excel to inception + { + //get file name + $file_id = $params['file_id']; + $file = $this->fileModel->find($file_id); + // dd($file); + $return = []; + if(!isset($file)) + { + //file not found in DB + return array('status' => false, 'msg' => 'file not found in DB'); + } + $file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name']; + + //check physical file + if(!file_exists($file_name_with_path)) + { + //file not found update status and reason + $message = "Physical file not found"; + // echo $message; + $this->myLogger->logme('error',($message . ' for file id ' . $file_id)); + $this->fileModel->where('id', $file_id)->set(['status' => 'failed','reason' => json_encode(['error_summary' => array_count_values([5]),'error_data' => $message])])->update(); + return array('error_summary' => [5], 'error_data' => $message); + } + + $columns_to_check = []; + if($file['action'] == 'inception'){ $columns_to_check = $this->inception_excel_columns; } + + // get policy and rack details + $policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']); + $policy_terms = (array) $policy_terms[0];// convert obj to array + // $policy_terms = json_decode($policy_terms[0]->policy_terms); + + // dd($policy_terms); + //get excel data + $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path); + $sheet = $spreadsheet->getActiveSheet(); + + $highestRowAndColumn = $sheet->getHighestRowAndColumn(); + $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); + unset($excel_data[0]); + + + //get policy slab rates + $slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']); + // dd($slab_details); + + $employee_data_group_by_family = data_group_by_family($excel_data); + // dd($employee_data_group_by_family); + foreach ($employee_data_group_by_family as $emp_id => $family) + { + + //if action is DA then get all familiy members,transfrom them into excel array, addd data source as db or excel + if($file['action'] == 'dependent_addition') + { + $existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $emp_id,client_id: $file['client_id'],client_policy_id: $file ['policy_id'],emp_status: 'active'); + // dd($existing_famility_details); + //transsform familiy details from db columns to exxcel row with column indexs for checking remaining functionalitites + $existing_famility_details = transform_db_data_to_excel($existing_famility_details,$file); + // Kint::dump($existing_famility_details); + $family = array_merge($family,$existing_famility_details); + // dd($family); + } + + // Kint::dump($family);die(); + $data = calculate_premimum($family,$policy_terms,$slab_details,$file); + // dd($data); + $employee_data_group_by_family[$emp_id] = $data; + //$this->employeesOnboardProcess(['familiy_data' => $data,'file' => $file]); + } + } + else if(isset($params['client_policy_id']))//handle data from enrollment to inception + { + $client_policy_id = $params['client_policy_id']; + //get client id + $client_id = ($this->clientPolicyModel->select('client_id')->find($client_policy_id))['client_id']; + // dd($client_id); + + // get policy and rack details + $policy_terms = $this->clientPolicyModel->getPolicyDetails($client_id,$client_policy_id); + $policy_terms = (array) $policy_terms[0];// convert obj to array + + //get policy slab rates + $slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($client_policy_id,$client_id); + + $existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $client_policy_id,emp_status: 'draft'); + + $file = ['id' => null,'client_id' => $client_id,'policy_id' => $client_policy_id,'action' => 'inception']; + // 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'); + // dd($employee_data_group_by_family); + foreach ($employee_data_group_by_family as $emp_id => $family) + { + $transformed_famility_details = transform_db_data_to_excel($family); + $data = calculate_premimum($transformed_famility_details,$policy_terms,$slab_details,$file); + // dd($data); + $employee_data_group_by_family[$emp_id] = $data; + $this->employeesOnboardProcess(['familiy_data' => $data,'file' => $file]); + } + + // dd($employee_data_group_by_family); + } + + + // die(); + return ($employee_data_group_by_family); + + } + + //deletion of emp + public function employeeDisembark($params) + { + helper('excel_util_helper'); + //get file name + $file_id = $params['file_id']; + $file = $this->fileModel->find($file_id); + + $file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name']; + + $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path); + $sheet = $spreadsheet->getActiveSheet(); + + $highestRowAndColumn = $sheet->getHighestRowAndColumn(); + + $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); + + unset($excel_data[0]); + // dd($excel_data); + $endorsement_data = []; + + + //make closure funciton which is going to use only by this method + $endorsement = function($data,$file,$row){ + + //for emp table + $this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'emp_status','old_value' => $data['emp_status'],'new_value' => 'deactivate','created_by' => $file['created_by'],'remarks' => 'general deletion']); + // dd( $this->empEndorsementModel->getLastQuery()); + // $this->empEndorsementModel->save(['pk' => (int)$data['emp_id'],'emp_code' => $data['emp_code'],'table_name' => 'employees','actions' => 'd','name' => $data['name'],'field_name' => 'change_event','old_value' => $data['change_event'],'new_value' => 'deletion','created_by' => $file['created_by'],'remarks' => 'general deletion']); + + // for employee policy table + $this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'date_of_exit','old_value' => $data['date_of_exit'],'new_value' => change_date_format($row[4],'d-M-Y','Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general deletion']); + $this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'reason_for_exit','old_value' => $data['reason_for_exit'],'new_value' => $row[5],'created_by' => $file['created_by'],'remarks' => 'general deletion']); + $this->empEndorsementModel->save(['pk' => (int)$data['emp_policy_id'],'emp_code' => $data['emp_code'],'table_name' => 'employee_polices','actions' => 'd','name' => $data['name'],'field_name' => 'status','old_value' => $data['status'],'new_value' => 'deactivate','created_by' => $file['created_by'],'remarks' => 'general deletion']); + }; + //iterate each row + foreach ($excel_data as $col_key => $row) + { + if(check_row_is_empty_or_null($row)) + { + break; + } + // echo '
START- ' . $row[2]; + $employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->first(); + + $existing_endorsements = $this->empEndorsementModel->where('actions','d') + ->where('table_name','employees') + ->where('endorsement_id is null') + ->where('emp_code',$employee['emp_code']) + ->where('name',$employee['name']) + ->where('field_name','emp_status') + ->findAll(); + + + if(!count($existing_endorsements)) + { + if(strtolower($employee['relationship']) != 'self') + { + + if(!in_array($employee['id'],$endorsement_data))//make entry in endorsement firsttime only with checking that PK of emp exisintg in variable $endorsement_data + { + $employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first(); + $data = ['emp_id' => $employee['id'],'name' => $employee['name'],'emp_status' => $employee['emp_status'],'emp_policy_id' => $employee_policy['id'],'emp_code' => $employee['emp_code'],'change_event' => $employee['change_event'],'date_of_exit' => $employee_policy['date_of_exit'],'reason_for_exit' => $employee_policy['reason_for_exit'],'status' => $employee_policy['status']]; + $endorsement($data,$file,$row); + $endorsement_data[] = $employee['id']; + } + } + else + { + + $family = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $row[1],client_id: $file['client_id'],client_policy_id: $file ['policy_id'],emp_status: 'active'); + // Kint::dump($family); + foreach ($family as $key => $emp) { + + if(!in_array($emp['emp_id'],$endorsement_data)) + { + $endorsement($emp,$file,$row); + + $endorsement_data[] = $emp['emp_id']; + + } + } + + } + } + + // print_r($endorsement_data); + + } + return $endorsement_data; + + } + + //correction of emp + public function employeesCorrectionProcess($params) + { + helper('excel_util_helper'); + //get file name + $file_id = $params['file_id']; + $file = $this->fileModel->find($file_id); + + $file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name']; + + $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path); + $sheet = $spreadsheet->getActiveSheet(); + + $highestRowAndColumn = $sheet->getHighestRowAndColumn(); + + $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); + + unset($excel_data[0]); + // dd($excel_data); + + //iterate each row + foreach ($excel_data as $col_key => $row) + { + if(check_row_is_empty_or_null($row)) + { + break; + } + // echo '
START- ' . $row[2]; + + $field_name = $row[3]; + $field_value = ($field_name == 'dob' ? change_date_format($row[4],'d-M-Y','Y-m-d') : $row[4] ); + + + $employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->first(); + $existing_endorsements = $this->empEndorsementModel->where('actions','c') + ->where('table_name','employees') + ->where('endorsement_id is null') + ->where('emp_code',$employee['emp_code']) + ->where('name',$employee['name']) + ->where('field_name',$field_name) + ->findAll(); + // dd($existing_endorsements); + //make entry in endorsement table + if(!count($existing_endorsements)) + { + $this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employees','actions' => 'c','name' => $employee['name'],'field_name' => $field_name,'old_value' => $employee[ $field_name ],'new_value' => $field_value,'created_by' => $file['created_by'],'remarks' => $row[7],'date_of_correction' => change_date_format($row[5],'d-M-Y','Y-m-d')]); + } + + + + + } + return true; + } + + + //enhance of emp + public function employeesSIEnhanceProcess($params) + { + helper('excel_util_helper'); + //get file name + $file_id = $params['file_id']; + $file = $this->fileModel->find($file_id); + + $file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name']; + + $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path); + $sheet = $spreadsheet->getActiveSheet(); + + $highestRowAndColumn = $sheet->getHighestRowAndColumn(); + + $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); + + unset($excel_data[0]); + // dd($excel_data); + + //get policy slab rates + $slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']); + //iterate each row + // dd($slab_details); + foreach ($excel_data as $col_key => $row) + { + if(check_row_is_empty_or_null($row)) + { + break; + } + // echo '
START- ' . $row[2]; + $employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->first(); + $employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first(); + + $existing_endorsements = $this->empEndorsementModel->where('actions','si') + ->where('table_name','employee_polices') + ->where('endorsement_id is null') + ->where('emp_code',$employee['emp_code']) + ->where('name',$employee['name']) + ->where('field_name','basic_cover_si') + ->findAll(); + // dd($existing_endorsements); + //make entry in endorsement table + if(!count($existing_endorsements)) + { + + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + if($slab_value['si'] == $row[3]) + { + $this->empEndorsementModel->save(['pk' => (int)$employee['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']); + $this->empEndorsementModel->save(['pk' => (int)$employee['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']); + $this->empEndorsementModel->save(['pk' => (int)$employee['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']); + break; + } + } + } + + + + + } + return true; + } + + + // insert or update in db for inception addition depent addition + public function employeesOnboardProcess($params) + { + $familiy_data = $params['familiy_data']; + $file = $params['file']; + // dd($file); + // print_r($familiy_data); + // echo '------------------------------------------------------'; + + + + foreach($familiy_data as $fkey => $value) + { + if($file['id'] == null || ($value['temp']['source'] == 'excel' || (in_array($value['temp']['grid_type'],[10,11]) && strtolower($value['relationship']) == 'self'))) //insert data come from excel and from db + { + + $employee = $this->employeeModel->checkExistingEmp($value); + $policy_data = $value['policy_details']; + unset($value['policy_details']); + unset($value['temp']); + + if($file['id'] == null && (strtolower($value['relationship']) == 'self' && $value['temp']['source'] == 'db' && $value['temp']['emp_id'] != null && $value['temp']['emp_policy_id'] != null)) + { + //check existing si and new si + $employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first(); + if($employee_policy['basic_cover_si'] != $policy_data['basic_cover_si']) + { + + //check any existing si enhancement pending + $existing_endorsements = $this->empEndorsementModel->where('actions','si') + ->where('table_name','employee_polices') + ->where('endorsement_id is null') + ->where('emp_code',$employee['emp_code']) + ->where('name',$employee['name']) + ->where('field_name','basic_cover_si') + ->findAll(); + + if(!count($existing_endorsements)) + { + + $slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']); + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + if($slab_value['si'] == $policy_data['si']) + { + //add new premimum details in endorsement table + $this->empEndorsementModel->save(['pk' => (int)$employee['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' => $policy_data['premium'],'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement']); + $this->empEndorsementModel->save(['pk' => (int)$employee['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' => 'da auto si enhancement']); + $this->empEndorsementModel->save(['pk' => (int)$employee['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' => ($policy_data['date_coverage']),'created_by' => $file['created_by'],'remarks' => 'da auto si enhancement']); + break; + } + } + } + + + + + } + + break; + }// end of self employee si enhance ment + + + //save employee table + if(count($employee)) + { + $value['updated_by'] = $file['created_by']; + $value['id'] = $employee[0]['id']; + $log_message = 'Update Employee - '.$employee[0]['name'].'('.$employee[0]['emp_code'].') with PK '.$employee[0]['id']; + // $this->myLogger->logme('error',('Update - ' . $employee[0]['id'].' - '. $employee[0]['emp_code'] .' - '.$employee[0]['name'])); + } + else + { + $value['emp_status'] = 'active'; + $value['created_by'] = $file['created_by']; + $log_message = 'Insert Employee- '.$value['name'] .'('.$value['emp_code'] .') with PK '; + // $this->myLogger->logme('error',('Insert - ' . $value['emp_code'] .' - '. $value['name'])); + } + + $this->employeeModel->save($value); + $emp_id = $this->employeeModel->getInsertID(); + if($emp_id != 0){ $log_message .= $emp_id; } + else{ $emp_id = $employee[0]['id']; } + + $this->myLogger->logme('error',$log_message); + + //save policy table + $employee_policy = $this->employeePolicyModel->checkExistingEmpPolicy(['employee_id' => $emp_id,'client_policy_id' => $file['policy_id']]); + if(count($employee_policy)) + { + $policy_data['updated_by'] = $file['created_by']; + $policy_data['id'] = $employee_policy[0]['id']; + $policy_data['status'] = 'active'; + + $log_message = 'Update Employee Policy for '. $value['name'].'('. $value['emp_code'].') with PK- ' . $employee_policy[0]['id'] .' client policy ID '.$employee_policy[0]['client_policy_id'].' with SI '.$policy_data['basic_cover_si']; + } + else + { + $policy_data['employee_id'] = $emp_id; + $policy_data['client_policy_id'] = $file['policy_id']; + $policy_data['created_by'] = $file['created_by']; + $policy_data['status'] = 'active'; + $log_message = 'Insert Employee Policy for '. $value['name'].'('. $value['emp_code'].') - client policy id -'. $file['policy_id'].' - with SI '.$policy_data['basic_cover_si']; + } + + $this->employeePolicyModel->save($policy_data); + $emp_policy_id = $this->employeePolicyModel->getInsertID(); + if($emp_policy_id != 0){ $log_message .= ' with PK ' . $emp_policy_id; } + else{ $emp_policy_id = $employee_policy[0]['id']; } + + $this->myLogger->logme('error',$log_message); + + }// if end + }// for end + }//function end + + // --------------------------------------------------------------------------------- @@ -476,5 +990,6 @@ class EmployeeServiceController extends AdminController // --------------------------------------------------------------------------------- + } diff --git a/app/Controllers/LoginController.php b/app/Controllers/LoginController.php index cb86e2fd..1d646d01 100644 --- a/app/Controllers/LoginController.php +++ b/app/Controllers/LoginController.php @@ -15,8 +15,8 @@ class LoginController extends BaseController public function index(){ - // $session_data = ['isLoggedIn' => True ,'userid' => '4']; - // set_session_data($session_data); + $session_data = ['isLoggedIn' => True ,'userid' => '25']; + set_session_data($session_data); // $isLoggedIn = check_session(); $isLoggedIn = check_session(); @@ -46,19 +46,19 @@ class LoginController extends BaseController set_session_data($session_data); log_message('error', 'Set The UserId : `'. $user->id .'` in Session'); log_message('error', 'User Login Sucessfully'); - - // $this->getUserDeviceInfo($user->id); + $this->getUserDeviceInfo($user->id, 'NhanceUser'); return redirect()->to(base_url('/dashboard/view')); }else{ - log_message('error', 'User Not Activate'); - session()->setFlashdata('error', 'User Not Activate'); + log_message('error', 'User Not Active'); + session()->setFlashdata('error', 'User Not Active'); return redirect()->to(base_url('login')); } }else{ - log_message('error', 'User Not Register'); - session()->setFlashdata('error', 'User Not Register'); + + log_message('error', 'User Not Registered'); + session()->setFlashdata('error', 'User Not Registered'); return redirect()->to(base_url('login')); } } diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 61ef2ff6..1801cc1c 100644 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -130,7 +130,6 @@ class RestAuthenticationController extends AdminController try { $mobile_number = $this->request->getJSON()->mobile_number; $randomNumber = rand(100000, 999999); - $randomNumber = 123456; $HrData = $this->hrModel->where('mobile', $mobile_number)->where('contact_type', 'client')->first(); if ($HrData) { diff --git a/app/Controllers/SwaggerController.php b/app/Controllers/SwaggerController.php new file mode 100644 index 00000000..75955f60 --- /dev/null +++ b/app/Controllers/SwaggerController.php @@ -0,0 +1,10 @@ +getHeader('Authorization'); + + $jwt =''; + + if($request->headers()['Auth']){ + $jwt = $request->headers()['Auth']; + }else{ + $jwt = $request->getHeader('Authorization'); + } + if ($jwt) { if (JWTToken::validateJWT($jwt)) { diff --git a/app/Helpers/JWTToken.php b/app/Helpers/JWTToken.php index dcee4d0d..6c6d29cf 100644 --- a/app/Helpers/JWTToken.php +++ b/app/Helpers/JWTToken.php @@ -16,7 +16,6 @@ use ReflectionClass; class JWTToken { - public static function encode($data =null) { $secret_Key="secret"; @@ -44,6 +43,7 @@ class JWTToken { $jwtParts = explode(' ', $jwt); + // print_r($jwtParts); if (count($jwtParts) != 2 || $jwtParts[0] == 'Bearer') { return false; } diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index 1f1e9b47..e3b2d2f6 100644 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -2,6 +2,20 @@ use App\Models\EmployeeModel; + +if(!function_exists('calculate_days_bw_dates')) +{ + function calculate_days_bw_dates(string $from_date = "", string $to_date ="") + { + if($to_date == ""){ $currentDateTime = new DateTime(); } + else{ $currentDateTime = new DateTime($to_date); } + if($from_date == ""){ $passedDateTime = new DateTime(); } + else{ $passedDateTime = new DateTime($from_date); } + + return $interval = $currentDateTime->diff($passedDateTime); + } +} + if (!function_exists('check_columns_name')) { function check_columns_name($definedColumns,$excelColumns) { @@ -11,7 +25,7 @@ if (!function_exists('check_columns_name')) { $definedColIdx = $definedCol['col_idx']; $definedColName = $definedCol['col_name']; - if (strtolower(trim($excelColumns[$definedColIdx])) !== strtolower($definedColName)) { + if (strtolower(strip_tags(trim($excelColumns[$definedColIdx]))) !== strtolower($definedColName)) { $mismatchedColumns[] = "Column order conflict. Column order no ".($definedColIdx + 1)." expected : ".$definedColName." and received : ".$excelColumns[$definedColIdx]."
"; } } @@ -55,23 +69,29 @@ if(!function_exists('check_relationship')) { function check_relationship($row,$relationship) { - // print_r($col);print_r($relationship); + // print_r($relationship); // echo '
'; - if($row[17] != null && in_array(strtoupper($row[17]), ['I','A','DA']))// check rule only of action column data available + if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA']))// check rule only of action column data available { if($row[5] != null && $row[4] != null)//$row[5] = relationship $row[4] = Gender { $slug = \Config\Services::slug(); $col = $slug->slugify($row[5]); - // echo $col;die(); + // echo $col;//die(); if($col != 'self' && $col != 'spouse') { - if($relationship[ $col ]['gender'] != $row[4]) + if(!isset($relationship[ $col ])) + { + return array('status' => false,'error' => 'Rule Conflict: Unknown Relationship'); + } + + if(isset($relationship[ $col ]) && $relationship[ $col ]['gender'] != $row[4]) { $error = "Gender relationship conflict: Expected ".$relationship[ $col ]['gender'].", received $row[4]"; return array('status' => false,'error' => $error); } + } return array('status' => true); } @@ -90,12 +110,12 @@ if(!function_exists('check_doj')) function check_doj($row) { - if($row[17] != null && in_array(strtoupper($row[17]), ['I','A','DA']))// check rule only of action column data available + if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA']))// check rule only of action column data available { $slug = \Config\Services::slug(); $relationship = $slug->slugify($row[5]); // echo $relationship;echo $row[7]; - if($relationship == 'self' && $row[7] == "") { return array('status' => false,'error' => "DOJ mandantory for self"); } + if($relationship == 'self' && $row[8] == "") { return array('status' => false,'error' => "DOJ mandantory for self"); } return array('status' => true); } else { return array('status' => true); } // in else condition no need to check rule, just return true @@ -105,14 +125,52 @@ if(!function_exists('check_doj')) if(!function_exists('check_employee_band')) { - function check_employee_band($row) + function check_employee_band($row,$policy_terms,$slab_details) { - if($row[17] != null && in_array(strtoupper($row[17]), ['I','A','DA']))// check rule only of action column data available + if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA']))// check rule only of action column data available { + $is_emp_band_needed = $slab_details['grid_master']['emp_band']; $slug = \Config\Services::slug(); $relationship = $slug->slugify($row[5]); // echo $relationship;echo $row[7]; - if($relationship == 'self' && $row[9] == "") { return array('status' => false,'error' => "Band mandantory for self"); } + if($is_emp_band_needed && $relationship == 'self' && $row[10] == "") { return array('status' => false,'error' => "Band mandantory for self"); } + else if($is_emp_band_needed && $relationship == 'self' && $row[10] != "") + { + $received_grade = $row[10]; + $found = false; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + if($slab_value['grade'] == $received_grade) + { + $found = true; + break; + } + } + if(!$found) { return array('status' => false,'error' => "Emp band/Grade not found"); } + } + return array('status' => true); + }else { return array('status' => true); } // in else condition no need to check rule, just return true + } +} + + +if(!function_exists('check_si')) +{ + function check_si($row,$policy_terms,$slab_details) + { + if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA','SI']))// check rule only of action column data available + { + $received_si = $row['current_action'] == 'SI' ? $row[3] : $row[6]; + $found = false; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + if($slab_value['si'] == $received_si) + { + $found = true; + break; + } + } + if(!$found) { return array('status' => false,'error' => "Sum insured not found"); } return array('status' => true); }else { return array('status' => true); } // in else condition no need to check rule, just return true } @@ -120,14 +178,15 @@ if(!function_exists('check_employee_band')) if(!function_exists('check_basic_pay')) { - function check_basic_pay($row) + function check_basic_pay($row,$policy_terms,$slab_details) { - if($row[17] != null && in_array(strtoupper($row[17]), ['I','A','DA']))// check rule only of action column data available + if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA']))// check rule only of action column data available { + $is_basic_pay_needed = $slab_details['grid_master']['basicpay']; $slug = \Config\Services::slug(); $relationship = $slug->slugify($row[5]); // echo $relationship;echo $row[7]; - if($relationship == 'self' && $row[8] == "") { return array('status' => false,'error' => "Basic pay mandantory for self"); } + if($is_basic_pay_needed && $relationship == 'self' && $row[9] == "") { return array('status' => false,'error' => "Basic pay mandantory for self"); } return array('status' => true); }else { return array('status' => true); } // in else condition no need to check rule, just return true } @@ -138,7 +197,7 @@ if (!function_exists('check_dob_diff')) { function check_dob_diff($row,$relationships) { // echo 'called'; - if($row[17] != null && in_array(strtoupper($row[17]), ['I','A','DA']))// check rule only of action column data available + if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA']))// check rule only of action column data available { if($row[3] != null && $row[5] != null) { @@ -150,8 +209,8 @@ if (!function_exists('check_dob_diff')) $slug = \Config\Services::slug(); $relationship = $slug->slugify($row[5]); - $age_min = $relationships[$relationship]['age_min']; - $age_max = $relationships[$relationship]['age_max']; + $age_min = isset($relationships[$relationship]['age_min']) ? $relationships[$relationship]['age_min'] : NULL; + $age_max = isset($relationships[$relationship]['age_max']) ? $relationships[$relationship]['age_max'] : NULL; // echo $relationship.','.$age_min.'-'.$age_max; if($age_min !== null && $age_min > $interval->y) { @@ -173,14 +232,21 @@ if (!function_exists('check_dob_diff')) if (!function_exists('data_group_by_family')) { - function data_group_by_family($emp_data) + function data_group_by_family($emp_data,$data_source = 'excel') { $result = []; foreach ($emp_data as $rkey => $row) { - if(!check_row_is_empty_or_null($row)) + if($data_source == 'excel') { - $result[$row[1]][] = $row; + if(!check_row_is_empty_or_null($row)) + { + $result[$row[1]][] = $row; + } + + }else if($data_source = 'db') + { + $result[$row['emp_code']][] = $row; } } @@ -216,10 +282,14 @@ if (!function_exists('name_dup_check_within_family')) if (!function_exists('name_and_empid_check_in_db')) { - function name_and_empid_check_in_db($family_data,$client_id,$policy_id) + function name_and_empid_check_in_db($family_data,$actionArr) { $employeeModel = new EmployeeModel(); $result = ['del' => [],'i' => []]; + $client_id = $actionArr['client_id']; + $policy_id = $actionArr['policy_id']; + $current_action = $actionArr['action']; + foreach ($family_data as $rkey => $row) { $res = $employeeModel @@ -227,22 +297,23 @@ if (!function_exists('name_and_empid_check_in_db')) ->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id") ->where("cp.policy_id",$policy_id) ->where("employees.client_id",$client_id) - ->like('name',$row[2],'both')->like('emp_code',$row[1],'both') + // ->where("ep.client_id",$client_id) + ->where('name',$row[2])->where('emp_code',$row[1]) ->findAll(); - - if(count($res)) - { - if($row[17] == 'D') + // dd($employeeModel); + + + if(($current_action == 'deletion' || $current_action == 'correction' || $current_action == 'si_enhancement') && !count($res)) { array_push($result['del'],$row[0]); } - else + if(($current_action == 'inception' || $current_action == 'dependent_addition' || $current_action == 'addition') && count($res)) { array_push($result['i'],$row[0]); } - } + } return $result; @@ -251,7 +322,7 @@ if (!function_exists('name_and_empid_check_in_db')) if (!function_exists('check_dependent_conflict')) { - function check_dependent_conflict($family_data,$policy_terms) + function check_dependent_conflict($family_data,$policy_terms,$actionArr) { $result = ['status' => true]; @@ -267,24 +338,26 @@ if (!function_exists('check_dependent_conflict')) $allowed_parent_in_laws_count = 0; $received_parent_in_laws_count = 0; $overall_famility_relationships = []; + $self_emp_row_id = 0; $temp_counts = [2,3,4,5,6,7,8,9,10]; //temp variable for check relation repetaed count $slug = \Config\Services::slug(); - if($policy_terms['family_floater'] == true) - { + // if($policy_terms['family_floater'] == true) + // { // $temp_string = implode(" ",$policy_terms['family_floaters']); $temp = $policy_terms['family_floaters']; - $allowed_child_count = count(preg_grep('/child/',$temp)); - $allowed_spouse_count = count(preg_grep('/spouse/',$temp)); - $allowed_parents_count = count(preg_grep('/parent[12]/',$temp)); - $allowed_parent_in_laws_count = count(preg_grep('/parent_in_law[12]/',$temp)); - + $allowed_child_count = $temp['childrens']; + $allowed_spouse_count = $temp['spouse']; + $allowed_adults = $temp['either-parents-pil']; + $allowed_parents_count = $temp['either-parents-pil'] == 0 ? $temp['parents'] : 0; + $allowed_parent_in_laws_count = $temp['either-parents-pil'] == 0 ? $temp['parents-in-law'] : 0; + // dd($allowed_adults == 0); foreach ($family_data as $key => $row) { $relationship = $slug->slugify($row[5]); - if($row[17] != 'D' && $relationship != 'son' && $relationship != 'daughter') + if($actionArr != 'deletion' && $relationship != 'son' && $relationship != 'daughter') { array_push($overall_famility_relationships, $relationship); } @@ -293,6 +366,7 @@ if (!function_exists('check_dependent_conflict')) if($relationship == 'self') { $self_gender = $row[4]; + $self_emp_row_id = $row[0]; } if($relationship == 'spouse') { @@ -316,7 +390,7 @@ if (!function_exists('check_dependent_conflict')) // print_r($overall_famility_relationships); // echo '
'; - if($row[17] != 'D') + if($actionArr != 'deletion') { $repeated_relationships_count = array_count_values($overall_famility_relationships); // print_r($repeated_relationships_count); @@ -325,7 +399,7 @@ if (!function_exists('check_dependent_conflict')) if(is_array($repeated_count) && count($repeated_count)) { $result['status'] = false; - $result['error_data'][] = ['code' => 13,'col_name' => 'relationship','msg' => 'Rule conflict: Twofold relationship found within family']; + $result['error_data'][] = ['code' => 13,'col_name' => 'relationship','msg' => 'Rule conflict: Twofold relationship found within family','row_id' => $family_data[0][0]]; } } // print_r($repeated_count); @@ -339,29 +413,492 @@ if (!function_exists('check_dependent_conflict')) if($self_gender == $spouse_gender) { $result['status'] = false; - $result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender']; + $result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])]; } - if(($allowed_spouse_count < $received_spouse_count) || ($allowed_child_count < $received_child_count) || ($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count)) + + if(($allowed_spouse_count < $received_spouse_count) || ($allowed_child_count < $received_child_count) ) { $result['status'] = false; - $result['error_data'][] = ['code' => 12,'col_name' => null,'msg' => 'Rule conflict: Dependent count greater than allowed dependent count'];//dependent count mismatch + $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Dependent count greater than allowed dependent count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch } - - } - else - { - if(count($family_data) > 1) + // || ($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count) + if($allowed_adults == 1 && $received_parents_count && $received_parent_in_laws_count ) { - $result['status'] = false; - $result['error_data'][] = ['code' => 11,'col_name' => null,'msg' => 'Rule conflict: Dependents not allowed'];//dependents not allowed + $result['status'] = false; + $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Parents and Parents in law both not allowed','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])]; + + if((2 < $received_parents_count) || (2 < $received_parent_in_laws_count)) + { + $result['status'] = false; + $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Dependent count greater than allowed dependent count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch + } } - } + + // var_dump($allowed_adults == 0); + // dd($allowed_adults == 0 && (($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count))); + if($allowed_adults == 0 && (($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count) )) + { + // dd($allowed_adults); + $result['status'] = false; + $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Dependent count greater than allowed dependent count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch + } + + + // } + // else + // { + // if(count($family_data) > 1) + // { + // $result['status'] = false; + // $result['error_data'][] = ['code' => 11,'col_name' => 'sno','msg' => 'Rule conflict: Dependents not allowed','row_id' => $row[0]];//dependents not allowed + // } + // } return $result; } } +if (!function_exists('generate_relationship_code')) +{ + function generate_relationship_code($arr) + { + $gender = ['M' => 1,'F' => 2]; + $relationship = ['self' => 1,'spouse' => 2,'son' => 3,'daughter' => 4,'father' => 5,'mother' => 6,'father-in-law' => 7,'mother-in-law' => 8]; + $slug = \Config\Services::slug(); + $relationship_code = $slug->slugify($arr['relationship']); + $relationship_code = $gender[ $arr['gender'] ] . $relationship[ $relationship_code ] ; + return $relationship_code; + } +} + +if (!function_exists('calculate_premimum')) +{ + function calculate_premimum($family_data,$policy_terms,$slab_details,$fileArr) + { +// + // dd($fileArr); + // grid type + // 1 = premium => si + $result = []; + $grid_type = $slab_details['grid_master']['ui_type']; + $fileArr['grid_type'] = $grid_type; + //this variable for store emp id and their band for emp band level premium calculation for all famility members (especially for grid type 9) also store max age and max count of a familiy for grid type 10,11 + $emp_details_with_empband_max_age_max_count = []; + //max age amoung familiy + $max_age = max(array_map(function($item) {return calculate_days_bw_dates(from_date: $item[3])->y; }, $family_data)); + + foreach($family_data as $fkey => $member) + { + //transform as db row column + $transformed_familiy_member_data = transform_excel_data_to_db($member,$fileArr); + // dd($transformed_familiy_member_data); + //store emp id and emp band and attach it to their familiy members where band is always empty + + $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['band'] = null; + if(strtolower($transformed_familiy_member_data['relationship']) == 'self') + { + $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['band'] = $transformed_familiy_member_data['band']; + } + + //end of store emp id and emp band and attach it to their familiy members where band is always empty + $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['maxcount'] =count($family_data); + + $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['maxage'] = $max_age; + + //generate relationship code + if($transformed_familiy_member_data['temp']['action'] != 'D' && $transformed_familiy_member_data['temp']['action'] != 'C' && $transformed_familiy_member_data['temp']['action'] != 'SI') + { + $transformed_familiy_member_data['relationship_code'] = generate_relationship_code($transformed_familiy_member_data); + } + + //calculate primimum based on grid type + if($transformed_familiy_member_data['temp']['action'] != 'D' && $transformed_familiy_member_data['temp']['action'] != 'C' && $transformed_familiy_member_data['temp']['action'] != 'SI') + { + + //before call premium_calculation_manager attach band,max age and max count into the array temporarly for grid 9,10 and 11 + $transformed_familiy_member_data['temp']['band'] = $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['band']; + $transformed_familiy_member_data['temp']['maxage'] = $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['maxage']; + $transformed_familiy_member_data['temp']['maxcount'] = $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['maxcount']; + + if( $fileArr['id'] == null || (in_array($grid_type,[10,11]) || $transformed_familiy_member_data['temp']['source'] == 'excel'))//if file id is null then data coming from enrollment (from DB) otherwise data coming from xcel, so calculate only data from excel (new entry) note: even data coming from excel for event dependet additon we fetch other dependts from db and calculate premium for whole family + { + $transformed_familiy_member_data = premium_calculation_manager($transformed_familiy_member_data,$policy_terms,$slab_details); + + $result[] = $transformed_familiy_member_data; + } + } + } + + return $result; + } +} +if (!function_exists('transform_excel_data_to_db')) +{ + function transform_excel_data_to_db($memArr,$actionArr) + { + + $current_column_action = null; + if($actionArr['action'] == 'inception'){ $current_column_action = 'I'; } + else if($actionArr['action'] == 'addition'){ $current_column_action = 'A'; } + else if($actionArr['action'] == 'dependent_addition'){ $current_column_action = 'DA'; } + else if($actionArr['action'] == 'deletion'){ $current_column_action = 'D'; } + else if($actionArr['action'] == 'correction'){ $current_column_action = 'C'; } + else if($actionArr['action'] == 'si_enhancement'){ $current_column_action = 'SI'; } + + if($actionArr['action'] == 'inception' || $actionArr['action'] == 'addition' || $actionArr['action'] == 'dependent_addition') + { + + $policy['basic_cover_si'] = $memArr[6]; + $policy['pre_existing_alignments'] = $memArr[14]; + $policy['date_of_exit'] = isset($memArr[16]) ? change_date_format($memArr[16],'d-M-Y','Y-m-d') : NULL; + $policy['reason_for_exit'] = $memArr[17]; + $policy['client_policy_id'] = $actionArr['policy_id']; + $policy['date_coverage'] = isset($memArr[7]) ? change_date_format($memArr[7],'d-M-Y','Y-m-d') : NULL;; + $policy['policy_end_date'] = null; + $policy['days'] = null; + $policy['premium'] = null; + $policy['rata_premimum'] = null; + $policy['gst'] = null; + + + $result['emp_code'] = $memArr[1]; + $result['name'] = $memArr[2]; + $result['dob'] = isset($memArr[3]) ? change_date_format($memArr[3],'d-M-Y','Y-m-d') : NULL; + $result['gender'] = $memArr[4]; + $result['relationship'] = $memArr[5]; + $result['relationship_code'] = $memArr[5]; + $result['doj'] = isset($memArr[8]) ? change_date_format($memArr[8],'d-M-Y','Y-m-d') : NULL; + $result['basic_pay'] = $memArr[9]; + $result['band'] = $memArr[10]; + $result['designation'] = $memArr[11]; + $result['mobile'] = $memArr[12]; + $result['email_corporate'] = $memArr[13]; + $result['file_id'] = $actionArr['id']; + $result['client_id'] = $actionArr['client_id']; + $result['change_event'] = $memArr[15]; + $result['temp']['grid_type'] = $actionArr['grid_type']; + $result['temp']['action'] = isset($memArr['current_action']) ? $memArr['current_action'] : $current_column_action; + $result['temp']['source'] = isset($memArr['temp']['source']) ? $memArr['temp']['source'] : 'excel'; + $result['temp']['emp_id'] = isset($memArr['temp']['emp_id']) ? $memArr['temp']['emp_id'] : null; + $result['temp']['emp_policy_id'] = isset($memArr['temp']['emp_policy_id']) ? $memArr['temp']['emp_policy_id'] : null; + $result['policy_details'] = $policy; + + return $result; + + } + } +} + + +if (!function_exists('premium_calculation_manager')) +{ + function premium_calculation_manager($emp_data,$policy_terms,$slab_details) + { + // grid type + // 1 = premium => si + $grid_type = $slab_details['grid_master']['ui_type']; + + switch ($grid_type) { + case "1": + //GPA - Sum Insured (SI) * Multiplier + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + if($slab_value['si'] == $employee_received_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; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + break; + } + } + + break; + case "2": + //GPA - Flat Rate for all SI + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + if($slab_value['si'] == $employee_received_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; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + break; + } + } + break; + case "3": + //GMC - SI + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + if($slab_value['si'] == $employee_received_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; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + break; + } + } + + break; + case "4": + //GMC - Employees Age band + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + $age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y; + if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age)) + { + $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; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + break; + } + } + break; + case "5": + //GMC - Employees Age + SI + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + $age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y; + if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age)) + { + + $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; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + break; + } + } + break; + case "6": + //GMC - Employees + Dependent Age band + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + $age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y; + if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age)) + { + + $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; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + break; + } + } + break; + case "7": + //GMC - Employees + Dependent Age + SI + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + $age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y; + if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age)) + { + + $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($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + + break; + } + } + break; + case "8": + //GMC - SI as per Grade or Band + $employee_received_band = $emp_data['temp']['band']; + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + + if($slab_value['grade'] == $employee_received_band && $slab_value['si'] == $employee_received_si) + { + // $emp_data['policy_details']['basic_cover_si'] = $slab_value['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($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + break; + } + } + break; + case "9": + //GMC - Flat Rate for all + $employee_received_band = $emp_data['temp']['band']; + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + + if($slab_value['grade'] == $employee_received_band && $slab_value['si'] == $employee_received_si) + { + // $emp_data['policy_details']['basic_cover_si'] = $slab_value['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($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days; + $emp_data['policy_details']['premium'] = $slab_value['premium']; + $emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']); + $emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''); + + break; + } + } + break; + case "10": + //GMC - Maximum age of Dependents + $max_age = $emp_data['temp']['maxage']; + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + $emp_data['policy_details']['basic_cover_si'] = null; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + + if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $max_age && $slab_value['age_to'] >= $max_age)) + { + + $emp_data['policy_details']['date_coverage'] = (strtolower($emp_data['relationship']) == 'self' ? (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'] = (strtolower($emp_data['relationship']) == 'self' ? $policy_terms['policy_end_date'] : ""); + $emp_data['policy_details']['days'] = (strtolower($emp_data['relationship']) == 'self' ? calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days : 0); + $emp_data['policy_details']['premium'] = (strtolower($emp_data['relationship']) == 'self' ? $slab_value['premium'] : 0); + $emp_data['policy_details']['rata_premimum'] = (strtolower($emp_data['relationship']) == 'self' ? calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']) : 0); + $emp_data['policy_details']['gst'] = (strtolower($emp_data['relationship']) == 'self' ? ((float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','')) : 0); + + break; + } + } + break; + case "11": + //GMC - Maximum count per Family + $max_count = $emp_data['temp']['maxage']; + $employee_received_band = $emp_data['temp']['band']; + $employee_received_si = $emp_data['policy_details']['basic_cover_si']; + $emp_data['policy_details']['basic_cover_si'] = null; + foreach ($slab_details['slab_rates'] as $skey => $slab_value) + { + + if($slab_value['si'] == $employee_received_si && ($slab_value['grade'] == $employee_received_band)) + { + //calculate premium based on count + $famility_si_covered = $employee_received_si * $max_count; + $famility_si_covered = ($famility_si_covered >= $slab_value['max_si'] ? $slab_value['max_si'] : $famility_si_covered); + + $emp_data['policy_details']['basic_cover_si'] = (strtolower($emp_data['relationship']) == 'self' ? $famility_si_covered : 0); + $emp_data['policy_details']['date_coverage'] = (strtolower($emp_data['relationship']) == 'self' ? (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'] = (strtolower($emp_data['relationship']) == 'self' ? $policy_terms['policy_end_date'] : ""); + $emp_data['policy_details']['days'] = (strtolower($emp_data['relationship']) == 'self' ? calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days : 0); + $emp_data['policy_details']['premium'] = (strtolower($emp_data['relationship']) == 'self' ? $slab_value['premium'] : 0); + $emp_data['policy_details']['rata_premimum'] = (strtolower($emp_data['relationship']) == 'self' ? calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']) : 0); + $emp_data['policy_details']['gst'] = (strtolower($emp_data['relationship']) == 'self' ? ((float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','')) : 0); + + break; + } + } + break; + + default: + echo "Not a valid grid"; + } + + // unset($emp_data['temp']);//remove temp data + return $emp_data; + + } +} + + +if (!function_exists('calculate_pro_rata_premimum')) +{ + function calculate_pro_rata_premimum($premium,$days) + { + return (float) number_format(($premium / 365) * $days,2,'.',''); + } +} + +//transform db columns into excel rows with indexs +if (!function_exists('transform_db_data_to_excel')) +{ + function transform_db_data_to_excel($familiyArr,$actionArr = []) + { + // if($actionArr['action'] == 'dependent_addition') + // { + $return_data = []; + + foreach ($familiyArr as $key => $value) + { + // dd($value); + $row = []; + $row[0] = ($key + 1); + $row[6] = $value['basic_cover_si']; + $row[14] = $value['pre_existing_alignments']; + $row[16] = isset($value['date_of_exit']) ? change_date_format($value['date_of_exit'], 'Y-m-d', 'd-M-Y') : NULL; + $row[17] = $value['reason_for_exit']; + + + $row[7] = isset($value['date_coverage']) ? change_date_format($value['date_coverage'], 'Y-m-d', 'd-M-Y') : NULL; + + $row[1] = $value['emp_code']; + $row[2] = $value['name']; + $row[3] = isset($value['dob']) ? change_date_format($value['dob'], 'Y-m-d', 'd-M-Y') : NULL; + $row[4] = $value['gender']; + $row[5] = $value['relationship']; + + $row[8] = isset($value['doj']) ? change_date_format($value['doj'], 'Y-m-d', 'd-M-Y') : NULL; + $row[9] = $value['basic_pay']; + $row[10] = $value['band']; + $row[11] = $value['designation']; + $row[12] = $value['mobile']; + $row[13] = $value['email_corporate']; + // $actionArr['id'] = $value['file_id']; + // $actionArr['client_id'] = $value['client_id']; + $row[15] = $value['change_event']; + $row['current_action'] = 'DA'; + $row['temp']['source'] = 'db'; + $row['temp']['emp_id'] = $value['emp_id']; + $row['temp']['emp_policy_id'] = $value['emp_policy_id']; + + array_push($return_data, ($row)); + } + + return $return_data; + // } + + + } +} \ No newline at end of file diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index ff437dc1..053e6f25 100644 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -37,6 +37,8 @@ class ClientPolicyModel extends Model "created_by", "updated_by", "Is_active", + "date_of_exit", + "reason_for_exit" ]; public function getClientPolicyById($id){ @@ -99,11 +101,11 @@ class ClientPolicyModel extends Model } - public function getPolicyTermsJson($client_id,$policy_id) + public function getPolicyDetails($client_id,$policy_id) { - return $this->select('policy_terms') + return $this->select('*') ->where('client_id',$client_id) - ->where('policy_id',$policy_id) + ->where('id',$policy_id) ->get() ->getResult(); diff --git a/app/Models/EmpEndorsementModel.php b/app/Models/EmpEndorsementModel.php index 26272fea..b6956259 100644 --- a/app/Models/EmpEndorsementModel.php +++ b/app/Models/EmpEndorsementModel.php @@ -10,7 +10,7 @@ class EmpEndorsementModel extends Model protected $primaryKey = 'id'; protected $allowedFields = [ 'id', - 'emp_id', + 'pk', 'endorsement_id', 'emp_code', 'table_name', @@ -19,10 +19,12 @@ class EmpEndorsementModel extends Model 'field_name', 'old_value', 'new_value', + 'date_of_correction', 'status', "created_by", "updated_by", "is_active", + "remarks" ]; } diff --git a/app/Models/EmployeeModel.php b/app/Models/EmployeeModel.php index 589d1a49..914c623b 100644 --- a/app/Models/EmployeeModel.php +++ b/app/Models/EmployeeModel.php @@ -13,6 +13,8 @@ class EmployeeModel extends Model "client_id", "employee_id", "change_event", + "relationship", + "relationship_code", "relationship_id", "relationship", "batch_id", @@ -24,6 +26,8 @@ class EmployeeModel extends Model "gender", "dob", "doj", + "basic_pay", + "band","designation", "otp", "family_floater_key", "emp_status", @@ -31,6 +35,7 @@ class EmployeeModel extends Model "updated_by", "updated_at", "is_active", + "file_id" ]; // Callbacks @@ -67,7 +72,53 @@ class EmployeeModel extends Model } -// ------------------------------------------------------------------------------------------------ + + // for emp onboard process do not change + public function checkExistingEmp($arr) + { + + return $this->where('emp_code',$arr['emp_code']) + ->where('name',$arr['name']) + ->where('client_id',$arr['client_id']) + // ->where('relationship_code',$arr['relationship_code']) + ->where('gender',$arr['gender']) + ->where('dob',$arr['dob']) + ->find(); + } + + + public function getEmpFamilybyEmpCode(string $client_policy_id = null,string $emp_code = null,string $client_id = null,string $emp_status = null) + { + $result = $this->select(['employees.id as emp_id', 'employees.client_id', 'employees.relationship', 'employees.relationship_code', 'employees.change_event', 'employees.emp_code', 'employees.name', 'employees.email_personal', 'employees.email_corporate', 'employees.mobile', 'employees.gender', 'employees.dob', 'employees.doj', 'employees.basic_pay', 'employees.band', 'employees.designation', 'employees.emp_status','employee_polices.id as emp_policy_id', 'employee_polices.employee_id', 'employee_polices.client_policy_id', 'employee_polices.tpa_id', 'employee_polices.uhid', 'employee_polices.batch_code', 'employee_polices.status', 'employee_polices.pre_existing_alignments', 'employee_polices.basic_cover_si', 'employee_polices.date_coverage', 'employee_polices.policy_end_date', 'employee_polices.days', 'employee_polices.premium', 'employee_polices.rata_premimum', 'employee_polices.gst', 'employee_polices.date_of_exit', 'employee_polices.reason_for_exit']) + ->join('employee_polices', 'employee_polices.employee_id = employees.id') + ->where('employees.is_active',1) + ->when($client_policy_id, function($query) use ($client_policy_id){ + return $query->where('employee_polices.client_policy_id',$client_policy_id); + }) + + ->where('employee_polices.is_active',1) + ->where('employees.emp_status', ($emp_status !== null ? $emp_status : 'active')) + // ->where('employees.emp_code',$emp_code) + ->when($emp_code, function($query) use ($emp_code){ + return $query->where('employees.emp_code',$emp_code); + + }) + // ->when($emp_status, function($query) use ($emp_status){ + // $emp_status = ($emp_status !== null ? $emp_status : 'active'); + // dd($emp_status); + // return $query->where('employees.emp_status', $emp_status); + // }) + ->when($client_id, function($query) use ($client_id){ + return $query->where('employees.client_id',$client_id); + }) + ->findAll(); + // dd($this->db->getLastQuery()); + + return ($result); + } + + + public function getEmployeePolicy($id) { @@ -80,16 +131,10 @@ class EmployeeModel extends Model ->getResult(); } - - - // for EMP rest API process do not change public function checkExistingEmployee($arr) { return $this->where('emp_code',$arr['emp_code'])->where('name',$arr['name'])->where('client_id', $arr['client_id'])->first(); } - - - } diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 8e59ce88..94a6e80e 100644 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -84,7 +84,18 @@ class EmployeePolicyModel extends Model return ($result); } -//------------------------------------------------------------------ + + + //for emp onboard do not change + public function checkExistingEmpPolicy($arr) + { + return $this->where('employee_id',$arr['employee_id']) + ->where('client_policy_id',$arr['client_policy_id']) + ->find(); + } + + //------------------------------------------------------------------ + public function getInceptionEmployeeDataForExportExcel($ref_data) { @@ -527,13 +538,13 @@ class EmployeePolicyModel extends Model } - //for emp onboard do not change - public function checkExistingEmpPolicy($arr) - { - return $this->where('employee_id',$arr['employee_id']) - ->where('client_policy_id',$arr['client_policy_id']) - ->find(); - } + // //for emp onboard do not change + // public function checkExistingEmpPolicy($arr) + // { + // return $this->where('employee_id',$arr['employee_id']) + // ->where('client_policy_id',$arr['client_policy_id']) + // ->find(); + // } public function updateSiAndPremium( $client_policy_id, $employee_id,$basic_cover_si,$premium) @@ -550,4 +561,5 @@ class EmployeePolicyModel extends Model } //------------------------------------------------------------------ + } diff --git a/app/Models/PolicesModel.php b/app/Models/PolicesModel.php index 70724d71..9f0a2718 100644 --- a/app/Models/PolicesModel.php +++ b/app/Models/PolicesModel.php @@ -5,6 +5,9 @@ use App\Models\PolicyPremium1Model; use App\Models\PolicyPremium2Model; use App\Models\PolicyGridModel; use CodeIgniter\Model; +use App\Models\PolicyGridModel; +use App\Models\PolicyPremium1Model; +use App\Models\PolicyPremium2Model; class PolicesModel extends Model { @@ -32,23 +35,26 @@ class PolicesModel extends Model } - - public function getPolicySlabRatesForEmpOnboard($policy_id,$client_id) - { - $premium_slab_data = null; - $policyPremium1Model = new PolicyPremium1Model(); - $premium_slab_data = $policyPremium1Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll(); - - if((!count($premium_slab_data))) - { - $policyPremium2Model = new PolicyPremium2Model(); - $premium_slab_data = $policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll(); - - } - $grid_id = $premium_slab_data[0]['policy_grid_id']; - $policyGridModel = new PolicyGridModel(); - $results = $policyGridModel->find($grid_id); - return ['slab_rates' => $premium_slab_data,'grid_master' => $results]; + public function getPolicySlabRatesForEmpOnboard($policy_id,$client_id) + + { + + $premium_slab_data = null; + + $policyPremium1Model = new PolicyPremium1Model(); + $premium_slab_data = $policyPremium1Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll(); + // dd($premium_slab_data); + if(is_array($premium_slab_data) && !count($premium_slab_data)) + { + // echo '2'; + $policyPremium2Model = new PolicyPremium2Model(); + $premium_slab_data = $policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll(); + } + + $grid_id = $premium_slab_data[0]['policy_grid_id']; + $policyGridModel = new PolicyGridModel(); + $results = $policyGridModel->find($grid_id); + return ['slab_rates' => $premium_slab_data,'grid_master' => $results]; } } diff --git a/app/Views/employee_upload.php b/app/Views/employee_upload.php index 517fd2b8..16e5d66d 100644 --- a/app/Views/employee_upload.php +++ b/app/Views/employee_upload.php @@ -281,29 +281,70 @@ function fetchFileError(file_id) { console.log('fetchFileError'); console.log(apiURL); $.ajax({ - url: apiURL, - method: 'GET', - headers: { - "X-Requested-With": "XMLHttpRequest" - }, - success: function(response) { - // console.log(response.code); - // console.log(response.dataStatus); - // console.log(response.data); - $(this).find(".modal-body").html(""); - if (response.code === 200 && response.dataStatus === true && response.data !== "") { - try { - console.log((JSON.parse(response.data))); - var file_error_data = (JSON.parse(response.data)); - var file_error_html = ""; - - for (var key in file_error_data['error_summary']) { - console.log(key); - var err_id = key; - var err_count = file_error_data['error_summary'][key]; - // for (var ckey in col) - // { + url: apiURL, + method: 'GET', + headers: { + "X-Requested-With": "XMLHttpRequest" + }, + success: function(response) { + + $(this).find(".modal-body").html(""); + if (response.code === 200 && response.dataStatus === true && response.data !== "") + { + try { + console.log((JSON.parse(response.data))); + var file_error_data = (JSON.parse(response.data)); + var file_error_html = ""; + + for (var key in file_error_data['error_summary']) { + console.log(key); + var err_id = key; + var err_count = file_error_data['error_summary'][key]; + switch (err_id) { + case 1: + file_error_html += "Mandatory values missing " + err_count + ""; + break; + case 2: + file_error_html += "Values not in expected format " + err_count + ""; + break; + case 3: + file_error_html += "Field contains not allowed values " + err_count + ""; + break; + case 4: + file_error_html += "Rule Conflict " + err_count + ""; + break; + case 5: + file_error_html += "" + file_error_data['error_data'] + ""; + break; + case 6: + file_error_html += "" + file_error_data['error_data'] + ""; + break; + case 7: + file_error_html += "Duplicate entry in file " + err_count + ""; + break; + case 8: + file_error_html += "to be config"; + break; + case 9: + file_error_html += "Duplicate entry " + err_count + ""; + break; + case 10: + file_error_html += "Duplicate entry in file " + err_count + ""; + break; + case 11: + file_error_html += "Rule conflict: Dependents not allowed " + err_count + ""; + break; + case 12: + file_error_html += "Rule conflict: Dependent count greater than allowed dependent count " + err_count + ""; + break; + case 13: + file_error_html += "Rule conflict: Twofold relationship found within family " + err_count + ""; + break; + default: + file_error_html += ""; + break; + } file_error_html += (err_id == 1 ? "Mandatory values missing " + err_count + "" : (err_id == 2 ? @@ -327,6 +368,7 @@ function fetchFileError(file_id) { "employee/excel_error/" + file_id + "' target=_blank>click here to more details..." : ""); } + console.log(file_error_html); $('#file-err-modal').find(".modal-body").html(file_error_html); return file_error_html; diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 66cfab3d..c59073f7 100644 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -394,7 +394,7 @@ diff --git a/app/Views/policy_gmc_terms.php b/app/Views/policy_gmc_terms.php index c1582a88..5cf1a613 100644 --- a/app/Views/policy_gmc_terms.php +++ b/app/Views/policy_gmc_terms.php @@ -109,20 +109,35 @@
-
-
- Self - Spouse - Child 1 - Child 2 - Child 3 - Child 4 +
+
+ Self: + + Spouse: +
- Parent 1 - Parent 2 - Parent-In-Law 1 - Parent-In-Law 2 + Children: + +
+
+ Select Other Members: +
@@ -683,12 +698,37 @@ var grid_html = ''; if (key.includes("family_floaters")) { let checkboxes = document.querySelectorAll(`input[name="${key}[]"]`); if (jsonObject[key]) { - jsonObject[key].forEach(element => { - let checkbox = $(`#${element}`); - if (checkbox.is(":checkbox")) { - checkbox.prop("checked", true); - } - }); + console.log(jsonObject[key]); + if (jsonObject[key].childrens) { + $('#children').val(jsonObject[key].childrens); + } + + if (jsonObject[key].self == 0) { + $('#self').prop('checked', false); + } + + if (jsonObject[key].spouse == 0) { + $('#spouse').prop('checked', false); + }else{ + $('#spouse').prop('checked', true); + } + + + if(jsonObject[key]['either-parents-pil'] == 1){ + $('#family_floaters').val('EPORPIL'); + }else if(jsonObject[key].parents == 1 && jsonObject[key]['parents-in-law'] == 1){ + $('#family_floaters').val('2EPORPIL'); + }else if(jsonObject[key].parents == 2 && jsonObject[key]['parents-in-law'] == 2){ + $('#family_floaters').val('4EPORPIL'); + }else if(jsonObject[key].parents == 1){ + $('#family_floaters').val('1P'); + }else if(jsonObject[key].parents == 2){ + $('#family_floaters').val('2P'); + }else if(jsonObject[key]['parents-in-law'] == 1){ + $('#family_floaters').val('1PIL'); + }else if(jsonObject[key]['parents-in-law'] == 2){ + $('#family_floaters').val('2PIL'); + } } } diff --git a/app/Views/swagger/index.php b/app/Views/swagger/index.php new file mode 100644 index 00000000..865b2a23 --- /dev/null +++ b/app/Views/swagger/index.php @@ -0,0 +1,60 @@ + + + + + + + Swagger UI + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/composer.json b/composer.json index e0f50cfa..77501e0f 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,8 @@ "phpmailer/phpmailer": "^6.9", "phpoffice/phpspreadsheet": "^2.0", "psr/log": "^1.1", - "slim/slim": "^4.13" + "slim/slim": "^4.13", + "zircote/swagger-php": "^4.8" }, "require-dev": { "codeigniter/coding-standard": "^1.7", diff --git a/public/assets/api.yaml b/public/assets/api.yaml new file mode 100644 index 00000000..d8159bab --- /dev/null +++ b/public/assets/api.yaml @@ -0,0 +1,890 @@ +openapi: 3.0.0 +paths: + '/nhance/employeeRest/verifyEmployeeNumber': + post: + tags: + - Login + summary: 'Add a new VerifyEmployeeNumber to the store' + operationId: VerifyEmployeeNumber + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + mobile_number: + type: string + description: mobile_number + multipart/form-data: + schema: + type: object + properties: + mobile_number: + type: string + description: mobile_number + + responses: + '201': + description: 'Upload VerifyEmployeeNumber' + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyEmployeeNumber' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/getVerifiedUserData': + post: + tags: + - Login + summary: ' GetVerifiedUserData' + operationId: GetVerifiedUserData + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + mobile_number: + type: string + description: mobile_number + otp: + type: string + description: otp + multipart/form-data: + schema: + type: object + properties: + mobile_number: + type: string + description: mobile_number + otp: + type: string + description: otp + responses: + '201': + description: 'GetVerifiedUserData' + content: + application/json: + schema: + $ref: '#/components/schemas/GetVerifiedUserData' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/verifyHrWithMobileNumber': + post: + tags: + - Login + summary: 'VerifyHrWithMobileNumber' + operationId: VerifyHrWithMobileNumber + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + mobile_number: + type: string + description: mobile_number + multipart/form-data: + schema: + type: object + properties: + mobile_number: + type: string + description: mobile_number + responses: + '201': + description: 'VerifyHrWithMobileNumber' + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyHrWithMobileNumber' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/getVerifiedHrData': + post: + tags: + - Login + summary: ' GetVerifiedHrData' + operationId: GetVerifiedHrData + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + mobile_number: + type: string + description: mobile_number + otp: + type: string + description: otp + + multipart/form-data: + schema: + type: object + properties: + mobile_number: + type: string + description: mobile_number + otp: + type: string + description: otp + responses: + '201': + description: 'GetVerifiedHrData' + content: + application/json: + schema: + $ref: '#/components/schemas/GetVerifiedHrData' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/employeeUpload': + post: + tags: + # - EmployeeUpload + summary: 'Add a new EmployeeUpload to the store' + operationId: EmployeeUpload + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + client_id: + type: integer + description: client_id + policy_id: + type: integer + description: policy_id + file: + type: string + format: binary + description: File to upload + application/json: + schema: + type: object + properties: + client_id: + type: integer + description: client_id + policy_id: + type: integer + description: policy_id + responses: + '201': + description: 'Upload EmployeeUpload' + content: + application/json: + schema: + $ref: '#/components/schemas/EmployeeUpload' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/getEmployeeProfile': + get: + tags: + # - EmployeeUpload + summary: 'GetEmployeeProfile' + operationId: GetEmployeeProfile + parameters: + - name: emp_code + in: query + description: an authorization header + required: true + type: string + responses: + '201': + description: 'GetEmployeeProfile' + content: + application/json: + schema: + $ref: '#/components/schemas/GetEmployeeProfile' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/editEmployeeProfile': + post: + tags: + # - EmployeeUpload + summary: 'EditEmployeeProfile' + operationId: EditEmployeeProfile + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the employee. + client_id: + type: string + description: The ID of the client. + relationship: + type: string + description: The relationship of the employee. + relationship_code: + type: string + description: The code representing the relationship. + change_event: + type: string + description: The change event associated with the employee. + batch_id: + type: string + description: The ID of the batch. + emp_code: + type: string + description: The code of the employee. + name: + type: string + description: The name of the employee. + email_personal: + type: string + description: The personal email of the employee. + email_corporate: + type: string + description: The corporate email of the employee. + mobile: + type: string + description: The mobile number of the employee. + gender: + type: string + description: The gender of the employee. + dob: + type: string + format: date + description: The date of birth of the employee. + doj: + type: string + format: date + description: The date of joining of the employee. + basic_pay: + type: string + description: The basic pay of the employee. + band: + type: string + description: The band of the employee. + designation: + type: string + description: The designation of the employee. + emp_status: + type: string + description: The status of the employee. + is_active: + type: string + description: Indicates if the employee is active. + file_id: + type: string + description: The ID of the file associated with the employee. + + responses: + '201': + description: 'EditEmployeeProfile' + content: + application/json: + schema: + $ref: '#/components/schemas/EditEmployeeProfile' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/relationshipList': + get: + tags: + # - EmployeeUpload + summary: 'RelationshipList' + operationId: RelationshipList + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + responses: + '201': + description: 'RelationshipList' + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipList' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/getEmployeeAndDependence': + get: + tags: + # - EmployeeUpload + summary: 'GetEmployeeAndDependence' + operationId: GetEmployeeAndDependence + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + - name: emp_code + in: query + description: an authorization header + required: true + type: string + responses: + '201': + description: 'GetEmployeeAndDependence' + content: + application/json: + schema: + $ref: '#/components/schemas/GetEmployeeAndDependence' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/editEmployeeAndDependence': + post: + tags: + # - EmployeeUpload + summary: 'EditEmployeeAndDependence' + operationId: EditEmployeeAndDependence + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the employee. + client_id: + type: string + description: The ID of the client. + relationship: + type: string + description: The relationship of the employee. + relationship_code: + type: string + description: The code representing the relationship. + change_event: + type: string + description: The change event associated with the employee. + batch_id: + type: string + description: The ID of the batch. + emp_code: + type: string + description: The code of the employee. + name: + type: string + description: The name of the employee. + email_personal: + type: string + description: The personal email of the employee. + email_corporate: + type: string + description: The corporate email of the employee. + mobile: + type: string + description: The mobile number of the employee. + gender: + type: string + description: The gender of the employee. + dob: + type: string + format: date + description: The date of birth of the employee. + doj: + type: string + format: date + description: The date of joining of the employee. + basic_pay: + type: string + description: The basic pay of the employee. + band: + type: string + description: The band of the employee. + designation: + type: string + description: The designation of the employee. + emp_status: + type: string + description: The status of the employee. + is_active: + type: string + description: Indicates if the employee is active. + file_id: + type: string + description: The ID of the file associated with the employee. + + responses: + '201': + description: 'EditEmployeeAndDependence' + content: + application/json: + schema: + $ref: '#/components/schemas/EditEmployeeAndDependence' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/addEmployeeAndDependence': + post: + tags: + # - EmployeeUpload + summary: 'AddEmployeeAndDependence' + operationId: AddEmployeeAndDependence + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + client_id: + type: string + description: The ID of the client. + relationship: + type: string + description: The relationship of the employee. + relationship_code: + type: string + description: The code representing the relationship. + change_event: + type: string + description: The change event associated with the employee. + batch_id: + type: string + description: The ID of the batch. + emp_code: + type: string + description: The code of the employee. + name: + type: string + description: The name of the employee. + email_personal: + type: string + description: The personal email of the employee. + email_corporate: + type: string + description: The corporate email of the employee. + mobile: + type: string + description: The mobile number of the employee. + gender: + type: string + description: The gender of the employee. + dob: + type: string + format: date + description: The date of birth of the employee. + doj: + type: string + format: date + description: The date of joining of the employee. + basic_pay: + type: string + description: The basic pay of the employee. + band: + type: string + description: The band of the employee. + designation: + type: string + description: The designation of the employee. + emp_status: + type: string + description: The status of the employee. + is_active: + type: string + description: Indicates if the employee is active. + file_id: + type: string + description: The ID of the file associated with the employee. + + responses: + '201': + description: 'EditEmployeeAndDependence' + content: + application/json: + schema: + $ref: '#/components/schemas/AddEmployeeAndDependence' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/getEmployeePolicy': + get: + tags: + # - EmployeeUpload + summary: 'GetEmployeePolicy' + operationId: GetEmployeePolicy + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + - name: id + in: query + description: an authorization header + required: true + type: string + - name: emp_code + in: query + description: an authorization header + required: true + type: string + responses: + '201': + description: 'GetEmployeePolicy' + content: + application/json: + schema: + $ref: '#/components/schemas/GetEmployeePolicy' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/createOrUpdateEmployeePolicySiAmount': + post: + tags: + # - EmployeeUpload + summary: 'CreateOrUpdateEmployeePolicySiAmount' + operationId: CreateOrUpdateEmployeePolicySiAmount + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + employee_id: + type: integer + description: The ID of the employee. + client_policy_id: + type: integer + description: The ID of the client. + basic_cover_si: + type: string + description: The Employee Policy. + premium: + type: string + description: The code representing the Employee Policy. + + responses: + '201': + description: 'CreateOrUpdateEmployeePolicySiAmount' + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOrUpdateEmployeePolicySiAmount' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/deleteDependence': + get: + tags: + # - EmployeeUpload + summary: 'DeleteDependence' + operationId: DeleteDependence + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + - name: id + in: query + description: an authorization header + required: true + type: string + responses: + '201': + description: 'DeleteDependence' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteDependence' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/getEmployeeAndDependenceByClientId': + get: + tags: + # - EmployeeUpload + summary: 'GetEmployeeAndDependenceByClientId' + operationId: GetEmployeeAndDependenceByClientId + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + - name: client_id + in: query + description: an authorization header + required: true + type: string + - name: client_policy_id + in: query + description: an authorization header + required: true + type: string + responses: + '201': + description: 'GetEmployeeAndDependenceByClientId' + content: + application/json: + schema: + $ref: '#/components/schemas/GetEmployeeAndDependenceByClientId' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + '/nhance/employeeRest/getClientPolicy': + get: + tags: + # - EmployeeUpload + summary: 'GetClientPolicy' + operationId: GetClientPolicy + parameters: + - name: auth + in: header + description: an authorization header + required: true + type: string + responses: + '201': + description: 'GetClientPolicy' + content: + application/json: + schema: + $ref: '#/components/schemas/GetClientPolicy' + '405': + description: 'Invalid input' + security: + - bearer_auth: [] + + + + + +components: + schemas: + EmployeeUpload: + title: EmployeeUpload + description: EmployeeUpload + properties: + client_id: + title: client_id + description: client_id + type: integer + policy_id: + title: policy_id + description: policy_id + type: integer + file: + title: file + description: file + type: string + format: binary + type: object + GetVerifiedUserData: + title: GetVerifiedUserData + description: GetVerifiedUserData + properties: + mobile_number: + title: mobile_number + description: mobile_number + type: string + otp: + title: otp + description: otp + type: string + type: object + VerifyEmployeeNumber: + title: VerifyEmployeeNumber + description: VerifyEmployeeNumber + properties: + mobile_number: + title: mobile_number + description: mobile_number + type: string + type: object + GetVerifiedHrData: + title: GetVerifiedHrData + description: GetVerifiedHrData + properties: + mobile_number: + title: mobile_number + description: mobile_number + type: string + otp: + title: otp + description: otp + type: string + type: object + VerifyHrWithMobileNumber: + title: VerifyHrWithMobileNumber + description: VerifyHrWithMobileNumber + properties: + mobile_number: + title: mobile_number + description: mobile_number + type: string + type: object + GetEmployeeProfile: + title: GetEmployeeProfile + description: GetEmployeeProfile + properties: + emp_code: + title: emp_code + description: emp_code + type: string + type: object + EditEmployeeProfile: + title: EditEmployeeProfile + description: EditEmployeeProfile + properties: + emp_code: + title: emp_code + description: emp_code + type: string + type: object + RelationshipList: + title: RelationshipList + description: RelationshipList + type: object + EditEmployeeAndDependence: + title: EditEmployeeAndDependence + description: EditEmployeeAndDependence + properties: + emp_code: + title: emp_code + description: emp_code + type: string + type: object + GetEmployeeAndDependence: + title: EditEmployeeAndDependence + description: EditEmployeeAndDependence + properties: + emp_code: + title: emp_code + description: emp_code + type: string + type: object + AddEmployeeAndDependence: + title: AddEmployeeAndDependence + description: AddEmployeeAndDependence + properties: + emp_code: + title: emp_code + description: emp_code + type: string + type: object + GetEmployeePolicy: + title: GetEmployeePolicy + description: GetEmployeePolicy + properties: + id: + title: id + description: id + type: integer + emp_code: + title: emp_code + description: emp_code + type: string + type: object + CreateOrUpdateEmployeePolicySiAmount: + title: CreateOrUpdateEmployeePolicySiAmount + description: CreateOrUpdateEmployeePolicySiAmount + properties: + employee_id: + title: employee_id + description: employee_id + type: integer + client_policy_id: + title: client_policy_id + description: client_policy_id + type: integer + basic_cover_si: + title: basic_cover_si + description: basic_cover_si + type: string + premium: + title: premium + description: premium + type: string + type: object + DeleteDependence: + title: DeleteDependence + description: DeleteDependence + properties: + id: + title: id + description: id + type: integer + type: object + GetEmployeeAndDependenceByClientId: + title: GetEmployeeAndDependenceByClientId + description: GetEmployeeAndDependenceByClientId + properties: + client_id: + title: client_id + description: client_id + type: integer + client_policy_id: + title: client_policy_id + description: client_policy_id + type: integer + type: object + GetClientPolicy: + title: GetClientPolicy + description: GetClientPolicy + type: object + + # securitySchemes: + # Authorization: + # type: http + # scheme: bearer + # bearerFormat: JWT \ No newline at end of file diff --git a/public/assets/swagger/favicon-16x16.png b/public/assets/swagger/favicon-16x16.png new file mode 100644 index 00000000..8b194e61 Binary files /dev/null and b/public/assets/swagger/favicon-16x16.png differ diff --git a/public/assets/swagger/favicon-32x32.png b/public/assets/swagger/favicon-32x32.png new file mode 100644 index 00000000..249737fe Binary files /dev/null and b/public/assets/swagger/favicon-32x32.png differ diff --git a/public/assets/swagger/index.html b/public/assets/swagger/index.html new file mode 100644 index 00000000..32169e36 --- /dev/null +++ b/public/assets/swagger/index.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
+ + + + + + diff --git a/public/assets/swagger/oauth2-redirect.html b/public/assets/swagger/oauth2-redirect.html new file mode 100644 index 00000000..a013fc82 --- /dev/null +++ b/public/assets/swagger/oauth2-redirect.html @@ -0,0 +1,68 @@ + + +Swagger UI: OAuth2 Redirect + + + + diff --git a/public/assets/swagger/swagger-ui-bundle.js b/public/assets/swagger/swagger-ui-bundle.js new file mode 100644 index 00000000..73773b75 --- /dev/null +++ b/public/assets/swagger/swagger-ui-bundle.js @@ -0,0 +1,92 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=586)}([function(e,t,n){"use strict";e.exports=n(121)},function(e,t,n){e.exports=n(901)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:z(e)}function r(e){return u(e)?e:V(e)}function o(e){return s(e)?e:W(e)}function i(e){return a(e)&&!c(e)?e:H(e)}function a(e){return!(!e||!e[f])}function u(e){return!(!e||!e[p])}function s(e){return!(!e||!e[h])}function c(e){return u(e)||s(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=u,n.isIndexed=s,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",v={},m={value:!1},g={value:!1};function y(e){return e.value=!1,e}function b(e){e&&(e.value=!0)}function _(){}function x(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?w(e)+t:t}function S(){return!0}function C(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function A(e,t){return k(e,t,0)}function O(e,t){return k(e,t,t)}function k(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var j,T,P,I="function"==typeof Symbol&&Symbol.iterator,M=I||"@@iterator";function N(e){this.next=e}function D(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function R(){return{value:void 0,done:!0}}function L(e){return!!U(e)}function B(e){return e&&"function"==typeof e.next}function F(e){var t=U(e);return t&&t.call(e)}function U(e){var t=e&&(I&&e[I]||e["@@iterator"]);if("function"==typeof t)return t}function q(e){return e&&"number"==typeof e.length}function z(e){return null==e?Z():a(e)?e.toSeq():function(e){var t=ee(e)||"object"==typeof e&&new K(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function V(e){return null==e?Z().toKeyedSeq():a(e)?u(e)?e.toSeq():e.fromEntrySeq():X(e)}function W(e){return null==e?Z():a(e)?u(e)?e.entrySeq():e.toIndexedSeq():Q(e)}function H(e){return(null==e?Z():a(e)?u(e)?e.entrySeq():e:Q(e)).toSetSeq()}function J(e){this._array=e,this.size=e.length}function K(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function $(e){this._iterable=e,this.size=e.length||e.size}function Y(e){this._iterator=e,this._iteratorCache=[]}function G(e){return!(!e||!e["@@__IMMUTABLE_SEQ__@@"])}function Z(){return j||(j=new J([]))}function X(e){var t=Array.isArray(e)?new J(e).fromEntrySeq():B(e)?new Y(e).fromEntrySeq():L(e)?new $(e).fromEntrySeq():"object"==typeof e?new K(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function Q(e){var t=ee(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ee(e){return q(e)?new J(e):B(e)?new Y(e):L(e)?new $(e):void 0}function te(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var u=o[n?i-a:a];if(!1===t(u[1],r?u[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ne(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new N((function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:D(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function re(e,t){return t?function e(t,n,r,o){return Array.isArray(n)?t.call(o,r,W(n).map((function(r,o){return e(t,r,o,n)}))):ie(n)?t.call(o,r,V(n).map((function(r,o){return e(t,r,o,n)}))):n}(t,e,"",{"":e}):oe(e)}function oe(e){return Array.isArray(e)?W(e).map(oe).toList():ie(e)?V(e).map(oe).toMap():e}function ie(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ae(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ue(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||u(e)!==u(t)||s(e)!==s(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(l(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&ae(o[1],e)&&(n||ae(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var f=!0,p=t.__iterate((function(t,r){if(n?!e.has(t):o?!ae(t,e.get(r,v)):!ae(e.get(r,v),t))return f=!1,!1}));return f&&e.size===p}function se(e,t){if(!(this instanceof se))return new se(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(T)return T;T=this}}function ce(e,t){if(!e)throw new Error(t)}function le(e,t,n){if(!(this instanceof le))return new le(e,t,n);if(ce(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?{value:void 0,done:!0}:D(e,o,n[t?r-o++:o++])}))},t(K,V),K.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},K.prototype.has=function(e){return this._object.hasOwnProperty(e)},K.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},K.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new N((function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:D(e,a,n[a])}))},K.prototype[d]=!0,t($,W),$.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=F(this._iterable),r=0;if(B(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},$.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=F(this._iterable);if(!B(n))return new N(R);var r=0;return new N((function(){var t=n.next();return t.done?t:D(e,r++,t.value)}))},t(Y,W),Y.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return D(e,o,r[o++])}))},t(se,W),se.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},se.prototype.get=function(e,t){return this.has(e)?this._value:t},se.prototype.includes=function(e){return ae(this._value,e)},se.prototype.slice=function(e,t){var n=this.size;return C(e,t,n)?this:new se(this._value,O(t,n)-A(e,n))},se.prototype.reverse=function(){return this},se.prototype.indexOf=function(e){return ae(this._value,e)?0:-1},se.prototype.lastIndexOf=function(e){return ae(this._value,e)?this.size:-1},se.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?{value:void 0,done:!0}:D(e,i++,a)}))},le.prototype.equals=function(e){return e instanceof le?this._start===e._start&&this._end===e._end&&this._step===e._step:ue(this,e)},t(fe,n),t(pe,fe),t(he,fe),t(de,fe),fe.Keyed=pe,fe.Indexed=he,fe.Set=de;var ve="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function me(e){return e>>>1&1073741824|3221225471&e}function ge(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return me(n)}if("string"===t)return e.length>Ce?function(e){var t=ke[e];return void 0===t&&(t=ye(e),Oe===Ae&&(Oe=0,ke={}),Oe++,ke[e]=t),t}(e):ye(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(we&&void 0!==(t=be.get(e)))return t;if(void 0!==(t=e[Se]))return t;if(!xe){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Se]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Ee,1073741824&Ee&&(Ee=0),we)be.set(e,t);else{if(void 0!==_e&&!1===_e(e))throw new Error("Non-extensible objects are not allowed as keys.");if(xe)Object.defineProperty(e,Se,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Se]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Se]=t}}return t}(e);if("function"==typeof e.toString)return ye(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ye(e){for(var t=0,n=0;n=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},Te.prototype.toString=function(){return this.__toString("Map {","}")},Te.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Te.prototype.set=function(e,t){return He(this,e,t)},Te.prototype.setIn=function(e,t){return this.updateIn(e,v,(function(){return t}))},Te.prototype.remove=function(e){return He(this,e,v)},Te.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return v}))},Te.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Te.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,o){var i=t===v,a=n.next();if(a.done){var u=i?r:t,s=o(u);return s===u?t:s}ce(i||t&&t.set,"invalid keyPath");var c=a.value,l=i?v:t.get(c,v),f=e(l,n,r,o);return f===l?t:f===v?t.remove(c):(i?We():t).set(c,f)}(this,Yt(e),t,n);return r===v?void 0:r},Te.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):We()},Te.prototype.merge=function(){return Ye(this,void 0,arguments)},Te.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Ye(this,t,n)},Te.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,We(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Te.prototype.mergeDeep=function(){return Ye(this,Ge,arguments)},Te.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ye(this,Ze(t),n)},Te.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,We(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Te.prototype.sort=function(e){return xt(Bt(this,e))},Te.prototype.sortBy=function(e,t){return xt(Bt(this,t,e))},Te.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Te.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new _)},Te.prototype.asImmutable=function(){return this.__ensureOwner()},Te.prototype.wasAltered=function(){return this.__altered},Te.prototype.__iterator=function(e,t){return new Ue(this,e,t)},Te.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},Te.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ve(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Te.isMap=Pe;var Ie,Me="@@__IMMUTABLE_MAP__@@",Ne=Te.prototype;function De(e,t){this.ownerID=e,this.entries=t}function Re(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Le(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Be(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Fe(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Ue(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&ze(e._root)}function qe(e,t){return D(e,t[0],t[1])}function ze(e,t){return{node:e,index:0,__prev:t}}function Ve(e,t,n,r){var o=Object.create(Ne);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function We(){return Ie||(Ie=Ve(0))}function He(e,t,n){var r,o;if(e._root){var i=y(m),a=y(g);if(r=Je(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===v?-1:1:0)}else{if(n===v)return e;o=1,r=new De(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ve(o,r):We()}function Je(e,t,n,r,o,i,a,u){return e?e.update(t,n,r,o,i,a,u):i===v?e:(b(u),b(a),new Fe(t,r,[o,i]))}function Ke(e){return e.constructor===Fe||e.constructor===Be}function $e(e,t,n,r,o){if(e.keyHash===r)return new Be(t,r,[e.entry,o]);var i,a=31&(0===n?e.keyHash:e.keyHash>>>n),u=31&(0===n?r:r>>>n);return new Re(t,1<>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function et(e,t,n,r){var o=r?e:x(e);return o[t]=n,o}Ne[Me]=!0,Ne.delete=Ne.remove,Ne.removeIn=Ne.deleteIn,De.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i=tt)return function(e,t,n,r){e||(e=new _);for(var o=new Fe(e,ge(n),[n,r]),i=0;i>>e)),i=this.bitmap;return 0==(i&o)?r:this.nodes[Qe(i&o-1)].get(e+5,t,n,r)},Re.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=ge(r));var u=31&(0===t?n:n>>>t),s=1<=nt)return function(e,t,n,r,o){for(var i=0,a=new Array(32),u=0;0!==n;u++,n>>>=1)a[u]=1&n?t[i++]:void 0;return a[r]=o,new Le(e,i+1,a)}(e,p,c,u,d);if(l&&!d&&2===p.length&&Ke(p[1^f]))return p[1^f];if(l&&d&&1===p.length&&Ke(d))return d;var m=e&&e===this.ownerID,g=l?d?c:c^s:c|s,y=l?d?et(p,f,d,m):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a>>e),i=this.nodes[o];return i?i.get(e+5,t,n,r):r},Le.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=ge(r));var u=31&(0===t?n:n>>>t),s=o===v,c=this.nodes,l=c[u];if(s&&!l)return this;var f=Je(l,e,t+5,n,r,o,i,a);if(f===l)return this;var p=this.count;if(l){if(!f&&--p0&&r<32?ht(0,r,5,null,new st(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function it(e){return!(!e||!e[at])}t(ot,he),ot.of=function(){return this(arguments)},ot.prototype.toString=function(){return this.__toString("List [","]")},ot.prototype.get=function(e,t){if((e=E(this,e))>=0&&e=e.size||t<0)return e.withMutations((function(e){t<0?yt(e,t).set(0,n):yt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,i=y(g);return t>=_t(e._capacity)?r=vt(r,e.__ownerID,0,t,n,i):o=vt(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):ht(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},ot.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},ot.prototype.insert=function(e,t){return this.splice(e,0,t)},ot.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):dt()},ot.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){yt(n,0,t+e.length);for(var r=0;r>>t&31;if(r>=this.array.length)return new st([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-5,n))===a&&i)return this}if(i&&!o)return this;var u=mt(this,e);if(!i)for(var s=0;s>>t&31;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-5,n))===i&&o===this.array.length-1)return this}var a=mt(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var ct,lt,ft={};function pt(e,t){var n=e._origin,r=e._capacity,o=_t(r),i=e._tail;return a(e._root,e._level,0);function a(e,u,s){return 0===u?function(e,a){var u=a===o?i&&i.array:e&&e.array,s=a>n?0:n-a,c=r-a;return c>32&&(c=32),function(){if(s===c)return ft;var e=t?--c:s++;return u&&u[e]}}(e,s):function(e,o,i){var u,s=e&&e.array,c=i>n?0:n-i>>o,l=1+(r-i>>o);return l>32&&(l=32),function(){for(;;){if(u){var e=u();if(e!==ft)return e;u=null}if(c===l)return ft;var n=t?--l:c++;u=a(s&&s[n],o-5,i+(n<>>n&31,s=e&&u0){var c=e&&e.array[u],l=vt(c,t,n-5,r,o,i);return l===c?e:((a=mt(e,t)).array[u]=l,a)}return s&&e.array[u]===o?e:(b(i),a=mt(e,t),void 0===o&&u===a.array.length-1?a.array.pop():a.array[u]=o,a)}function mt(e,t){return t&&e&&t===e.ownerID?e:new st(e?e.array.slice():[],t)}function gt(e,t){if(t>=_t(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&31],r-=5;return n}}function yt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new _,o=e._origin,i=e._capacity,a=o+t,u=void 0===n?i:n<0?i+n:o+n;if(a===o&&u===i)return e;if(a>=u)return e.clear();for(var s=e._level,c=e._root,l=0;a+l<0;)c=new st(c&&c.array.length?[void 0,c]:[],r),l+=1<<(s+=5);l&&(a+=l,o+=l,u+=l,i+=l);for(var f=_t(i),p=_t(u);p>=1<f?new st([],r):h;if(h&&p>f&&a5;m-=5){var g=f>>>m&31;v=v.array[g]=mt(v.array[g],r)}v.array[f>>>5&31]=h}if(u=p)a-=p,u-=p,s=5,c=null,d=d&&d.removeBefore(r,0,a);else if(a>o||p>>s&31;if(y!==p>>>s&31)break;y&&(l+=(1<o&&(c=c.removeBefore(r,s,a-l)),c&&pi&&(i=c.size),a(s)||(c=c.map((function(e){return re(e)}))),r.push(c)}return i>e.size&&(e=e.setSize(i)),Xe(e,t,r)}function _t(e){return e<32?0:e-1>>>5<<5}function xt(e){return null==e?St():wt(e)?e:St().withMutations((function(t){var n=r(e);je(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function wt(e){return Pe(e)&&l(e)}function Et(e,t,n,r){var o=Object.create(xt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function St(){return lt||(lt=Et(We(),dt()))}function Ct(e,t,n){var r,o,i=e._map,a=e._list,u=i.get(t),s=void 0!==u;if(n===v){if(!s)return e;a.size>=32&&a.size>=2*i.size?(r=(o=a.filter((function(e,t){return void 0!==e&&u!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=u===a.size-1?a.pop():a.set(u,void 0))}else if(s){if(n===a.get(u)[1])return e;r=i,o=a.set(u,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Et(r,o)}function At(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Ot(e){this._iter=e,this.size=e.size}function kt(e){this._iter=e,this.size=e.size}function jt(e){this._iter=e,this.size=e.size}function Tt(e){var t=Jt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Kt,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(2===t){var r=e.__iterator(t,n);return new N((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,n)},t}function Pt(e,t,n){var r=Jt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,v);return i===v?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate((function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)}),o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(2,o);return new N((function(){var o=i.next();if(o.done)return o;var a=o.value,u=a[0];return D(r,u,t.call(n,a[1],u,e),o)}))},r}function It(e,t){var n=Jt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Tt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Kt,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function Mt(e,t,n,r){var o=Jt(e);return r&&(o.has=function(r){var o=e.get(r,v);return o!==v&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,v);return i!==v&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,u=0;return e.__iterate((function(e,i,s){if(t.call(n,e,i,s))return u++,o(e,r?i:u-1,a)}),i),u},o.__iteratorUncached=function(o,i){var a=e.__iterator(2,i),u=0;return new N((function(){for(;;){var i=a.next();if(i.done)return i;var s=i.value,c=s[0],l=s[1];if(t.call(n,l,c,e))return D(o,r?c:u++,l,i)}}))},o}function Nt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),C(t,n,o))return e;var i=A(t,o),a=O(n,o);if(i!=i||a!=a)return Nt(e.toSeq().cacheResult(),t,n,r);var u,s=a-i;s==s&&(u=s<0?0:s);var c=Jt(e);return c.size=0===u?u:e.size&&u||void 0,!r&&G(e)&&u>=0&&(c.get=function(t,n){return(t=E(this,t))>=0&&tu)return{value:void 0,done:!0};var e=o.next();return r||1===t?e:D(t,s-1,0===t?void 0:e.value[1],e)}))},c}function Dt(e,t,n,r){var o=Jt(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var u=!0,s=0;return e.__iterate((function(e,i,c){if(!u||!(u=t.call(n,e,i,c)))return s++,o(e,r?i:s-1,a)})),s},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var u=e.__iterator(2,i),s=!0,c=0;return new N((function(){var e,i,l;do{if((e=u.next()).done)return r||1===o?e:D(o,c++,0===o?void 0:e.value[1],e);var f=e.value;i=f[0],l=f[1],s&&(s=t.call(n,l,i,a))}while(s);return 2===o?e:D(o,i,l,e)}))},o}function Rt(e,t){var n=u(e),o=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?X(e):Q(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&u(i)||s(e)&&s(i))return i}var c=new J(o);return n?c=c.toKeyedSeq():s(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),c}function Lt(e,t,n){var r=Jt(e);return r.__iterateUncached=function(r,o){var i=0,u=!1;return function e(s,c){var l=this;s.__iterate((function(o,s){return(!t||c0}function qt(e,t,r){var o=Jt(e);return o.size=new J(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(1,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=n(e),F(o?e.reverse():e)})),a=0,u=!1;return new N((function(){var n;return u||(n=i.map((function(e){return e.next()})),u=n.some((function(e){return e.done}))),u?{value:void 0,done:!0}:D(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function zt(e,t){return G(e)?t:e.constructor(t)}function Vt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Wt(e){return je(e.size),w(e)}function Ht(e){return u(e)?r:s(e)?o:i}function Jt(e){return Object.create((u(e)?V:s(e)?W:H).prototype)}function Kt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):z.prototype.cacheResult.call(this)}function $t(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):xn(e,t)},mn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;je(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):xn(t,n)},mn.prototype.pop=function(){return this.slice(1)},mn.prototype.unshift=function(){return this.push.apply(this,arguments)},mn.prototype.unshiftAll=function(e){return this.pushAll(e)},mn.prototype.shift=function(){return this.pop.apply(this,arguments)},mn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):wn()},mn.prototype.slice=function(e,t){if(C(e,t,this.size))return this;var n=A(e,this.size);if(O(t,this.size)!==this.size)return he.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):xn(r,o)},mn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},mn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},mn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new N((function(){if(r){var t=r.value;return r=r.next,D(e,n++,t)}return{value:void 0,done:!0}}))},mn.isStack=gn;var yn,bn="@@__IMMUTABLE_STACK__@@",_n=mn.prototype;function xn(e,t,n,r){var o=Object.create(_n);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function wn(){return yn||(yn=xn(0))}function En(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}_n[bn]=!0,_n.withMutations=Ne.withMutations,_n.asMutable=Ne.asMutable,_n.asImmutable=Ne.asImmutable,_n.wasAltered=Ne.wasAltered,n.Iterator=N,En(n,{toArray:function(){je(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Ot(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new At(this,!0)},toMap:function(){return Te(this.toKeyedSeq())},toObject:function(){je(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return xt(this.toKeyedSeq())},toOrderedSet:function(){return ln(u(this)?this.valueSeq():this)},toSet:function(){return tn(u(this)?this.valueSeq():this)},toSetSeq:function(){return new kt(this)},toSeq:function(){return s(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return mn(u(this)?this.valueSeq():this)},toList:function(){return ot(u(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return zt(this,Rt(this,t))},includes:function(e){return this.some((function(t){return ae(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){je(this.size);var n=!0;return this.__iterate((function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1})),n},filter:function(e,t){return zt(this,Mt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return je(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){je(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return zt(this,Pt(this,e,t))},reduce:function(e,t,n){var r,o;return je(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return zt(this,It(this,!0))},slice:function(e,t){return zt(this,Nt(this,e,t,!0))},some:function(e,t){return!this.every(kn(e),t)},sort:function(e){return zt(this,Bt(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return w(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Te().asMutable();return e.__iterate((function(o,i){r.update(t.call(n,o,i,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return ue(this,e)},entrySeq:function(){var e=this;if(e._cache)return new J(e._cache);var t=e.toSeq().map(On).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(kn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,o,i){if(e.call(t,n,o,i))return r=[o,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(S)},flatMap:function(e,t){return zt(this,function(e,t,n){var r=Ht(e);return e.toSeq().map((function(o,i){return r(t.call(n,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return zt(this,Lt(this,e,!0))},fromEntrySeq:function(){return new jt(this)},get:function(e,t){return this.find((function(t,n){return ae(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=Yt(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,v):v)===v)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=u(e),o=(l(e)?xt():Te()).asMutable();e.__iterate((function(i,a){o.update(t.call(n,i,a,e),(function(e){return(e=e||[]).push(r?[a,i]:i),e}))}));var i=Ht(e);return o.map((function(t){return zt(e,i(t))}))}(this,e,t)},has:function(e){return this.get(e,v)!==v},hasIn:function(e){return this.getIn(e,v)!==v},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return ae(t,e)}))},keySeq:function(){return this.toSeq().map(An).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Ft(this,e)},maxBy:function(e,t){return Ft(this,t,e)},min:function(e){return Ft(this,e?jn(e):In)},minBy:function(e,t){return Ft(this,t?jn(t):In,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return zt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return zt(this,Dt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(kn(e),t)},sortBy:function(e,t){return zt(this,Bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return zt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return zt(this,function(e,t,n){var r=Jt(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate((function(e,o,u){return t.call(n,e,o,u)&&++a&&r(e,o,i)})),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(2,o),u=!0;return new N((function(){if(!u)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,s=o[0],c=o[1];return t.call(n,c,s,i)?2===r?e:D(r,s,c,e):(u=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(kn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=l(e),n=u(e),r=t?1:0;return function(e,t){return t=ve(t,3432918353),t=ve(t<<15|t>>>-15,461845907),t=ve(t<<13|t>>>-13,5),t=ve((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=me((t=ve(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Mn(ge(e),ge(t))|0}:function(e,t){r=r+Mn(ge(e),ge(t))|0}:t?function(e){r=31*r+ge(e)|0}:function(e){r=r+ge(e)|0}),r)}(this))}});var Sn=n.prototype;Sn[f]=!0,Sn[M]=Sn.values,Sn.__toJS=Sn.toArray,Sn.__toStringMapper=Tn,Sn.inspect=Sn.toSource=function(){return this.toString()},Sn.chain=Sn.flatMap,Sn.contains=Sn.includes,En(r,{flip:function(){return zt(this,Tt(this))},mapEntries:function(e,t){var n=this,r=0;return zt(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return zt(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var Cn=r.prototype;function An(e,t){return t}function On(e,t){return[t,e]}function kn(e){return function(){return!e.apply(this,arguments)}}function jn(e){return function(){return-e.apply(this,arguments)}}function Tn(e){return"string"==typeof e?JSON.stringify(e):String(e)}function Pn(){return x(arguments)}function In(e,t){return et?-1:0}function Mn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Cn[p]=!0,Cn[M]=Sn.entries,Cn.__toJS=Sn.toObject,Cn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Tn(e)},En(o,{toKeyedSeq:function(){return new At(this,!1)},filter:function(e,t){return zt(this,Mt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return zt(this,It(this,!1))},slice:function(e,t){return zt(this,Nt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=A(e,e<0?this.count():this.size);var r=this.slice(0,e);return zt(this,1===n?r:r.concat(x(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return zt(this,Lt(this,e,!1))},get:function(e,t){return(e=E(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=E(this,e))>=0&&(void 0!==this.size?this.size===1/0||e=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,c=!0,f=!1;return{s:function(){n=o()(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){f=!0,u=e},f:function(){try{c||null==n.return||n.return()}finally{if(f)throw u}}}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}function le(e){return t=e.replace(/\.[^./]*$/,""),O()(C()(t));var t}var fe=function(e,t){if(e>t)return"Value must be less than Maximum"},pe=function(e,t){if(et)return"Value must be less than MaxLength"},xe=function(e,t){if(e.length2&&void 0!==arguments[2]?arguments[2]:{},r=n.isOAS3,o=void 0!==r&&r,i=n.bypassRequiredCheck,a=void 0!==i&&i,u=[],s=e.get("required"),c=Object(q.a)(e,{isOAS3:o}),l=c.schema,f=c.parameterContentMediaType;if(!l)return u;var p=l.get("required"),h=l.get("maximum"),d=l.get("minimum"),v=l.get("type"),m=l.get("format"),g=l.get("maxLength"),b=l.get("minLength"),x=l.get("pattern");if(v&&(s||p||t)){var E="string"===v&&t,S="array"===v&&y()(t)&&t.length,C="array"===v&&w.a.List.isList(t)&&t.count(),A="array"===v&&"string"==typeof t&&t,O="file"===v&&t instanceof B.a.File,k="boolean"===v&&(t||!1===t),j="number"===v&&(t||0===t),T="integer"===v&&(t||0===t),P="object"===v&&"object"===_()(t)&&null!==t,I="object"===v&&"string"==typeof t&&t,M=[E,S,C,A,O,k,j,T,P,I],N=M.some((function(e){return!!e}));if((s||p)&&!N&&!a)return u.push("Required field is not provided"),u;if("object"===v&&"string"==typeof t&&(null===f||"application/json"===f))try{JSON.parse(t)}catch(e){return u.push("Parameter string value must be valid JSON"),u}if(x){var D=we(t,x);D&&u.push(D)}if(g||0===g){var R=_e(t,g);R&&u.push(R)}if(b){var L=xe(t,b);L&&u.push(L)}if(h||0===h){var F=fe(t,h);F&&u.push(F)}if(d||0===d){var U=pe(t,d);U&&u.push(U)}if("string"===v){var z;if(!(z="date-time"===m?ye(t):"uuid"===m?be(t):ge(t)))return u;u.push(z)}else if("boolean"===v){var V=me(t);if(!V)return u;u.push(V)}else if("number"===v){var W=he(t);if(!W)return u;u.push(W)}else if("integer"===v){var H=de(t);if(!H)return u;u.push(H)}else if("array"===v){var J;if(!C||!t.count())return u;J=l.getIn(["items","type"]),t.forEach((function(e,t){var n;"number"===J?n=he(e):"integer"===J?n=de(e):"string"===J&&(n=ge(e)),n&&u.push({index:t,error:n})}))}else if("file"===v){var K=ve(t);if(!K)return u;u.push(K)}}return u},Se=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'\n\x3c!-- XML example cannot be generated; root element name is undefined --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return Object(R.memoizedCreateXMLExample)(e,n)}var o=Object(R.memoizedSampleFromSchema)(e,n);return"object"===_()(o)?p()(o,null,2):o},Ce=function(){var e={},t=B.a.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return e},Ae=function(t){return(t instanceof e?t:new e(t.toString(),"utf-8")).toString("base64")},Oe={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},ke=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},je=function(e,t,n){return!!P()(n,(function(n){return M()(e[n],t[n])}))};function Te(e){return"string"!=typeof e||""===e?"":Object(E.sanitizeUrl)(e)}function Pe(e){return!(!e||e.indexOf("localhost")>=0||e.indexOf("127.0.0.1")>=0||"none"===e)}function Ie(e){if(!w.a.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find((function(e,t){return t.startsWith("2")&&m()(e.get("content")||{}).length>0})),n=e.get("default")||w.a.OrderedMap(),r=(n.get("content")||w.a.OrderedMap()).keySeq().toJS().length?n:null;return t||r}var Me=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"%20"):""},Ne=function(e){return U()(Me(e).replace(/%20/g,"_"))},De=function(e){return e.filter((function(e,t){return/^x-/.test(t)}))},Re=function(e){return e.filter((function(e,t){return/^pattern|maxLength|minLength|maximum|minimum/.test(t)}))};function Le(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==_()(e)||y()(e)||null===e||!t)return e;var r=d()({},e);return m()(r).forEach((function(e){e===t&&n(r[e],e)?delete r[e]:r[e]=Le(r[e],t,n)})),r}function Be(e){if("string"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),"object"===_()(e)&&null!==e)try{return p()(e,null,2)}catch(t){return String(e)}return null==e?"":e.toString()}function Fe(e){return"number"==typeof e?e.toString():e}function Ue(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.returnAll,r=void 0!==n&&n,o=t.allowHashes,i=void 0===o||o;if(!w.a.Map.isMap(e))throw new Error("paramToIdentifier: received a non-Im.Map parameter as input");var a=e.get("name"),u=e.get("in"),s=[];return e&&e.hashCode&&u&&a&&i&&s.push("".concat(u,".").concat(a,".hash-").concat(e.hashCode())),u&&a&&s.push("".concat(u,".").concat(a)),s.push(a),r?s:s[0]||""}function qe(e,t){return Ue(e,{returnAll:!0}).map((function(e){return t[e]})).filter((function(e){return void 0!==e}))[0]}function ze(){return We(V()(32).toString("base64"))}function Ve(e){return We(H()("sha256").update(e).digest("base64"))}function We(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var He=function(e){return!e||!(!$(e)||!e.isEmpty())}}).call(this,n(62).Buffer)},function(e,t,n){var r=n(225),o=n(906);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=r(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var r=n(17),o=n(9);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){e.exports=n(990)()},function(e,t,n){e.exports=n(651)},function(e,t,n){e.exports=n(667)},function(e,t,n){var r=n(429),o=n(697),i=n(192),a=n(432);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()}},function(e,t,n){var r=n(856),o=n(470),i=n(192),a=n(857);e.exports=function(e){return r(e)||o(e)||i(e)||a()}},function(e,t,n){"use strict";function r(e,t){return e===t}function o(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:r,n=null,i=null;return function(){return o(t,n,arguments)||(i=e.apply(null,arguments)),n=arguments,i}}))},function(e,t,n){var r=n(138),o=n(94);function i(t){return e.exports=i="function"==typeof o&&"symbol"==typeof r?function(e){return typeof e}:function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":typeof e},i(t)}e.exports=i},function(e,t,n){e.exports=n(671)},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,u],l=0;(s=new Error(t.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},function(e,t){e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;for(var t=0,n=["File","Blob","FormData"];t5?s-5:0),l=5;l6?u-6:0),c=6;c>",null!=n[r])return e.apply(void 0,[n,r,o,i,a].concat(s));var l=i;return t?new Error("Required "+l+" `"+a+"` was not specified in `"+o+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function u(e,t){return a((function(n,r,o,a,u){var s=n[r];if(!t(s)){var c=i(s);return new Error("Invalid "+a+" `"+u+"` of type `"+c+"` supplied to `"+o+"`, expected `"+e+"`.")}return null}))}function s(e,t,n){return a((function(r,o,a,u,s){for(var c=arguments.length,l=Array(c>5?c-5:0),f=5;f5?a-5:0),s=5;s key("+l[f]+")"].concat(u));if(h instanceof Error)return h}}))}function l(e,t,n,r){return a((function(){for(var o=arguments.length,i=Array(o),a=0;a5?c-5:0),f=5;f4)}function s(e){var t=e.get("swagger");return"string"==typeof t&&t.startsWith("2.0")}function c(e){return function(t,n){return function(r){return n&&n.specSelectors&&n.specSelectors.specJson?u(n.specSelectors.specJson())?a.a.createElement(e,o()({},r,n,{Ori:t})):a.a.createElement(t,r):(console.warn("OAS3 wrapper: couldn't get spec"),null)}}}},function(e,t,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,s=a(e),c=1;c0){var o=n.map((function(e){return console.error(e),e.line=e.fullPath?g(y,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",k()(e,"message",{enumerable:!0,value:e.message}),e}));i.newThrownErrBatch(o)}return r.updateResolved(t)}))}},be=[],_e=V()(A()(S.a.mark((function e(){var t,n,r,o,i,a,u,s,c,l,f,p,h,d,v,m,g;return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=be.system){e.next=4;break}return console.error("debResolveSubtrees: don't have a system to operate on, aborting."),e.abrupt("return");case 4:if(n=t.errActions,r=t.errSelectors,o=t.fn,i=o.resolveSubtree,a=o.AST,u=void 0===a?{}:a,s=t.specSelectors,c=t.specActions,i){e.next=8;break}return console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."),e.abrupt("return");case 8:return l=u.getLineNumberForPath?u.getLineNumberForPath:function(){},f=s.specStr(),p=t.getConfigs(),h=p.modelPropertyMacro,d=p.parameterMacro,v=p.requestInterceptor,m=p.responseInterceptor,e.prev=11,e.next=14,be.reduce(function(){var e=A()(S.a.mark((function e(t,o){var a,u,c,p,g,y,b;return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return a=e.sent,u=a.resultMap,c=a.specWithCurrentSubtrees,e.next=7,i(c,o,{baseDoc:s.url(),modelPropertyMacro:h,parameterMacro:d,requestInterceptor:v,responseInterceptor:m});case 7:return p=e.sent,g=p.errors,y=p.spec,r.allErrors().size&&n.clearBy((function(e){return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!e.get("fullPath").every((function(e,t){return e===o[t]||void 0===o[t]}))})),T()(g)&&g.length>0&&(b=g.map((function(e){return e.line=e.fullPath?l(f,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",k()(e,"message",{enumerable:!0,value:e.message}),e})),n.newThrownErrBatch(b)),H()(u,o,y),H()(c,o,y),e.abrupt("return",{resultMap:u,specWithCurrentSubtrees:c});case 15:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),w.a.resolve({resultMap:(s.specResolvedSubtree([])||Object(D.Map)()).toJS(),specWithCurrentSubtrees:s.specJson().toJS()}));case 14:g=e.sent,delete be.system,be=[],e.next=22;break;case 19:e.prev=19,e.t0=e.catch(11),console.error(e.t0);case 22:c.updateResolvedSubtree([],g.resultMap);case 23:case"end":return e.stop()}}),e,null,[[11,19]])}))),35),xe=function(e){return function(t){be.map((function(e){return e.join("@@")})).indexOf(e.join("@@"))>-1||(be.push(e),be.system=t,_e())}};function we(e,t,n,r,o){return{type:X,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:o}}}function Ee(e,t,n,r){return{type:X,payload:{path:e,param:t,value:n,isXml:r}}}var Se=function(e,t){return{type:le,payload:{path:e,value:t}}},Ce=function(){return{type:le,payload:{path:[],value:Object(D.Map)()}}},Ae=function(e,t){return{type:ee,payload:{pathMethod:e,isOAS3:t}}},Oe=function(e,t,n,r){return{type:Q,payload:{pathMethod:e,paramName:t,paramIn:n,includeEmptyValue:r}}};function ke(e){return{type:ue,payload:{pathMethod:e}}}function je(e,t){return{type:se,payload:{path:e,value:t,key:"consumes_value"}}}function Te(e,t){return{type:se,payload:{path:e,value:t,key:"produces_value"}}}var Pe=function(e,t,n){return{payload:{path:e,method:t,res:n},type:te}},Ie=function(e,t,n){return{payload:{path:e,method:t,req:n},type:ne}},Me=function(e,t,n){return{payload:{path:e,method:t,req:n},type:re}},Ne=function(e){return{payload:e,type:oe}},De=function(e){return function(t){var n=t.fn,r=t.specActions,o=t.specSelectors,i=t.getConfigs,a=t.oas3Selectors,u=e.pathName,s=e.method,c=e.operation,l=i(),f=l.requestInterceptor,p=l.responseInterceptor,h=c.toJS();if(c&&c.get("parameters")&&c.get("parameters").filter((function(e){return e&&!0===e.get("allowEmptyValue")})).forEach((function(t){if(o.parameterInclusionSettingFor([u,s],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};var n=Object(J.C)(t,e.parameters);(!n||n&&0===n.size)&&(e.parameters[t.get("name")]="")}})),e.contextUrl=L()(o.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&u&&s&&(e.operationId=n.opId(h,u,s)),o.isOAS3()){var d="".concat(u,":").concat(s);e.server=a.selectedServer(d)||a.selectedServer();var v=a.serverVariables({server:e.server,namespace:d}).toJS(),g=a.serverVariables({server:e.server}).toJS();e.serverVariables=_()(v).length?v:g,e.requestContentType=a.requestContentType(u,s),e.responseContentType=a.responseContentType(u,s)||"*/*";var b=a.requestBodyValue(u,s),x=a.requestBodyInclusionSetting(u,s);Object(J.t)(b)?e.requestBody=JSON.parse(b):b&&b.toJS?e.requestBody=b.map((function(e){return D.Map.isMap(e)?e.get("value"):e})).filter((function(e,t){return!Object(J.q)(e)||x.get(t)})).toJS():e.requestBody=b}var w=y()({},e);w=n.buildRequest(w),r.setRequest(e.pathName,e.method,w);e.requestInterceptor=function(t){var n=f.apply(this,[t]),o=y()({},n);return r.setMutatedRequest(e.pathName,e.method,o),n},e.responseInterceptor=p;var E=m()();return n.execute(e).then((function(t){t.duration=m()()-E,r.setResponse(e.pathName,e.method,t)})).catch((function(t){console.error(t),r.setResponse(e.pathName,e.method,{error:!0,err:F()(t)})}))}},Re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=d()(e,["path","method"]);return function(e){var o=e.fn.fetch,i=e.specSelectors,a=e.specActions,u=i.specJsonWithResolvedSubtrees().toJS(),s=i.operationScheme(t,n),c=i.contentTypeValues([t,n]).toJS(),l=c.requestContentType,f=c.responseContentType,p=/xml/i.test(l),h=i.parameterValues([t,n],p).toJS();return a.executeRequest($($({},r),{},{fetch:o,spec:u,pathName:t,method:n,parameters:h,requestContentType:l,scheme:s,responseContentType:f}))}};function Le(e,t){return{type:ie,payload:{path:e,method:t}}}function Be(e,t){return{type:ae,payload:{path:e,method:t}}}function Fe(e,t,n){return{type:fe,payload:{scheme:e,path:t,method:n}}}},function(e,t,n){e.exports=n(875)},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";var r=n(162),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){a[String(t)]=e}))})),a),-1===i.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,n){var r=n(237)("wks"),o=n(239),i=n(44).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(254)("wks"),o=n(187),i=n(34).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(65),o=n(866);e.exports=function(e,t){if(null==e)return{};var n,i,a=o(e,t);if(r){var u=r(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){var r=n(44),o=n(86),i=n(98),a=n(114),u=n(181),s=function(e,t,n){var c,l,f,p,h=e&s.F,d=e&s.G,v=e&s.S,m=e&s.P,g=e&s.B,y=d?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,b=d?o:o[t]||(o[t]={}),_=b.prototype||(b.prototype={});for(c in d&&(n=t),n)f=((l=!h&&y&&void 0!==y[c])?y:n)[c],p=g&&l?u(f,r):m&&"function"==typeof f?u(Function.call,f):f,y&&a(y,c,f,e&s.U),b[c]!=f&&i(b,c,p),m&&_[c]!=f&&(_[c]=f)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,n){var r=n(37);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(41),o=n(116),i=n(87),a=/"/g,u=function(e,t,n,r){var o=String(i(e)),u="<"+t;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,""")+'"'),u+">"+o+""};e.exports=function(e,t){var n={};n[e]=t(u),r(r.P+r.F*o((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},function(e,t,n){e.exports=!n(90)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"e",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"a",(function(){return g})),n.d(t,"d",(function(){return y}));var r=n(73),o=n.n(r),i=n(17),a=n.n(i),u=n(55),s=n.n(u),c=n(392),l=n.n(c),f=function(e){return String.prototype.toLowerCase.call(e)},p=function(e){return e.replace(/[^\w]/gi,"_")};function h(e){var t=e.openapi;return!!t&&l()(t,"3")}function d(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.v2OperationIdCompatibilityMode;if(!e||"object"!==a()(e))return null;var i=(e.operationId||"").replace(/\s/g,"");return i.length?p(e.operationId):v(t,n,{v2OperationIdCompatibilityMode:o})}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.v2OperationIdCompatibilityMode;if(r){var o="".concat(t.toLowerCase(),"_").concat(e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return(o=o||"".concat(e.substring(1),"_").concat(t)).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return"".concat(f(t)).concat(p(e))}function m(e,t){return"".concat(f(t),"-").concat(e)}function g(e,t){return e&&e.paths?function(e,t){return function(e,t,n){if(!e||"object"!==a()(e)||!e.paths||"object"!==a()(e.paths))return null;var r=e.paths;for(var o in r)for(var i in r[o])if("PARAMETERS"!==i.toUpperCase()){var u=r[o][i];if(u&&"object"===a()(u)){var s={spec:e,pathName:o,method:i.toUpperCase(),operation:u},c=t(s);if(n&&c)return s}}return}(e,t,!0)||null}(e,(function(e){var n=e.pathName,r=e.method,o=e.operation;if(!o||"object"!==a()(o))return!1;var i=o.operationId;return[d(o,n,r),m(n,r),i].some((function(e){return e&&e===t}))})):null}function y(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e;for(var i in n){var a=n[i];if(s()(a)){var u=a.parameters,c=function(e){var n=a[e];if(!s()(n))return"continue";var c=d(n,i,e);if(c){r[c]?r[c].push(n):r[c]=[n];var l=r[c];if(l.length>1)l.forEach((function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId="".concat(c).concat(t+1)}));else if(void 0!==n.operationId){var f=l[0];f.__originalOperationId=f.__originalOperationId||n.operationId,f.operationId=c}}if("parameters"!==e){var p=[],h={};for(var v in t)"produces"!==v&&"consumes"!==v&&"security"!==v||(h[v]=t[v],p.push(h));if(u&&(h.parameters=u,p.push(h)),p.length){var m,g=o()(p);try{for(g.s();!(m=g.n()).done;){var y=m.value;for(var b in y)if(n[b]){if("parameters"===b){var _,x=o()(y[b]);try{var w=function(){var e=_.value;n[b].some((function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e}))||n[b].push(e)};for(x.s();!(_=x.n()).done;)w()}catch(e){x.e(e)}finally{x.f()}}}else n[b]=y[b]}}catch(e){g.e(e)}finally{g.f()}}}};for(var l in a)c(l)}}return t.$$normalized=!0,e}},function(e,t,n){"use strict";n.r(t),n.d(t,"NEW_THROWN_ERR",(function(){return i})),n.d(t,"NEW_THROWN_ERR_BATCH",(function(){return a})),n.d(t,"NEW_SPEC_ERR",(function(){return u})),n.d(t,"NEW_SPEC_ERR_BATCH",(function(){return s})),n.d(t,"NEW_AUTH_ERR",(function(){return c})),n.d(t,"CLEAR",(function(){return l})),n.d(t,"CLEAR_BY",(function(){return f})),n.d(t,"newThrownErr",(function(){return p})),n.d(t,"newThrownErrBatch",(function(){return h})),n.d(t,"newSpecErr",(function(){return d})),n.d(t,"newSpecErrBatch",(function(){return v})),n.d(t,"newAuthErr",(function(){return m})),n.d(t,"clear",(function(){return g})),n.d(t,"clearBy",(function(){return y}));var r=n(140),o=n.n(r),i="err_new_thrown_err",a="err_new_thrown_err_batch",u="err_new_spec_err",s="err_new_spec_err_batch",c="err_new_auth_err",l="err_clear",f="err_clear_by";function p(e){return{type:i,payload:o()(e)}}function h(e){return{type:a,payload:e}}function d(e){return{type:u,payload:e}}function v(e){return{type:s,payload:e}}function m(e){return{type:c,payload:e}}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:l,payload:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:f,payload:e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SELECTED_SERVER",(function(){return r})),n.d(t,"UPDATE_REQUEST_BODY_VALUE",(function(){return o})),n.d(t,"UPDATE_REQUEST_BODY_INCLUSION",(function(){return i})),n.d(t,"UPDATE_ACTIVE_EXAMPLES_MEMBER",(function(){return a})),n.d(t,"UPDATE_REQUEST_CONTENT_TYPE",(function(){return u})),n.d(t,"UPDATE_RESPONSE_CONTENT_TYPE",(function(){return s})),n.d(t,"UPDATE_SERVER_VARIABLE_VALUE",(function(){return c})),n.d(t,"SET_REQUEST_BODY_VALIDATE_ERROR",(function(){return l})),n.d(t,"CLEAR_REQUEST_BODY_VALIDATE_ERROR",(function(){return f})),n.d(t,"setSelectedServer",(function(){return p})),n.d(t,"setRequestBodyValue",(function(){return h})),n.d(t,"setRequestBodyInclusion",(function(){return d})),n.d(t,"setActiveExamplesMember",(function(){return v})),n.d(t,"setRequestContentType",(function(){return m})),n.d(t,"setResponseContentType",(function(){return g})),n.d(t,"setServerVariableValue",(function(){return y})),n.d(t,"setRequestBodyValidateError",(function(){return b})),n.d(t,"clearRequestBodyValidateError",(function(){return _})),n.d(t,"initRequestBodyValidateError",(function(){return x}));var r="oas3_set_servers",o="oas3_set_request_body_value",i="oas3_set_request_body_inclusion",a="oas3_set_active_examples_member",u="oas3_set_request_content_type",s="oas3_set_response_content_type",c="oas3_set_server_variable_value",l="oas3_set_request_body_validate_error",f="oas3_clear_request_body_validate_error";function p(e,t){return{type:r,payload:{selectedServerUrl:e,namespace:t}}}function h(e){var t=e.value,n=e.pathMethod;return{type:o,payload:{value:t,pathMethod:n}}}function d(e){var t=e.value,n=e.pathMethod,r=e.name;return{type:i,payload:{value:t,pathMethod:n,name:r}}}function v(e){var t=e.name,n=e.pathMethod,r=e.contextType,o=e.contextName;return{type:a,payload:{name:t,pathMethod:n,contextType:r,contextName:o}}}function m(e){var t=e.value,n=e.pathMethod;return{type:u,payload:{value:t,pathMethod:n}}}function g(e){var t=e.value,n=e.path,r=e.method;return{type:s,payload:{value:t,path:n,method:r}}}function y(e){var t=e.server,n=e.namespace,r=e.key,o=e.val;return{type:c,payload:{server:t,namespace:n,key:r,val:o}}}var b=function(e){var t=e.path,n=e.method,r=e.validationErrors;return{type:l,payload:{path:t,method:n,validationErrors:r}}},_=function(e){var t=e.path,n=e.method;return{type:f,payload:{path:t,method:n}}},x=function(e){var t=e.pathMethod;return{type:f,payload:{path:t[0],method:t[1]}}}},function(e,t,n){var r=n(115);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(62),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r; +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t + * @license MIT + */ +var r=n(665),o=n(666),i=n(415);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,u=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,u/=2,s/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;iu&&(n=u-s),i=n;i>=0;i--){for(var f=!0,p=0;po&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:c>223?3:c>191?2:1;if(o+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(s=(31&c)<<6|63&i)>127&&(l=s);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(s=(15&c)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:i=e[o+1],a=e[o+2],u=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(s=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},s.prototype.compare=function(e,t,n,r,o){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),u=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,r,o,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function D(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,n,r,i){return i||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return i||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}s.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},s.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||I(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);I(this,e,t,n,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&e;++i>0)-u&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);I(this,e,t,n,o-1,-o)}var i=n-1,a=1,u=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(39))},function(e,t,n){e.exports=n(669)},function(e,t,n){e.exports=n(863)},function(e,t,n){e.exports=n(865)},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";var r=n(24),o=n(29),i=n(486),a=n(108),u=n(487),s=n(132),c=n(207),l=n(19),f=[],p=0,h=i.getPooled(),d=!1,v=null;function m(){w.ReactReconcileTransaction&&v||r("123")}var g=[{initialize:function(){this.dirtyComponentsLength=f.length},close:function(){this.dirtyComponentsLength!==f.length?(f.splice(0,this.dirtyComponentsLength),x()):f.length=0}},{initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}}];function y(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=i.getPooled(),this.reconcileTransaction=w.ReactReconcileTransaction.getPooled(!0)}function b(e,t){return e._mountOrder-t._mountOrder}function _(e){var t=e.dirtyComponentsLength;t!==f.length&&r("124",t,f.length),f.sort(b),p++;for(var n=0;n + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Viacheslav Lotsmanov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach((function(e,i){"object"==typeof e&&null!==e?Array.isArray(e)?t[i]=o(e):n(e)?t[i]=r(e):t[i]=a({},e):t[i]=e})),t}function i(e,t){return"__proto__"===t?void 0:e[t]}var a=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,u=arguments[0],s=Array.prototype.slice.call(arguments,1);return s.forEach((function(s){"object"!=typeof s||null===s||Array.isArray(s)||Object.keys(s).forEach((function(c){return t=i(u,c),(e=i(s,c))===u?void 0:"object"!=typeof e||null===e?void(u[c]=e):Array.isArray(e)?void(u[c]=o(e)):n(e)?void(u[c]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(u[c]=a({},e)):void(u[c]=a(t,e))}))})),u}}).call(this,n(62).Buffer)},function(e,t,n){var r=n(139),o=n(13),i=n(138),a=n(94),u=n(192);e.exports=function(e,t){var n;if(void 0===a||null==e[i]){if(o(e)||(n=u(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var s=0,c=function(){};return{s:c,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,f=!0,p=!1;return{s:function(){n=r(e)},n:function(){var e=n.next();return f=e.done,e},e:function(e){p=!0,l=e},f:function(){try{f||null==n.return||n.return()}finally{if(p)throw l}}}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(251),o=n(250);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(100);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";e.exports={current:null}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,c=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=u(p);l=!0;for(var t=c.length;t;){for(s=c,c=[];++f1)for(var n=1;n0&&"/"!==t[0]}));function oe(e,t,n){return t=t||[],te.apply(void 0,[e].concat(s()(t))).get("parameters",Object(f.List)()).reduce((function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(Object(l.B)(t,{allowHashes:!1}),r)}),Object(f.fromJS)({}))}function ie(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(f.List.isList(e))return e.some((function(e){return f.Map.isMap(e)&&e.get("in")===t}))}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(f.List.isList(e))return e.some((function(e){return f.Map.isMap(e)&&e.get("type")===t}))}function ue(e,t){t=t||[];var n=w(e).getIn(["paths"].concat(s()(t)),Object(f.fromJS)({})),r=e.getIn(["meta","paths"].concat(s()(t)),Object(f.fromJS)({})),o=se(e,t),i=n.get("parameters")||new f.List,a=r.get("consumes_value")?r.get("consumes_value"):ae(i,"file")?"multipart/form-data":ae(i,"formData")?"application/x-www-form-urlencoded":void 0;return Object(f.fromJS)({requestContentType:a,responseContentType:o})}function se(e,t){t=t||[];var n=w(e).getIn(["paths"].concat(s()(t)),null);if(null!==n){var r=e.getIn(["meta","paths"].concat(s()(t),["produces_value"]),null),o=n.getIn(["produces",0],null);return r||o||"application/json"}}function ce(e,t){t=t||[];var n=w(e),r=n.getIn(["paths"].concat(s()(t)),null);if(null!==r){var o=t,i=a()(o,1)[0],u=r.get("produces",null),c=n.getIn(["paths",i,"produces"],null),l=n.getIn(["produces"],null);return u||c||l}}function le(e,t){t=t||[];var n=w(e),r=n.getIn(["paths"].concat(s()(t)),null);if(null!==r){var o=t,i=a()(o,1)[0],u=r.get("consumes",null),c=n.getIn(["paths",i,"consumes"],null),l=n.getIn(["consumes"],null);return u||c||l}}var fe=function(e,t,n){var r=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),i=o()(r)?r[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||i||""},pe=function(e,t,n){return["http","https"].indexOf(fe(e,t,n))>-1},he=function(e,t){t=t||[];var n=e.getIn(["meta","paths"].concat(s()(t),["parameters"]),Object(f.fromJS)([])),r=!0;return n.forEach((function(e){var t=e.get("errors");t&&t.count()&&(r=!1)})),r},de=function(e,t){var n={requestBody:!1,requestContentType:{}},r=e.getIn(["resolvedSubtrees","paths"].concat(s()(t),["requestBody"]),Object(f.fromJS)([]));return r.size<1||(r.getIn(["required"])&&(n.requestBody=r.getIn(["required"])),r.getIn(["content"]).entrySeq().forEach((function(e){var t=e[0];if(e[1].getIn(["schema","required"])){var r=e[1].getIn(["schema","required"]).toJS();n.requestContentType[t]=r}}))),n};function ve(e){return f.Map.isMap(e)?e:new f.Map}},function(e,t,n){var r=n(58);function o(e,t,n,o,i,a,u){try{var s=e[a](u),c=s.value}catch(e){return void n(e)}s.done?t(c):r.resolve(c).then(o,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new r((function(r,i){var a=e.apply(t,n);function u(e){o(a,r,i,u,s,"next",e)}function s(e){o(a,r,i,u,s,"throw",e)}u(void 0)}))}}},function(e,t,n){var r=n(134),o=n(55);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(310);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){"use strict";n.r(t),n.d(t,"SHOW_AUTH_POPUP",(function(){return d})),n.d(t,"AUTHORIZE",(function(){return v})),n.d(t,"LOGOUT",(function(){return m})),n.d(t,"PRE_AUTHORIZE_OAUTH2",(function(){return g})),n.d(t,"AUTHORIZE_OAUTH2",(function(){return y})),n.d(t,"VALIDATE",(function(){return b})),n.d(t,"CONFIGURE_AUTH",(function(){return _})),n.d(t,"showDefinitions",(function(){return x})),n.d(t,"authorize",(function(){return w})),n.d(t,"logout",(function(){return E})),n.d(t,"preAuthorizeImplicit",(function(){return S})),n.d(t,"authorizeOauth2",(function(){return C})),n.d(t,"authorizePassword",(function(){return A})),n.d(t,"authorizeApplication",(function(){return O})),n.d(t,"authorizeAccessCodeWithFormParams",(function(){return k})),n.d(t,"authorizeAccessCodeWithBasicAuthentication",(function(){return j})),n.d(t,"authorizeRequest",(function(){return T})),n.d(t,"configureAuth",(function(){return P}));var r=n(17),o=n.n(r),i=n(18),a=n.n(i),u=n(27),s=n.n(u),c=n(112),l=n.n(c),f=n(20),p=n.n(f),h=n(7),d="show_popup",v="authorize",m="logout",g="pre_authorize_oauth2",y="authorize_oauth2",b="validate",_="configure_auth";function x(e){return{type:d,payload:e}}function w(e){return{type:v,payload:e}}function E(e){return{type:m,payload:e}}var S=function(e){return function(t){var n=t.authActions,r=t.errActions,o=e.auth,i=e.token,a=e.isValid,u=o.schema,c=o.name,l=u.get("flow");delete p.a.swaggerUIRedirectOauth2,"accessCode"===l||a||r.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),i.error?r.newAuthErr({authId:c,source:"auth",level:"error",message:s()(i)}):n.authorizeOauth2({auth:o,token:i})}};function C(e){return{type:y,payload:e}}var A=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.name,i=e.username,u=e.password,s=e.passwordType,c=e.clientId,l=e.clientSecret,f={grant_type:"password",scope:e.scopes.join(" "),username:i,password:u},p={};switch(s){case"request-body":!function(e,t,n){t&&a()(e,{client_id:t});n&&a()(e,{client_secret:n})}(f,c,l);break;case"basic":p.Authorization="Basic "+Object(h.a)(c+":"+l);break;default:console.warn("Warning: invalid passwordType ".concat(s," was passed, not including client id and secret"))}return n.authorizeRequest({body:Object(h.b)(f),url:r.get("tokenUrl"),name:o,headers:p,query:{},auth:e})}};var O=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.scopes,i=e.name,a=e.clientId,u=e.clientSecret,s={Authorization:"Basic "+Object(h.a)(a+":"+u)},c={grant_type:"client_credentials",scope:o.join(" ")};return n.authorizeRequest({body:Object(h.b)(c),name:i,url:r.get("tokenUrl"),auth:e,headers:s})}},k=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,u=t.clientSecret,s=t.codeVerifier,c={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:u,redirect_uri:n,code_verifier:s};return r.authorizeRequest({body:Object(h.b)(c),name:i,url:o.get("tokenUrl"),auth:t})}},j=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,u=t.clientSecret,s={Authorization:"Basic "+Object(h.a)(a+":"+u)},c={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:n};return r.authorizeRequest({body:Object(h.b)(c),name:i,url:o.get("tokenUrl"),auth:t,headers:s})}},T=function(e){return function(t){var n,r=t.fn,i=t.getConfigs,u=t.authActions,c=t.errActions,f=t.oas3Selectors,p=t.specSelectors,h=t.authSelectors,d=e.body,v=e.query,m=void 0===v?{}:v,g=e.headers,y=void 0===g?{}:g,b=e.name,_=e.url,x=e.auth,w=(h.getConfigs()||{}).additionalQueryStringParams;if(p.isOAS3()){var E=f.selectedServer();n=l()(_,f.serverEffectiveValue({server:E}),!0)}else n=l()(_,p.url(),!0);"object"===o()(w)&&(n.query=a()({},n.query,w));var S=n.toString(),C=a()({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},y);r.fetch({url:S,method:"post",headers:C,query:m,body:d,requestInterceptor:i().requestInterceptor,responseInterceptor:i().responseInterceptor}).then((function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");e.ok?n||r?c.newAuthErr({authId:b,level:"error",source:"auth",message:s()(t)}):u.authorizeOauth2({auth:x,token:t}):c.newAuthErr({authId:b,level:"error",source:"auth",message:e.statusText})})).catch((function(e){var t=new Error(e).message;if(e.response&&e.response.data){var n=e.response.data;try{var r="string"==typeof n?JSON.parse(n):n;r.error&&(t+=", error: ".concat(r.error)),r.error_description&&(t+=", description: ".concat(r.error_description))}catch(e){}}c.newAuthErr({authId:b,level:"error",source:"auth",message:t})}))}};function P(e){return{type:_,payload:e}}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(148),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(59),o=n(152);e.exports=n(46)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(701);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){e.exports=n(660)},function(e,t,n){"use strict";var r=n(876);e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_LAYOUT",(function(){return o})),n.d(t,"UPDATE_FILTER",(function(){return i})),n.d(t,"UPDATE_MODE",(function(){return a})),n.d(t,"SHOW",(function(){return u})),n.d(t,"updateLayout",(function(){return s})),n.d(t,"updateFilter",(function(){return c})),n.d(t,"show",(function(){return l})),n.d(t,"changeMode",(function(){return f}));var r=n(7),o="layout_update_layout",i="layout_update_filter",a="layout_update_mode",u="layout_show";function s(e){return{type:o,payload:e}}function c(e){return{type:i,payload:e}}function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=Object(r.w)(e),{type:u,payload:{thing:e,shown:t}}}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=Object(r.w)(e),{type:a,payload:{thing:e,mode:t}}}},function(e,t,n){"use strict";var r=n(1152),o=n(1153);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=b(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),p=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(1154);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),u=-1!==i&&i127?M+="x":M+=I[N];if(!M.match(h)){var R=T.slice(0,O),L=T.slice(O+1),B=I.match(d);B&&(R.push(B[1]),L.unshift(B[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=R.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[w])for(O=0,P=l.length;O0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=E.slice(-1)[0],A=(n.host||e.host||E.length>1)&&("."===C||".."===C)||""===C,O=0,k=E.length;k>=0;k--)"."===(C=E[k])?E.splice(k,1):".."===C?(E.splice(k,1),O++):O&&(E.splice(k,1),O--);if(!x&&!w)for(;O--;O)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),A&&"/"!==E.join("/").substr(-1)&&E.push("");var j,T=""===E[0]||E[0]&&"/"===E[0].charAt(0);S&&(n.hostname=n.host=T?"":E.length?E.shift():"",(j=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift()));return(x=x||n.host&&E.length)&&!T&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var r=n(179),o=n(397);e.exports=n(147)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(250);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(123),o=n(702),i=n(703),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(720),o=n(723);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";var r=n(201),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var i=n(161);i.inherits=n(52);var a=n(454),u=n(282);i.inherits(f,a);for(var s=o(u.prototype),c=0;c=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t){e.exports={}},function(e,t,n){n(658);for(var r=n(34),o=n(89),i=n(119),a=n(38)("toStringTag"),u="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s1){for(var d=Array(h),v=0;v1){for(var g=Array(m),y=0;y=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},function(e,t,n){var r=n(76),o=n(425),i=n(426),a=n(42),u=n(186),s=n(266),c={},l={};(t=e.exports=function(e,t,n,f,p){var h,d,v,m,g=p?function(){return e}:s(e),y=r(n,f,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(h=u(e.length);h>b;b++)if((m=t?y(a(d=e[b])[0],d[1]):y(e[b]))===c||m===l)return m}else for(v=g.call(e);!(d=v.next()).done;)if((m=o(v,y,d.value,t))===c||m===l)return m}).BREAK=c,t.RETURN=l},function(e,t,n){"use strict";function r(e){return null==e}e.exports.isNothing=r,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:r(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=Object(i.A)(t),a=r.type,u=r.example,s=r.properties,c=r.additionalProperties,l=r.items,f=n.includeReadOnly,p=n.includeWriteOnly;if(void 0!==u)return Object(i.e)(u,"$$ref",(function(e){return"string"==typeof e&&e.indexOf("#")>-1}));if(!a)if(s)a="object";else{if(!l)return;a="array"}if("object"===a){var d=Object(i.A)(s),v={};for(var m in d)d[m]&&d[m].deprecated||d[m]&&d[m].readOnly&&!f||d[m]&&d[m].writeOnly&&!p||(v[m]=e(d[m],n));if(!0===c)v.additionalProp1={};else if(c)for(var g=Object(i.A)(c),y=e(g,n),b=1;b<4;b++)v["additionalProp"+b]=y;return v}return"array"===a?o()(l.anyOf)?l.anyOf.map((function(t){return e(t,n)})):o()(l.oneOf)?l.oneOf.map((function(t){return e(t,n)})):[e(l,n)]:t.enum?t.default?t.default:Object(i.w)(t.enum)[0]:"file"!==a?h(t):void 0},v=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},m=function e(t){var n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=f()({},Object(i.A)(t)),s=u.type,c=u.properties,l=u.additionalProperties,p=u.items,d=u.example,v=a.includeReadOnly,m=a.includeWriteOnly,g=u.default,y={},b={},_=t.xml,x=_.name,w=_.prefix,E=_.namespace,S=u.enum;if(!s)if(c||l)s="object";else{if(!p)return;s="array"}if(n=(w?w+":":"")+(x=x||"notagname"),E){var C=w?"xmlns:"+w:"xmlns";b[C]=E}if("array"===s&&p){if(p.xml=p.xml||_||{},p.xml.name=p.xml.name||_.name,_.wrapped)return y[n]=[],o()(d)?d.forEach((function(t){p.example=t,y[n].push(e(p,a))})):o()(g)?g.forEach((function(t){p.default=t,y[n].push(e(p,a))})):y[n]=[e(p,a)],b&&y[n].push({_attr:b}),y;var A=[];return o()(d)?(d.forEach((function(t){p.example=t,A.push(e(p,a))})),A):o()(g)?(g.forEach((function(t){p.default=t,A.push(e(p,a))})),A):e(p,a)}if("object"===s){var O=Object(i.A)(c);for(var k in y[n]=[],d=d||{},O)if(O.hasOwnProperty(k)&&(!O[k].readOnly||v)&&(!O[k].writeOnly||m))if(O[k].xml=O[k].xml||{},O[k].xml.attribute){var j=o()(O[k].enum)&&O[k].enum[0],T=O[k].example,P=O[k].default;b[O[k].xml.name||k]=void 0!==T&&T||void 0!==d[k]&&d[k]||void 0!==P&&P||j||h(O[k])}else{O[k].xml.name=O[k].xml.name||k,void 0===O[k].example&&void 0!==d[k]&&(O[k].example=d[k]);var I=e(O[k]);o()(I)?y[n]=y[n].concat(I):y[n].push(I)}return!0===l?y[n].push({additionalProp:"Anything can be here"}):l&&y[n].push({additionalProp:h(l)}),b&&y[n].push({_attr:b}),y}return r=void 0!==d?d:void 0!==g?g:o()(S)?S[0]:h(t),y[n]=b?[{_attr:b},r]:r,y};function g(e,t){var n=m(e,t);if(n)return u()(n,{declaration:!0,indent:"\t"})}var y=c()(g),b=c()(d)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_CONFIGS",(function(){return i})),n.d(t,"TOGGLE_CONFIGS",(function(){return a})),n.d(t,"update",(function(){return u})),n.d(t,"toggle",(function(){return s})),n.d(t,"loaded",(function(){return c}));var r=n(3),o=n.n(r),i="configs_update",a="configs_toggle";function u(e,t){return{type:i,payload:o()({},e,t)}}function s(e){return{type:a,payload:e}}var c=function(){return function(){}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(2),o=n.n(r),i=o.a.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isOAS3;if(!o.a.Map.isMap(e))return{schema:o.a.Map(),parameterContentMediaType:null};if(!n)return"body"===e.get("in")?{schema:e.get("schema",o.a.Map()),parameterContentMediaType:null}:{schema:e.filter((function(e,t){return i.includes(t)})),parameterContentMediaType:null};if(e.get("content")){var r=e.get("content",o.a.Map({})).keySeq(),a=r.first();return{schema:e.getIn(["content",a,"schema"],o.a.Map()),parameterContentMediaType:a}}return{schema:e.get("schema",o.a.Map()),parameterContentMediaType:null}}},function(e,t,n){"use strict";n.r(t),n.d(t,"createStore",(function(){return C})),n.d(t,"combineReducers",(function(){return O})),n.d(t,"bindActionCreators",(function(){return j})),n.d(t,"applyMiddleware",(function(){return I})),n.d(t,"compose",(function(){return T}));var r=n(543),o="object"==typeof self&&self&&self.Object===Object&&self,i=(r.a||o||Function("return this")()).Symbol,a=Object.prototype,u=a.hasOwnProperty,s=a.toString,c=i?i.toStringTag:void 0;var l=function(e){var t=u.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=s.call(e);return r&&(t?e[c]=n:delete e[c]),o},f=Object.prototype.toString;var p=function(e){return f.call(e)},h=i?i.toStringTag:void 0;var d=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":h&&h in Object(e)?l(e):p(e)};var v=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var m=function(e){return null!=e&&"object"==typeof e},g=Function.prototype,y=Object.prototype,b=g.toString,_=y.hasOwnProperty,x=b.call(Object);var w=function(e){if(!m(e)||"[object Object]"!=d(e))return!1;var t=v(e);if(null===t)return!0;var n=_.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&b.call(n)==x},E=n(385),S="@@redux/INIT";function C(e,t,n){var r;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(C)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,i=t,a=[],u=a,s=!1;function c(){u===a&&(u=a.slice())}function l(){return i}function f(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),u.push(e),function(){if(t){t=!1,c();var n=u.indexOf(e);u.splice(n,1)}}}function p(e){if(!w(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,i=o(i,e)}finally{s=!1}for(var t=a=u,n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var r=!1,o={},u=0;u0&&(e.patches=[],e.callback&&e.callback(r)),r}function d(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var a=o._objectKeys(t),u=o._objectKeys(e),s=!1,c=u.length-1;c>=0;c--){var l=e[p=u[c]];if(!o.hasOwnProperty(t,p)||void 0===t[p]&&void 0!==l&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+o.escapePathComponent(p),value:o._deepClone(l)}),n.push({op:"remove",path:r+"/"+o.escapePathComponent(p)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}),!0);else{var f=t[p];"object"==typeof l&&null!=l&&"object"==typeof f&&null!=f?d(l,f,n,r+"/"+o.escapePathComponent(p),i):l!==f&&(!0,i&&n.push({op:"test",path:r+"/"+o.escapePathComponent(p),value:o._deepClone(l)}),n.push({op:"replace",path:r+"/"+o.escapePathComponent(p),value:o._deepClone(f)}))}}if(s||a.length!=u.length)for(c=0;c0?r:n)(e)}},function(e,t){e.exports={}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(42),o=n(411),i=n(255),a=n(253)("IE_PROTO"),u=function(){},s=function(){var e,t=n(257)("iframe"),r=i.length;for(t.style.display="none",n(412).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("