done with repayment

This commit is contained in:
lennyaiko
2025-03-27 11:51:52 +01:00
parent cf561728cb
commit 87015cbddb
2 changed files with 75 additions and 0 deletions
+26
View File
@@ -91,3 +91,29 @@ def status():
}
return jsonify(response), 200
@loan_bp.route("/repayment", methods=["POST"])
def repayment():
data = request.json
api_url = f"{current_app.config['API_BASE_URL']}/Repayment"
# response = requests.post(api_url, json=data, headers=get_headers())
# return jsonify(response.json()), response.status_code
response = {
"requestId": "R02802",
"countryCode": "NGR",
"transactionId": "Tr201712RK9232P115",
"debtId": "273194670",
"customerId": "CN621868",
"accountId": "2017821799",
"productId": "101",
"collectedAmount": 60000,
"penalCharge": 0,
"lienAmount": 20000,
"comment": "Testing CollectionLoanRequest",
"resultCode": "00",
"resultDescription": "Loan Collection Successful",
}
return jsonify(response), 200
+49
View File
@@ -163,3 +163,52 @@ paths:
responses:
200:
description: A successful response
/loans/repayment:
post:
summary: Repays a loan
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
requestId:
type: string
example: "R02802"
countryCode:
type: string
example: "NGR"
transactionId:
type: string
example: "Tr201712RK9232P115"
debtId:
type: string
example: "273194670"
customerId:
type: string
example: "CN621868"
accountId:
type: string
example: "2017821799"
productId:
type: string
example: "101"
collectedAmount:
type: integer
example: 80000
penalCharge:
type: integer
example: 0
collectionMethod:
type: integer
example: 1
lienAmount:
type: integer
example: 80000
comment:
type: string
example: "Testing CollectionLoanRequest"
responses:
200:
description: A successful response