Merge : GWM

This commit is contained in:
Gowtham M 2025-09-27 11:30:52 +05:30
parent 63a58621a7
commit e062057d9f
2 changed files with 14 additions and 17 deletions

View File

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

View File

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