Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Goals

  • Implement a module that deals with collateral as an independent and dynamic entity of the Mifos X core system.
  • Remove the current tight coupling between loans and collaterals.

...

By developing the collateral module we will maintain the collaterals as a separate entity. This way a single collateral definition can be associated with multiple loans. The base price of the underlying security can be adjusted dynamically without affecting the loan products. The user will also have an option to custom build a collateral as a combination of several individual collateral definitions. Even the financial institutions will have the option to roll out various collateral schemes based on specific use cases. 

...

DB Design

Image RemovedImage Added

 

Foreign Keys:

`m_loan_collateral`.`collateral.id`  Refers  `m_collateral`.`id`

`m_collateral`.`base_id`   Refers   `m_collateral_base_value`.`id`

...

Columns (Explanation)

m_collateral_base_value

ColumnMeaning
type_cv_idThee code value table id of the particular collateral
base_price

The base unit price of the collateral (eg: 31000 for (10 grams)gold, Rs. 5000/sq ft for real estate etc.)

The base unit is pre decided.

m_collateral

ColumnMeaning
base_idid in the m_collateral_base_value table for the particular base definition of a collateral
quality_standardQuality description (24 carat, 20 carat etc. for gold)
pct_to_baseQuality value of the collateral as a percentage of the base quality ( 24(100%) carat, 20(83.33%) carat etc. for gold )

The m_collateral_base_value will mention the current market value of any collateral. It can be changed dynamically. For example If the Current market price of gold is 31k/10 grams, we will create an entry for gold collateral in m_code_value , refer it in the m_collateral_base_value and store 31k in the `m_collateral_base_value`.`base_price` column. This is the base value which will be used for all gold based collaterals created .


The m_collateral table stores the actual collateral definition. For example if we want to store the definition of 24 carat gold, The `m_collateral`.`base_id` will store the `m_collateral_base_value` table id for the gold price entry. The `m_collateral`.`quality_standard` will store the definition of the collateral (24 carat in this case). The `m_collateral`.`pct_to_base` is the percentage value w.r.t. the base price of that collateral. 24 carat gold being the purest form will have this value as 100.0 (100%). Other definitions such as 22 carat will have values less than 100.0 in this column. In case of collaterals such as real estate there is no definition of purity as such, hence all collateral definitions will have 100.0 value in the `pct_to_base` column.

...

       5. This will give the net collateral amount of the list of collaterals mentioned.
Sample Collateral Data for given loanId
[
{
"id": 6,
"collateralDetails": {
"codeValueName": "Gold Loan",
"quality": "22 carat",
"basePrice": 12.75,
"pctToBase": 77.5
},
"value": 29.64375,
"quantity": 3,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
},
{
"id": 7,
"collateralDetails": {
"codeValueName": "Gold Loan",
"quality": "24 carat",
"basePrice": 12.75,
"pctToBase": 80
},
"value": 51,
"quantity": 5,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
},
{
"id": 11,
"collateralDetails": {
"codeValueName": "Gold Loan",
"quality": "trial quality",
"basePrice": 12.75,
"pctToBase": 75
},
"value": 57.375,
"quantity": 6,
"currency": {
"code": "USD",
"name": "US Dollar",
"decimalPlaces": 2,
"displaySymbol": "$",
"nameCode": "currency.USD",
"displayLabel": "US Dollar ($)"
}
}
]
Implementation till now

https://github.com/karthikiyer/incubator-fineract/commit/4ab2f559d13634934ed1364c41f809411c82b2251504cd8b54a03077e1722f6feb9c3025cf448fb5

 

The above design is under review and will go through multiple changes which will be reflected in this document.