CHANGE_GMC_TERMS_FAMILY_FLOATERS : AADHAVAN

This commit is contained in:
aadhavan valli 2024-03-25 17:22:46 +05:30
parent 602cceab7c
commit 55c16a422c
24 changed files with 1627 additions and 338 deletions

View File

@ -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");

View File

@ -933,23 +933,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"));
@ -996,7 +1058,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,
@ -1004,6 +1065,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) {

View File

@ -1,57 +0,0 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class EmployeeModel extends Model
{
protected $table = 'employees';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"client_id",
"employee_id",
"change_event",
"relationship_id",
"relationship",
"batch_id",
"emp_code",
"name",
"email_personal",
"email_corporate",
"mobile",
"gender",
"dob",
"otp",
"emp_status",
"created_by",
"updated_by",
"is_active",
];
public function getEmployeePolicy($id)
{
return $this->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();
}
}

View File

@ -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 <count($value) ; $i++) {
if ($data[0][$i] != $value[$i]) {
$check_miss_match[]=$data[0][$i];
}
}
if (count($check_miss_match) > 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 <count($dataToInsert) ; $a++)
{
$employee = $this->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 <count($dataToInsert) ; $a++)
{
$employee = $this->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'] . ",<br> We are glad to welcome you to the employee benefit program ," .$policy_name['name'] ."offered by your employer, <br><br><br> Click on the link below to review your personal and family details:<br><a href='https://venbait.in/nhance/app/dev'>Review Details</a>" ;
$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'] . ",<br> We are glad to welcome you to the employee benefit program ," .$policy_name['name'] ."offered by your employer, <br><br><br> Click on the link below to review your personal and family details:<br><a href='https://venbait.in/nhance/app/dev'>Review Details</a>" ;
$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);
}
}

View File

@ -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) {

View File

@ -0,0 +1,10 @@
<?php namespace App\Controllers;
use App\Controllers\BaseController;
class SwaggerController extends BaseController
{
public function index(){
return view('swagger/index');
}
}

View File

@ -18,7 +18,15 @@ class AuthJWT implements FilterInterface
{
public function before(RequestInterface $request, $arguments = null)
{
$jwt = $request->getHeader('Authorization');
$jwt ='';
if($request->headers()['Auth']){
$jwt = $request->headers()['Auth'];
}else{
$jwt = $request->getHeader('Authorization');
}
if ($jwt) {
if (JWTToken::validateJWT($jwt)) {

View File

@ -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;
}

View File

@ -109,20 +109,35 @@
</div>
<div class="col-md-6">
</div>
<div class="col-md-6">
<div>
<input type="checkbox" name="family_floaters[]" value="self" id="self" checked disabled> Self
<input type="checkbox" name="family_floaters[]" value="spouse" id="spouse"> Spouse
<input type="checkbox" name="family_floaters[]" value="child1" id="child1"> Child 1
<input type="checkbox" name="family_floaters[]" value="child2" id="child2"> Child 2
<input type="checkbox" name="family_floaters[]" value="child3" id="child3"> Child 3
<input type="checkbox" name="family_floaters[]" value="child4" id="child4"> Child 4
<div class="col-md-6" style="margin-bottom:10px">
<div style="margin-top:10px">
<span style="margin-right: 20px;">Self:</span>
<input type="checkbox" style="margin-right: 70px;" name="family_floaters[]" value="self" id="self" checked>
<span style="margin-right: 20px;">Spouse:</span>
<input type="checkbox" style="margin-right: 70px;"name="family_floaters[]" value="spouse" id="spouse">
</div>
<div style="margin-top:10px">
<input type="checkbox" name="family_floaters[]" value="parent1" id="parent1"> Parent 1
<input type="checkbox" name="family_floaters[]" value="parent2" id="parent2"> Parent 2
<input type="checkbox" name="family_floaters[]" value="parent_in_law1" id="parent_in_law1"> Parent-In-Law 1
<input type="checkbox" name="family_floaters[]" value="parent_in_law2" id="parent_in_law2"> Parent-In-Law 2
<span for="children">Children:</span>
<select name="family_floaters[]" id="children" style="margin-left: 109px;">
<option value="0">None</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<div style="margin-top:10px">
<span for="family_floaters">Select Other Members:</span>
<select name="family_floaters[]" id="family_floaters" style="margin-left: 10px;">
<option value="0">None</option>
<option value="1P">Only one parent (Either Father / Mother)</option>
<option value="2P">Only two parents (Father+Mother)</option>
<option value="1PIL">Only one parent in law (Either MIL / FIL)</option>
<option value="2PIL">Only two parents in law (FIL + MIL)</option>
<option value="2EPORPIL">Parents or PIL (Any two of Father, Mother, MIl, FIL)</option>
<option value="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option>
<option value="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
</select>
</div>
</div>
</div>
@ -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');
}
}
}

View File

@ -0,0 +1,60 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="<?= base_url('assets/swagger/swagger-ui.css') ?>">
<link rel="icon" type="image/png" href="<?= base_url('assets/swagger/favicon-32x32.png') ?> sizes=" 32x32" />
<link rel="icon" type="image/png" href="<?= base_url('assets/swagger/favicon-16x16.png') ?> sizes=" 16x16" />
<style>
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
margin: 0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="<?= base_url('assets/swagger/swagger-ui-bundle.js') ?>">console.log(base_url); </script>
<script src="<?= base_url('assets/swagger/swagger-ui-standalone-preset.js') ?>"> </script>
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "<?= base_url('assets/api.yaml') ?>",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
// End Swagger UI call region
window.ui = ui
}
</script>
</body>
</html>

View File

@ -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",

890
public/assets/api.yaml Normal file
View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

View File

@ -0,0 +1,60 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after
{
box-sizing: inherit;
}
body
{
margin:0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js"> </script>
<script src="./swagger-ui-standalone-preset.js"> </script>
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
// End Swagger UI call region
window.ui = ui
}
</script>
</body>
</html>

View File

@ -0,0 +1,68 @@
<!doctype html>
<html lang="en-US">
<title>Swagger UI: OAuth2 Redirect</title>
<body onload="run()">
</body>
</html>
<script>
'use strict';
function run () {
var oauth2 = window.opener.swaggerUIRedirectOauth2;
var sentState = oauth2.state;
var redirectUrl = oauth2.redirectUrl;
var isValid, qp, arr;
if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1);
} else {
qp = location.search.substring(1);
}
arr = qp.split("&")
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
qp = qp ? JSON.parse('{' + arr.join() + '}',
function (key, value) {
return key === "" ? value : decodeURIComponent(value)
}
) : {}
isValid = qp.state === sentState
if ((
oauth2.auth.schema.get("flow") === "accessCode"||
oauth2.auth.schema.get("flow") === "authorizationCode"
) && !oauth2.auth.code) {
if (!isValid) {
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
});
}
if (qp.code) {
delete oauth2.state;
oauth2.auth.code = qp.code;
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
} else {
let oauthErrorMsg
if (qp.error) {
oauthErrorMsg = "["+qp.error+"]: " +
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
(qp.error_uri ? "More info: "+qp.error_uri : "");
}
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
});
}
} else {
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
}
window.close();
}
</script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long