The purpose of the tool is to store and provide the specifications of the loan products. It is used to provide data to the frontend to show all available product variants for a particular customer. It is also used to validate the incoming loan requests against available products based on risk parameters.
The process of uploading and activating the product table is described on page Uploading loan/overdraft product table.
Main features
Imports product parameters from the Google sheet and validates them.
Maintains the whole history of imported products.
Allows selecting the product version to be used.
Provides API for querying the product parameters based on various inputs.
Product parameters import and version handling
The products are specified using ordinary Google Sheet tables. The table is exported to an intermediate format (e.g. CSV) and imported to the tool. The column names and their content is defined by the tool and it is validated during import. There are multiple table types and they are used for different purposes (e.g. definitions of overdraft and loan product). The non-valid table is rejected. The valid table is imported and stored in a system as a new product version. The product version cannot be deleted.
The new version is not used automatically. There is a functionality (the REST endpoint) to select the current version of the product which will be used for the parameters querying.
Together with back office it has to be assured that the new version is selected after the correct approval process. For the MVP this could be handled by the API only.
The change of active version is logged and there is a functionality to retrieve the active version id for the requested timestamp.
There are Kafka notifications when the new version is created and the active version is changed.
High-level functions
Import table
Input:
Product name to be imported (table type)
CSV file with product definition
Output:
New product version
Show product parameters
Input:
Product version
Output:
Product table in JSON format
Select current version
Input:
Product name
Product version to be used
Get product version active in selected time
Input:
Product name
Timestamp (if ommited, the current active version is returned)
Output:
Product version
Product table data format and validation
The tool handles multiple product tables identified by name. Each table is specified by a schema. The schema contains list of columns with their names and allowed values (data type and range/regex).
Supported data types:
Integer
Decimal number (fixed point number)
Money
String
All number types can be further restricted using range and the string format can be defined using regex.
Two number columns can be connected together to provide range matching (minimum, maximum).
Querying parameters
The main purpose of the product tool is to query available products using the list of the parameters.
There is one endpoint used for this purpose. It returns product table rows which matches the input parameters. The matching logic is specified using matching operators. By default the parameter is matched if the value is equal.
All the parameter values can be ommited. If there is no parameter at the input, the whole table is returned.
Input:
Product name
List of parameter values
List of parameter matching operators
Output:
Product table in JSON format containing with the matching rows only
Available matching operators:
Equal (default)
Less
Less or equal
Greater
Greater or equal
Initial data implementation
Available products
In the first version there will be two product tables:
Loan product table
Overdraft product table
More will be added later, e.g.:
Documents required for getting loan above limit
Loan product table
Parameter | Example | Restrictions | Description |
---|---|---|---|
grade_min | 60 | Integer, lower then grade_max. | Lower bound of grade range. |
grade_max | 100 | Integer, greater then grade_min. | Upper bound of grade range. |
amount_min | 1001 | Preferably positive integer but works with decimal numbers too. Lower then amount_max. | Lower bound of amount range. |
amount_max | 2000 | Preferably positive integer but works with decimal numbers too. Greater then amount_min. | Upper bound of amount range. |
tenor | 6 | Positive integer. | Number of monthly installments. |
interest_rate | 0.12 | Positive decimal number representing percentege (0.5 = 50%). | Annual interest rate. |
monthly_interest_rate | 0.01 | Positive decimal number representing percentege (0.5 = 50%). Must be 1/12 of interest_rate. | Monthy interest rate. Just for checking annual interest rate. |
initial_fee | 25.5 | Positive decimal number. | Flat fee for taking the loan. |
initial_fee_percentage | 0.01 | Positive decimal number representing percentege (0.5 = 50%). | Percetage fee (from principal) for taking the loan. |
monthly_fee | 4.3 | Positive decimal number. | Monthly fee for having the loan. |
monthly_installment_min | 150 | Preferably positive integer but works with decimal numbers too. | Monthly installement cannot be lower that this number. |
monthly_installment_max | 510 | Preferably positive integer but works with decimal numbers too. | Monthly installement cannot be greater that this number. |
There cannot be mupliple products for specific grade, amount and tenor. It’s recommended to specify product continuously for amount (do not create gabs).
Input querying parameters provided by Risk engine:
Grade (score)
The row is matched if the parameter is inside the grade range in the row.
Max amount
The row is matched if the parameter is greater or equal than the minimum amount in the row.
Max monthly installment
The row is matched if the parameter is greater or equal than the minimum monthly installment in the row.
Max tenor
The row is matched if the parameter is lesser or equal than the tenor in the row.
Overdraft product table
Parameter | Example | Restrictions | Description |
---|---|---|---|
grade_min | 31 | integer, lower then grade_max | Lower bound of grade range. |
grade_max | 60 | integer, greater then grade_min | Upper bound of grade range. |
amount_min | 50 | preferably positive integer but works with decimal numbers too | Lower bound of amount range. |
amount_max | 500 | preferably positive integer but works with decimal numbers too | Upper bound of amount range. |
after_grace_period_fee | 40.6 | positive decimal number | Fee that is applied in not repaid in grace period. |
penalty_interest_rate | 0.07 | positive decimal number representing percentege (0.5 = 50%) | Controlled by Loxon. For customer information only. |
There cannot be mupliple products for specific grade and amount. It’s recommended to specify product continuously for amount (do not create gabs).
See also
https://advancegroup.larksuite.com/docs/docusrRjgdBVgTOjoKMsGHzDL3r