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')
|
public function generateAuthToken($scope = 'esbhealth')
|
||||||
{
|
{
|
||||||
helper('api');
|
helper('api');
|
||||||
$url = 'https://ilesbapigee.insurancearticlez.com/generate-jwt-token';
|
$url = env('ICICI_TOKEN_URL');
|
||||||
$method = 'POST';
|
$method = 'POST';
|
||||||
$headers = [
|
$headers = [
|
||||||
'Content-Type: application/x-www-form-urlencoded'
|
'Content-Type: application/x-www-form-urlencoded'
|
||||||
];
|
];
|
||||||
$body = [
|
$body = [
|
||||||
'grant_type' => 'password',
|
'grant_type' => env('ICICI_GRANT_TYPE'),
|
||||||
'username' => 'Nhanceins',
|
'username' => env('ICICI_USER_NAME'),
|
||||||
'password' => 'SSWW7bFNaLxxQyw',
|
'password' => env('ICICI_PASSWORD'),
|
||||||
'scope' => $scope,
|
'scope' => env('ICICI_API_SCOPE'),
|
||||||
'client_id' => 'Nhanceins',
|
'client_id' => env('ICICI_CLIENT_ID'),
|
||||||
'client_secret' => 'P4W0G6TAYMa0MV8bbVSx4pTAqbCcUIg48kCWa6PJykAhGWzPmpPr0iLuNWtz5wqN'
|
'client_secret' => env('ICICI_CLIENT_SECRET')
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = call_third_party_api($url, $method, $headers, $body);
|
$response = call_third_party_api($url, $method, $headers, $body);
|
||||||
@ -42,8 +42,6 @@ class ICICILombardController extends AdminController
|
|||||||
|
|
||||||
public function createEnrollmentBatch()
|
public function createEnrollmentBatch()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$client_id = $this->request->getGet('client_id');
|
$client_id = $this->request->getGet('client_id');
|
||||||
$client_branch_id = $this->request->getGet('client_branch_id');
|
$client_branch_id = $this->request->getGet('client_branch_id');
|
||||||
$policy_id = $this->request->getGet('policy_id');
|
$policy_id = $this->request->getGet('policy_id');
|
||||||
@ -61,7 +59,7 @@ class ICICILombardController extends AdminController
|
|||||||
$token = $tokenResponse['data']['access_token'];
|
$token = $tokenResponse['data']['access_token'];
|
||||||
|
|
||||||
|
|
||||||
$url = 'https://ilesbapigee.insurancearticlez.com/health/ilservices/health/v1/enrollment/batchcreation';
|
$url = env('ICICI_BASE_URL').'/batchcreation';
|
||||||
$headers = [
|
$headers = [
|
||||||
'Authorization: Bearer ' . $token,
|
'Authorization: Bearer ' . $token,
|
||||||
'Content-Type: application/json',
|
'Content-Type: application/json',
|
||||||
@ -71,7 +69,7 @@ class ICICILombardController extends AdminController
|
|||||||
//Prepare body data
|
//Prepare body data
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
$data = $db->table('employee_polices ep')
|
$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.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
|
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();
|
->getResultArray();
|
||||||
|
|
||||||
$body = $this->formatPolicyData($data);
|
$body = $this->formatPolicyData($data);
|
||||||
dd($body);
|
// dd($body);
|
||||||
|
|
||||||
$response = call_third_party_api($url, 'POST', $headers, $body, true); // true = raw body mode
|
$response = call_third_party_api($url, 'POST', $headers, $body, true); // true = raw body mode
|
||||||
// print_rr(json_encode($response));die();
|
// print_rr(json_encode($response));die();
|
||||||
@ -108,7 +106,7 @@ class ICICILombardController extends AdminController
|
|||||||
$token = $tokenResponse['data']['access_token'];
|
$token = $tokenResponse['data']['access_token'];
|
||||||
|
|
||||||
|
|
||||||
$url = 'https://ilesbapigee.insurancearticlez.com/health/ilservices/health/v1/enrollment/batchstatus';
|
$url = env('ICICI_BASE_URL').'/batchstatus';
|
||||||
$headers = [
|
$headers = [
|
||||||
'Authorization: Bearer ' . $token,
|
'Authorization: Bearer ' . $token,
|
||||||
'Content-Type: application/json'
|
'Content-Type: application/json'
|
||||||
@ -144,7 +142,7 @@ class ICICILombardController extends AdminController
|
|||||||
|
|
||||||
// print_rr($token);
|
// print_rr($token);
|
||||||
|
|
||||||
$url = 'https://ilesbapigee.insurancearticlez.com/health/ilservices/health/v1/enrollment/fetchuhid';
|
$url = env('ICICI_BASE_URL').'/fetchuhid';
|
||||||
$headers = [
|
$headers = [
|
||||||
'Authorization: Bearer ' . $token,
|
'Authorization: Bearer ' . $token,
|
||||||
'Content-Type: application/json'
|
'Content-Type: application/json'
|
||||||
@ -161,7 +159,6 @@ class ICICILombardController extends AdminController
|
|||||||
return $this->response->setJSON($response);
|
return $this->response->setJSON($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function formatPolicyData($data)
|
public function formatPolicyData($data)
|
||||||
{
|
{
|
||||||
// Helper to format date
|
// Helper to format date
|
||||||
@ -203,7 +200,7 @@ class ICICILombardController extends AdminController
|
|||||||
// Final body
|
// Final body
|
||||||
return [
|
return [
|
||||||
"PolicyNumber" => $data[0]['policyNumber'] ?? null,
|
"PolicyNumber" => $data[0]['policyNumber'] ?? null,
|
||||||
"CDBGAccountNumber" => "CD-MUM-0026",
|
"CDBGAccountNumber" => $data[0]['CDBGAccountNumber'] ?? null , // "CD-MUM-0026",
|
||||||
"CorrelationId" => $generateUUID(),
|
"CorrelationId" => $generateUUID(),
|
||||||
"MemberDetails" => $memberDetails
|
"MemberDetails" => $memberDetails
|
||||||
];
|
];
|
||||||
|
|||||||
@ -198,7 +198,7 @@ class VidalApiController extends BaseController
|
|||||||
|
|
||||||
helper('api');
|
helper('api');
|
||||||
|
|
||||||
$url = ''. getenv('VIDAL_API_BASE_URL').'/enrollmendataservice';
|
$url = getenv('VIDAL_API_BASE_URL').'/enrollmendataservice';
|
||||||
$method = 'POST';
|
$method = 'POST';
|
||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
|
|||||||
@ -920,7 +920,8 @@ table.dataTable tbody td {
|
|||||||
enableFiltering: false,
|
enableFiltering: false,
|
||||||
enableCaseInsensitiveFiltering: false,
|
enableCaseInsensitiveFiltering: false,
|
||||||
includeSelectAllOption : false,
|
includeSelectAllOption : false,
|
||||||
buttonWidth:'100%'
|
buttonWidth:'100%',
|
||||||
|
dropUp: true
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.close').click(function(){
|
$('.close').click(function(){
|
||||||
|
|||||||
@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="policy_no">Policy No<span class="text-danger">*</span></label>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1832,24 +1832,27 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#policy_no').change(function(){
|
//check dublicate policy number
|
||||||
|
function checkPolicyNo() {
|
||||||
|
|
||||||
var policy_no = $(this).val();
|
var policy_no = $('#policy_no').val();
|
||||||
console.log(policy_no + '-' + policy_no.length);
|
console.log(policy_no + '-' + policy_no.length);
|
||||||
policy_no = policy_no.trim();
|
policy_no = policy_no.trim();
|
||||||
console.log(policy_no + '-' + policy_no.length);
|
console.log(policy_no + '-' + policy_no.length);
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.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",
|
type: "GET",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
|
console.log(res);
|
||||||
console.log(res)
|
|
||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
|
|
||||||
toastr.warning(res.message, 'warning');
|
toastr.warning(res.message, 'warning');
|
||||||
$('#policy_no').val('');
|
$('#policy_no').val('');
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
@ -1857,8 +1860,7 @@
|
|||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
})
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
// Check if the URL contains a hash
|
// Check if the URL contains a hash
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user