FIX_REMOVE_API

This commit is contained in:
VENKATESHWARAN 2026-04-15 18:13:15 +05:30
parent a0459a3fbb
commit 90660bf4f7

View File

@ -3308,10 +3308,26 @@ class EmployeeRestController extends AdminController
{
try {
$clientPolicy = $this->clientPolicyModel->where('id',$this->request->getGet('client_policy_id'))
->where('open_for_enrollment',1)->findAll();
$clientPolicy = $this->clientPolicyModel
->where('id', $this->request->getGet('client_policy_id'))
->findAll();
if (!count($clientPolicy ?? [])) {
return $this->respond([
'status' => 'failed',
'code' => 404,
'message' => 'Client policy not found',
'data' => []
], 200);
}
if(in_array($clientPolicy['policy_type_id'], [3,4,5,72])){
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($clientPolicy['base_policy'], $this->request->getGet('emp_code'));
}else{
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($this->request->getGet('client_policy_id'), $this->request->getGet('emp_code'));
}
if(count($clientPolicy))
if($openForEnrollment)
{
@ -3371,7 +3387,7 @@ class EmployeeRestController extends AdminController
return $this->respond(['status' => 'success','code' => 200,'data' =>[] ], 200);
}else{
return $this->respond(['status' => 'failed','code' => 404,'data' => [] ], 200);
return $this->respond(['status' => 'failed', 'message' => 'Enrollment closed for this policy','code' => 404,'data' => [] ], 200);
}