progress on stuff
This commit is contained in:
@@ -41,3 +41,53 @@ def select_offer():
|
|||||||
}
|
}
|
||||||
|
|
||||||
return jsonify(response), 200
|
return jsonify(response), 200
|
||||||
|
|
||||||
|
|
||||||
|
@loan_bp.route("/provide-loan", methods=["POST"])
|
||||||
|
def provide_loan():
|
||||||
|
data = request.json
|
||||||
|
api_url = f"{current_app.config['API_BASE_URL']}/ProvideLoan"
|
||||||
|
|
||||||
|
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||||
|
# return jsonify(response.json()), response.status_code
|
||||||
|
response = {
|
||||||
|
"requestId": "202111170001371256908",
|
||||||
|
"transactionId": "Tr201712RK9232P115",
|
||||||
|
"customerId": "CN621868",
|
||||||
|
"accountId": "ACN8263457",
|
||||||
|
"msisdn": "3451342",
|
||||||
|
"resultCode": "00",
|
||||||
|
"resultDescription": "Successful",
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonify(response), 200
|
||||||
|
|
||||||
|
|
||||||
|
@loan_bp.route("/status", methods=["POST"])
|
||||||
|
def status():
|
||||||
|
data = request.json
|
||||||
|
api_url = f"{current_app.config['API_BASE_URL']}/LoanStatus"
|
||||||
|
|
||||||
|
# response = requests.post(api_url, json=data, headers=get_headers())
|
||||||
|
# return jsonify(response.json()), response.status_code
|
||||||
|
response = {
|
||||||
|
"customerId": "CN621868",
|
||||||
|
"transactionId": "Tr201712RK9232P115",
|
||||||
|
"loans": [
|
||||||
|
{
|
||||||
|
"debtId": "123456789",
|
||||||
|
"loanDate": "2019-10-18 14:26:21.063",
|
||||||
|
"dueDate": "2019-11-20 14:26:21.063",
|
||||||
|
"currentLoanAmount": 8500,
|
||||||
|
"initialLoanAmount": 10000,
|
||||||
|
"defaultPenaltyFee": 0,
|
||||||
|
"continuousFee": 0,
|
||||||
|
"productId": "101",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"totalDebtAmount": 8500,
|
||||||
|
"resultCode": "00",
|
||||||
|
"resultDescription": "Successful",
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonify(response), 200
|
||||||
|
|||||||
+68
@@ -95,3 +95,71 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: A successful response
|
description: A successful response
|
||||||
|
/loans/provide-loan:
|
||||||
|
post:
|
||||||
|
summary: Provides a loan
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
requestId:
|
||||||
|
type: string
|
||||||
|
example: "202111170001371256908"
|
||||||
|
transactionId:
|
||||||
|
type: string
|
||||||
|
example: "Tr201712RK9232P115"
|
||||||
|
customerId:
|
||||||
|
type: string
|
||||||
|
example: "CN621868"
|
||||||
|
accountId:
|
||||||
|
type: string
|
||||||
|
example: "ACN8263457"
|
||||||
|
msisdn:
|
||||||
|
type: string
|
||||||
|
example: "3451342"
|
||||||
|
productId:
|
||||||
|
type: string
|
||||||
|
example: "101"
|
||||||
|
requestedAmount:
|
||||||
|
type: integer
|
||||||
|
example: 900
|
||||||
|
collectionType:
|
||||||
|
type: integer
|
||||||
|
example: 1
|
||||||
|
offerId:
|
||||||
|
type: integer
|
||||||
|
example: 1127
|
||||||
|
channel:
|
||||||
|
type: string
|
||||||
|
example: "100"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: A successful response
|
||||||
|
/loans/status:
|
||||||
|
post:
|
||||||
|
summary: Returns the status of a loan
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
transactionId:
|
||||||
|
type: string
|
||||||
|
example: "Tr201712RK9232P115"
|
||||||
|
customerId:
|
||||||
|
type: string
|
||||||
|
example: "CN621868"
|
||||||
|
msisdn:
|
||||||
|
type: string
|
||||||
|
example: "3451342"
|
||||||
|
channel:
|
||||||
|
type: string
|
||||||
|
example: "100"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: A successful response
|
||||||
|
|||||||
Reference in New Issue
Block a user