diff --git a/digifi_swagger.json b/digifi_swagger.json index 90717ab..a1f8af5 100644 --- a/digifi_swagger.json +++ b/digifi_swagger.json @@ -82,6 +82,14 @@ "description": "Find out more", "url": "https://www.simbrellang.net" } + }, + { + "name": "CollectLoanRequest", + "description": "Request to collect money from user accounts", + "externalDocs": { + "description": "Find out more", + "url": "https://www.simbrellang.net" + } } ], "paths": { @@ -460,6 +468,53 @@ } ] } + }, + "/CollectLoan": { + "post": { + "tags": [ + "CollectLoanRequest" + ], + "summary": "Request to collect money from user accounts", + "description": "This request is to collect money from user accounts. When request is received, FIRSTBANK should check all user accounts and collect as much as possible money to cover existing loan either partially or fully.", + "operationId": "collectLoanRequest", + "requestBody": { + "description": "Post JSON to collect loan", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectLoanRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectLoanResponse" + } + } + } + }, + "400": { + "description": "Invalid request parameters" + }, + "404": { + "description": "Resource not found" + }, + "422": { + "description": "Validation exception" + } + }, + "security": [ + { + "apiKey": [] + } + ] + } } }, "components": { @@ -1460,6 +1515,155 @@ "description": "Description of provided result code" } } + }, + "CollectLoanRequest": { + "type": "object", + "required": [ + "transactionId", + "fbnTransactionId", + "debtId", + "customerId", + "accountId", + "productId", + "collectAmount", + "collectionMethod", + "lienAmount", + "countryId" + ], + "properties": { + "transactionId": { + "type": "string", + "example": "T002", + "description": "Unique identifier of transaction in Simbrella system" + }, + "fbnTransactionId": { + "type": "string", + "example": "Tr201712RK9232P115", + "description": "Unique id of the transaction received from FBN in Eligibility or Provision requests" + }, + "debtId": { + "type": "string", + "example": "273194670", + "description": "Unique identifier of a loan in Simbrella system" + }, + "customerId": { + "type": "string", + "example": "CN621868", + "description": "Unique identifier of a user" + }, + "accountId": { + "type": "string", + "example": "2017821799", + "description": "Specific identifier of a user's account" + }, + "productId": { + "type": "string", + "example": "101", + "description": "Identifier of a product for which collection to be made" + }, + "collectAmount": { + "type": "number", + "format": "double", + "example": 80000.00, + "description": "Amount to be collected from user's account (penalCharge is not included)" + }, + "penalCharge": { + "type": "number", + "format": "double", + "example": 0.0, + "description": "Amount of penalty to be collected from user's account. If there is no penalty, amount is '0'." + }, + "collectionMethod": { + "type": "integer", + "example": 1, + "description": "1 - on deposit of salary; 2 - on due date; 3 - initiated by user" + }, + "lienAmount": { + "type": "number", + "format": "double", + "example": 80000.00, + "description": "Aggregated (summed up) lien amount" + }, + "countryId": { + "type": "string", + "example": "01", + "description": "Set to static value '01'" + }, + "comment": { + "type": "string", + "example": "Testing CollectionLoanRequest", + "description": "Any additional comment for provided loan operation" + } + } + }, + "CollectLoanResponse": { + "type": "object", + "required": [ + "transactionId", + "debtId", + "customerId", + "accountId", + "productId", + "collectAmount", + "lienAmount", + "resultCode", + "resultDescription" + ], + "properties": { + "transactionId": { + "type": "string", + "example": "T002", + "description": "Unique identifier of transaction in Simbrella system" + }, + "debtId": { + "type": "string", + "example": "273194670", + "description": "Unique identifier of a loan in Simbrella system" + }, + "customerId": { + "type": "string", + "example": "CN621868", + "description": "Unique identifier of a user" + }, + "accountId": { + "type": "string", + "example": "2017821799", + "description": "Specific identifier of a user's account" + }, + "productId": { + "type": "string", + "example": "101", + "description": "Identifier of a product for which collection to be made" + }, + "collectAmount": { + "type": "number", + "format": "double", + "example": 60000.00, + "description": "Amount collected from user's account" + }, + "penalCharge": { + "type": "number", + "format": "double", + "example": 0.0, + "description": "Amount of penalty collected from user's account" + }, + "lienAmount": { + "type": "number", + "format": "double", + "example": 20000.00, + "description": "Remaining lien amount" + }, + "resultCode": { + "type": "string", + "example": "00", + "description": "Result code of executed transaction" + }, + "resultDescription": { + "type": "string", + "example": "Loan Collection Successful", + "description": "Description of provided result code" + } + } } }, "securitySchemes": {