Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
9f35e20e2b
@ -17,6 +17,10 @@ class Acl
|
||||
'#^/swagger#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||
'#^/fedeploy#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||
'#^/visitOffBoardCheck#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||
'#^/logs#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||
'#^/util/log_list#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||
'#^/util/view_log#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||
'#^/util/download_log#' => ['roles' => [ADMIN_ROLE_ID]],
|
||||
|
||||
// ===================== PUBLIC DOWNLOADS / FORMS =====================
|
||||
'#^/download-#' => ['public' => true],
|
||||
|
||||
@ -5621,32 +5621,25 @@ class ClientController extends AdminController
|
||||
],
|
||||
|
||||
'type' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'rules' => 'required',
|
||||
'errors' => [
|
||||
'required' => 'Vehicle type is required'
|
||||
]
|
||||
],
|
||||
|
||||
'description' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'rules' => 'required',
|
||||
'errors' => [
|
||||
'required' => 'Vehicle description is required'
|
||||
]
|
||||
],
|
||||
'owner' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'rules' => 'required',
|
||||
'errors' => [
|
||||
'required' => 'Owner is required'
|
||||
]
|
||||
],
|
||||
|
||||
'old_onwer' => [
|
||||
'rules' => 'permit_empty|alpha_space',
|
||||
'errors' => [
|
||||
'alpha_space' => 'Old owner name can contain only letters and spaces'
|
||||
]
|
||||
],
|
||||
|
||||
];
|
||||
if (!$this->validate($rules)) {
|
||||
return $this->response->setStatusCode(400)->setJSON([
|
||||
|
||||
@ -4477,9 +4477,9 @@ class EmployeeController extends AdminController
|
||||
public function visitOffBoard(array $params)
|
||||
{
|
||||
// 1. Load credentials from .env
|
||||
$apiUrl = env('WELLNESS_ONBOARD_ENDPOINT_URL');
|
||||
$apiUrl = env('WELLNESS_ONBOARD_ENDPOINT_URL').'delete-policy-with-dependents';
|
||||
$apiToken = env('WELLNESS_ONBOARD_AUTHORIZATION');
|
||||
|
||||
// echo $apiUrl;die();
|
||||
// 2. Initialize the CI4 CURL service
|
||||
$client = \Config\Services::curlrequest([
|
||||
'base_uri' => $apiUrl,
|
||||
|
||||
@ -449,7 +449,7 @@ class MasterController extends AdminController
|
||||
$insert = $this->insurerBranchModel->insert($sanitized_post_data);
|
||||
|
||||
if($insert){
|
||||
for ($i = 0; $i < count($sanitized_post_data('name')); $i++) {
|
||||
for ($i = 0; $i < count($sanitized_post_data['name']); $i++) {
|
||||
// Prepare data to insert
|
||||
$sanitized_post_data_for_level = [
|
||||
'contact_type' => 'insurer',
|
||||
@ -465,7 +465,7 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
if($insert){
|
||||
$branchData = $this->insurerBranchModel->where('insurer_id', $sanitized_post_data_for_level['insurer_id'])->findAll();
|
||||
$branchData = $this->insurerBranchModel->where('insurer_id', $sanitized_post_data['insurer_id'])->findAll();
|
||||
echo json_encode(array("status" => true , 'data' => $branchData));
|
||||
}else{
|
||||
echo json_encode(array("status" => false));
|
||||
@ -2168,72 +2168,74 @@ class MasterController extends AdminController
|
||||
public function createCDMasterData()
|
||||
{
|
||||
$this->myLogger->logme("error", 'Create CD Master Data API called.');
|
||||
$rules = [
|
||||
|
||||
// ======================
|
||||
// Client / Insurer Mapping
|
||||
// ======================
|
||||
'client_id' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'errors' => [
|
||||
'required' => 'Client is required'
|
||||
]
|
||||
],
|
||||
|
||||
'insurer_id' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'errors' => [
|
||||
'required' => 'Insurer is required'
|
||||
]
|
||||
],
|
||||
|
||||
'insurer_branch_id' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'errors' => [
|
||||
'required' => 'Insurer branch is required'
|
||||
]
|
||||
],
|
||||
|
||||
// ======================
|
||||
// CD Account Details
|
||||
// ======================
|
||||
'opening_date' => [
|
||||
'rules' => 'required|valid_date[d-m-Y]',
|
||||
'errors' => [
|
||||
'required' => 'Opening date is required',
|
||||
'valid_date' => 'Opening date must be in DD-MM-YYYY format'
|
||||
]
|
||||
],
|
||||
|
||||
'cd_ac_no' => [
|
||||
'rules' => 'required|trim',
|
||||
'errors' => [
|
||||
'required' => 'CD account number is required'
|
||||
]
|
||||
],
|
||||
|
||||
'opening_bal' => [
|
||||
'rules' => 'required|numeric|greater_than_equal_to[0]',
|
||||
'errors' => [
|
||||
'required' => 'Opening amount is required',
|
||||
'numeric' => 'Opening amount must be numeric',
|
||||
'greater_than_equal_to' => 'Opening amount cannot be negative'
|
||||
]
|
||||
],
|
||||
];
|
||||
if (!$this->validate($rules)) {
|
||||
return $this->response->setStatusCode(400)->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Input validation failed',
|
||||
'code' => 400,
|
||||
'errors' => $this->validator->getErrors()
|
||||
]);
|
||||
}
|
||||
$data = $this->request->getPost();
|
||||
$sanitized_post_data = sanitizeInputArrayAdvanced($data);
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
if($id === null){
|
||||
$rules = [
|
||||
|
||||
// ======================
|
||||
// Client / Insurer Mapping
|
||||
// ======================
|
||||
'client_id' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'errors' => [
|
||||
'required' => 'Client is required'
|
||||
]
|
||||
],
|
||||
|
||||
'insurer_id' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'errors' => [
|
||||
'required' => 'Insurer is required'
|
||||
]
|
||||
],
|
||||
|
||||
'insurer_branch_id' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'errors' => [
|
||||
'required' => 'Insurer branch is required'
|
||||
]
|
||||
],
|
||||
|
||||
// ======================
|
||||
// CD Account Details
|
||||
// ======================
|
||||
'opening_date' => [
|
||||
'rules' => 'required|valid_date[d-m-Y]',
|
||||
'errors' => [
|
||||
'required' => 'Opening date is required',
|
||||
'valid_date' => 'Opening date must be in DD-MM-YYYY format'
|
||||
]
|
||||
],
|
||||
|
||||
'cd_ac_no' => [
|
||||
'rules' => 'required|trim',
|
||||
'errors' => [
|
||||
'required' => 'CD account number is required'
|
||||
]
|
||||
],
|
||||
|
||||
'opening_bal' => [
|
||||
'rules' => 'required|numeric|greater_than_equal_to[0]',
|
||||
'errors' => [
|
||||
'required' => 'Opening amount is required',
|
||||
'numeric' => 'Opening amount must be numeric',
|
||||
'greater_than_equal_to' => 'Opening amount cannot be negative'
|
||||
]
|
||||
],
|
||||
];
|
||||
if (!$this->validate($rules)) {
|
||||
return $this->response->setStatusCode(400)->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Input validation failed',
|
||||
'code' => 400,
|
||||
'errors' => $this->validator->getErrors()
|
||||
]);
|
||||
}
|
||||
}
|
||||
$this->myLogger->logme("error", 'Received POST data: ' . json_encode($data));
|
||||
|
||||
$id = $sanitized_post_data['PrimaryKey'] ?? null;
|
||||
$date = (string) ($sanitized_post_data['opening_date'] ?? '');
|
||||
$sanitized_post_data['opening_date'] = date('Y-m-d', strtotime($date));
|
||||
$this->myLogger->logme("error", 'Formatted opening_date: ' . $data['opening_date']);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user