Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
49e61063f4
@ -12,18 +12,18 @@ class ICICILombardController extends AdminController
|
||||
public function generateAuthToken($scope = 'esbhealth')
|
||||
{
|
||||
helper('api');
|
||||
$url = 'https://ilesbapigee.insurancearticlez.com/generate-jwt-token';
|
||||
$url = env('ICICI_TOKEN_URL');
|
||||
$method = 'POST';
|
||||
$headers = [
|
||||
'Content-Type: application/x-www-form-urlencoded'
|
||||
];
|
||||
$body = [
|
||||
'grant_type' => 'password',
|
||||
'username' => 'Nhanceins',
|
||||
'password' => 'SSWW7bFNaLxxQyw',
|
||||
'scope' => $scope,
|
||||
'client_id' => 'Nhanceins',
|
||||
'client_secret' => 'P4W0G6TAYMa0MV8bbVSx4pTAqbCcUIg48kCWa6PJykAhGWzPmpPr0iLuNWtz5wqN'
|
||||
'grant_type' => env('ICICI_GRANT_TYPE'),
|
||||
'username' => env('ICICI_USER_NAME'),
|
||||
'password' => env('ICICI_PASSWORD'),
|
||||
'scope' => env('ICICI_API_SCOPE'),
|
||||
'client_id' => env('ICICI_CLIENT_ID'),
|
||||
'client_secret' => env('ICICI_CLIENT_SECRET')
|
||||
];
|
||||
|
||||
$response = call_third_party_api($url, $method, $headers, $body);
|
||||
@ -42,8 +42,6 @@ class ICICILombardController extends AdminController
|
||||
|
||||
public function createEnrollmentBatch()
|
||||
{
|
||||
|
||||
|
||||
$client_id = $this->request->getGet('client_id');
|
||||
$client_branch_id = $this->request->getGet('client_branch_id');
|
||||
$policy_id = $this->request->getGet('policy_id');
|
||||
@ -61,7 +59,7 @@ class ICICILombardController extends AdminController
|
||||
$token = $tokenResponse['data']['access_token'];
|
||||
|
||||
|
||||
$url = 'https://ilesbapigee.insurancearticlez.com/health/ilservices/health/v1/enrollment/batchcreation';
|
||||
$url = env('ICICI_BASE_URL').'/batchcreation';
|
||||
$headers = [
|
||||
'Authorization: Bearer ' . $token,
|
||||
'Content-Type: application/json',
|
||||
@ -71,7 +69,7 @@ class ICICILombardController extends AdminController
|
||||
//Prepare body data
|
||||
$db = \Config\Database::connect();
|
||||
$data = $db->table('employee_polices ep')
|
||||
->select('cp.policy_no as policyNumber,
|
||||
->select('cp.policy_no as policyNumber, cp.cd_ac_no as CDBGAccountNumber,
|
||||
e.id,e.emp_code as MemberEmpId, e.doj as DOJ, e.name as InsuredName, e.dob as DOB, e.relationship as Relationship,
|
||||
e.gender as Gender, ep.date_coverage as DOC,ep.basic_cover_si as SumInsured, e.email_corporate as EmailId
|
||||
')
|
||||
@ -85,7 +83,7 @@ class ICICILombardController extends AdminController
|
||||
->getResultArray();
|
||||
|
||||
$body = $this->formatPolicyData($data);
|
||||
dd($body);
|
||||
// dd($body);
|
||||
|
||||
$response = call_third_party_api($url, 'POST', $headers, $body, true); // true = raw body mode
|
||||
// print_rr(json_encode($response));die();
|
||||
@ -108,7 +106,7 @@ class ICICILombardController extends AdminController
|
||||
$token = $tokenResponse['data']['access_token'];
|
||||
|
||||
|
||||
$url = 'https://ilesbapigee.insurancearticlez.com/health/ilservices/health/v1/enrollment/batchstatus';
|
||||
$url = env('ICICI_BASE_URL').'/batchstatus';
|
||||
$headers = [
|
||||
'Authorization: Bearer ' . $token,
|
||||
'Content-Type: application/json'
|
||||
@ -144,7 +142,7 @@ class ICICILombardController extends AdminController
|
||||
|
||||
// print_rr($token);
|
||||
|
||||
$url = 'https://ilesbapigee.insurancearticlez.com/health/ilservices/health/v1/enrollment/fetchuhid';
|
||||
$url = env('ICICI_BASE_URL').'/fetchuhid';
|
||||
$headers = [
|
||||
'Authorization: Bearer ' . $token,
|
||||
'Content-Type: application/json'
|
||||
@ -161,7 +159,6 @@ class ICICILombardController extends AdminController
|
||||
return $this->response->setJSON($response);
|
||||
}
|
||||
|
||||
|
||||
public function formatPolicyData($data)
|
||||
{
|
||||
// Helper to format date
|
||||
@ -203,7 +200,7 @@ class ICICILombardController extends AdminController
|
||||
// Final body
|
||||
return [
|
||||
"PolicyNumber" => $data[0]['policyNumber'] ?? null,
|
||||
"CDBGAccountNumber" => "CD-MUM-0026",
|
||||
"CDBGAccountNumber" => $data[0]['CDBGAccountNumber'] ?? null , // "CD-MUM-0026",
|
||||
"CorrelationId" => $generateUUID(),
|
||||
"MemberDetails" => $memberDetails
|
||||
];
|
||||
|
||||
@ -198,7 +198,7 @@ class VidalApiController extends BaseController
|
||||
|
||||
helper('api');
|
||||
|
||||
$url = ''. getenv('VIDAL_API_BASE_URL').'/enrollmendataservice';
|
||||
$url = getenv('VIDAL_API_BASE_URL').'/enrollmendataservice';
|
||||
$method = 'POST';
|
||||
|
||||
$headers = [
|
||||
|
||||
@ -920,7 +920,8 @@ table.dataTable tbody td {
|
||||
enableFiltering: false,
|
||||
enableCaseInsensitiveFiltering: false,
|
||||
includeSelectAllOption : false,
|
||||
buttonWidth:'100%'
|
||||
buttonWidth:'100%',
|
||||
dropUp: true
|
||||
});
|
||||
|
||||
$('.close').click(function(){
|
||||
|
||||
@ -129,7 +129,7 @@
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="policy_no">Policy No<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Policy Number " name="policy_no" id="policy_no" required>
|
||||
<input value="" type="text" class="form-control" oninput="checkPolicyNo(this)" placeholder="Enter Policy Number" name="policy_no" id="policy_no" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1832,33 +1832,35 @@
|
||||
|
||||
}
|
||||
|
||||
$('#policy_no').change(function(){
|
||||
//check dublicate policy number
|
||||
function checkPolicyNo() {
|
||||
|
||||
var policy_no = $(this).val();
|
||||
console.log(policy_no +'-'+policy_no.length);
|
||||
var policy_no = $('#policy_no').val();
|
||||
console.log(policy_no + '-' + policy_no.length);
|
||||
policy_no = policy_no.trim();
|
||||
console.log(policy_no +'-'+policy_no.length);
|
||||
|
||||
console.log(policy_no + '-' + policy_no.length);
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/check_policy_no/');?>'+policy_no,
|
||||
url: '<?php echo base_url('util/check_policy_no/');?>' + policy_no,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
if (res.status == true) {
|
||||
|
||||
console.log(res)
|
||||
if(res.status == true){
|
||||
toastr.warning(res.message, 'warning');
|
||||
$('#policy_no').val('');
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// Check if the URL contains a hash
|
||||
|
||||
Loading…
Reference in New Issue
Block a user