diff --git a/app/routes/loan.py b/app/routes/loan.py index 3f06551..f95ca5b 100644 --- a/app/routes/loan.py +++ b/app/routes/loan.py @@ -117,3 +117,33 @@ def repayment(): } return jsonify(response), 200 + + +@loan_bp.route("/rac-check", methods=["POST"]) +def rac_check(): + data = request.json + api_url = f"{current_app.config['API_BASE_URL']}/RACCheck" + + # response = requests.post(api_url, json=data, headers=get_headers()) + # return jsonify(response.json()), response.status_code + response = { + "transactionId": "T001", + "customerId": "CN621868", + "accountId": "2017821799", + "RACResponse": { + "Salary account": "1", + "BVN": "1", + "BVNAttachedToAccount": "1", + "CRMS": "1", + "CRC": "1", + "AccountStatus": "1", + "Lien": "1", + "NoBouncedCheck": "1", + "Whitelist": "1", + "NoPastDueSalaryLoan": "1", + "NoPastDueOtherLoan": "1", + }, + "resultDescription": "RAC Check Successful", + } + + return jsonify(response), 200 diff --git a/openapi.yml b/openapi.yml index 041e69f..6901425 100644 --- a/openapi.yml +++ b/openapi.yml @@ -212,3 +212,44 @@ paths: responses: 200: description: A successful response + /loans/raccheck: + post: + summary: Performs RAC check on a user + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + transactionId: + type: string + example: "T001" + fbnTransactionId: + type: string + example: "Tr201712RK9232P115" + customerId: + type: string + example: "CN621868" + accountId: + type: string + example: "2017821799" + RAC_Array: + type: array + items: + type: string + example: + - "SalaryAccount" + - "BVN" + - "BVNAttachedtoAccount" + - "CRC" + - "CRMS" + - "AccountStatus" + - "Lien" + - "NoBouncedCheck" + - "Whitelist" + - "NoPastDueSalaryLoan" + - "NoPastDueOtherLoan" + responses: + 200: + description: A successful response