From d2f403ed59c30baee9b73314583d96559a746e77 Mon Sep 17 00:00:00 2001 From: VivianDee <115420678+VivianDee@users.noreply.github.com> Date: Fri, 21 Mar 2025 10:22:09 +0100 Subject: [PATCH] [chore]: Separated Simbrella to bank calls --- .gitignore | 1 + Dockerfile | 4 +- app.log | 373 ++++++------------ app/__pycache__/__init__.cpython-39.pyc | Bin 535 -> 535 bytes app/__pycache__/config.cpython-39.pyc | Bin 337 -> 337 bytes app/blueprints/__init__.py | 9 - .../__pycache__/__init__.cpython-39.pyc | Bin 1441 -> 797 bytes .../__pycache__/collect_loan.cpython-39.pyc | Bin 1729 -> 1718 bytes .../__pycache__/disbursement.cpython-39.pyc | Bin 1813 -> 1802 bytes .../__pycache__/lien_check.cpython-39.pyc | Bin 1432 -> 1421 bytes .../new_transaction_check.cpython-39.pyc | Bin 1651 -> 1640 bytes .../__pycache__/penal_charge.cpython-39.pyc | Bin 1481 -> 1470 bytes .../__pycache__/rac_check.cpython-39.pyc | Bin 1657 -> 1646 bytes .../revoke_enable_consent.cpython-39.pyc | Bin 1605 -> 1594 bytes .../token_validation.cpython-39.pyc | Bin 1616 -> 1605 bytes .../transaction_verify.cpython-39.pyc | Bin 1717 -> 1706 bytes app/blueprints/bulk_sms.py | 55 --- app/blueprints/collect_loan.py | 6 +- app/blueprints/customer_consent.py | 4 +- app/blueprints/disbursement.py | 4 +- app/blueprints/eligibility_check.py | 77 ---- app/blueprints/lien_check.py | 4 +- app/blueprints/loan_information.py | 67 ---- app/blueprints/new_transaction_check.py | 4 +- app/blueprints/notification_callback.py | 54 --- app/blueprints/penal_charge.py | 4 +- app/blueprints/provide_loan.py | 59 --- app/blueprints/rac_check.py | 4 +- app/blueprints/repayment.py | 54 --- app/blueprints/revoke_enable_consent.py | 4 +- app/blueprints/select_offer.py | 109 ----- app/blueprints/sms.py | 56 --- app/blueprints/token_validation.py | 4 +- app/blueprints/transaction_verify.py | 4 +- .../response_helper.cpython-39.pyc | Bin 7816 -> 7816 bytes app/helpers/response_helper.py | 4 +- app/middlewares/__init__.py | 1 + app/middlewares/app_id_checker.py | 20 + app/middlewares/encryption.py | 20 +- app/middlewares/verify_api_key.py | 20 +- .../__pycache__/__init__.cpython-39.pyc | Bin 152 -> 152 bytes app/routes/__pycache__/routes.cpython-39.pyc | Bin 4539 -> 2871 bytes app/routes/routes.py | 83 +--- .../__pycache__/__init__.cpython-39.pyc | Bin 119 -> 119 bytes .../__pycache__/collect_loan.cpython-39.pyc | Bin 703 -> 703 bytes .../__pycache__/disbursement.cpython-39.pyc | Bin 850 -> 850 bytes .../__pycache__/lien_check.cpython-39.pyc | Bin 643 -> 643 bytes .../new_transaction_check.cpython-39.pyc | Bin 647 -> 647 bytes .../__pycache__/penal_charge.cpython-39.pyc | Bin 1144 -> 1144 bytes .../__pycache__/rac_check.cpython-39.pyc | Bin 977 -> 977 bytes .../revoke_enable_consent.cpython-39.pyc | Bin 1040 -> 1040 bytes .../token_validation.cpython-39.pyc | Bin 474 -> 474 bytes .../transaction_verify.cpython-39.pyc | Bin 565 -> 565 bytes app/schemas/bulk_sms.py | 6 - app/schemas/eligibility_check.py | 11 - app/schemas/loan_information.py | 5 - app/schemas/notification_callback.py | 14 - app/schemas/provide_loan.py | 16 - app/schemas/repayment.py | 11 - app/schemas/select_offer.py | 13 - app/schemas/sms.py | 7 - app/utils/__pycache__/logger.cpython-39.pyc | Bin 370 -> 347 bytes app/utils/logger.py | 2 +- requirements.txt | 5 +- wsgi.py | 7 + 65 files changed, 201 insertions(+), 1004 deletions(-) delete mode 100644 app/blueprints/bulk_sms.py delete mode 100644 app/blueprints/eligibility_check.py delete mode 100644 app/blueprints/loan_information.py delete mode 100644 app/blueprints/notification_callback.py delete mode 100644 app/blueprints/provide_loan.py delete mode 100644 app/blueprints/repayment.py delete mode 100644 app/blueprints/select_offer.py delete mode 100644 app/blueprints/sms.py create mode 100644 app/middlewares/app_id_checker.py delete mode 100644 app/schemas/bulk_sms.py delete mode 100644 app/schemas/eligibility_check.py delete mode 100644 app/schemas/loan_information.py delete mode 100644 app/schemas/notification_callback.py delete mode 100644 app/schemas/provide_loan.py delete mode 100644 app/schemas/repayment.py delete mode 100644 app/schemas/select_offer.py delete mode 100644 app/schemas/sms.py create mode 100644 wsgi.py diff --git a/.gitignore b/.gitignore index 392cb2b..78b08ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # Byte-compiled / optimized / DLL files __pycache__/ +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3e3f6f1..33828c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,6 @@ ENV FLASK_APP=app.py ENV FLASK_RUN_HOST=0.0.0.0 # Run the application -CMD ["flask", "run"] +CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "wsgi:wsgi_app"] + + diff --git a/app.log b/app.log index 386398e..907c315 100644 --- a/app.log +++ b/app.log @@ -1,258 +1,127 @@ -2025-03-20 14:13:09,801 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. +2025-03-21 08:07:50,689 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on all addresses (0.0.0.0) * Running on http://127.0.0.1:5000 - * Running on http://192.168.43.192:5000 -2025-03-20 14:13:09,802 - INFO - Press CTRL+C to quit -2025-03-20 14:13:09,804 - INFO - * Restarting with stat -2025-03-20 14:13:10,513 - WARNING - * Debugger is active! -2025-03-20 14:13:10,534 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:13:18,851 - INFO - 127.0.0.1 - - [20/Mar/2025 14:13:18] "GET / HTTP/1.1" 404 - -2025-03-20 14:13:19,654 - INFO - 127.0.0.1 - - [20/Mar/2025 14:13:19] "GET /favicon.ico HTTP/1.1" 404 - -2025-03-20 14:14:03,987 - INFO - 127.0.0.1 - - [20/Mar/2025 14:14:03] "GET /EligibilityCheck HTTP/1.1" 405 - -2025-03-20 14:14:14,898 - INFO - 127.0.0.1 - - [20/Mar/2025 14:14:14] "GET /EligibilityCheck HTTP/1.1" 405 - -2025-03-20 14:14:21,063 - INFO - 127.0.0.1 - - [20/Mar/2025 14:14:21] "POST /EligibilityCheck HTTP/1.1" 415 - -2025-03-20 14:14:40,328 - INFO - 127.0.0.1 - - [20/Mar/2025 14:14:40] "POST /EligibilityCheck HTTP/1.1" 415 - -2025-03-20 14:15:52,642 - INFO - EligibilityCheck request received: {'hi': 'bye'} -2025-03-20 14:15:52,643 - INFO - Processing EligibilityCheck request -2025-03-20 14:15:52,647 - ERROR - An error occurred during EligibilityCheck processing: {'income': ['Missing data for required field.'], 'user_id': ['Missing data for required field.'], 'credit_score': ['Missing data for required field.'], 'hi': ['Unknown field.']} + * Running on http://172.21.0.2:5000 +2025-03-21 08:07:50,689 - INFO - Press CTRL+C to quit +2025-03-21 08:25:00,902 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. + * Running on all addresses (0.0.0.0) + * Running on http://127.0.0.1:5000 + * Running on http://172.21.0.2:5000 +2025-03-21 08:25:00,903 - INFO - Press CTRL+C to quit +2025-03-21 08:27:59,768 - INFO - before_request middleware triggered +2025-03-21 08:27:59,772 - ERROR - Unauthorized access: Missing API key. +2025-03-21 08:27:59,774 - INFO - 172.21.0.1 - - [21/Mar/2025 08:27:59] "GET /health HTTP/1.1" 200 - +2025-03-21 08:27:59,921 - INFO - 172.21.0.1 - - [21/Mar/2025 08:27:59] "GET /favicon.ico HTTP/1.1" 404 - +2025-03-21 08:28:47,107 - INFO - before_request middleware triggered +2025-03-21 08:28:47,108 - ERROR - Unauthorized access: Missing API key. +2025-03-21 08:28:47,111 - INFO - 172.21.0.1 - - [21/Mar/2025 08:28:47] "POST /Disbursement HTTP/1.1" 200 - +2025-03-21 08:30:01,346 - INFO - before_request middleware triggered +2025-03-21 08:30:01,350 - INFO - Processing Disbursement request +2025-03-21 08:30:01,352 - ERROR - Validation Error: {'countryId': ['Missing data for required field.'], 'collectAmountMgtFee': ['Missing data for required field.'], 'requestId': ['Missing data for required field.'], 'debtId': ['Missing data for required field.'], 'provideAmount': ['Missing data for required field.'], 'collectAmountVAT': ['Missing data for required field.'], 'collectAmountInsurance': ['Missing data for required field.'], 'productId': ['Missing data for required field.'], 'msisdn': ['Unknown field.'], 'channel': ['Unknown field.'], 'lienAmount': ['Unknown field.'], '$type': ['Unknown field.'], 'countryCode': ['Unknown field.']} +2025-03-21 08:30:01,353 - INFO - 172.21.0.1 - - [21/Mar/2025 08:30:01] "POST /Disbursement HTTP/1.1" 200 - +2025-03-21 08:34:16,957 - INFO - before_request middleware triggered +2025-03-21 08:34:16,960 - INFO - Processing Disbursement request +2025-03-21 08:34:16,970 - ERROR - Validation Error: {'countryId': ['Missing data for required field.'], 'collectAmountMgtFee': ['Missing data for required field.'], 'requestId': ['Missing data for required field.'], 'debtId': ['Missing data for required field.'], 'provideAmount': ['Missing data for required field.'], 'collectAmountVAT': ['Missing data for required field.'], 'collectAmountInsurance': ['Missing data for required field.'], 'productId': ['Missing data for required field.'], 'msisdn': ['Unknown field.'], 'channel': ['Unknown field.'], 'lienAmount': ['Unknown field.'], '$type': ['Unknown field.'], 'countryCode': ['Unknown field.']} +2025-03-21 08:34:16,973 - INFO - 172.21.0.1 - - [21/Mar/2025 08:34:16] "POST /Disbursement HTTP/1.1" 200 - +2025-03-21 08:38:52,829 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. + * Running on all addresses (0.0.0.0) + * Running on http://127.0.0.1:5000 + * Running on http://172.21.0.2:5000 +2025-03-21 08:38:52,829 - INFO - Press CTRL+C to quit +2025-03-21 08:44:44,426 - INFO - before_request middleware triggered +2025-03-21 08:44:44,430 - ERROR - Exception on /Disbursement [POST] Traceback (most recent call last): - File "/Users/viviandagbue/Documents/livelinessCheckYOLO/app/blueprints/eligibility_check.py", line 23, in process_request - validated_data = schema.load(data) # Raises an error if invalid - File "/Users/viviandagbue/Documents/venv/lib/python3.9/site-packages/marshmallow/schema.py", line 722, in load - return self._do_load( - File "/Users/viviandagbue/Documents/venv/lib/python3.9/site-packages/marshmallow/schema.py", line 909, in _do_load - raise exc -marshmallow.exceptions.ValidationError: {'income': ['Missing data for required field.'], 'user_id': ['Missing data for required field.'], 'credit_score': ['Missing data for required field.'], 'hi': ['Unknown field.']} -2025-03-20 14:15:52,683 - INFO - 127.0.0.1 - - [20/Mar/2025 14:15:52] "POST /EligibilityCheck HTTP/1.1" 200 - -2025-03-20 14:27:54,479 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:27:54,721 - INFO - * Restarting with stat -2025-03-20 14:27:56,270 - WARNING - * Debugger is active! -2025-03-20 14:27:56,301 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:00,496 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:28:00,704 - INFO - * Restarting with stat -2025-03-20 14:28:01,613 - WARNING - * Debugger is active! -2025-03-20 14:28:01,691 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:03,809 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:28:04,018 - INFO - * Restarting with stat -2025-03-20 14:28:04,870 - WARNING - * Debugger is active! -2025-03-20 14:28:04,886 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:07,012 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:28:07,200 - INFO - * Restarting with stat -2025-03-20 14:28:08,193 - WARNING - * Debugger is active! -2025-03-20 14:28:08,206 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:10,289 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:28:10,503 - INFO - * Restarting with stat -2025-03-20 14:28:11,437 - WARNING - * Debugger is active! -2025-03-20 14:28:11,456 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:13,532 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:28:13,750 - INFO - * Restarting with stat -2025-03-20 14:28:14,774 - WARNING - * Debugger is active! -2025-03-20 14:28:14,815 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:17,101 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:28:17,262 - INFO - * Restarting with stat -2025-03-20 14:28:18,410 - WARNING - * Debugger is active! -2025-03-20 14:28:18,428 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:19,512 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:28:19,690 - INFO - * Restarting with stat -2025-03-20 14:28:20,801 - WARNING - * Debugger is active! -2025-03-20 14:28:20,936 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:41,355 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/config.py', reloading -2025-03-20 14:28:41,499 - INFO - * Restarting with stat -2025-03-20 14:28:42,243 - WARNING - * Debugger is active! -2025-03-20 14:28:42,255 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:45,329 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/config.py', reloading -2025-03-20 14:28:45,519 - INFO - * Restarting with stat -2025-03-20 14:28:46,382 - WARNING - * Debugger is active! -2025-03-20 14:28:46,403 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:28:51,552 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/config.py', reloading -2025-03-20 14:28:51,712 - INFO - * Restarting with stat -2025-03-20 14:28:52,758 - WARNING - * Debugger is active! -2025-03-20 14:28:52,792 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:29:13,307 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:29:13,443 - INFO - * Restarting with stat -2025-03-20 14:29:15,136 - WARNING - * Debugger is active! -2025-03-20 14:29:15,155 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:29:24,320 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/main.py', reloading -2025-03-20 14:29:24,462 - INFO - * Restarting with stat -2025-03-20 14:29:25,635 - WARNING - * Debugger is active! -2025-03-20 14:29:25,668 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:29:39,423 - INFO - 127.0.0.1 - - [20/Mar/2025 14:29:39] "POST /health HTTP/1.1" 405 - -2025-03-20 14:30:17,001 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/routes/__init__.py', reloading -2025-03-20 14:30:17,444 - INFO - * Restarting with stat -2025-03-20 14:30:20,724 - WARNING - * Debugger is active! -2025-03-20 14:30:20,742 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:37:21,240 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/__init__.py', reloading -2025-03-20 14:37:21,737 - INFO - * Restarting with stat -2025-03-20 14:37:23,075 - WARNING - * Debugger is active! -2025-03-20 14:37:23,088 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:39:23,292 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/verify_api_key.py', reloading -2025-03-20 14:39:23,563 - INFO - * Restarting with stat -2025-03-20 14:39:25,229 - WARNING - * Debugger is active! -2025-03-20 14:39:25,254 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:39:26,355 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/verify_api_key.py', reloading -2025-03-20 14:39:26,517 - INFO - * Restarting with stat -2025-03-20 14:39:27,457 - WARNING - * Debugger is active! -2025-03-20 14:39:27,476 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:41:20,187 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/encryption.py', reloading -2025-03-20 14:41:20,429 - INFO - * Restarting with stat -2025-03-20 14:41:21,622 - WARNING - * Debugger is active! -2025-03-20 14:41:21,634 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:42:03,558 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/cors.py', reloading -2025-03-20 14:42:03,709 - INFO - * Restarting with stat -2025-03-20 14:42:05,112 - WARNING - * Debugger is active! -2025-03-20 14:42:05,137 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:42:30,565 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/cors.py', reloading -2025-03-20 14:42:30,976 - INFO - * Restarting with stat -2025-03-20 14:42:32,051 - WARNING - * Debugger is active! -2025-03-20 14:42:32,065 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:43:14,856 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:43:15,006 - INFO - * Restarting with stat -2025-03-20 14:43:16,050 - WARNING - * Debugger is active! -2025-03-20 14:43:16,062 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:44:03,834 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:44:04,003 - INFO - * Restarting with stat -2025-03-20 14:44:05,142 - WARNING - * Debugger is active! -2025-03-20 14:44:05,182 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:44:09,364 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:44:09,512 - INFO - * Restarting with stat -2025-03-20 14:44:10,512 - WARNING - * Debugger is active! -2025-03-20 14:44:10,548 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:44:11,658 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:44:11,834 - INFO - * Restarting with stat -2025-03-20 14:44:12,885 - WARNING - * Debugger is active! -2025-03-20 14:44:12,904 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:44:37,478 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:44:37,636 - INFO - * Restarting with stat -2025-03-20 14:44:38,872 - WARNING - * Debugger is active! -2025-03-20 14:44:38,889 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:44:52,116 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:44:52,260 - INFO - * Restarting with stat -2025-03-20 14:44:53,048 - WARNING - * Debugger is active! -2025-03-20 14:44:53,061 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:44:54,180 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:44:54,328 - INFO - * Restarting with stat -2025-03-20 14:44:55,536 - WARNING - * Debugger is active! -2025-03-20 14:44:55,549 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:44:56,596 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:44:56,745 - INFO - * Restarting with stat -2025-03-20 14:44:57,615 - WARNING - * Debugger is active! -2025-03-20 14:44:57,627 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:44:59,795 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:45:00,013 - INFO - * Restarting with stat -2025-03-20 14:45:00,839 - WARNING - * Debugger is active! -2025-03-20 14:45:00,854 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:45:05,953 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:45:06,143 - INFO - * Restarting with stat -2025-03-20 14:45:06,976 - WARNING - * Debugger is active! -2025-03-20 14:45:06,992 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:45:09,077 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:45:09,366 - INFO - * Restarting with stat -2025-03-20 14:45:10,260 - WARNING - * Debugger is active! -2025-03-20 14:45:10,491 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:45:11,571 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:45:11,748 - INFO - * Restarting with stat -2025-03-20 14:45:12,615 - WARNING - * Debugger is active! -2025-03-20 14:45:12,631 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:45:14,690 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/middlewares/request_validator.py', reloading -2025-03-20 14:45:14,821 - INFO - * Restarting with stat -2025-03-20 14:45:15,576 - WARNING - * Debugger is active! -2025-03-20 14:45:15,597 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:47:55,793 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/__init__.py', reloading -2025-03-20 14:47:56,010 - INFO - * Restarting with stat -2025-03-20 14:48:23,203 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5000 - * Running on http://192.168.43.192:5000 -2025-03-20 14:48:23,204 - INFO - Press CTRL+C to quit -2025-03-20 14:48:23,208 - INFO - * Restarting with stat -2025-03-20 14:48:25,258 - WARNING - * Debugger is active! -2025-03-20 14:48:25,331 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:48:30,183 - INFO - 127.0.0.1 - - [20/Mar/2025 14:48:30] "POST /api/health HTTP/1.1" 405 - -2025-03-20 14:48:35,969 - INFO - 127.0.0.1 - - [20/Mar/2025 14:48:35] "GET /api/health HTTP/1.1" 200 - -2025-03-20 14:53:13,504 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/schemas/eligibility_check.py', reloading -2025-03-20 14:53:14,721 - INFO - * Restarting with stat -2025-03-20 14:53:20,279 - WARNING - * Debugger is active! -2025-03-20 14:53:20,384 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:54:16,579 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/blueprints/eligibility_check.py', reloading -2025-03-20 14:54:17,245 - INFO - * Restarting with stat -2025-03-20 14:54:21,211 - WARNING - * Debugger is active! -2025-03-20 14:54:21,298 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:54:32,913 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/blueprints/eligibility_check.py', reloading -2025-03-20 14:54:33,587 - INFO - * Restarting with stat -2025-03-20 14:54:36,684 - WARNING - * Debugger is active! -2025-03-20 14:54:36,850 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:54:38,191 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/blueprints/eligibility_check.py', reloading -2025-03-20 14:54:38,906 - INFO - * Restarting with stat -2025-03-20 14:54:44,502 - WARNING - * Debugger is active! -2025-03-20 14:54:44,539 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:55:04,187 - INFO - 127.0.0.1 - - [20/Mar/2025 14:55:04] "GET /api/EligibilityCheck HTTP/1.1" 405 - -2025-03-20 14:55:10,064 - INFO - Processing EligibilityCheck request -2025-03-20 14:55:10,073 - ERROR - An error occurred during EligibilityCheck processing: {'lien_amount': ['Missing data for required field.'], 'lienAmount': ['Unknown field.']} + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app + response = self.full_dispatch_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request + rv = self.handle_user_exception(e) + File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function + return cors_after_request(app.make_response(f(*args, **kwargs))) + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1482, in full_dispatch_request + rv = self.preprocess_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1974, in preprocess_request + rv = self.ensure_sync(before_func)() + File "/app/app/routes/routes.py", line 24, in require_api_key_middleware + return require_api_key() +TypeError: require_api_key() missing 1 required positional argument: 'f' +2025-03-21 08:44:44,446 - INFO - 172.21.0.1 - - [21/Mar/2025 08:44:44] "POST /Disbursement HTTP/1.1" 500 - +2025-03-21 09:02:19,681 - INFO - before_request middleware triggered +2025-03-21 09:02:19,683 - ERROR - Exception on /Disbursement [POST] Traceback (most recent call last): - File "/Users/viviandagbue/Documents/livelinessCheckYOLO/app/blueprints/eligibility_check.py", line 23, in process_request - validated_data = schema.load(data) # Raises an error if invalid - File "/Users/viviandagbue/Documents/venv/lib/python3.9/site-packages/marshmallow/schema.py", line 722, in load - return self._do_load( - File "/Users/viviandagbue/Documents/venv/lib/python3.9/site-packages/marshmallow/schema.py", line 909, in _do_load - raise exc -marshmallow.exceptions.ValidationError: {'lien_amount': ['Missing data for required field.'], 'lienAmount': ['Unknown field.']} -2025-03-20 14:55:10,103 - INFO - 127.0.0.1 - - [20/Mar/2025 14:55:10] "POST /api/EligibilityCheck HTTP/1.1" 200 - -2025-03-20 14:55:37,613 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/schemas/eligibility_check.py', reloading -2025-03-20 14:55:38,428 - INFO - * Restarting with stat -2025-03-20 14:55:47,297 - WARNING - * Debugger is active! -2025-03-20 14:55:47,413 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:55:51,943 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/schemas/eligibility_check.py', reloading -2025-03-20 14:55:52,455 - INFO - * Restarting with stat -2025-03-20 14:55:56,940 - WARNING - * Debugger is active! -2025-03-20 14:55:56,968 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 14:56:01,718 - INFO - Processing EligibilityCheck request -2025-03-20 14:56:01,737 - INFO - 127.0.0.1 - - [20/Mar/2025 14:56:01] "POST /api/EligibilityCheck HTTP/1.1" 200 - -2025-03-20 14:59:24,543 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/schemas/select_offer.py', reloading -2025-03-20 14:59:25,271 - INFO - * Restarting with stat -2025-03-20 14:59:31,688 - WARNING - * Debugger is active! -2025-03-20 14:59:31,738 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 15:00:44,032 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/blueprints/select_offer.py', reloading -2025-03-20 15:00:44,863 - INFO - * Restarting with stat -2025-03-20 15:00:52,010 - WARNING - * Debugger is active! -2025-03-20 15:00:52,134 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 15:00:53,368 - INFO - * Detected change in '/Users/viviandagbue/Documents/livelinessCheckYOLO/app/blueprints/select_offer.py', reloading -2025-03-20 15:00:53,663 - INFO - * Restarting with stat -2025-03-20 17:05:48,612 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app + response = self.full_dispatch_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request + rv = self.handle_user_exception(e) + File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function + return cors_after_request(app.make_response(f(*args, **kwargs))) + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1482, in full_dispatch_request + rv = self.preprocess_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1974, in preprocess_request + rv = self.ensure_sync(before_func)() + File "/app/app/routes/routes.py", line 24, in require_api_key_middleware + return require_api_key() +TypeError: require_api_key() missing 1 required positional argument: 'f' +2025-03-21 09:02:19,685 - INFO - 172.21.0.1 - - [21/Mar/2025 09:02:19] "POST /Disbursement HTTP/1.1" 500 - +2025-03-21 09:02:24,680 - INFO - before_request middleware triggered +2025-03-21 09:02:24,681 - ERROR - Exception on /Disbursement [POST] +Traceback (most recent call last): + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app + response = self.full_dispatch_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request + rv = self.handle_user_exception(e) + File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function + return cors_after_request(app.make_response(f(*args, **kwargs))) + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1482, in full_dispatch_request + rv = self.preprocess_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1974, in preprocess_request + rv = self.ensure_sync(before_func)() + File "/app/app/routes/routes.py", line 24, in require_api_key_middleware + return require_api_key() +TypeError: require_api_key() missing 1 required positional argument: 'f' +2025-03-21 09:02:24,683 - INFO - 172.21.0.1 - - [21/Mar/2025 09:02:24] "POST /Disbursement HTTP/1.1" 500 - +2025-03-21 09:03:00,120 - INFO - before_request middleware triggered +2025-03-21 09:03:00,121 - ERROR - Exception on /Disbursement [POST] +Traceback (most recent call last): + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app + response = self.full_dispatch_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request + rv = self.handle_user_exception(e) + File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function + return cors_after_request(app.make_response(f(*args, **kwargs))) + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1482, in full_dispatch_request + rv = self.preprocess_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1974, in preprocess_request + rv = self.ensure_sync(before_func)() + File "/app/app/routes/routes.py", line 24, in require_api_key_middleware + return require_api_key() +TypeError: require_api_key() missing 1 required positional argument: 'f' +2025-03-21 09:03:00,122 - INFO - 172.21.0.1 - - [21/Mar/2025 09:03:00] "POST /Disbursement HTTP/1.1" 500 - +2025-03-21 09:03:03,022 - INFO - before_request middleware triggered +2025-03-21 09:03:03,023 - ERROR - Exception on /Disbursement [POST] +Traceback (most recent call last): + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app + response = self.full_dispatch_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request + rv = self.handle_user_exception(e) + File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function + return cors_after_request(app.make_response(f(*args, **kwargs))) + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1482, in full_dispatch_request + rv = self.preprocess_request() + File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1974, in preprocess_request + rv = self.ensure_sync(before_func)() + File "/app/app/routes/routes.py", line 24, in require_api_key_middleware + return require_api_key() +TypeError: require_api_key() missing 1 required positional argument: 'f' +2025-03-21 09:03:03,024 - INFO - 172.21.0.1 - - [21/Mar/2025 09:03:03] "POST /Disbursement HTTP/1.1" 500 - +2025-03-21 09:03:36,056 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on all addresses (0.0.0.0) * Running on http://127.0.0.1:5000 - * Running on http://192.168.43.192:5000 -2025-03-20 17:05:48,613 - INFO - Press CTRL+C to quit -2025-03-20 17:05:48,614 - INFO - * Restarting with stat -2025-03-20 17:05:49,355 - WARNING - * Debugger is active! -2025-03-20 17:05:49,373 - INFO - * Debugger PIN: 716-001-293 -2025-03-20 17:05:52,329 - INFO - Processing EligibilityCheck request -2025-03-20 17:05:52,333 - INFO - 127.0.0.1 - - [20/Mar/2025 17:05:52] "POST /api/EligibilityCheck HTTP/1.1" 200 - -2025-03-20 17:16:19,388 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on http://127.0.0.1:5000 -2025-03-20 17:16:19,388 - INFO - Press CTRL+C to quit -2025-03-20 17:17:44,903 - INFO - Processing SelectOffer request -2025-03-20 17:17:44,908 - ERROR - Validation Error: {'productId': ['Missing data for required field.'], 'requestId': ['Missing data for required field.'], 'requestedAmount': ['Missing data for required field.'], 'countryCode': ['Unknown field.'], 'lienAmount': ['Unknown field.'], '$type': ['Unknown field.']} -2025-03-20 17:17:44,916 - INFO - 127.0.0.1 - - [20/Mar/2025 17:17:44] "POST /api/SelectOffer HTTP/1.1" 200 - -2025-03-20 17:45:41,511 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on http://127.0.0.1:5000 -2025-03-20 17:45:41,513 - INFO - Press CTRL+C to quit -2025-03-20 17:51:07,000 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5000 - * Running on http://172.20.0.2:5000 -2025-03-20 17:51:07,001 - INFO - Press CTRL+C to quit -2025-03-20 17:51:28,286 - INFO - 172.20.0.1 - - [20/Mar/2025 17:51:28] "GET / HTTP/1.1" 404 - -2025-03-20 17:51:28,603 - INFO - 172.20.0.1 - - [20/Mar/2025 17:51:28] "GET /favicon.ico HTTP/1.1" 404 - -2025-03-20 17:51:38,063 - INFO - 172.20.0.1 - - [20/Mar/2025 17:51:38] "GET /api/health HTTP/1.1" 200 - -2025-03-20 17:52:29,740 - INFO - 172.20.0.1 - - [20/Mar/2025 17:52:29] "GET /health HTTP/1.1" 404 - -2025-03-20 17:53:14,937 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5000 - * Running on http://172.20.0.2:5000 -2025-03-20 17:53:14,938 - INFO - Press CTRL+C to quit -2025-03-20 17:53:49,208 - INFO - 172.20.0.1 - - [20/Mar/2025 17:53:49] "GET /health HTTP/1.1" 200 - -2025-03-21 00:36:08,145 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5000 - * Running on http://172.23.0.2:5000 -2025-03-21 00:36:08,146 - INFO - Press CTRL+C to quit + * Running on http://172.21.0.2:5000 +2025-03-21 09:03:36,056 - INFO - Press CTRL+C to quit +2025-03-21 09:03:43,372 - INFO - before_request middleware triggered +2025-03-21 09:03:43,373 - INFO - Processing Disbursement request +2025-03-21 09:03:43,374 - ERROR - Validation Error: {'collectAmountMgtFee': ['Missing data for required field.'], 'collectAmountVAT': ['Missing data for required field.'], 'collectAmountInsurance': ['Missing data for required field.'], 'productId': ['Missing data for required field.'], 'countryId': ['Missing data for required field.'], 'provideAmount': ['Missing data for required field.'], 'debtId': ['Missing data for required field.'], 'requestId': ['Missing data for required field.'], 'countryCode': ['Unknown field.'], 'lienAmount': ['Unknown field.'], 'msisdn': ['Unknown field.'], '$type': ['Unknown field.'], 'channel': ['Unknown field.']} +2025-03-21 09:03:43,375 - INFO - 172.21.0.1 - - [21/Mar/2025 09:03:43] "POST /Disbursement HTTP/1.1" 200 - +2025-03-21 09:16:24,496 - INFO - before_request middleware triggered +2025-03-21 09:16:24,496 - INFO - Processing Disbursement request +2025-03-21 09:16:24,498 - ERROR - Validation Error: {'productId': ['Missing data for required field.'], 'debtId': ['Missing data for required field.'], 'collectAmountMgtFee': ['Missing data for required field.'], 'collectAmountVAT': ['Missing data for required field.'], 'provideAmount': ['Missing data for required field.'], 'requestId': ['Missing data for required field.'], 'collectAmountInsurance': ['Missing data for required field.'], 'countryId': ['Missing data for required field.'], 'channel': ['Unknown field.'], '$type': ['Unknown field.'], 'msisdn': ['Unknown field.'], 'countryCode': ['Unknown field.'], 'lienAmount': ['Unknown field.']} diff --git a/app/__pycache__/__init__.cpython-39.pyc b/app/__pycache__/__init__.cpython-39.pyc index 2a7bdd5b9732b6df32ad2ed5bdc0d187bd32b819..482582278f13c0f7d6016ee101f24366d36a604c 100644 GIT binary patch delta 22 ccmbQvGM$Atk(ZZ?0SH3R+)2;h$jik906FaiW&i*H delta 22 ccmbQvGM$Atk(ZZ?0SHVt-AQlS$jik9061I)KL7v# diff --git a/app/__pycache__/config.cpython-39.pyc b/app/__pycache__/config.cpython-39.pyc index af0b39ebd772e6cb7dc7611df85ebfdeaba9a502..6dabae914e7c1838a7c03f7f88ccba49c8655616 100644 GIT binary patch delta 22 ccmcb}bdiZSk(ZZ?0SH3R+({SO$m_xg071hAvH$=8 delta 22 ccmcb}bdiZSk(ZZ?0SHVt-AR|;$m_xg06+i*fdBvi diff --git a/app/blueprints/__init__.py b/app/blueprints/__init__.py index fcdb467..f877f51 100644 --- a/app/blueprints/__init__.py +++ b/app/blueprints/__init__.py @@ -1,10 +1,3 @@ -from app.blueprints.eligibility_check import EligibilityCheckService -from app.blueprints.select_offer import SelectOfferService -from app.blueprints.provide_loan import ProvideLoanService -from app.blueprints.loan_information import LoanInformationService -from app.blueprints.repayment import RepaymentService -from app.blueprints.customer_consent import CustomerConsentService -from app.blueprints.notification_callback import NotificationCallbackService from app.blueprints.rac_check import RACCheckService from app.blueprints.disbursement import DisbursementService from app.blueprints.collect_loan import CollectLoanService @@ -14,5 +7,3 @@ from app.blueprints.revoke_enable_consent import RevokeEnableConsentService from app.blueprints.token_validation import TokenValidationService from app.blueprints.lien_check import LienCheckService from app.blueprints.new_transaction_check import NewTransactionCheckService -from app.blueprints.sms import SMSService -from app.blueprints.bulk_sms import BulkSMSService diff --git a/app/blueprints/__pycache__/__init__.cpython-39.pyc b/app/blueprints/__pycache__/__init__.cpython-39.pyc index 92cc8b7fe79e95ea0b93ba5b1b6ea30ab8f8adb6..74d5f6dcb36e3260507642cfbbf7b70e9f8dcaab 100644 GIT binary patch delta 147 zcmZ3;J(rCyk(ZZ?0SNY9xs&d|G?7n+v0$Qh0T)*=gC_S&ki_KujCYv*G=(PbXO^D) zkV$m%duCon=E;AV6&YD3%d@C6vQBnqQDkJBJds&saxIG(Bm3kjEUJtglXtPmGjak& efjU@3!IrFKDB=d1Sj0WqgVk6>0LbKFM1=s2^dB<- literal 1441 zcmah|yKdVs6qRB-e!pbLcI>9kYsr#K-HM{EnxR0N26m8v3qi|tLgZ2sDA|EOscSzc z$kwU9(5WQtMhat~GDIKp9Fgbh9+7IbWXbE@&!^icYgxb4Bz9UI1d$GMOBRpP~&w}*SH7` z-b77}OW^PpYH3`CHs3)z8dsphyQr&i6?%LZ?P^?uJ|Ccg#&vkZ_t2ik4S36kXsB@$ z_W1!i(Aa@PeuR!BZjG&z_HS9Cbz(nu&w<^t2?G`{-8<^tkEvKNk4nlJQ=ne_eKw;a zwR$Cj1)I`~fcVL3M@_%_vp{eXvmnJZMl>W#PW?EgcIQzXa4Ouuk6ti?%OGYm=IKpb z0x%(IOZCww*KpbT!lKDsMD*nmjvIh-|I%jfS`a@Xp0apD1)D7sQ_dCj3AlGe+|p#V zKcb7^o}T+;0`!&L&b8$H8v<-YL(ub4*gDs7}jgxb0pXYF&tX!TPqkR&F zrxTddP%uA^PHECP?5WlXm0vV4WRdP74pbXOW|JaZbrgf_p^)E&g@(o+ioq;tugED? z&rpefofg}hHu2U?$KI;zBCk}(#wLC$0N7h6KomBfN4$06MMay1PgB7V>cfAf@KzaF z6<$_~1H(<6gIlI#ylwB?^3{tVBgRNqM= g&#=r0i!nY8myd<_Jebabez4^;(V-kF_Wyo=0WqS*djJ3c diff --git a/app/blueprints/__pycache__/collect_loan.cpython-39.pyc b/app/blueprints/__pycache__/collect_loan.cpython-39.pyc index 6a873b21dd4365f26d44d2ad40756e3bed7537a4..c915ebf771763a1841129ce9c288e86731437849 100644 GIT binary patch delta 133 zcmX@eyN#DGk(ZZ?0SIO)+)ZE4zL8Ihk@4DOOU6FV3yci4tc(m*CX+8PN^^6SaMrLk zGp305GEV-*D9b3ZS%PT^BV*L$z07MlH5rQ}fktR@Pwr)rVU(P_ibYB6mS|>PNorAE lVorQIMnZp^_7$O-`glk#rSc9Ro0fPaM70jS1xmkp13CNh8%xjgaq#W}UGV@AO zi}Dh46jFjH${00SojFS(iY+BIsl+qo7FTjG$#+;}7zHQ)WKj~kC7PL6l3J9Pm=j-|T2z)=6rWmDls{RD t)tXU$au}-}qr>E>td2}<|0myJjTTh|YA=#UB@`z6u+0>}5d6xf004q;NgV(H delta 257 zcmeC;o65(V$ji&c00gF+?xbJd$g9i9cyF>b<0Ru7j10A`j0{y4B@9`tDWWBuHLT5y zvl-?xrHG}7_cAdul&}NEB~m0IGAY8n%#;5x$}&n#mSVchcx&=ICOPq29L|1bMurw< z7ExSA28QMqMuz5=mbWG=GiL!+^fAjZ-rBsDnS)WeO3E=$Av3QewJ0w!M)-4Qn&w zY=*f^DLg5>y-bV@CG1&T5YZIAUdG918D$yyH@{}AVdT_gEaC&2sL4IKi`ic6mS|>P zNorAEVorQ50{hwUK5+N!F)L0~gO2|&W N&(bY`Ay~yK2LQ`)FGv6Y delta 205 zcmeC>p25wV$ji&c00gF+?xZi+$Sc6ecw({~V~z14Muu8eMusYj5{4|+6z&qv8rEjU z*$i`;Qg~8$dzly+O4xzod@1}8nH0`m=E)}+Wf=uFKWD6ARIZY8%u~qBD@iTNOUzM7 zEh@?{QpitEE-flbP09Si$iSe@^}!uG#PYvNz2$sw$6q6$FW nMRKTw{N(kl)AY~tT96*AH5e%6CSQ|E0 delta 206 zcmaFC^O=V)k(ZZ?0SHVt-AOm&*vO~M$arnC5o4F}1xAKiRz`*@ixP$`))avf&KlNc z#@P&WnNkE(gnF468A{lJ;=(B+5SbLdUgpWK8D$woH*+#^F)3F`Ip!&3=9Q!t3HMvSSYgn5Z zQ+RtB!x`8ZA{kORYgy}9gQ2tmg8`5g%%I7)nT4r|kyDegh!<$4Cimo(%=TipL^JbB zQj78ubK;9ri^@`q;!}%?@+UuMwq}%`tjuD^s4+Q-MU#o`|Ky1*QKGUyjYZO^gv=z? NnF8oylUK4T0039nEye%< delta 206 zcmdnTeUh6uk(ZZ?0SHVt-AUiGkyo3M@z`Wb#wyMOj10A`j0{y4llL%6>$0Zsrtp<; z*044+rf~E!hcmD-L^7ms*0R>I2198B1_K}~m_d_&6H^nTa+Q>0onHwsi0vjmV_#@xuM$yme#G)$9wvKNaCBhTb?7Nwvl z(agM()S|q^ocQ9@qO#PY_|&4J{31=ZTP!JwC5cgN#mO0|xrtGHWr;bNK#|mxc(6Ec zQEG8PeqM1Zn0t#EsOuJE>Pm(pvB^hRtQj39u{tub{h#d48ZIgUw6jPIl@Oo2nN<_$ Tth=llK$4BkSpY*pB%1;N306rD delta 315 zcmaFI^OJ`+k(ZZ?0SHVt-AV7;$g9f8_+YXz;}p(Yj10A`j0{y4lP@qz>$0ZsrwEjA z*044+rf~H#hcmD-L^7ms*Rs~J2198B1_K}~m_bu;vIx^r##@tbF|Cuj#Z{DAT$)qj zoS%{!#U1469F$sIke^qadTa6`=0@czDaSm8%)FA+qP)Z$h18;={339 z!es^;c#AQ0B}0+Sk(ZZ?0SF52-bw$+wvo?@k@3W2PsRrQLyQcytc(m*CM676tSP)DoHeY? zjI$Z$GNtgP@b@w?GL*1qaX~~=1bP`K|6!D66x=Mubb^snld(t$Xrw0hWL6e?v0I{< zc_pbud5Jmk#i>PQsYUUrMMe3Ooms3I6(-lSxHIZaKF*@g!uG#PYvMtX$wI6?qDnyB TMGB~d;^bo1MFJRts%#1X)y^@) delta 206 zcmdnRbCicKk(ZZ?0SHVt-AONE-^gdh$arS5Cu4*0F-C@3Rz`*@ixP$`))d|n&KlNc z#@P&WnNs*t_a?Df6%qvMP%1g{q zNG&SLFH*=)PA)AfN=?c9!pOj&$u;>ov;AaS7Ar>i$rUW_j7F0Wu;{ZfF)}f-{hj=g ZB}r5f=&T}nR6=2L2J0dL3_&S21pp4ZGeiIY diff --git a/app/blueprints/__pycache__/token_validation.cpython-39.pyc b/app/blueprints/__pycache__/token_validation.cpython-39.pyc index 8c27e419f70d9aa4e146b591cf586a00ae297397..72f833356fca88b851c7cc781cb112961a2e4ad3 100644 GIT binary patch delta 196 zcmcb>bCicSk(ZZ?0SF52-brWO$ZO2Vcw(|6V*}?QMuu8eMusYr$)^~lHMvSSYgn5Z zQ}}xs!x`8ZA{kP6YFX=8gQ2tmg8`5g%%CZ-S%~Q+Bc~=~5f9KzP43BZEcRlzL^JbB zQj78ubK;9ri^@`q;!}%?@+ZfzSTjmZp26b8s5kjGi#`+E|H%TZaiTInjYU$Zg!JTQ M*0};0f(C2~0FlQn!Txk}10Pa!j}B(*3nF-IY_s3^ZkAwM~}w5TXGCG!g- z1A`{lBo_P0VJudRl9MO0I58SczQUr|1rukifoo)vS8xWWGoT_8mY-Wxtzsb?3QR| zUP)?EUSdvsacWUnYEgV@QBnTntt{4z3X?ywxG%j24siSxwoP7?~K^{!UI~ ZO%PQCI;%(?l~9;`n{~bbhF}+)0sv=jGJXI6 diff --git a/app/blueprints/bulk_sms.py b/app/blueprints/bulk_sms.py deleted file mode 100644 index b06063b..0000000 --- a/app/blueprints/bulk_sms.py +++ /dev/null @@ -1,55 +0,0 @@ -from marshmallow import ValidationError -from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.bulk_sms import BulkSMSSchema - -class BulkSMSService: - @staticmethod - def process_request(data): - """ - Process the Bulk SMS request. - - Args: - data (dict): The request data. - - Returns: - dict: A standardized response. - """ - try: - logger.info("Processing BulkSMS request") - - # Validate input data using BulkSMSSchema - schema = BulkSMSSchema() - validated_data = schema.load(data) # Raises ValidationError if invalid - - # Simulated Bulk SMS sending logic - response_data = { - "data": "", - "statusCode": 200, - "isSuccessful": True, - "errorMessage": None - } - - - # return ResponseHelper.success( - # data=response_data, - # message="Bulk SMS sent successfully" - # ) - - return response_data - - except ValidationError as err: - logger.error(f"Validation Error: {err.messages}") - return ResponseHelper.error( - message="Invalid input data", - status_code=400, - error=err.messages - ) - - except Exception as e: - logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, - error=str(e) - ) diff --git a/app/blueprints/collect_loan.py b/app/blueprints/collect_loan.py index 3912d57..d777a54 100644 --- a/app/blueprints/collect_loan.py +++ b/app/blueprints/collect_loan.py @@ -21,7 +21,7 @@ class CollectLoanService: # Validate input data using CollectLoanSchema schema = CollectLoanSchema() - validated_data = schema.load(data) # Raises ValidationError if invalid + validated_data = schema.load(data) # Simulated processing logic response_data = { @@ -56,8 +56,6 @@ class CollectLoanService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/customer_consent.py b/app/blueprints/customer_consent.py index 6f33f47..17f9858 100644 --- a/app/blueprints/customer_consent.py +++ b/app/blueprints/customer_consent.py @@ -48,8 +48,6 @@ class CustomerConsentService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/disbursement.py b/app/blueprints/disbursement.py index b2ad0db..f4d9374 100644 --- a/app/blueprints/disbursement.py +++ b/app/blueprints/disbursement.py @@ -59,8 +59,6 @@ class DisbursementService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/eligibility_check.py b/app/blueprints/eligibility_check.py deleted file mode 100644 index 3b78d74..0000000 --- a/app/blueprints/eligibility_check.py +++ /dev/null @@ -1,77 +0,0 @@ -from flask import session -from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.eligibility_check import EligibilityCheckSchema -from marshmallow import ValidationError - -class EligibilityCheckService: - @staticmethod - def process_request(data): - """ - Process the EligibilityCheck request. - - Args: - data (dict): The request data. - - Returns: - dict: A standardized response. - """ - try: - logger.info("Processing EligibilityCheck request") - - # Validate input data using Schema - schema = EligibilityCheckSchema() - validated_data = schema.load(data) # Raises an error if invalid - - # Example: Validate data, perform calculations, etc. - if not data: - return ResponseHelper.error("Invalid input data", status_code=400) - - # Simulate processing - response_data = { - "customerId": "CN621868", - "transactionId": "Tr201712RK9232P115", - "msisdn": "3451342", - "eligibleOffers": [ - { - "minamount": 5000, - "maxamount": 20000, - "productId": 101, - "offerid": 101, - "Tenor": 30 - }, - { - "minamount": 20000, - "maxamount": 50000, - "productId": 102, - "offerid": 102, - "Tenor": 60 - } - ], - "resultCode": "00", - "resultDescription": "Successful" - } - - - # Return a success response - # return ResponseHelper.success( - # data=response_data, - # message="Eligibility check completed successfully" - # ) - - return response_data - except ValidationError as err: - logger.error(f"Validation Error: {err.messages}") - return ResponseHelper.error( - message="Invalid input data", - status_code=400, - error=err.messages - ) - - except Exception as e: - logger.error(f"An error occurred during EligibilityCheck processing: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, - error=str(e) - ) \ No newline at end of file diff --git a/app/blueprints/lien_check.py b/app/blueprints/lien_check.py index b3f2b3e..358882e 100644 --- a/app/blueprints/lien_check.py +++ b/app/blueprints/lien_check.py @@ -47,8 +47,6 @@ class LienCheckService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/loan_information.py b/app/blueprints/loan_information.py deleted file mode 100644 index d9197f9..0000000 --- a/app/blueprints/loan_information.py +++ /dev/null @@ -1,67 +0,0 @@ -from flask import request -from marshmallow import ValidationError -from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.loan_information import LoanInformationSchema - -class LoanInformationService: - @staticmethod - def process_request(data): - """ - Process the Loan Information request. - - Args: - data (dict): The request data. - - Returns: - dict: A standardized response. - """ - try: - logger.info("Processing LoanInformation request") - - # Validate input data using the imported schema - schema = LoanInformationSchema() - validated_data = schema.load(data) # Raises ValidationError if invalid - - # Simulated processing logic - response_data = { - "customerId": "CN621868", - "loans": [ - { - "debtId": "123456789", - "loanDate": "2019-10-18 14:26:21.063", - "dueDate": "2019-11-20 14:26:21.063", - "currentLoanAmount": 8500.0, - "initialLoanAmount": 10000.0, - "defaultFee": 0.0, - "continuousFee": 0.0, - "productId": "101" - } - ], - "resultCode": "00", - "resultDescription": "Successful" - } - - - # return ResponseHelper.success( - # data=response_data, - # message="Loan information retrieved successfully" - # ) - - return response_data - - except ValidationError as err: - logger.error(f"Validation Error: {err.messages}") - return ResponseHelper.error( - message="Invalid input data", - status_code=400, - error=err.messages - ) - - except Exception as e: - logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, - error=str(e) - ) diff --git a/app/blueprints/new_transaction_check.py b/app/blueprints/new_transaction_check.py index 60461f9..688d6ed 100644 --- a/app/blueprints/new_transaction_check.py +++ b/app/blueprints/new_transaction_check.py @@ -54,8 +54,6 @@ class NewTransactionCheckService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/notification_callback.py b/app/blueprints/notification_callback.py deleted file mode 100644 index 72522fa..0000000 --- a/app/blueprints/notification_callback.py +++ /dev/null @@ -1,54 +0,0 @@ -from flask import request -from marshmallow import ValidationError -from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.notification_callback import NotificationCallbackSchema - -class NotificationCallbackService: - @staticmethod - def process_request(data): - """ - Process the NotificationCallback request. - - Args: - data (dict): The request data. - - Returns: - dict: A standardized response. - """ - try: - logger.info("Processing NotificationCallback request") - - # Validate input data using the NotificationCallback schema - schema = NotificationCallbackSchema() - validated_data = schema.load(data) # Raises ValidationError if invalid - - # Simulated processing logic - response_data = { - "resultCode": "00", - "resultDescription": "Successful" - } - - - # return ResponseHelper.success( - # data=response_data, - # message="Notification callback processed successfully" - # ) - - return response_data - - except ValidationError as err: - logger.error(f"Validation Error: {err.messages}") - return ResponseHelper.error( - message="Invalid input data", - status_code=400, - error=err.messages - ) - - except Exception as e: - logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, - error=str(e) - ) diff --git a/app/blueprints/penal_charge.py b/app/blueprints/penal_charge.py index 5cc9df4..d8db5f8 100644 --- a/app/blueprints/penal_charge.py +++ b/app/blueprints/penal_charge.py @@ -48,8 +48,6 @@ class PenalChargeService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/provide_loan.py b/app/blueprints/provide_loan.py deleted file mode 100644 index 3c84d45..0000000 --- a/app/blueprints/provide_loan.py +++ /dev/null @@ -1,59 +0,0 @@ -from flask import request -from marshmallow import ValidationError -from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.provide_loan import ProvideLoanSchema - -class ProvideLoanService: - @staticmethod - def process_request(data): - """ - Process the ProvideLoan request. - - Args: - data (dict): The request data. - - Returns: - dict: A standardized response. - """ - try: - logger.info("Processing ProvideLoan request") - - # Validate input data using the imported schema - schema = ProvideLoanSchema() - validated_data = schema.load(data) # Raises ValidationError if invalid - - # Business logic - providing a loan - response_data ={ - "requestId": "202111170001371256908", - "transactionId": "Tr201712RK9232P115", - "customerId": "CN621868", - "accountId": "ACN8263457", - "msisdn": "3451342", - "resultCode": "00", - "resultDescription": "Successful" - } - - - # return ResponseHelper.success( - # data=response_data, - # message="Loan successfully provided" - # ) - - return response_data - - except ValidationError as err: - logger.error(f"Validation Error: {err.messages}") - return ResponseHelper.error( - message="Invalid input data", - status_code=400, - error=err.messages - ) - - except Exception as e: - logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, - error=str(e) - ) diff --git a/app/blueprints/rac_check.py b/app/blueprints/rac_check.py index 7a1397e..5940569 100644 --- a/app/blueprints/rac_check.py +++ b/app/blueprints/rac_check.py @@ -60,8 +60,6 @@ class RACCheckService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/repayment.py b/app/blueprints/repayment.py deleted file mode 100644 index fbedf68..0000000 --- a/app/blueprints/repayment.py +++ /dev/null @@ -1,54 +0,0 @@ -from flask import request -from marshmallow import ValidationError -from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.repayment import RepaymentSchema - -class RepaymentService: - @staticmethod - def process_request(data): - """ - Process the Repayment request. - - Args: - data (dict): The request data. - - Returns: - dict: A standardized response. - """ - try: - logger.info("Processing Repayment request") - - # Validate input data using the Repayment schema - schema = RepaymentSchema() - validated_data = schema.load(data) # Raises ValidationError if invalid - - # Simulated processing logic - response_data = { - "repayment_id": "67890", - "status": "Paid", - "amount": validated_data.get("amount", 0), # Example: Use validated field - } - - # return ResponseHelper.success( - # data=response_data, - # message="Repayment processed successfully" - # ) - - return response_data - - except ValidationError as err: - logger.error(f"Validation Error: {err.messages}") - return ResponseHelper.error( - message="Invalid input data", - status_code=400, - error=err.messages - ) - - except Exception as e: - logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, - error=str(e) - ) diff --git a/app/blueprints/revoke_enable_consent.py b/app/blueprints/revoke_enable_consent.py index 4379d7a..9da5b2e 100644 --- a/app/blueprints/revoke_enable_consent.py +++ b/app/blueprints/revoke_enable_consent.py @@ -51,8 +51,6 @@ class RevokeEnableConsentService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/select_offer.py b/app/blueprints/select_offer.py deleted file mode 100644 index 5a21f16..0000000 --- a/app/blueprints/select_offer.py +++ /dev/null @@ -1,109 +0,0 @@ -from flask import request -from marshmallow import ValidationError -from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.select_offer import SelectOfferSchema - -class SelectOfferService: - @staticmethod - def process_request(data): - """ - Process the SelectOffer request. - - Args: - data (dict): The request data. - - Returns: - dict: A standardized response. - """ - try: - logger.info("Processing SelectOffer request") - - # Validate input data using the imported schema - schema = SelectOfferSchema() - validated_data = schema.load(data) # Raises ValidationError if invalid - - # Business logic - selecting an offer - response_data = { - "outstandingDebtAmount": 0, - "requestId": "202111170001371256908", - "transactionId": "1231231321232", - "customerId": "1256907", - "accountId": "5948306019", - "offers": [ - { - "offerId": "14451", - "productId": "2030", - "amount": 10000.0, - "upfrontPayment": 1000.0, - "interestRate": 3.0, - "managementRate": 1.0, - "managementFee": 1.0, - "insuranceRate": 1.0, - "insuranceFee": 100.0, - "vatRate": 7.5, - "vatAmount": 100.0, - "recommendedRepaymentDates": ["2022-11-30"], - "installmentAmount": 11000.0, - "totalRepaymentAmount": 11000.0 - }, - { - "offerId": "16645", - "productId": "2060", - "amount": 10000.0, - "upfrontPayment": 0.0, - "interestRate": 3.0, - "managementRate": 1.0, - "managementFee": 1.0, - "insuranceRate": 1.0, - "insuranceFee": 100.0, - "vatRate": 7.5, - "vatAmount": 100.0, - "recommendedRepaymentDates": ["2022-11-30", "2023-12-30"], - "installmentAmount": 5761.9, - "totalRepaymentAmount": 11523.8 - }, - { - "offerId": "122212", - "productId": "2090", - "amount": 10000.0, - "upfrontPayment": 0.0, - "interestRate": 10.0, - "managementRate": 1.0, - "managementFee": 1.0, - "insuranceRate": 1.0, - "insuranceFee": 100.0, - "vatRate": 7.5, - "vatAmount": 100.0, - "recommendedRepaymentDates": ["2022-11-30", "2022-12-30", "2023-01-29"], - "installmentAmount": 4021.15, - "totalRepaymentAmount": 12063.45 - } - ], - "resultCode": "00", - "resultDescription": "Successful" - } - - - # return ResponseHelper.success( - # data=response_data, - # message="Offer selection completed successfully" - # ) - - return response_data - - except ValidationError as err: - logger.error(f"Validation Error: {err.messages}") - return ResponseHelper.error( - message="Invalid input data", - status_code=400, - error=err.messages - ) - - except Exception as e: - logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, - error=str(e) - ) diff --git a/app/blueprints/sms.py b/app/blueprints/sms.py deleted file mode 100644 index 08ce9a3..0000000 --- a/app/blueprints/sms.py +++ /dev/null @@ -1,56 +0,0 @@ -from marshmallow import ValidationError -from app.utils.logger import logger -from app.helpers.response_helper import ResponseHelper -from app.schemas.sms import SMSSchema - - -class SMSService: - @staticmethod - def process_request(data): - """ - Process the SMS request. - - Args: - data (dict): The request data. - - Returns: - dict: A standardized response. - """ - try: - logger.info("Processing SMS request") - - # Validate input data using SMSSchema - schema = SMSSchema() - validated_data = schema.load(data) # Raises ValidationError if invalid - - # Simulated SMS sending logic - response_data = { - "data": "", - "statusCode": 200, - "isSuccessful": True, - "errorMessage": None - } - - - # return ResponseHelper.success( - # data=response_data, - # message="SMS sent successfully" - # ) - - return response_data - - except ValidationError as err: - logger.error(f"Validation Error: {err.messages}") - return ResponseHelper.error( - message="Invalid input data", - status_code=400, - error=err.messages - ) - - except Exception as e: - logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, - error=str(e) - ) diff --git a/app/blueprints/token_validation.py b/app/blueprints/token_validation.py index 88fc77d..5369928 100644 --- a/app/blueprints/token_validation.py +++ b/app/blueprints/token_validation.py @@ -51,8 +51,6 @@ class TokenValidationService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/blueprints/transaction_verify.py b/app/blueprints/transaction_verify.py index 7aea3a0..3920e02 100644 --- a/app/blueprints/transaction_verify.py +++ b/app/blueprints/transaction_verify.py @@ -54,8 +54,6 @@ class TransactionVerifyService: except Exception as e: logger.error(f"An error occurred: {str(e)}", exc_info=True) - return ResponseHelper.error( - message="An internal error occurred", - status_code=500, + return ResponseHelper.internal_server_error( error=str(e) ) diff --git a/app/helpers/__pycache__/response_helper.cpython-39.pyc b/app/helpers/__pycache__/response_helper.cpython-39.pyc index 180c8b7951d142a5fe10c6c8ec7792eb3c890172..b48f8530fc96300e57f8e26385bc877479eef019 100644 GIT binary patch delta 22 bcmeCM?Xcxdv~D{tDgK#PAU*Th_f-Wn~@@{rKVpDJCV zRf(@lyq4f~+K~8$#G47eOj{D)l=w=5x9O_HI}%?@@O8Q&@kbKhOz;kUB=N@*f1Kc3 zbX($E65mO1o$g9}TjF~OzE7V>d`IF>=_hyR`jmbqah-Ngl%3wY!8tqh?Y_%;fiF_4ubsk(|JrsP zYU66NIn5Ui^B<7w9I?yPw&}4hi3)Bo95N2A2AO79fak*_Exze??{+?ORmX@a!Zc7d5$kfr6CI~yj47p-Nu*)117}mfi=L}xCLENfJ#wIDjWg()0&aKoBx+JUx&5sc=HWtbKHk- zVudt09y-gcN>f?!6kbS^+lKzMYNT>xaombXW)8POoSc>m+4)6=+YWMT8L6a+b9HeH zOY<4F!h5N(E~Hj`mEox)&#IA9j>R!7&u3U2qh!I|L(Tdo!)+J2wT+J`*y1>%f6n>N zt6WN`1x!IhtwAiJhZ(YaNVaKYBz18_m*x{~hN$P(MIz`gGaUDkW5r11eR1sI&&Rwl zRzS!7SY>|A@Opy0+QvsrW^oK_^BJ!C?9xi7jFiORGGtMOrbT1KY&RT5+E0h44@knO zf?D2#A}}nJP}Lz+J5#~jaz{}?gmyR)ks6$T_zT8Ul9$*|EX&n+k2q!w*TaPsl|O^} zsJk2G&s$2$@ZsJP93F9K^0J zUD9kIeD8BY8fH|oEZ_E+WpQ-!sQ%D)rT;~FX`IqXI0`mLW#l?mnBN@phVNsAw}4}G q<@vH{k=A55Kxm=XQcH@tC zonK}p=`U!6x3p;77rXnlB1uFdvMn)LlbNC^ETyGn&=fn(GFpaZwJghNIhNP*te_QG zQ7f_uZGx4w5-V$EHmOarDQ${XvEkdydU(^Rh%` zlBS1VDcS;Ec(zC~B-@cm?zKYlr0}EkO4bgeUJUdJQbPR*>g7P6BvYs#MZH3%hy7H^ z4C=>FuLbwl$t>!}QJ)L+d2$H#6R0l)`XV`u`bpG}1o}~O4E0l}9}n~s5$G4lMbyusekstG$TI5ZQC9=~GP#0!1NEzcevMp5{Q~MY z0{terh5AL*KMVBF$rq?!Lj882-ywHVUqby}@SeXU_fcOa4_Z>=;d_X%M#?WdwEMKj zt*+tAVJpi|`N}q>@J#ekqdfXa~HuKfiKfU&(wIS}yG3sqO#5G}hN1I3+QcCPivAYZ6;7R-P8|kIw zDf_7x(i{1u?4@7GujH2WR$gsnINa>#JJi!55_krhQ$6mO)OGb?lyFE(Zxuf+9@_Bp zoVq=jx3>~MAujxVNHuyr+_}^DsH+ZsmV3MYG#$s3ZbDEU5&v+r;vgw`r6}`L;%u*^ zhCuE!u)D z6za*b<$xoGO-uuo`FP+8fa=yb1Kb!x7h$p+09{mreDG<~e-GUcr@9bNSKy;G zba#w}F?a#6DrzJtB?kvJKW45g<}f4b<{%}mL>MmuV_p4Nf=mu{A|ABf4W($^9Omf9 z5!y>YTTn+CJ2}EqJYj(w<{;O67ombRv{zQcWg|JVay(gygbLR85x8Z5E2*LKl^omT ze_%5QbrX{fjj*Y}R#ijwY*0p%Bb!%3gHDD~Nf%8g^ZYG|tXbZzP$TF`ZT-SlCrhdf#B}Z6`C#-krb3MFd(0=_KfrSda zmsW)VO%ARe50`S8`)dT{CZOcip&w2TM|@|;Rp0!kFyXpj`YpnA3z%~17By^d>j09t zAb~k;irs~(L}a2^GD)=+@y(T9^|P*LczxGbobC62it8cg8TFup?g!EIJM;$~OA5a& zj;jsT&$MmB-R7X8HA6eAO$yh&ygB-$bJ4mFEH8RX^lNB~(0*WP$LfiN3M&F8UCe8k zIB-#7>|=Q0G{Vc%Dlk&tvut;H@NL59gzV>ay=yS4>wF%X8MOUq=s7rNw9{z$I2bGr z4u*p<;7f3TddH!#aLC#m(j$ko!(m->SVSCxlS5c=mRx727=}EbmOJ@HEi!i89 diff --git a/app/routes/routes.py b/app/routes/routes.py index 1033b4c..144f047 100644 --- a/app/routes/routes.py +++ b/app/routes/routes.py @@ -1,12 +1,5 @@ from flask import Blueprint, request, jsonify from app.blueprints import ( - EligibilityCheckService, - SelectOfferService, - ProvideLoanService, - LoanInformationService, - RepaymentService, - CustomerConsentService, - NotificationCallbackService, RACCheckService, DisbursementService, CollectLoanService, @@ -16,70 +9,20 @@ from app.blueprints import ( TokenValidationService, LienCheckService, NewTransactionCheckService, - SMSService, - BulkSMSService ) from app.utils.logger import logger +from app.middlewares import require_api_key api = Blueprint("api", __name__) -# EligibilityCheck Endpoint -@api.route('/EligibilityCheck', methods=['POST']) -def eligibility_check(): - data = request.get_json() - # logger.info(f"EligibilityCheck request received: {data}") - response = EligibilityCheckService.process_request(data) - return jsonify(response) +@api.before_request +def require_api_key_middleware(): + """Middleware applied globally to all API routes in this blueprint""" + return require_api_key() -# SelectOffer Endpoint -@api.route('/SelectOffer', methods=['POST']) -def select_offer(): - data = request.get_json() - # logger.info(f"SelectOffer request received: {data}") - response = SelectOfferService.process_request(data) - return jsonify(response) -# ProvideLoan Endpoint -@api.route('/ProvideLoan', methods=['POST']) -def provide_loan(): - data = request.get_json() - # logger.info(f"ProvideLoan request received: {data}") - response = ProvideLoanService.process_request(data) - return jsonify(response) - -# LoanInformation Endpoint -@api.route('/LoanInformation', methods=['GET']) -def loan_information(): - data = request.args.to_dict() - # logger.info(f"LoanInformation request received: {data}") - response = LoanInformationService.process_request(data) - return jsonify(response) - -# Repayment Endpoint -@api.route('/Repayment', methods=['POST']) -def repayment(): - data = request.get_json() - # logger.info(f"Repayment request received: {data}") - response = RepaymentService.process_request(data) - return jsonify(response) - -# CustomerConsent Endpoint -@api.route('/CustomerConsent', methods=['POST']) -def customer_consent(): - data = request.get_json() - # logger.info(f"CustomerConsent request received: {data}") - response = CustomerConsentService.process_request(data) - return jsonify(response) - -# NotificationCallback Endpoint -@api.route('/NotificationCallback', methods=['POST']) -def notification_callback(): - data = request.get_json() - # logger.info(f"NotificationCallback request received: {data}") - response = NotificationCallbackService.process_request(data) - return jsonify(response) # RACCheck Endpoint @api.route('/RACCheck', methods=['POST']) @@ -153,22 +96,6 @@ def new_transaction_check(): response = NewTransactionCheckService.process_request(data) return jsonify(response) -# SMS Endpoint -@api.route('/SMS', methods=['POST']) -def sms(): - data = request.get_json() - # logger.info(f"SMS request received: {data}") - response = SMSService.process_request(data) - return jsonify(response) - -# BulkSMS Endpoint -@api.route('/BulkSMS', methods=['POST']) -def bulk_sms(): - data = request.get_json() - # logger.info(f"BulkSMS request received: {data}") - response = BulkSMSService.process_request(data) - return jsonify(response) - # Health Check Endpoint @api.route('/health', methods=['GET']) def health_check(): diff --git a/app/schemas/__pycache__/__init__.cpython-39.pyc b/app/schemas/__pycache__/__init__.cpython-39.pyc index 5b171dcc2a095f2741847928236d975643f47a8a..b6f3844864d1e6ddf27c7c2a579578a679da60d6 100644 GIT binary patch delta 16 VcmXRf=St+|ZD!?7ZD!?7(^b delta 22 ccmZo?ZD-|8dmk(ZZ?0SH3R+(}=tkvE$K08Cg0%m4rY delta 22 ccmeyt@q>dmk(ZZ?0SHVt-AUiJkvE$K07|X~pa1{> diff --git a/app/schemas/__pycache__/rac_check.cpython-39.pyc b/app/schemas/__pycache__/rac_check.cpython-39.pyc index 151cb6dd14f3f0a3c662816773712e77cd2d343b..2b8b7a34004fd0c9b0152cb253562693c7f90f1c 100644 GIT binary patch delta 73 zcmcb}evzFwk(ZZ?0SH3R+)0nz$oq~-FN(LMC^4@%F}Wl&KhHBIN+2yMF9bz|E4j3| PBtJK`2q-&QlX(RIfz=tU delta 73 zcmcb}evzFwk(ZZ?0SHVt-AT{i$oq~-?-p-KQDR})WknIld delta 80 zcmbQhF@b|Ok(ZZ?0SHVt-APy4$m_t&cx$pBvof0qP^?H~ayfIM280Rbg9uR|af`zy TH$SB`C)JJ-$SY<75&|p$qdpHy diff --git a/app/schemas/__pycache__/token_validation.cpython-39.pyc b/app/schemas/__pycache__/token_validation.cpython-39.pyc index 69311d44ae110585ecfbc708b231114c26b485bf..9a223e2d4e3e6332bc786658540d32489e222096 100644 GIT binary patch delta 22 ccmcb`e2bYkk(ZZ?0SH3R+)3x&$a|I%07O&K1=VQDR S8FK_6OfVlr2uzk`k^lfJlM^Zc diff --git a/app/schemas/bulk_sms.py b/app/schemas/bulk_sms.py deleted file mode 100644 index 40c2465..0000000 --- a/app/schemas/bulk_sms.py +++ /dev/null @@ -1,6 +0,0 @@ -from marshmallow import Schema, fields -from .sms import SMSSchema - -# Bulk SMS Schema -class BulkSMSSchema(Schema): - requests = fields.List(fields.Nested(SMSSchema), required=True) \ No newline at end of file diff --git a/app/schemas/eligibility_check.py b/app/schemas/eligibility_check.py deleted file mode 100644 index 41e3a3e..0000000 --- a/app/schemas/eligibility_check.py +++ /dev/null @@ -1,11 +0,0 @@ -from marshmallow import Schema, fields - -class EligibilityCheckSchema(Schema): - type = fields.Str(required=True, description="Request type") - transactionId = fields.Str(data_key="transactionId", required=True, description="Transaction ID") - countryCode = fields.Str(data_key="countryCode", required=True, description="Country code (ISO)") - customerId = fields.Str(data_key="customerId", required=True, description="Customer ID") - accountId = fields.Str(data_key="accountId", required=True, description="Account ID") - msisdn = fields.Str(required=True, description="Mobile number") - lienAmount = fields.Float(required=True, description="Amount for lien") - channel = fields.Str(required=True, description="Transaction channel (USSD, Mobile, Web)") diff --git a/app/schemas/loan_information.py b/app/schemas/loan_information.py deleted file mode 100644 index 4d9b5ab..0000000 --- a/app/schemas/loan_information.py +++ /dev/null @@ -1,5 +0,0 @@ -from marshmallow import Schema, fields - -# Loan Information Schema -class LoanInformationSchema(Schema): - loan_id = fields.Str(required=True) \ No newline at end of file diff --git a/app/schemas/notification_callback.py b/app/schemas/notification_callback.py deleted file mode 100644 index 19e6b4d..0000000 --- a/app/schemas/notification_callback.py +++ /dev/null @@ -1,14 +0,0 @@ -from marshmallow import Schema, fields - -# Notification Callback Schema -class NotificationCallbackSchema(Schema): - fbnTransactionId = fields.Str(required=True) - transactionId = fields.Str(required=True) - customerId = fields.Str(required=True) - accountId = fields.Str(required=True) - debtId = fields.Str(required=True) - transactionType = fields.Str(required=True) - amountProvided = fields.Float(required=True) - amountCollected = fields.Float(required=True) - responseCode = fields.Str(required=True) - responseDescription = fields.Str(required=True) \ No newline at end of file diff --git a/app/schemas/provide_loan.py b/app/schemas/provide_loan.py deleted file mode 100644 index ca82352..0000000 --- a/app/schemas/provide_loan.py +++ /dev/null @@ -1,16 +0,0 @@ -from marshmallow import Schema, fields - -# Provide Loan Schema -class ProvideLoanSchema(Schema): - type = fields.Str(required=True) - requestId = fields.Str(required=True) - transactionId = fields.Str(required=True) - customerId = fields.Str(required=True) - accountId = fields.Str(required=True) - msisdn = fields.Str(required=False) - productId = fields.Str(required=True) - lienAmount = fields.Float(required=True) - requestedAmount = fields.Float(required=True) - collectionType = fields.Int(required=True) - loanType = fields.Int(required=True) - channel = fields.Str(required=True) \ No newline at end of file diff --git a/app/schemas/repayment.py b/app/schemas/repayment.py deleted file mode 100644 index 535419c..0000000 --- a/app/schemas/repayment.py +++ /dev/null @@ -1,11 +0,0 @@ -from marshmallow import Schema, fields - -# Repayment Schema -class RepaymentSchema(Schema): - type = fields.Str(required=True) - msisdn = fields.Str(required=False) #optional - debtId = fields.Str(required=True) - productId = fields.Str(required=True) - transactionId = fields.Str(required=True) - customerId = fields.Str(required=True) - channel = fields.Str(required=True) diff --git a/app/schemas/select_offer.py b/app/schemas/select_offer.py deleted file mode 100644 index 99398e1..0000000 --- a/app/schemas/select_offer.py +++ /dev/null @@ -1,13 +0,0 @@ -from marshmallow import Schema, fields - -# Select Offer Schema -class SelectOfferSchema(Schema): - requestId = fields.Str(required=True, description="Unique request identifier") - transactionId = fields.Str(required=True, description="Transaction ID") - customerId = fields.Str(required=True, description="Customer ID") - accountId = fields.Str(required=True, description="Account ID") - msisdn = fields.Str(required=True, description="Mobile number") - requestedAmount = fields.Float(required=True, description="Amount requested") - productId = fields.Str(required=True, description="Product ID") - channel = fields.Str(required=True, description="Transaction channel (e.g., USSD)") - diff --git a/app/schemas/sms.py b/app/schemas/sms.py deleted file mode 100644 index e8209c4..0000000 --- a/app/schemas/sms.py +++ /dev/null @@ -1,7 +0,0 @@ -from marshmallow import Schema, fields - -# SMS Schema -class SMSSchema(Schema): - text = fields.Str(required=True) - dest = fields.Str(required=True) - unicode = fields.Bool(required=True) \ No newline at end of file diff --git a/app/utils/__pycache__/logger.cpython-39.pyc b/app/utils/__pycache__/logger.cpython-39.pyc index 7651329bb3c2c43a9670f663f5d478f4730c7087..d168ce844ec004e5642e5a448623c09a1b8c2c57 100644 GIT binary patch delta 141 zcmeywbekzIk(ZZ?0SH#B+)a07WMFs<;vfTdAjbiSi%oz;3PTEG4nq_}Dnk|{5HqDP z0ZHZ*<`k9`)?TJ`#uT<*W=5dw0+tl^g^W?G6H_V~*(TnToy^6k#KsFWpon*}5u=U} VACSqx%)-dR$i&R^kLfQPCjhxw7<~W$ delta 163 zcmcc3^oc1Yk(ZZ?0SHVt-ANB%WMFs<;vfSKAjbiSi>-h}3PTEG4nq_}Dnk|{5HqDP zr7|pFUI^l|q%fzjq_Flfr8A|l^)fR8#TKxpurFkcVw)IO$;dwOhAba%a7j^WVy;JG rUP?}C(ZnyxY