From beea16eac9187fd219bd1ad6b78e62f2190404db Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 6 Aug 2024 04:47:03 -0400 Subject: [PATCH] employer page --- app/Config/Routes.php | 7 +++- app/Controllers/Users.php | 71 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 5612b35..de36997 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -50,7 +50,12 @@ $routes->get('/digibko/v1/dashboard/bvn/recent', 'DigiFiAuth::startBkoToken'); $routes->post('/digiusers/v1/bvn', 'DigiFiBVN::startBVNVerify'); $routes->post('/digiusers/v1/bvn/verify', 'DigiFiBVN::completeBVNVerify'); -$routes->get('/digiusers/v1/dash', 'Users::userDash'); +$routes->get('/digiusers/v1/dash', 'Users::userDash'); + +$routes->get('/digiusers/v1/das/profile', 'Users::userDashProfile'); +$routes->get('/digiusers/v1/dash/employer', 'Users::userDashEmployer'); +$routes->get('/digiusers/v1/dash/references', 'Users::userDashReferences'); + $routes->get('/digiusers/v1/profile', 'Users::userProfile'); $routes->post('/digiusers/v1/addcard', 'Users::userAddCard'); diff --git a/app/Controllers/Users.php b/app/Controllers/Users.php index f8e5f05..d4636ad 100644 --- a/app/Controllers/Users.php +++ b/app/Controllers/Users.php @@ -138,10 +138,79 @@ class Users extends BaseController ]; return $this->respond($data, 200); }else{ - return $this->respond(['error'=>'empty uid'], 400); + return $this->respond(['error'=>'empty uid','inn'=>$in,], 400); } // return $this->respond([], 400); } + public function userDashProfile(){ + $in = $this->request->getGet(); + $data = []; + if ($in['uid'] !=''){ + $query = $this->db->query("SELECT * FROM customers WHERE uid = '".$in['uid']."' "); + $row = $query->getRowArray(); + $data = [ + 'call_return' => '100', + 'customer' => $row + ]; + return $this->respond($data, 200); + }else{ + return $this->respond(['error'=>'empty uid','inn'=>$in,], 400); + } + + // return $this->respond([], 400); + } + + public function userDashEmployer(){ + $in = $this->request->getGet(); + $data = []; + if ($in['uid'] !=''){ + $query = $this->db->query("SELECT uid FROM customers WHERE uid = '".$in['uid']."' "); + $row = $query->getRowArray(); + $empl= + [ + "employer_uid" => "9cb678e0-0697-4cc9-9bf0-3f40a3c989fb", + "name" => "ChiefSoft Works LLC", + "official_email" => "workemail@work.com", + "industry" => "Education", + "job_sector" => "Non-Profit", + "job_title" => "Manager", + "start_date" => "10-10-2000", + "salary_date" => "15-08-2024", + "annual_salary" => "10000000", + "net_montlty" => "80000", + "employee_id" => "1234567890", + ]; + $data = [ + 'call_return' => '100', + 'customer' => $row, + 'employer' => $empl + ]; + return $this->respond($data, 200); + }else{ + return $this->respond(['error'=>'empty uid','inn'=>$in,], 400); + } + + // return $this->respond([], 400); + } + + public function userDashReferences(){ + $in = $this->request->getGet(); + $data = []; + if ($in['uid'] !=''){ + $query = $this->db->query("SELECT * FROM customers WHERE uid = '".$in['uid']."' "); + $row = $query->getRowArray(); + $data = [ + 'call_return' => '100', + 'customer' => $row + ]; + return $this->respond($data, 200); + }else{ + return $this->respond(['error'=>'empty uid','inn'=>$in,], 400); + } + + // return $this->respond([], 400); + } + } \ No newline at end of file