FEAT_HR_TPA_DASHBOARD
This commit is contained in:
parent
2df39c114f
commit
cfddad8485
@ -29,6 +29,7 @@ class Acl
|
|||||||
'#^/util/view_log#' => ['roles' => [ADMIN_ROLE_ID]],
|
'#^/util/view_log#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||||
'#^/util/download_log#' => ['roles' => [ADMIN_ROLE_ID]],
|
'#^/util/download_log#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||||
'#^/metaDashboardDemo#' => ['roles' => [ADMIN_ROLE_ID, HEAD_ROLE_ID]],
|
'#^/metaDashboardDemo#' => ['roles' => [ADMIN_ROLE_ID, HEAD_ROLE_ID]],
|
||||||
|
'#^/metaTpaDashboardDemo#' => ['roles' => [ADMIN_ROLE_ID, HEAD_ROLE_ID]],
|
||||||
|
|
||||||
// ===================== PUBLIC DOWNLOADS / FORMS =====================
|
// ===================== PUBLIC DOWNLOADS / FORMS =====================
|
||||||
'#^/download-#' => ['public' => true],
|
'#^/download-#' => ['public' => true],
|
||||||
|
|||||||
@ -32,6 +32,7 @@ $routes->get('/fedeploy', 'DeployController::fedeploy_view', ['filter' => 'authM
|
|||||||
$routes->post('/fedeploy', 'DeployController::fedeploy', ['filter' => 'authMVC']);
|
$routes->post('/fedeploy', 'DeployController::fedeploy', ['filter' => 'authMVC']);
|
||||||
$routes->get('/visitOffBoardCheck', 'EmployeeController::visitOffBoardCheck');
|
$routes->get('/visitOffBoardCheck', 'EmployeeController::visitOffBoardCheck');
|
||||||
$routes->get('/metaDashboardDemo', 'TestingController::metaDashboardDemo');
|
$routes->get('/metaDashboardDemo', 'TestingController::metaDashboardDemo');
|
||||||
|
$routes->get('/metaTpaDashboardDemo', 'TestingController::metaTpaDashboardDemo');
|
||||||
|
|
||||||
// Reminder Mail Notification
|
// Reminder Mail Notification
|
||||||
|
|
||||||
@ -670,6 +671,7 @@ $routes->group("employeeRest", ["filter" => ['GlobalPostFileUploadGuard', 'ratel
|
|||||||
$routes->post("hrFileUpload", "EmployeeRestController::hrFileUpload");
|
$routes->post("hrFileUpload", "EmployeeRestController::hrFileUpload");
|
||||||
$routes->post("updateHrFileUploadData", "EmployeeRestController::updateHrFileUploadData");
|
$routes->post("updateHrFileUploadData", "EmployeeRestController::updateHrFileUploadData");
|
||||||
$routes->post("getHrDashboad", "EmployeeRestController::getHrDashboad");
|
$routes->post("getHrDashboad", "EmployeeRestController::getHrDashboad");
|
||||||
|
$routes->post("getHrTpaDashboard", "EmployeeRestController::getHrTpaDashboard");
|
||||||
|
|
||||||
|
|
||||||
//thz_master's
|
//thz_master's
|
||||||
|
|||||||
@ -5534,6 +5534,49 @@ class EmployeeRestController extends AdminController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getHrTpaDashboard()
|
||||||
|
{
|
||||||
|
$METABASE_SECRET_KEY = getenv('METABASE_SECRET_KEY');
|
||||||
|
$received_data = $this->request->getJSON(true) ?? null;
|
||||||
|
|
||||||
|
$policy_id = $received_data['client_policy_id'] ?? 4687;
|
||||||
|
|
||||||
|
$client_policy_data = $this->clientPolicyModel
|
||||||
|
->select('tpa.dashboard_id')
|
||||||
|
->join('tpa', 'client_policy.tpa_id = tpa.id')
|
||||||
|
->where('client_policy.id', $policy_id)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$database_id = isset($client_policy_data['dashboard_id']) ? (int) $client_policy_data['dashboard_id'] : null;
|
||||||
|
|
||||||
|
if (empty($database_id)) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'failed',
|
||||||
|
'message' => 'There is no dashboard for this TPA.',
|
||||||
|
'data' => []
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$payload = [
|
||||||
|
'resource' => [
|
||||||
|
'dashboard' => $database_id
|
||||||
|
],
|
||||||
|
'exp' => time() + (10 * 60), // 10 minutes
|
||||||
|
'params' => (object)[]
|
||||||
|
];
|
||||||
|
|
||||||
|
$token = JWT::encode($payload, $METABASE_SECRET_KEY, 'HS256');
|
||||||
|
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Form data received successfully!',
|
||||||
|
'data' => [
|
||||||
|
'metabaseToken' => $token,
|
||||||
|
'metabaseUrl' => 'https://nsights.nhanceindia.in'
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// get policy files
|
// get policy files
|
||||||
public function getPolicyAndEndorsementFiles()
|
public function getPolicyAndEndorsementFiles()
|
||||||
|
|||||||
@ -4,6 +4,7 @@ namespace App\Controllers;
|
|||||||
|
|
||||||
use App\Controllers\BaseController;
|
use App\Controllers\BaseController;
|
||||||
use App\Models\EmployeePolicyModel;
|
use App\Models\EmployeePolicyModel;
|
||||||
|
use App\Models\ClientPolicyModel;
|
||||||
use App\Models\InsurerBranchModel;
|
use App\Models\InsurerBranchModel;
|
||||||
use App\Models\RFQModel;
|
use App\Models\RFQModel;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -23,10 +24,12 @@ class TestingController extends BaseController
|
|||||||
{
|
{
|
||||||
use ResponseTrait;
|
use ResponseTrait;
|
||||||
protected $myLogger;
|
protected $myLogger;
|
||||||
|
protected $ClientPolicyModel;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->myLogger = \Config\Services::mylogger();
|
$this->myLogger = \Config\Services::mylogger();
|
||||||
|
$this->ClientPolicyModel = new ClientPolicyModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveForm()
|
public function saveForm()
|
||||||
@ -1060,4 +1063,59 @@ class TestingController extends BaseController
|
|||||||
return $this->respond(['status' => 'failed', 'code' => '500' , 'message' => 'Error: ' . $e->getMessage()], 200);
|
return $this->respond(['status' => 'failed', 'code' => '500' , 'message' => 'Error: ' . $e->getMessage()], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function metaTpaDashboardDemo()
|
||||||
|
{
|
||||||
|
$METABASE_SECRET_KEY = getenv('METABASE_SECRET_KEY');
|
||||||
|
$policy_id = $this->request->getGet('client_policy') ?? 4687;
|
||||||
|
|
||||||
|
$client_policy_data = $this->ClientPolicyModel
|
||||||
|
->select('tpa.dashboard_id')
|
||||||
|
->join('tpa', 'client_policy.tpa_id = tpa.id')
|
||||||
|
->where('client_policy.id', $policy_id)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$database_id = isset($client_policy_data['dashboard_id']) ? (int) $client_policy_data['dashboard_id'] : null;
|
||||||
|
|
||||||
|
if (empty($database_id)) {
|
||||||
|
|
||||||
|
if ($this->request->getGet('api') == 1) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'failed',
|
||||||
|
'message' => 'There is no dashboard for this TPA.',
|
||||||
|
'data' => []
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('errors/404', [
|
||||||
|
'message' => 'There is no dashboard for this TPA.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$payload = [
|
||||||
|
'resource' => [
|
||||||
|
'dashboard' => $database_id
|
||||||
|
],
|
||||||
|
'exp' => time() + (10 * 60), // 10 minutes
|
||||||
|
'params' => (object)[]
|
||||||
|
];
|
||||||
|
|
||||||
|
$token = JWT::encode($payload, $METABASE_SECRET_KEY, 'HS256');
|
||||||
|
|
||||||
|
if ($this->request->getGet('api') == 1) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Form data received successfully!',
|
||||||
|
'data' => [
|
||||||
|
'metabaseToken' => $token,
|
||||||
|
'metabaseUrl' => 'https://nsights.nhanceindia.in'
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('meta_dashboard_demo_one', [
|
||||||
|
'metabaseToken' => $token,
|
||||||
|
'metabaseUrl' => 'https://nsights.nhanceindia.in',
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,5 +19,6 @@ class TPAModel extends Model
|
|||||||
"created_by",
|
"created_by",
|
||||||
"updated_by",
|
"updated_by",
|
||||||
"is_active",
|
"is_active",
|
||||||
|
"dashboard_id",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user