From 8ecbdb04e06d06134a2c8c7c57680b6cd0acf159 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 14 Sep 2024 11:29:19 -0400 Subject: [PATCH] fix end poinst --- app/Config/Routes.php | 10 ++++-- app/Controllers/AirFlow.php | 61 ++++++++++++++++++++++++++++++++++ app/Controllers/BkoReports.php | 18 ++++++++++ 3 files changed, 87 insertions(+), 2 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 5392f7c..2e476e4 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -7,6 +7,12 @@ use CodeIgniter\Router\RouteCollection; */ $routes->post('/callback/cards', 'DigiCallBack::cardAccount'); $routes->get('/flow/v1/new-account', 'AirFlow::flowNewAccount'); +$routes->get('/flow/v1/applicationreminder', 'AirFlow::flowAppReminder'); +$routes->get('/flow/v1/dailyreports', 'AirFlow::flowDailyReports'); +$routes->get('/flow/v1/generalalerts', 'AirFlow::flowGeneralAlerts'); +$routes->get('/flow/v1/newemployers', 'AirFlow::flowNewEmployers'); +$routes->get('/flow/v1/paymentreminder', 'AirFlow::flowPaymentReminder'); +$routes->get('/flow/v1/verifyempoyer', 'AirFlow::flowVerifyEmpoyer'); $routes->get('/', 'Home::index'); @@ -36,9 +42,9 @@ $routes->patch('/digibko/v1/employers/signatory', 'BkoReports::sign $routes->post('/digibko/v1/employers/verify', 'Employers::verifyEmployer'); -$routes->get('/digibko/v1/users', 'BkoReports::listUsers'); +$routes->get('/digibko/v1/users', 'BkoReports::listUsers'); $routes->get('/digibko/v1/customers', 'BkoReports::listCustomers'); - +$routes->get('/digibko/v1/customers/(:any)', 'BkoReports::getCustomer/$1'); $routes->post('/digibko/v1/employer', 'BkoReports::employerAdd'); diff --git a/app/Controllers/AirFlow.php b/app/Controllers/AirFlow.php index bc5dd80..3c9972d 100644 --- a/app/Controllers/AirFlow.php +++ b/app/Controllers/AirFlow.php @@ -15,6 +15,67 @@ class AirFlow extends BaseController return []; //json_encode( $final_out ); } + public function flowAppReminder(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $out =[]; + // $this->processLoadData(); + log_message('critical', "AirFlow::flowAppReminder ********* ALL ".serialize($in) ); + return []; //json_encode( $final_out ); + } + + public function flowDailyReports(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $out =[]; + // $this->processLoadData(); + log_message('critical', "AirFlow::flowDailyReports ********* ALL ".serialize($in) ); + return []; //json_encode( $final_out ); + } + + public function flowGeneralAlerts(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $out =[]; + // $this->processLoadData(); + log_message('critical', "AirFlow::flowGeneralAlerts ********* ALL ".serialize($in) ); + return []; //json_encode( $final_out ); + } + + public function flowNewEmployers(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $out =[]; + // $this->processLoadData(); + log_message('critical', "AirFlow::flowNewEmployers ********* ALL ".serialize($in) ); + return []; //json_encode( $final_out ); + } + + public function flowPaymentReminder(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $out =[]; + // $this->processLoadData(); + log_message('critical', "AirFlow::flowPaymentReminder ********* ALL ".serialize($in) ); + return []; //json_encode( $final_out ); + } + + public function flowVerifyEmpoyer(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $out =[]; + // $this->processLoadData(); + log_message('critical', "AirFlow::flowVerifyEmpoyer ********* ALL ".serialize($in) ); + return []; //json_encode( $final_out ); + } + + private function processLoadData(){ $mysql ="SELECT uid,customer_uid,loan_detail FROM applications diff --git a/app/Controllers/BkoReports.php b/app/Controllers/BkoReports.php index 2c1a80c..9c9a06c 100644 --- a/app/Controllers/BkoReports.php +++ b/app/Controllers/BkoReports.php @@ -309,6 +309,24 @@ public function signatoryUpdate():ResponseInterface{ return $this->respond($data, 200); } + public function getCustomer($uid){ + + $query = $this->db->query("SELECT * FROM customers WHERE uid::text ='".$uid."'"); + $rowC = $query->getResult('array'); + + $mySqA ="SELECT uid AS applications_uid, loan_amount, added, payment_month FROM applications WHERE customer_uid::text ='".$uid."'"; + $query = $this->db->query($mySqA); + $rowA = $query->getResult('array'); + + $data = [ + 'call_return' => '100', + 'customer' => $rowC, + 'applications' => $rowA + ]; + return $this->respond($data, 200); + + + } public function listCustomers():ResponseInterface{ $query = $this->db->query("select * from customers order by id desc");