From 3b5e726fb6a5390a84d890257fb8bd32f7cfe98c Mon Sep 17 00:00:00 2001 From: Venba Date: Sat, 30 Mar 2024 11:45:28 +0000 Subject: [PATCH 1/4] CHANGE_CICD_DOCKER_IMG --- bitbucket-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index e905c2b3..d6dc568c 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -3,7 +3,7 @@ # This template allows you to validate your PHP application. # The workflow allows running tests and code linting on the default branch. -image: composer:2.0 +image: php:8.2-cli pipelines: From 0a2e97f2a5a55c77323a33a7b3630d375c4f9423 Mon Sep 17 00:00:00 2001 From: Venba Date: Sat, 30 Mar 2024 12:34:53 +0000 Subject: [PATCH 2/4] CHANGE_CICD_SCRIPT1 --- bitbucket-pipelines.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d6dc568c..d922751c 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -10,10 +10,18 @@ pipelines: default: - parallel: - step: - name: Test + name: Initialize Git FTP + script: + - apt-get update + - apt-get -qq install git-ftp + - git ftp init -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL + caches: + - composer + - step: + name: Deploy using Git FTP script: - apt-get update - apt-get -qq install git-ftp - git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL caches: - - composer \ No newline at end of file + - composer From 47659c4fa6aaf1977a8cc28912d863a53a7e4db0 Mon Sep 17 00:00:00 2001 From: Venba Date: Sat, 30 Mar 2024 12:39:22 +0000 Subject: [PATCH 3/4] CHANGE_CICD_SCRIPT2 --- bitbucket-pipelines.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d922751c..321823d4 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -8,20 +8,12 @@ image: php:8.2-cli pipelines: default: - - parallel: - - step: - name: Initialize Git FTP - script: - - apt-get update - - apt-get -qq install git-ftp - - git ftp init -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL - caches: - - composer - - step: - name: Deploy using Git FTP - script: - - apt-get update - - apt-get -qq install git-ftp - - git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL - caches: - - composer + - step: + name: Initialize and Deploy using Git FTP + script: + - apt-get update + - apt-get -qq install git-ftp + - git ftp init -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL + - git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL + caches: + - composer From cf3547333d9b8c46ee8df413db5fbf4bf1432deb Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Sat, 30 Mar 2024 18:18:39 +0530 Subject: [PATCH 4/4] FIX_CLIENT_POLICY_NAME_ADD_POLICY_TYPE_NAME : AADHAVAN --- app/Controllers/EmployeeRestController.php | 32 ++++++++++++---------- app/Models/ClientPolicyModel.php | 7 ++++- app/Views/client_basic_info.php | 6 ++-- app/Views/client_policy.php | 7 +++-- public/assets/api.yaml | 3 -- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 973a5d3c..70abe646 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -497,11 +497,13 @@ class EmployeeRestController extends AdminController 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'); - $employee_id = $this->request->getPost('employee_id'); - // $policy_id = $this->request->getJSON('policy_id'); + $token = $this->request->headers()['Auth']->getValue(); + $decodedPayload = json_decode(base64_decode(explode('.', $token)[1]), true); + + // get the employee id from token + $employee_id = $decodedPayload['id']; $client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->first(); @@ -586,18 +588,18 @@ class EmployeeRestController extends AdminController } $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], 200); - } - } + // 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], 200); + // } + // } foreach ($extra['0'] as $index => $id) { $relation =''; if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') { diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index 2ebafcc9..01bc2a2c 100644 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -61,12 +61,14 @@ class ClientPolicyModel extends Model } public function getClientPolicyByClientId($client_id){ + return $this->db->table('client_policy') ->select('client_policy.*') ->select('insurers.name as insurer_name, insurers.short_name as insurer_short') ->select('tpa.name as tpa_name, tpa.short_name as tpa_short') - ->select('policies.name as policy_name') + ->select('policies.name as policy_name, policies.policy_type_id') + ->select('policy_type.policy_type as policy_type_name') ->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code') ->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code') ->join('insurers', 'insurers.id = client_policy.insurer_id') @@ -74,10 +76,13 @@ class ClientPolicyModel extends Model ->join('tpa', 'tpa.id = client_policy.tpa_id') ->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id') ->join('policies', 'policies.id = client_policy.policy_id') + ->join('policy_type', 'policy_type.id = policies.policy_type_id') ->where('client_policy.client_id', $client_id) ->get() ->getResult(); + + } public function getPolicyPremium($policy_id){ diff --git a/app/Views/client_basic_info.php b/app/Views/client_basic_info.php index 9d562f2b..3f08c20a 100644 --- a/app/Views/client_basic_info.php +++ b/app/Views/client_basic_info.php @@ -105,13 +105,11 @@ input:checked + .slider:before {
- +
- +
diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index 9018586c..a4e893ab 100644 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -194,12 +194,15 @@ if (policy_PrimaryKey !== '') { var policyTable = ''; var data = ; - data.forEach(function(item) { + // console.log("----------------------------"); + + // console.log(item); + policyTable += ` ${item.insurer_short} - ${item.insurer_branch_name} - ${item.policy_name} + ${item.policy_name} (${item.policy_type_name}) ${item.tpa_short} - ${item.tpa_branch_code} ${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)} ${checkDateStatus(item.policy_end_date, 1)} diff --git a/public/assets/api.yaml b/public/assets/api.yaml index 4d3e8f7e..d8159bab 100644 --- a/public/assets/api.yaml +++ b/public/assets/api.yaml @@ -175,9 +175,6 @@ paths: policy_id: type: integer description: policy_id - employee_id: - type: integer - description: employee_id file: type: string format: binary