From 99420f37c0918ebc5899ebf1fb2616aa60e98074 Mon Sep 17 00:00:00 2001 From: lennyaiko Date: Thu, 27 Mar 2025 12:22:59 +0100 Subject: [PATCH] done with penal charge --- app/routes/loan.py | 15 +++++++++++++++ openapi.yml | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/app/routes/loan.py b/app/routes/loan.py index b162cb0..a15832a 100644 --- a/app/routes/loan.py +++ b/app/routes/loan.py @@ -225,3 +225,18 @@ def transaction_verify(): } return jsonify(response), 200 + + +@loan_bp.route("/penal-charge", methods=["POST"]) +def penal_charge(): + data = request.json + api_url = f"{current_app.config['API_BASE_URL']}/PenalCharge" + + # response = requests.post(api_url, json=data, headers=get_headers()) + # return jsonify(response.json()), response.status_code + response = { + "resultCode": "00", + "resultDescription": "Penal charge debited successfully", + } + + return jsonify(response), 200 diff --git a/openapi.yml b/openapi.yml index e533950..e0a5cd2 100644 --- a/openapi.yml +++ b/openapi.yml @@ -391,3 +391,42 @@ paths: responses: 200: description: A successful response + /loans/penal-charge: + post: + summary: A penalty charge on a customer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + transactionId: + type: string + example: "T004" + fbnTransactionId: + type: string + example: "Tr201712RK9232P115" + debtId: + type: string + example: "273194670" + customerId: + type: string + example: "CN621868" + accountId: + type: string + example: "2017821799" + penalCharge: + type: number + format: float + example: 101.2 + lienAmount: + type: number + format: float + example: 101.2 + comment: + type: string + example: "Testing PenalChargeRequest" + responses: + 200: + description: A successful response