Merge branch 'master' into IT_With_Waive_Interest
Merging branch master into this branch to stay current with the codebase before sending pull request
This commit is contained in:
@@ -18,3 +18,4 @@ repos
|
|||||||
rebel.xml
|
rebel.xml
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
|
*.ini
|
||||||
|
|||||||
+618
-265
@@ -470,6 +470,22 @@
|
|||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="#loans_charges">Loan Charges</a></td>
|
||||||
|
<td>loans/{loanId}/charges</td>
|
||||||
|
<td><a href="#loans_charges_create">Add a Loan Charge</a></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="alt">
|
||||||
|
<td></td>
|
||||||
|
<td>loans/{loanId}/charges/{loanChargeId}</td>
|
||||||
|
<td></td>
|
||||||
|
<td><a href="#loans_charges_retrieve">Retrieve a Loan Charge</a></td>
|
||||||
|
<td><a href="#loans_charges_update">Modify a Loan Charge</a></td>
|
||||||
|
<td><a href="#loans_charges_delete">Delete a Loan Charge</a></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="#guarantors">Loan Guarantors</a></td>
|
<td><a href="#guarantors">Loan Guarantors</a></td>
|
||||||
<td>loans/{loanId}/guarantors</td>
|
<td>loans/{loanId}/guarantors</td>
|
||||||
@@ -1529,7 +1545,7 @@ function executeAjaxRequest(url, verbType, jsonData, basicAuthKey, successFuncti
|
|||||||
<b>Error Message returned when attempting to create an Office without passing any parameters</b>
|
<b>Error Message returned when attempting to create an Office without passing any parameters</b>
|
||||||
{
|
{
|
||||||
"developerMessage": "The request was invalid. This typically will happen due to validation errors which are provided.",
|
"developerMessage": "The request was invalid. This typically will happen due to validation errors which are provided.",
|
||||||
"developerDocLink": "https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes",
|
"developerDocLink": "https://github.com/openMF/mifosx/wiki/HTTP-API-Error-codes",
|
||||||
"httpStatusCode": "400",
|
"httpStatusCode": "400",
|
||||||
"defaultUserMessage": "Validation errors exist.",
|
"defaultUserMessage": "Validation errors exist.",
|
||||||
"userMessageGlobalisationCode": "validation.msg.validation.errors.exist",
|
"userMessageGlobalisationCode": "validation.msg.validation.errors.exist",
|
||||||
@@ -4260,255 +4276,7 @@ Request Body:
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Loan Charges API-->
|
<!--Start of guarantors functionality-->
|
||||||
<a id="loans_charges" name="loans_charges" class="old-syle-anchor"> </a>
|
|
||||||
<div class="method-section">
|
|
||||||
<div class="method-description">
|
|
||||||
<h3>Loan Charges</h3>
|
|
||||||
<p>Loan charges can be fees or penalities. They can be defined using the charges api and associated with loan products.</p>
|
|
||||||
<p></p>
|
|
||||||
<table class=matrixHeading>
|
|
||||||
<tr class="matrixHeadingBG">
|
|
||||||
<td><div class="mifosXHeading2">Field Descriptions</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr class=alt>
|
|
||||||
<td>chargeId</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class=fielddesc>The id of the charge definition.</td>
|
|
||||||
</tr>
|
|
||||||
<tr class=alt>
|
|
||||||
<td>amount</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class=fielddesc>The flat amount or percenatge amount of the charge. (depending on its type)</td>
|
|
||||||
</tr>
|
|
||||||
<tr class=alt>
|
|
||||||
<td>dueDate</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class=fielddesc>The date the loan charge is due for collection. Relevant for charges defined as <b>specified due date</b>.</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a id="loans_charges_template" name="loans_charges_template" class="old-syle-anchor"> </a>
|
|
||||||
<div class="method-section">
|
|
||||||
<div class="method-description">
|
|
||||||
<h4>Retrieve Loan Charge Template</h4>
|
|
||||||
<p>This is a convenience resource. It can be useful when
|
|
||||||
building maintenance user interface screens for client
|
|
||||||
applications. The template data returned consists of any or all
|
|
||||||
of:
|
|
||||||
<ul>
|
|
||||||
<li class=normalli>Field Defaults</li>
|
|
||||||
<li class=normalli>Allowed Value Lists</li>
|
|
||||||
</ul>
|
|
||||||
</p>
|
|
||||||
<p>Example Request:</p>
|
|
||||||
<div class=apiClick>loans/1/charges/template</div>
|
|
||||||
</div>
|
|
||||||
<div class="method-example">
|
|
||||||
<code class="method-declaration">
|
|
||||||
GET https://DomainName/api/v1/loans/{loanId}/charges/template
|
|
||||||
</code>
|
|
||||||
<code class="method-response">
|
|
||||||
{
|
|
||||||
{
|
|
||||||
"amountPaid": 0,
|
|
||||||
"amountWaived": 0,
|
|
||||||
"amountWrittenOff": 0,
|
|
||||||
"chargeOptions": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Bank Fee (per installment)",
|
|
||||||
"active": true,
|
|
||||||
"penalty": false,
|
|
||||||
"currency": {
|
|
||||||
"code": "UGX",
|
|
||||||
"name": "Uganda Shilling",
|
|
||||||
"decimalPlaces": 2,
|
|
||||||
"displaySymbol": "USh",
|
|
||||||
"nameCode": "currency.UGX",
|
|
||||||
"displayLabel": "Uganda Shilling (USh)"
|
|
||||||
},
|
|
||||||
"amount": 1500,
|
|
||||||
"chargeTimeType": {
|
|
||||||
"id": 2,
|
|
||||||
"code": "chargeTimeType.specifiedDueDate",
|
|
||||||
"value": "Specified due date"
|
|
||||||
},
|
|
||||||
"chargeAppliesTo": {
|
|
||||||
"id": 1,
|
|
||||||
"code": "chargeAppliesTo.loan",
|
|
||||||
"value": "Loan"
|
|
||||||
},
|
|
||||||
"chargeCalculationType": {
|
|
||||||
"id": 1,
|
|
||||||
"code": "chargeCalculationType.flat",
|
|
||||||
"value": "Flat"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"penalty": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a id="loans_charges_create" name="loans_charges_create" class="old-syle-anchor"> </a>
|
|
||||||
<div class="method-section">
|
|
||||||
<div class="method-description">
|
|
||||||
<h4>Create a Loan Charge</h4>
|
|
||||||
<table class=matrixHeading>
|
|
||||||
<tr class="matrixHeadingBG">
|
|
||||||
<td><div class="mifosXHeading2">Mandatory Fields</div></td>
|
|
||||||
</tr>
|
|
||||||
<tr class=alt>
|
|
||||||
<td>chargeId, amount, dueDate (depending on chargeTimeType of charge definition)</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="method-example">
|
|
||||||
<code class="method-declaration">
|
|
||||||
POST https://DomainName/api/v1//loans/{loanId}/charges
|
|
||||||
</code>
|
|
||||||
<code class="method-request">
|
|
||||||
POST /loans/1/charges
|
|
||||||
Content-Type: application/json
|
|
||||||
Request Body:
|
|
||||||
{
|
|
||||||
"locale": "en",
|
|
||||||
"dateFormat": "dd MMMM yyyy",
|
|
||||||
"chargeId": 1,
|
|
||||||
"amount": "333",
|
|
||||||
"dueDate": "21 November 2011"
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
<code class="method-response">
|
|
||||||
{
|
|
||||||
"officeId": 1,
|
|
||||||
"clientId": 1,
|
|
||||||
"loanId": 1,
|
|
||||||
"resourceId": 14
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a id="loans_charges_update" name="loans_charges_update" class="old-syle-anchor"> </a>
|
|
||||||
<div class="method-section">
|
|
||||||
<div class="method-description">
|
|
||||||
<h4>Update a Loan Charge</h4>
|
|
||||||
</div>
|
|
||||||
<div class="method-example">
|
|
||||||
<code class="method-declaration">
|
|
||||||
PUT https://DomainName/api/v1//loans/{loanId}/charges/{loanChargeId}
|
|
||||||
</code>
|
|
||||||
<code class="method-request">
|
|
||||||
PUT /loans/1/charges/14
|
|
||||||
Content-Type: application/json
|
|
||||||
Request Body:
|
|
||||||
{
|
|
||||||
"locale": "en",
|
|
||||||
"amount": "650"
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
<code class="method-response">
|
|
||||||
{
|
|
||||||
"officeId": 1,
|
|
||||||
"clientId": 1,
|
|
||||||
"loanId": 1,
|
|
||||||
"resourceId": 14,
|
|
||||||
"changes": {
|
|
||||||
"amount": 650,
|
|
||||||
"locale": "en"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a id="loans_charges_delete" name="loans_charges_delete" class="old-syle-anchor"> </a>
|
|
||||||
<div class="method-section">
|
|
||||||
<div class="method-description">
|
|
||||||
<h4>Delete a Loan Charge</h4>
|
|
||||||
</div>
|
|
||||||
<div class="method-example">
|
|
||||||
<code class="method-declaration">
|
|
||||||
DELETE https://DomainName/api/v1//loans/{loanId}/charges/{loanChargeId}
|
|
||||||
</code>
|
|
||||||
<code class="method-request">
|
|
||||||
DELETE /loans/1/charges/14
|
|
||||||
Content-Type: application/json
|
|
||||||
</code>
|
|
||||||
<code class="method-response">
|
|
||||||
{
|
|
||||||
"officeId": 1,
|
|
||||||
"clientId": 1,
|
|
||||||
"loanId": 1,
|
|
||||||
"resourceId": 14
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a id="loans_charges_retrieve" name="loans_charges_retrieve" class="old-syle-anchor"> </a>
|
|
||||||
<div class="method-section">
|
|
||||||
<div class="method-description">
|
|
||||||
<h4>Retrieve a Loan Charge</h4>
|
|
||||||
</div>
|
|
||||||
<div class="method-example">
|
|
||||||
<code class="method-declaration">
|
|
||||||
GET https://DomainName/api/v1//loans/{loanId}/charges/{loanChargeId}
|
|
||||||
</code>
|
|
||||||
<code class="method-request">
|
|
||||||
GET /loans/1/charges/1
|
|
||||||
Content-Type: application/json
|
|
||||||
</code>
|
|
||||||
<code class="method-response">
|
|
||||||
{
|
|
||||||
"id": 14,
|
|
||||||
"chargeId": 1,
|
|
||||||
"name": "Bank Fee (per installment)",
|
|
||||||
"chargeTimeType": {
|
|
||||||
"id": 2,
|
|
||||||
"code": "chargeTimeType.specifiedDueDate",
|
|
||||||
"value": "Specified due date"
|
|
||||||
},
|
|
||||||
"dueDate": [
|
|
||||||
2011,
|
|
||||||
11,
|
|
||||||
21
|
|
||||||
],
|
|
||||||
"chargeCalculationType": {
|
|
||||||
"id": 1,
|
|
||||||
"code": "chargeCalculationType.flat",
|
|
||||||
"value": "Flat"
|
|
||||||
},
|
|
||||||
"percentage": 0,
|
|
||||||
"amountPercentageAppliedTo": 0,
|
|
||||||
"currency": {
|
|
||||||
"code": "UGX",
|
|
||||||
"name": "Uganda Shilling",
|
|
||||||
"decimalPlaces": 2,
|
|
||||||
"displaySymbol": "USh",
|
|
||||||
"nameCode": "currency.UGX",
|
|
||||||
"displayLabel": "Uganda Shilling (USh)"
|
|
||||||
},
|
|
||||||
"amount": 650,
|
|
||||||
"amountPaid": 0,
|
|
||||||
"amountWaived": 0,
|
|
||||||
"amountWrittenOff": 0,
|
|
||||||
"amountOutstanding": 650,
|
|
||||||
"amountOrPercentage": 650,
|
|
||||||
"penalty": false
|
|
||||||
}
|
|
||||||
</code>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a id="guarantors" name="guarantors" class="old-syle-anchor"> </a>
|
<a id="guarantors" name="guarantors" class="old-syle-anchor"> </a>
|
||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
@@ -5116,6 +4884,431 @@ No Request Body:
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- start of Loan charges content-->
|
||||||
|
<a id="loans_charges" name="loans_charges" class="old-syle-anchor"> </a>
|
||||||
|
<div class="method-section">
|
||||||
|
<div class="method-description">
|
||||||
|
<h3>Loan Charges</h3>
|
||||||
|
<p>Its typical for MFIs to add extra costs for their loan products. They
|
||||||
|
can be either Fees or Penalties.</p>
|
||||||
|
<p>Loan Charges are instances of <a href="#charges">Charges</a> and
|
||||||
|
represent either fees and penalties for loan products. Refer <a href="#charges">Charges</a>
|
||||||
|
for documentation of the various properties of a charge, Only additional properties (
|
||||||
|
specific to the context of a Charge being associated with a Loan) are
|
||||||
|
described here</p>
|
||||||
|
<table class=matrixHeading>
|
||||||
|
<tr class="matrixHeadingBG">
|
||||||
|
<td><div class="mifosXHeading2">Field Descriptions</div></td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>amountPaid</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>The Total amount which has been paid for this Charge
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>amountWaived</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>The Total amount that has been waived for this Charge
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>amountWrittenOff</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>Total amount written off from this Charge
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>amountOutstanding</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>The Total outstanding amount for this Charge
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="loans_charges_list" name="loans_charges_list"
|
||||||
|
class="old-syle-anchor"> </a>
|
||||||
|
<div class="method-section">
|
||||||
|
<div class="method-description">
|
||||||
|
<h4>List Loan Charges</h4>
|
||||||
|
<p>Example Requests:</p>
|
||||||
|
<div class=apiClick>loans/1/charges</div>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<div class=apiClick>loans/1/charges?fields=name,amountOrPercentage</div>
|
||||||
|
</div>
|
||||||
|
<div class="method-example">
|
||||||
|
<code class="method-declaration">
|
||||||
|
GET https://DomainName/api/v1/loans/{loanId}/charges
|
||||||
|
</code>
|
||||||
|
<code class="method-response">
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"chargeId": 1,
|
||||||
|
"name": "Loan Processing fee",
|
||||||
|
"chargeTimeType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeTimeType.disbursement",
|
||||||
|
"value": "Disbursement"
|
||||||
|
},
|
||||||
|
"chargeCalculationType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeCalculationType.flat",
|
||||||
|
"value": "Flat"
|
||||||
|
},
|
||||||
|
"percentage": 0,
|
||||||
|
"amountPercentageAppliedTo": 0,
|
||||||
|
"currency": {
|
||||||
|
"code": "USD",
|
||||||
|
"name": "US Dollar",
|
||||||
|
"decimalPlaces": 2,
|
||||||
|
"displaySymbol": "$",
|
||||||
|
"nameCode": "currency.USD",
|
||||||
|
"displayLabel": "US Dollar ($)"
|
||||||
|
},
|
||||||
|
"amount": 100,
|
||||||
|
"amountPaid": 0,
|
||||||
|
"amountWaived": 0,
|
||||||
|
"amountWrittenOff": 0,
|
||||||
|
"amountOutstanding": 100,
|
||||||
|
"amountOrPercentage": 100,
|
||||||
|
"penalty": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"chargeId": 2,
|
||||||
|
"name": "Collection Fee",
|
||||||
|
"chargeTimeType": {
|
||||||
|
"id": 2,
|
||||||
|
"code": "chargeTimeType.specifiedDueDate",
|
||||||
|
"value": "Specified due date"
|
||||||
|
},
|
||||||
|
"dueDate": [
|
||||||
|
2013,
|
||||||
|
3,
|
||||||
|
29
|
||||||
|
],
|
||||||
|
"chargeCalculationType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeCalculationType.flat",
|
||||||
|
"value": "Flat"
|
||||||
|
},
|
||||||
|
"percentage": 0,
|
||||||
|
"amountPercentageAppliedTo": 0,
|
||||||
|
"currency": {
|
||||||
|
"code": "USD",
|
||||||
|
"name": "US Dollar",
|
||||||
|
"decimalPlaces": 2,
|
||||||
|
"displaySymbol": "$",
|
||||||
|
"nameCode": "currency.USD",
|
||||||
|
"displayLabel": "US Dollar ($)"
|
||||||
|
},
|
||||||
|
"amount": 100,
|
||||||
|
"amountPaid": 0,
|
||||||
|
"amountWaived": 0,
|
||||||
|
"amountWrittenOff": 0,
|
||||||
|
"amountOutstanding": 100,
|
||||||
|
"amountOrPercentage": 100,
|
||||||
|
"penalty": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="loans_charges_template" name="loans_charges_template"
|
||||||
|
class="old-syle-anchor"> </a>
|
||||||
|
<div class="method-section">
|
||||||
|
<div class="method-description">
|
||||||
|
<h4>Retrieve Loan Charges Template</h4>
|
||||||
|
<p>This is a convenience resource. It can be useful when
|
||||||
|
building maintenance user interface screens for client
|
||||||
|
applications. The template data returned consists of any or all
|
||||||
|
of:
|
||||||
|
<ul>
|
||||||
|
<li class=normalli>Field Defaults</li>
|
||||||
|
<li class=normalli>Allowed Value Lists</li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
<p>Example Request:</p>
|
||||||
|
<div class=apiClick>loans/1/charges/template</div>
|
||||||
|
</div>
|
||||||
|
<div class="method-example">
|
||||||
|
<code class="method-declaration">
|
||||||
|
GET https://DomainName/api/v1/loans/{loanId}/charges/template
|
||||||
|
</code>
|
||||||
|
<code class="method-response">
|
||||||
|
{
|
||||||
|
"amountPaid": 0,
|
||||||
|
"amountWaived": 0,
|
||||||
|
"amountWrittenOff": 0,
|
||||||
|
"chargeOptions": [
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"name": "Collection Fee",
|
||||||
|
"active": true,
|
||||||
|
"penalty": false,
|
||||||
|
"currency": {
|
||||||
|
"code": "USD",
|
||||||
|
"name": "US Dollar",
|
||||||
|
"decimalPlaces": 2,
|
||||||
|
"displaySymbol": "$",
|
||||||
|
"nameCode": "currency.USD",
|
||||||
|
"displayLabel": "US Dollar ($)"
|
||||||
|
},
|
||||||
|
"amount": 100,
|
||||||
|
"chargeTimeType": {
|
||||||
|
"id": 2,
|
||||||
|
"code": "chargeTimeType.specifiedDueDate",
|
||||||
|
"value": "Specified due date"
|
||||||
|
},
|
||||||
|
"chargeAppliesTo": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeAppliesTo.loan",
|
||||||
|
"value": "Loan"
|
||||||
|
},
|
||||||
|
"chargeCalculationType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeCalculationType.flat",
|
||||||
|
"value": "Flat"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"name": "Late payment penalty",
|
||||||
|
"active": true,
|
||||||
|
"penalty": true,
|
||||||
|
"currency": {
|
||||||
|
"code": "USD",
|
||||||
|
"name": "US Dollar",
|
||||||
|
"decimalPlaces": 2,
|
||||||
|
"displaySymbol": "$",
|
||||||
|
"nameCode": "currency.USD",
|
||||||
|
"displayLabel": "US Dollar ($)"
|
||||||
|
},
|
||||||
|
"amount": 1,
|
||||||
|
"chargeTimeType": {
|
||||||
|
"id": 2,
|
||||||
|
"code": "chargeTimeType.specifiedDueDate",
|
||||||
|
"value": "Specified due date"
|
||||||
|
},
|
||||||
|
"chargeAppliesTo": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeAppliesTo.loan",
|
||||||
|
"value": "Loan"
|
||||||
|
},
|
||||||
|
"chargeCalculationType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeCalculationType.flat",
|
||||||
|
"value": "Flat"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"name": "Loan Processing fee",
|
||||||
|
"active": true,
|
||||||
|
"penalty": false,
|
||||||
|
"currency": {
|
||||||
|
"code": "USD",
|
||||||
|
"name": "US Dollar",
|
||||||
|
"decimalPlaces": 2,
|
||||||
|
"displaySymbol": "$",
|
||||||
|
"nameCode": "currency.USD",
|
||||||
|
"displayLabel": "US Dollar ($)"
|
||||||
|
},
|
||||||
|
"amount": 100,
|
||||||
|
"chargeTimeType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeTimeType.disbursement",
|
||||||
|
"value": "Disbursement"
|
||||||
|
},
|
||||||
|
"chargeAppliesTo": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeAppliesTo.loan",
|
||||||
|
"value": "Loan"
|
||||||
|
},
|
||||||
|
"chargeCalculationType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeCalculationType.flat",
|
||||||
|
"value": "Flat"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"penalty": false
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="loans_charges_retrieve" name="loans_charges_retrieve"
|
||||||
|
class="old-syle-anchor"> </a>
|
||||||
|
<div class="method-section">
|
||||||
|
<div class="method-description">
|
||||||
|
<h4>Retrieve a Loan Charge</h4>
|
||||||
|
<p>Example Requests:</p>
|
||||||
|
<div class=apiClick>/loans/1/charges/1</div>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<div class=apiClick>/loans/1/charges/1?fields=name,amountOrPercentage</div>
|
||||||
|
</div>
|
||||||
|
<div class="method-example">
|
||||||
|
<code class="method-declaration">
|
||||||
|
GET https://DomainName/api/v1/loans/{loanId}/charges/{chargeId}
|
||||||
|
</code>
|
||||||
|
<code class="method-response">
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"chargeId": 1,
|
||||||
|
"name": "Loan Processing fee",
|
||||||
|
"chargeTimeType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeTimeType.disbursement",
|
||||||
|
"value": "Disbursement"
|
||||||
|
},
|
||||||
|
"chargeCalculationType": {
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeCalculationType.flat",
|
||||||
|
"value": "Flat"
|
||||||
|
},
|
||||||
|
"percentage": 0,
|
||||||
|
"amountPercentageAppliedTo": 0,
|
||||||
|
"currency": {
|
||||||
|
"code": "USD",
|
||||||
|
"name": "US Dollar",
|
||||||
|
"decimalPlaces": 2,
|
||||||
|
"displaySymbol": "$",
|
||||||
|
"nameCode": "currency.USD",
|
||||||
|
"displayLabel": "US Dollar ($)"
|
||||||
|
},
|
||||||
|
"amount": 100,
|
||||||
|
"amountPaid": 0,
|
||||||
|
"amountWaived": 0,
|
||||||
|
"amountWrittenOff": 0,
|
||||||
|
"amountOutstanding": 100,
|
||||||
|
"amountOrPercentage": 100,
|
||||||
|
"penalty": false
|
||||||
|
} </code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="loans_charges_create" name="loans_charges_create" class="old-syle-anchor"> </a>
|
||||||
|
<div class="method-section">
|
||||||
|
<div class="method-description">
|
||||||
|
<h4>Create a Loan Charge</h4>
|
||||||
|
<table class=matrixHeading>
|
||||||
|
<tr class="matrixHeadingBG">
|
||||||
|
<td><div class="mifosXHeading2">Mandatory Fields
|
||||||
|
for Loan Charges</div></td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>chargeId, amount, dueDate</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="method-example">
|
||||||
|
<code class="method-declaration">
|
||||||
|
POST https://DomainName/api/v1/loans/{loanId}/charges
|
||||||
|
</code>
|
||||||
|
<code class="method-request">
|
||||||
|
POST /loans/1/charges
|
||||||
|
Content-Type: application/json
|
||||||
|
Request Body:
|
||||||
|
{
|
||||||
|
"chargeId": "2",
|
||||||
|
"locale": "en",
|
||||||
|
"amount": "100",
|
||||||
|
"dateFormat": "dd MMMM yyyy",
|
||||||
|
"dueDate": "29 April 2013"
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
<code class="method-response">
|
||||||
|
{
|
||||||
|
"officeId": 1,
|
||||||
|
"clientId": 1,
|
||||||
|
"loanId": 1,
|
||||||
|
"resourceId": 31
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="loans_charges_update" name="loans_charges_update"
|
||||||
|
class="old-syle-anchor"> </a>
|
||||||
|
<div class="method-section">
|
||||||
|
<div class="method-description">
|
||||||
|
<h4>Update a Loan Charge</h4>
|
||||||
|
<p>Currently Loan Charges may be updated only if the Loan
|
||||||
|
is not yet approved
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="method-example">
|
||||||
|
<code class="method-declaration">
|
||||||
|
PUT https://DomainName/api/v1/loans/{loanId}/charges/{chargeId}
|
||||||
|
</code>
|
||||||
|
<code class="method-request">
|
||||||
|
PUT loans/1/charges/12
|
||||||
|
Content-Type: application/json
|
||||||
|
Request Body:
|
||||||
|
{
|
||||||
|
"dateFormat": "dd MMMM yyyy",
|
||||||
|
"locale": "en",
|
||||||
|
"amount": "60",
|
||||||
|
"dueDate": "27 March 2013"
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
<code class="method-response">
|
||||||
|
{
|
||||||
|
"officeId": 1,
|
||||||
|
"clientId": 1,
|
||||||
|
"loanId": 1,
|
||||||
|
"resourceId": 6,
|
||||||
|
"changes": {
|
||||||
|
"dueDate": "27 March 2013",
|
||||||
|
"dateFormat": "dd MMMM yyyy",
|
||||||
|
"locale": "en",
|
||||||
|
"amount": 60.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="loans_charges_delete" name="loans_charges_delete" class="old-syle-anchor"> </a>
|
||||||
|
<div class="method-section">
|
||||||
|
<div class="method-description">
|
||||||
|
<h4>Delete a Loan Charge</h4>
|
||||||
|
<p>
|
||||||
|
<b>Note:</b>Currently, A Loan Charge may only be removed from Loans that are not
|
||||||
|
yet approved.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="method-example">
|
||||||
|
<code class="method-declaration">
|
||||||
|
DELETE https://DomainName/api/v1/loans/{loanId}/charges/{chargeId}
|
||||||
|
</code>
|
||||||
|
<code class="method-request">
|
||||||
|
DELETE loans/1/charges/2
|
||||||
|
Content-Type: application/json
|
||||||
|
No Request Body:
|
||||||
|
</code>
|
||||||
|
<code class="method-response">
|
||||||
|
{
|
||||||
|
"officeId": 1,
|
||||||
|
"clientId": 1,
|
||||||
|
"loanId": 1,
|
||||||
|
"resourceId": 2
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- start of offices content -->
|
<!-- start of offices content -->
|
||||||
<a id="offices" name="offices" class="old-syle-anchor"> </a>
|
<a id="offices" name="offices" class="old-syle-anchor"> </a>
|
||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
@@ -6808,7 +7001,7 @@ Request Body:
|
|||||||
<div class="method-description">
|
<div class="method-description">
|
||||||
<h3>Staff</h3>
|
<h3>Staff</h3>
|
||||||
<p>Allows you to model staff members. At present the key role
|
<p>Allows you to model staff members. At present the key role
|
||||||
of signifigance is whether this staff member is a loan officer or
|
of significance is whether this staff member is a loan officer or
|
||||||
not.</p>
|
not.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -6925,21 +7118,156 @@ Request Body:
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--Charges section starts here-->
|
||||||
<a id="charges" name="charges" class="old-syle-anchor"> </a>
|
<a id="charges" name="charges" class="old-syle-anchor"> </a>
|
||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
<div class="method-description">
|
<div class="method-description">
|
||||||
<h3>Charges</h3>
|
<h3>Charges</h3>
|
||||||
<p>
|
<p>
|
||||||
Its typical for MFIs to add extra costs to their financial
|
Its typical for MFIs to add extra costs for their financial
|
||||||
products. There are typically <b>Fees</b> or <b>Penalites</b>.
|
products. There are typically <b>Fees</b> or <b>Penalties</b>.
|
||||||
</p>
|
</p>
|
||||||
<p>Charges is what we use to model both fees and penalities.
|
<p>Charges is what we use to model both fees and penalties.
|
||||||
For now charges can only be associated with loan products / loans.</p>
|
For now charges can only be associated with loan products / loans.</p>
|
||||||
|
<table class=matrixHeading>
|
||||||
|
<tr class="matrixHeadingBG">
|
||||||
|
<td><div class="mifosXHeading2">Field Descriptions</div></td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>name</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>Name associated with this charge.</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>active</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>Boolean flag determines if the Charge is currently active.</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>penalty</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>Boolean flag determines if the Charge is a penalty.</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>currency</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>Details of the currency associated with this charge.
|
||||||
|
Refer <a href="#charges_template">Charges Template</a> for additional details</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>amount</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>Field holds the details of the actual amount to be collected
|
||||||
|
in the case of "Flat Charges" or the percentage amount to be collected in
|
||||||
|
case of "Percentage Amount Charges". Refer <a href="#charges_template">Charges Template</a>
|
||||||
|
for details of the Available Charge Types</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>chargeTimeType</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>The time at which the charge becomes Due.
|
||||||
|
Refer <a href="#charges_template">Charges Template</a> for additional details</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>chargeAppliesTo</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>The Entity for which the charge can be applied (Loans etc).
|
||||||
|
Refer <a href="#charges_template">Charges Template</a> for additional details</td>
|
||||||
|
</tr>
|
||||||
|
<tr class=alt>
|
||||||
|
<td>chargeCalculationType</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class=fielddesc>Rules for calculating the amount for a particular Charge.
|
||||||
|
Refer <a href="#charges_template">Charges Template</a> for additional details</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a id="charges_create" name="staff_create" class="old-syle-anchor"> </a>
|
<a id="charges_template" name="charges_template"
|
||||||
|
class="old-syle-anchor"> </a>
|
||||||
|
<div class="method-section">
|
||||||
|
<div class="method-description">
|
||||||
|
<h4>Retrieve Charges Details Template</h4>
|
||||||
|
<p>This is a convenience resource. It can be useful when
|
||||||
|
building maintenance user interface screens for client
|
||||||
|
applications. The template data returned consists of any or all
|
||||||
|
of:
|
||||||
|
<ul>
|
||||||
|
<li class=normalli>Field Defaults</li>
|
||||||
|
<li class=normalli>Allowed Value Lists</li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
<p>Example Request:</p>
|
||||||
|
<div class=apiClick>charges/template</div>
|
||||||
|
</div>
|
||||||
|
<div class="method-example">
|
||||||
|
<code class="method-declaration">
|
||||||
|
GET https://DomainName/api/v1/charges/template
|
||||||
|
</code>
|
||||||
|
<code class="method-response">
|
||||||
|
{
|
||||||
|
"active": false,
|
||||||
|
"penalty": false,
|
||||||
|
"currencyOptions":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"code": "USD",
|
||||||
|
"name": "US Dollar",
|
||||||
|
"decimalPlaces": 2,
|
||||||
|
"displaySymbol": "$",
|
||||||
|
"nameCode": "currency.USD",
|
||||||
|
"displayLabel": "US Dollar ($)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"chargeCalculationTypeOptions":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeCalculationType.flat",
|
||||||
|
"value": "Flat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"code": "chargeCalculationType.percent.of.amount",
|
||||||
|
"value": "% Amount"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"chargeAppliesToOptions":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeAppliesTo.loan",
|
||||||
|
"value": "Loan"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"chargeTimeTypeOptions":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"code": "chargeTimeType.disbursement",
|
||||||
|
"value": "Disbursement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"code": "chargeTimeType.specifiedDueDate",
|
||||||
|
"value": "Specified due date"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a id="charges_create" name="charges_create" class="old-syle-anchor"> </a>
|
||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
<div class="method-description">
|
<div class="method-description">
|
||||||
<h4>Create/Define a Charge</h4>
|
<h4>Create/Define a Charge</h4>
|
||||||
@@ -6965,7 +7293,32 @@ Request Body:
|
|||||||
"active": true
|
"active": true
|
||||||
}
|
}
|
||||||
</code>
|
</code>
|
||||||
<code class="method-response">{ "resourceId": 1 }</code>
|
<code class="method-response">
|
||||||
|
{
|
||||||
|
"resourceId": 1
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
<code class="method-request">
|
||||||
|
POST charges
|
||||||
|
Content-Type: application/json
|
||||||
|
Request Body:
|
||||||
|
{
|
||||||
|
"locale": "en",
|
||||||
|
"name": "Default Penalty",
|
||||||
|
"amount": "2",
|
||||||
|
"currencyCode": "USD",
|
||||||
|
"chargeAppliesTo": "1",
|
||||||
|
"chargeTimeType": "2",
|
||||||
|
"chargeCalculationType": "2",
|
||||||
|
"active": "true",
|
||||||
|
"penalty": "true"
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
<code class="method-response">
|
||||||
|
{
|
||||||
|
"resourceId": 4
|
||||||
|
}
|
||||||
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -7118,8 +7471,8 @@ Content-Type: application/json
|
|||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
<div class="method-description">
|
<div class="method-description">
|
||||||
<h3>Savings Product:</h3>
|
<h3>Savings Product:</h3>
|
||||||
<p>An MFIs savings product offerings are modelled using this API.</p>
|
<p>An MFIs savings product offerings are modeled using this API.</p>
|
||||||
<p>When creating savings accounts, the details from the savings product are used to autofill details of savings account.</p>
|
<p>When creating savings accounts, the details from the savings product are used to auto fill details of savings account.</p>
|
||||||
<table class=matrixHeading>
|
<table class=matrixHeading>
|
||||||
<tr class="matrixHeadingBG"><td><div class="mifosXHeading2">Field Descriptions</div></td></tr>
|
<tr class="matrixHeadingBG"><td><div class="mifosXHeading2">Field Descriptions</div></td></tr>
|
||||||
|
|
||||||
@@ -7130,7 +7483,7 @@ Content-Type: application/json
|
|||||||
<tr><td class=fielddesc>A description of the product offering.</td></tr>
|
<tr><td class=fielddesc>A description of the product offering.</td></tr>
|
||||||
|
|
||||||
<tr class=alt><td>currencyCode</td></tr>
|
<tr class=alt><td>currencyCode</td></tr>
|
||||||
<tr><td class=fielddesc>Three letter ISO code reprsenting currency.</td></tr>
|
<tr><td class=fielddesc>Three letter ISO code representing currency.</td></tr>
|
||||||
|
|
||||||
<tr class=alt><td>digitsAfterDecimal</td></tr>
|
<tr class=alt><td>digitsAfterDecimal</td></tr>
|
||||||
<tr><td class=fielddesc>Override the currency default value for digitsAfterDecimal.</td></tr>
|
<tr><td class=fielddesc>Override the currency default value for digitsAfterDecimal.</td></tr>
|
||||||
@@ -7724,7 +8077,7 @@ Request Body:
|
|||||||
<h4>Arguments</h4>
|
<h4>Arguments</h4>
|
||||||
<dl class="argument-list">
|
<dl class="argument-list">
|
||||||
<dt>associations</dt>
|
<dt>associations</dt>
|
||||||
<dd>optional, <span>Either 'all' or a comma separated list of savings 'associations' (itemised below).</span></dd>
|
<dd>optional, <span>Either 'all' or a comma separated list of savings 'associations' (itemized below).</span></dd>
|
||||||
<dd><br>Associations are just extra pieces of data that you might or might not want to retrieve.<br><br></dd>
|
<dd><br>Associations are just extra pieces of data that you might or might not want to retrieve.<br><br></dd>
|
||||||
<dd><b>'all':</b> Gets data related to all associations e.g. ?associations=all.</dd>
|
<dd><b>'all':</b> Gets data related to all associations e.g. ?associations=all.</dd>
|
||||||
<dd><b>'transactions':</b> Gets data related to transactions on the account e.g. ?associations=transactions</dd>
|
<dd><b>'transactions':</b> Gets data related to transactions on the account e.g. ?associations=transactions</dd>
|
||||||
@@ -7813,7 +8166,7 @@ No Request Body:
|
|||||||
<div class="method-section">
|
<div class="method-section">
|
||||||
<div class="method-description">
|
<div class="method-description">
|
||||||
<h2>Delete a Savings Account</h2>
|
<h2>Delete a Savings Account</h2>
|
||||||
<p>At present we support <b>hard</b> delete of savings account but this is likely to change to a savings account <b>closure</b> or <b>de-activation</b> process/command.</p>
|
<p>At present we support <b>hard</b> delete of savings account but this is likely to change to a savings account <b>closure</b> or <b>De-activation</b> process/command.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="method-example">
|
<div class="method-example">
|
||||||
<code class="method-declaration">DELETE https://Domain Name/api/v1/savingsaccounts/{accountsId}</code>
|
<code class="method-declaration">DELETE https://Domain Name/api/v1/savingsaccounts/{accountsId}</code>
|
||||||
@@ -7959,7 +8312,7 @@ No Request Body:
|
|||||||
'plugged-in' table. The API checks for permission and for 'data
|
'plugged-in' table. The API checks for permission and for 'data
|
||||||
scoping' (only data within the users' office hierarchy can be
|
scoping' (only data within the users' office hierarchy can be
|
||||||
managed by the user).</p>
|
managed by the user).</p>
|
||||||
<p>The Mifos X Reference App uses a JQuery plugin called
|
<p>The Mifos X Reference App uses a JQuery plug-in called
|
||||||
stretchydatatables (which in turn uses this datatables resource)
|
stretchydatatables (which in turn uses this datatables resource)
|
||||||
to provide a pretty flexible CRUD (Create, Read, Update, Delete)
|
to provide a pretty flexible CRUD (Create, Read, Update, Delete)
|
||||||
User Interface.</p>
|
User Interface.</p>
|
||||||
@@ -9927,7 +10280,7 @@ No Request Body
|
|||||||
<code class="method-response">
|
<code class="method-response">
|
||||||
{
|
{
|
||||||
"developerMessage": "Invalid authentication details were passed in api request.",
|
"developerMessage": "Invalid authentication details were passed in api request.",
|
||||||
"developerDocLink": "https://github.com/keithwoodlock/mifosx/wiki/HTTP-API-Error-codes",
|
"developerDocLink": "https://github.com/openMF/mifosx/wiki/HTTP-API-Error-codes",
|
||||||
"httpStatusCode": "401",
|
"httpStatusCode": "401",
|
||||||
"defaultUserMessage": "Unauthenticated. Please login.",
|
"defaultUserMessage": "Unauthenticated. Please login.",
|
||||||
"userMessageGlobalisationCode": "error.msg.not.authenticated",
|
"userMessageGlobalisationCode": "error.msg.not.authenticated",
|
||||||
@@ -11720,7 +12073,7 @@ Content-Type: application/json
|
|||||||
<tr class="alt">
|
<tr class="alt">
|
||||||
<td><a href="#loans_charges">Loan Charges</a></td>
|
<td><a href="#loans_charges">Loan Charges</a></td>
|
||||||
<td>loans/{loanId}/charges</td>
|
<td>loans/{loanId}/charges</td>
|
||||||
<td><a href="#loans_charges_create">Add a loan charge</a></td>
|
<td><a href="#loans_charges_create">Add a Loan Charge</a></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|||||||
Binary file not shown.
@@ -595,6 +595,7 @@ CREATE TABLE `m_loan_arrears_aging` (
|
|||||||
CREATE TABLE `m_guarantor` (
|
CREATE TABLE `m_guarantor` (
|
||||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||||
`loan_id` BIGINT(20) NOT NULL,
|
`loan_id` BIGINT(20) NOT NULL,
|
||||||
|
`client_reln_cv_id` INT(11) DEFAULT NULL,
|
||||||
`type_enum` SMALLINT(5) NOT NULL,
|
`type_enum` SMALLINT(5) NOT NULL,
|
||||||
`entity_id` BIGINT(20) NULL DEFAULT NULL,
|
`entity_id` BIGINT(20) NULL DEFAULT NULL,
|
||||||
`firstname` VARCHAR(50) NULL DEFAULT NULL,
|
`firstname` VARCHAR(50) NULL DEFAULT NULL,
|
||||||
@@ -611,6 +612,7 @@ CREATE TABLE `m_guarantor` (
|
|||||||
`comment` VARCHAR(500) NULL DEFAULT NULL,
|
`comment` VARCHAR(500) NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
INDEX `FK_m_guarantor_m_loan` (`loan_id`),
|
INDEX `FK_m_guarantor_m_loan` (`loan_id`),
|
||||||
|
CONSTRAINT `FK_m_guarantor_m_code_value` FOREIGN KEY (`client_reln_cv_id`) REFERENCES `m_code_value` (`id`),
|
||||||
CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
@@ -642,6 +644,7 @@ CREATE TABLE `m_loan_collateral` (
|
|||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
`loan_id` bigint(20) NOT NULL,
|
`loan_id` bigint(20) NOT NULL,
|
||||||
`type_cv_id` int(11) NOT NULL,
|
`type_cv_id` int(11) NOT NULL,
|
||||||
|
`value` DECIMAL(19,6) DEFAULT NULL,
|
||||||
`description` varchar(500) DEFAULT NULL,
|
`description` varchar(500) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `FK_collateral_m_loan` (`loan_id`),
|
KEY `FK_collateral_m_loan` (`loan_id`),
|
||||||
|
|||||||
@@ -271,7 +271,8 @@ VALUES
|
|||||||
('LoanCollateral',1),
|
('LoanCollateral',1),
|
||||||
('LoanPurpose',1),
|
('LoanPurpose',1),
|
||||||
('Gender',1),
|
('Gender',1),
|
||||||
('YesNo',1);
|
('YesNo',1),
|
||||||
|
('GuarantorRelationship',1);
|
||||||
|
|
||||||
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
||||||
select mc.id, 'Passport', 1
|
select mc.id, 'Passport', 1
|
||||||
@@ -291,4 +292,30 @@ where mc.`code_name` = "Customer Identifier";
|
|||||||
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
||||||
select mc.id, 'Any Other Id Type', 4
|
select mc.id, 'Any Other Id Type', 4
|
||||||
from m_code mc
|
from m_code mc
|
||||||
where mc.`code_name` = "Customer Identifier";
|
where mc.`code_name` = "Customer Identifier";
|
||||||
|
|
||||||
|
-- Adding a few Default Guarantor Relationships
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Spouse",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
|
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Parent",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
|
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Sibling",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
|
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Business Associate",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
|
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Other",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
@@ -220,6 +220,13 @@ INSERT INTO `m_permission`
|
|||||||
('portfolio', 'UPDATE_GUARANTOR_CHECKER', 'GUARANTOR', 'UPDATE', 0),
|
('portfolio', 'UPDATE_GUARANTOR_CHECKER', 'GUARANTOR', 'UPDATE', 0),
|
||||||
('portfolio', 'DELETE_GUARANTOR', 'GUARANTOR', 'DELETE', 1),
|
('portfolio', 'DELETE_GUARANTOR', 'GUARANTOR', 'DELETE', 1),
|
||||||
('portfolio', 'DELETE_GUARANTOR_CHECKER', 'GUARANTOR', 'DELETE', 0),
|
('portfolio', 'DELETE_GUARANTOR_CHECKER', 'GUARANTOR', 'DELETE', 0),
|
||||||
|
('portfolio', 'READ_COLLATERAL', 'COLLATERAL', 'READ', '0'),
|
||||||
|
('portfolio', 'CREATE_COLLATERAL', 'COLLATERAL', 'CREATE', '1'),
|
||||||
|
('portfolio', 'UPDATE_COLLATERAL', 'COLLATERAL', 'UPDATE', '1'),
|
||||||
|
('portfolio', 'DELETE_COLLATERAL', 'COLLATERAL', 'DELETE', '1'),
|
||||||
|
('portfolio', 'CREATE_COLLATERAL_CHECKER', 'COLLATERAL', 'CREATE', '0'),
|
||||||
|
('portfolio', 'UPDATE_COLLATERAL_CHECKER', 'COLLATERAL', 'UPDATE', '0'),
|
||||||
|
('portfolio', 'DELETE_COLLATERAL_CHECKER', 'COLLATERAL', 'DELETE', '0'),
|
||||||
('transaction_loan', 'APPROVE_LOAN', 'LOAN', 'APPROVE', '1'),
|
('transaction_loan', 'APPROVE_LOAN', 'LOAN', 'APPROVE', '1'),
|
||||||
('transaction_loan', 'APPROVEINPAST_LOAN', 'LOAN', 'APPROVEINPAST', '1'),
|
('transaction_loan', 'APPROVEINPAST_LOAN', 'LOAN', 'APPROVEINPAST', '1'),
|
||||||
('transaction_loan', 'REJECT_LOAN', 'LOAN', 'REJECT', '1'),
|
('transaction_loan', 'REJECT_LOAN', 'LOAN', 'REJECT', '1'),
|
||||||
|
|||||||
+3
@@ -595,6 +595,7 @@ CREATE TABLE `m_loan_arrears_aging` (
|
|||||||
CREATE TABLE `m_guarantor` (
|
CREATE TABLE `m_guarantor` (
|
||||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
|
||||||
`loan_id` BIGINT(20) NOT NULL,
|
`loan_id` BIGINT(20) NOT NULL,
|
||||||
|
`client_reln_cv_id` INT(11) DEFAULT NULL,
|
||||||
`type_enum` SMALLINT(5) NOT NULL,
|
`type_enum` SMALLINT(5) NOT NULL,
|
||||||
`entity_id` BIGINT(20) NULL DEFAULT NULL,
|
`entity_id` BIGINT(20) NULL DEFAULT NULL,
|
||||||
`firstname` VARCHAR(50) NULL DEFAULT NULL,
|
`firstname` VARCHAR(50) NULL DEFAULT NULL,
|
||||||
@@ -611,6 +612,7 @@ CREATE TABLE `m_guarantor` (
|
|||||||
`comment` VARCHAR(500) NULL DEFAULT NULL,
|
`comment` VARCHAR(500) NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
INDEX `FK_m_guarantor_m_loan` (`loan_id`),
|
INDEX `FK_m_guarantor_m_loan` (`loan_id`),
|
||||||
|
CONSTRAINT `FK_m_guarantor_m_code_value` FOREIGN KEY (`client_reln_cv_id`) REFERENCES `m_code_value` (`id`)
|
||||||
CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
@@ -642,6 +644,7 @@ CREATE TABLE `m_loan_collateral` (
|
|||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
`loan_id` bigint(20) NOT NULL,
|
`loan_id` bigint(20) NOT NULL,
|
||||||
`type_cv_id` int(11) NOT NULL,
|
`type_cv_id` int(11) NOT NULL,
|
||||||
|
`value` DECIMAL(19,6) DEFAULT NULL,
|
||||||
`description` varchar(500) DEFAULT NULL,
|
`description` varchar(500) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `FK_collateral_m_loan` (`loan_id`),
|
KEY `FK_collateral_m_loan` (`loan_id`),
|
||||||
+29
-2
@@ -271,7 +271,8 @@ VALUES
|
|||||||
('LoanCollateral',1),
|
('LoanCollateral',1),
|
||||||
('LoanPurpose',1),
|
('LoanPurpose',1),
|
||||||
('Gender',1),
|
('Gender',1),
|
||||||
('YesNo',1);
|
('YesNo',1),
|
||||||
|
('GuarantorRelationship',1);
|
||||||
|
|
||||||
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
||||||
select mc.id, 'Passport', 1
|
select mc.id, 'Passport', 1
|
||||||
@@ -291,4 +292,30 @@ where mc.`code_name` = "Customer Identifier";
|
|||||||
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
|
||||||
select mc.id, 'Any Other Id Type', 4
|
select mc.id, 'Any Other Id Type', 4
|
||||||
from m_code mc
|
from m_code mc
|
||||||
where mc.`code_name` = "Customer Identifier";
|
where mc.`code_name` = "Customer Identifier";
|
||||||
|
|
||||||
|
-- Adding a few Default Guarantor Relationships
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Spouse",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
|
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Parent",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
|
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Sibling",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
|
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Business Associate",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
|
|
||||||
|
insert into m_code_value (code_id,code_value,order_position)
|
||||||
|
select id,"Other",0
|
||||||
|
from m_code
|
||||||
|
where m_code.code_name="GuarantorRelationship";
|
||||||
+7
@@ -220,6 +220,13 @@ INSERT INTO `m_permission`
|
|||||||
('portfolio', 'UPDATE_GUARANTOR_CHECKER', 'GUARANTOR', 'UPDATE', 0),
|
('portfolio', 'UPDATE_GUARANTOR_CHECKER', 'GUARANTOR', 'UPDATE', 0),
|
||||||
('portfolio', 'DELETE_GUARANTOR', 'GUARANTOR', 'DELETE', 1),
|
('portfolio', 'DELETE_GUARANTOR', 'GUARANTOR', 'DELETE', 1),
|
||||||
('portfolio', 'DELETE_GUARANTOR_CHECKER', 'GUARANTOR', 'DELETE', 0),
|
('portfolio', 'DELETE_GUARANTOR_CHECKER', 'GUARANTOR', 'DELETE', 0),
|
||||||
|
('portfolio', 'READ_COLLATERAL', 'COLLATERAL', 'READ', '0'),
|
||||||
|
('portfolio', 'CREATE_COLLATERAL', 'COLLATERAL', 'CREATE', '1'),
|
||||||
|
('portfolio', 'UPDATE_COLLATERAL', 'COLLATERAL', 'UPDATE', '1'),
|
||||||
|
('portfolio', 'DELETE_COLLATERAL', 'COLLATERAL', 'DELETE', '1'),
|
||||||
|
('portfolio', 'CREATE_COLLATERAL_CHECKER', 'COLLATERAL', 'CREATE', '0'),
|
||||||
|
('portfolio', 'UPDATE_COLLATERAL_CHECKER', 'COLLATERAL', 'UPDATE', '0'),
|
||||||
|
('portfolio', 'DELETE_COLLATERAL_CHECKER', 'COLLATERAL', 'DELETE', '0'),
|
||||||
('transaction_loan', 'APPROVE_LOAN', 'LOAN', 'APPROVE', '1'),
|
('transaction_loan', 'APPROVE_LOAN', 'LOAN', 'APPROVE', '1'),
|
||||||
('transaction_loan', 'APPROVEINPAST_LOAN', 'LOAN', 'APPROVEINPAST', '1'),
|
('transaction_loan', 'APPROVEINPAST_LOAN', 'LOAN', 'APPROVEINPAST', '1'),
|
||||||
('transaction_loan', 'REJECT_LOAN', 'LOAN', 'REJECT', '1'),
|
('transaction_loan', 'REJECT_LOAN', 'LOAN', 'REJECT', '1'),
|
||||||
Executable → Regular
Executable → Regular
@@ -180,11 +180,14 @@ task dist(type:Zip){
|
|||||||
|
|
||||||
task deployPentahoReports() {
|
task deployPentahoReports() {
|
||||||
def pentahoReportDir = System.properties['user.home'] + System.properties['file.separator'] + '.mifosx' + System.properties['file.separator'] + 'pentahoReports'
|
def pentahoReportDir = System.properties['user.home'] + System.properties['file.separator'] + '.mifosx' + System.properties['file.separator'] + 'pentahoReports'
|
||||||
println ":deployPentahoReports - moving pentaho reports under: " + pentahoReportDir
|
|
||||||
copy {
|
copy {
|
||||||
from "src/main/pentahoReports"
|
from "src/main/pentahoReports"
|
||||||
into pentahoReportDir
|
into pentahoReportDir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
println ':deployPentahoReports - moving pentaho reports under: ' + pentahoReportDir
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
war {
|
war {
|
||||||
@@ -200,6 +203,7 @@ tomcatRun {
|
|||||||
httpPort = 8080
|
httpPort = 8080
|
||||||
httpsPort = 8443
|
httpsPort = 8443
|
||||||
stopPort = 8081
|
stopPort = 8081
|
||||||
|
stopKey= 'stopKey'
|
||||||
enableSSL = true
|
enableSSL = true
|
||||||
configFile = file('src/test/resources/META-INF/context.xml')
|
configFile = file('src/test/resources/META-INF/context.xml')
|
||||||
}
|
}
|
||||||
@@ -208,7 +212,10 @@ tomcatRunWar {
|
|||||||
httpPort = 8080
|
httpPort = 8080
|
||||||
httpsPort = 8443
|
httpsPort = 8443
|
||||||
stopPort = 8081
|
stopPort = 8081
|
||||||
|
stopKey= 'stopKey'
|
||||||
enableSSL = true
|
enableSSL = true
|
||||||
|
keystoreFile = file('../keystore.jks')
|
||||||
|
keystorePass = 'openmf'
|
||||||
configFile = file('src/test/resources/META-INF/context.xml')
|
configFile = file('src/test/resources/META-INF/context.xml')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,12 +231,53 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task integrationTest(type:Test){
|
task integrationTest(type:Test){
|
||||||
description = "Run integration tests (located in src/integrationTest/java). Requires server to be running."
|
description = "Run integration tests (located in src/integrationTest/java). Starts tomcat in daemon mode before executing the tests."
|
||||||
|
doFirst {
|
||||||
|
tomcatRunWar.daemon = true
|
||||||
|
tomcatRunWar.execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
tomcatStop.execute()
|
||||||
|
}
|
||||||
testClassesDir = project.sourceSets.integrationTest.output.classesDir
|
testClassesDir = project.sourceSets.integrationTest.output.classesDir
|
||||||
classpath = project.sourceSets.integrationTest.runtimeClasspath
|
classpath = project.sourceSets.integrationTest.runtimeClasspath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
import groovy.sql.Sql
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
configurations {
|
||||||
|
driver
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
driver 'mysql:mysql-connector-java:5.1.16'
|
||||||
|
}
|
||||||
|
|
||||||
|
URLClassLoader loader = GroovyObject.class.classLoader
|
||||||
|
configurations.driver.each {File file ->
|
||||||
|
loader.addURL(file.toURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
task createDatabase<<{
|
||||||
|
description= "Creates the Database mifosplatform-tenants and mifostenant-default"
|
||||||
|
sql = Sql.newInstance( 'jdbc:mysql://localhost:3306/', 'root', 'mysql', 'com.mysql.jdbc.Driver' )
|
||||||
|
sql.execute( 'create database `mifosplatform-tenants`' )
|
||||||
|
sql.execute( 'create database `mifostenant-default`' )
|
||||||
|
|
||||||
|
}
|
||||||
|
task dropDatabase<<{
|
||||||
|
description= "Drops the created Databases mifosplatform-tenants and mifostenant-default"
|
||||||
|
sql = Sql.newInstance( 'jdbc:mysql://localhost:3306/', 'root', 'mysql', 'com.mysql.jdbc.Driver' )
|
||||||
|
sql.execute( 'DROP DATABASE `mifosplatform-tenants`' )
|
||||||
|
sql.execute( 'DROP DATABASE `mifostenant-default`' )
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
apply plugin: 'flyway'
|
apply plugin: 'flyway'
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
@@ -272,4 +320,5 @@ def qualifyVersionIfNecessary(version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return version
|
return version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -3,7 +3,7 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
package org.mifosplatform.audit.api;
|
package org.mifosplatform.commands.api;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -21,9 +21,9 @@ import javax.ws.rs.core.MediaType;
|
|||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.mifosplatform.audit.data.AuditData;
|
import org.mifosplatform.commands.data.AuditData;
|
||||||
import org.mifosplatform.audit.data.AuditSearchData;
|
import org.mifosplatform.commands.data.AuditSearchData;
|
||||||
import org.mifosplatform.audit.service.AuditReadPlatformService;
|
import org.mifosplatform.commands.service.AuditReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||||
@@ -33,10 +33,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Path("/audit")
|
@Path("/audits")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
public class AuditApiResource {
|
public class AuditsApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(
|
||||||
Arrays.asList("id", "actionName", "entityName", "resourceId", "subresourceId",
|
Arrays.asList("id", "actionName", "entityName", "resourceId", "subresourceId",
|
||||||
@@ -52,7 +52,7 @@ public class AuditApiResource {
|
|||||||
private final DefaultToApiJsonSerializer<AuditSearchData> toApiJsonSerializerSearchTemplate;
|
private final DefaultToApiJsonSerializer<AuditSearchData> toApiJsonSerializerSearchTemplate;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public AuditApiResource(
|
public AuditsApiResource(
|
||||||
final PlatformSecurityContext context,
|
final PlatformSecurityContext context,
|
||||||
final AuditReadPlatformService auditReadPlatformService,
|
final AuditReadPlatformService auditReadPlatformService,
|
||||||
final ApiRequestParameterHelper apiRequestParameterHelper,
|
final ApiRequestParameterHelper apiRequestParameterHelper,
|
||||||
@@ -130,10 +130,10 @@ public class AuditApiResource {
|
|||||||
.process(uriInfo.getQueryParameters());
|
.process(uriInfo.getQueryParameters());
|
||||||
|
|
||||||
final AuditSearchData auditSearchData = this.auditReadPlatformService
|
final AuditSearchData auditSearchData = this.auditReadPlatformService
|
||||||
.retrieveSearchTemplate();
|
.retrieveSearchTemplate("audit");
|
||||||
|
|
||||||
final Set<String> RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE = new HashSet<String>(
|
final Set<String> RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE = new HashSet<String>(
|
||||||
Arrays.asList("appUsers", "apiOperations", "resources"));
|
Arrays.asList("appUsers", "actionNames", "entityNames", "processingResults"));
|
||||||
|
|
||||||
return this.toApiJsonSerializerSearchTemplate.serialize(settings,
|
return this.toApiJsonSerializerSearchTemplate.serialize(settings,
|
||||||
auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE);
|
auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE);
|
||||||
+32
-6
@@ -23,9 +23,10 @@ import javax.ws.rs.core.MediaType;
|
|||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.mifosplatform.audit.data.AuditData;
|
import org.mifosplatform.commands.data.AuditData;
|
||||||
import org.mifosplatform.audit.service.AuditReadPlatformService;
|
import org.mifosplatform.commands.data.AuditSearchData;
|
||||||
import org.mifosplatform.commands.data.CommandSourceData;
|
import org.mifosplatform.commands.data.CommandSourceData;
|
||||||
|
import org.mifosplatform.commands.service.AuditReadPlatformService;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
@@ -37,10 +38,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Path("/commands")
|
@Path("/makercheckers")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
public class CommandsApiResource {
|
public class MakercheckersApiResource {
|
||||||
|
|
||||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(
|
||||||
Arrays.asList("id", "actionName", "entityName", "resourceId", "subresourceId",
|
Arrays.asList("id", "actionName", "entityName", "resourceId", "subresourceId",
|
||||||
@@ -52,18 +53,21 @@ public class CommandsApiResource {
|
|||||||
private final AuditReadPlatformService readPlatformService;
|
private final AuditReadPlatformService readPlatformService;
|
||||||
private final DefaultToApiJsonSerializer<CommandSourceData> toApiJsonSerializer;
|
private final DefaultToApiJsonSerializer<CommandSourceData> toApiJsonSerializer;
|
||||||
private final DefaultToApiJsonSerializer<AuditData> toApiJsonSerializerAudit;
|
private final DefaultToApiJsonSerializer<AuditData> toApiJsonSerializerAudit;
|
||||||
|
private final DefaultToApiJsonSerializer<AuditSearchData> toApiJsonSerializerSearchTemplate;
|
||||||
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
||||||
private final PortfolioCommandSourceWritePlatformService writePlatformService;
|
private final PortfolioCommandSourceWritePlatformService writePlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public CommandsApiResource(final PlatformSecurityContext context, final AuditReadPlatformService readPlatformService,
|
public MakercheckersApiResource(final PlatformSecurityContext context, final AuditReadPlatformService readPlatformService,
|
||||||
final DefaultToApiJsonSerializer<CommandSourceData> toApiJsonSerializer, final DefaultToApiJsonSerializer<AuditData> toApiJsonSerializerAudit,
|
final DefaultToApiJsonSerializer<CommandSourceData> toApiJsonSerializer, final DefaultToApiJsonSerializer<AuditData> toApiJsonSerializerAudit,
|
||||||
|
final DefaultToApiJsonSerializer<AuditSearchData> toApiJsonSerializerSearchTemplate,
|
||||||
final ApiRequestParameterHelper apiRequestParameterHelper, final PortfolioCommandSourceWritePlatformService writePlatformService) {
|
final ApiRequestParameterHelper apiRequestParameterHelper, final PortfolioCommandSourceWritePlatformService writePlatformService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.readPlatformService = readPlatformService;
|
this.readPlatformService = readPlatformService;
|
||||||
this.toApiJsonSerializer = toApiJsonSerializer;
|
this.toApiJsonSerializer = toApiJsonSerializer;
|
||||||
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
||||||
this.toApiJsonSerializerAudit = toApiJsonSerializerAudit;
|
this.toApiJsonSerializerAudit = toApiJsonSerializerAudit;
|
||||||
|
this.toApiJsonSerializerSearchTemplate = toApiJsonSerializerSearchTemplate;
|
||||||
this.writePlatformService = writePlatformService;
|
this.writePlatformService = writePlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,6 +84,28 @@ public class CommandsApiResource {
|
|||||||
return this.toApiJsonSerializerAudit.serialize(settings, entries, RESPONSE_DATA_PARAMETERS);
|
return this.toApiJsonSerializerAudit.serialize(settings, entries, RESPONSE_DATA_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/searchtemplate")
|
||||||
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
|
public String retrieveAuditSearchTemplate(@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
|
context.authenticatedUser().validateHasReadPermission(
|
||||||
|
resourceNameForPermissions);
|
||||||
|
|
||||||
|
final ApiRequestJsonSerializationSettings settings = apiRequestParameterHelper
|
||||||
|
.process(uriInfo.getQueryParameters());
|
||||||
|
|
||||||
|
final AuditSearchData auditSearchData = this.readPlatformService
|
||||||
|
.retrieveSearchTemplate("makerchecker");
|
||||||
|
|
||||||
|
final Set<String> RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE = new HashSet<String>(
|
||||||
|
Arrays.asList("appUsers", "actionNames", "entityNames"));
|
||||||
|
|
||||||
|
return this.toApiJsonSerializerSearchTemplate.serialize(settings,
|
||||||
|
auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE);
|
||||||
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("{commandId}")
|
@Path("{commandId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
package org.mifosplatform.audit.data;
|
package org.mifosplatform.commands.data;
|
||||||
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
+1
-2
@@ -3,12 +3,11 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
package org.mifosplatform.audit.data;
|
package org.mifosplatform.commands.data;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.mifosplatform.audit.api.ProcessingResultLookup;
|
|
||||||
import org.mifosplatform.useradministration.data.AppUserData;
|
import org.mifosplatform.useradministration.data.AppUserData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
package org.mifosplatform.audit.api;
|
package org.mifosplatform.commands.data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable data object for application user data.
|
* Immutable data object for application user data.
|
||||||
+4
-4
@@ -3,12 +3,12 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
package org.mifosplatform.audit.service;
|
package org.mifosplatform.commands.service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.mifosplatform.audit.data.AuditData;
|
import org.mifosplatform.commands.data.AuditData;
|
||||||
import org.mifosplatform.audit.data.AuditSearchData;
|
import org.mifosplatform.commands.data.AuditSearchData;
|
||||||
|
|
||||||
public interface AuditReadPlatformService {
|
public interface AuditReadPlatformService {
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ public interface AuditReadPlatformService {
|
|||||||
|
|
||||||
AuditData retrieveAuditEntry(Long auditId);
|
AuditData retrieveAuditEntry(Long auditId);
|
||||||
|
|
||||||
AuditSearchData retrieveSearchTemplate();
|
AuditSearchData retrieveSearchTemplate(String useType);
|
||||||
|
|
||||||
Collection<AuditData> retrieveAllEntriesToBeChecked();
|
Collection<AuditData> retrieveAllEntriesToBeChecked();
|
||||||
|
|
||||||
+17
-9
@@ -3,7 +3,7 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
package org.mifosplatform.audit.service;
|
package org.mifosplatform.commands.service;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -12,10 +12,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.mifosplatform.audit.api.ProcessingResultLookup;
|
import org.mifosplatform.commands.data.AuditData;
|
||||||
import org.mifosplatform.audit.data.AuditData;
|
import org.mifosplatform.commands.data.AuditSearchData;
|
||||||
import org.mifosplatform.audit.data.AuditSearchData;
|
import org.mifosplatform.commands.data.ProcessingResultLookup;
|
||||||
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
||||||
|
import org.mifosplatform.infrastructure.core.exception.PlatformDataIntegrityException;
|
||||||
import org.mifosplatform.infrastructure.core.service.TenantAwareRoutingDataSource;
|
import org.mifosplatform.infrastructure.core.service.TenantAwareRoutingDataSource;
|
||||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
import org.mifosplatform.useradministration.data.AppUserData;
|
import org.mifosplatform.useradministration.data.AppUserData;
|
||||||
@@ -141,7 +142,12 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AuditSearchData retrieveSearchTemplate() {
|
public AuditSearchData retrieveSearchTemplate(String useType) {
|
||||||
|
|
||||||
|
if (!(useType.equals("audit") || useType.equals("makerchecker"))) {
|
||||||
|
throw new PlatformDataIntegrityException("error.msg.invalid.auditSearchTemplate.useType",
|
||||||
|
"Invalid Audit Search Template UseType: " + useType); }
|
||||||
|
|
||||||
final Collection<AppUserData> appUsers = appUserReadPlatformService
|
final Collection<AppUserData> appUsers = appUserReadPlatformService
|
||||||
.retrieveSearchTemplate();
|
.retrieveSearchTemplate();
|
||||||
|
|
||||||
@@ -153,10 +159,12 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
|||||||
List<String> entityNames = this.jdbcTemplate.query(mapper2.schema(),
|
List<String> entityNames = this.jdbcTemplate.query(mapper2.schema(),
|
||||||
mapper2, new Object[] {});
|
mapper2, new Object[] {});
|
||||||
|
|
||||||
ProcessingResultsMapper mapper3 = new ProcessingResultsMapper();
|
Collection<ProcessingResultLookup> processingResults = null;
|
||||||
Collection<ProcessingResultLookup> processingResults = this.jdbcTemplate
|
if (useType.equals("audit")) {
|
||||||
.query(mapper3.schema(), mapper3, new Object[] {});
|
ProcessingResultsMapper mapper3 = new ProcessingResultsMapper();
|
||||||
|
processingResults = this.jdbcTemplate.query(mapper3.schema(), mapper3, new Object[] {});
|
||||||
|
}
|
||||||
|
|
||||||
return new AuditSearchData(appUsers, actionNames, entityNames,
|
return new AuditSearchData(appUsers, actionNames, entityNames,
|
||||||
processingResults);
|
processingResults);
|
||||||
}
|
}
|
||||||
+17
-4
@@ -77,6 +77,19 @@ public class LoanChargesApiResource {
|
|||||||
return StringUtils.isNotBlank(commandParam) && commandParam.trim().equalsIgnoreCase(commandValue);
|
return StringUtils.isNotBlank(commandParam) && commandParam.trim().equalsIgnoreCase(commandValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
|
public String retrieveAllLoanCharges(@PathParam("loanId") final Long loanId, @Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
|
context.authenticatedUser().validateHasReadPermission(resourceNameForPermissions);
|
||||||
|
|
||||||
|
final Collection<LoanChargeData> loanCharges = this.loanChargeReadPlatformService.retrieveLoanCharges(loanId);
|
||||||
|
|
||||||
|
final ApiRequestJsonSerializationSettings settings = apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
return this.toApiJsonSerializer.serialize(settings, loanCharges, RESPONSE_DATA_PARAMETERS);
|
||||||
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("template")
|
@Path("template")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@@ -94,10 +107,10 @@ public class LoanChargesApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{loanChargeId}")
|
@Path("{chargeId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
public String retrieveLoanCharge(@PathParam("loanId") final Long loanId, @PathParam("loanChargeId") final Long loanChargeId,
|
public String retrieveLoanCharge(@PathParam("loanId") final Long loanId, @PathParam("chargeId") final Long loanChargeId,
|
||||||
@Context final UriInfo uriInfo) {
|
@Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
context.authenticatedUser().validateHasReadPermission(resourceNameForPermissions);
|
context.authenticatedUser().validateHasReadPermission(resourceNameForPermissions);
|
||||||
@@ -121,10 +134,10 @@ public class LoanChargesApiResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@Path("{loanChargeId}")
|
@Path("{chargeId}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
public String updateLoanCharge(@PathParam("loanId") final Long loanId, @PathParam("loanChargeId") final Long loanChargeId,
|
public String updateLoanCharge(@PathParam("loanId") final Long loanId, @PathParam("chargeId") final Long loanChargeId,
|
||||||
final String apiRequestBodyAsJson) {
|
final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateLoanCharge(loanId, loanChargeId)
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updateLoanCharge(loanId, loanChargeId)
|
||||||
|
|||||||
+6
-3
@@ -810,9 +810,12 @@ public class Loan extends AbstractPersistable<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String clientIdParamName = "clientId";
|
final String clientIdParamName = "clientId";
|
||||||
if (command.isChangeInLongParameterNamed(clientIdParamName, this.client.getId())) {
|
//FIXME AA : Client is null for group loans. Group loan modifications require group validation.
|
||||||
final Long newValue = command.longValueOfParameterNamed(clientIdParamName);
|
if (this.client != null) {
|
||||||
actualChanges.put(clientIdParamName, newValue);
|
if (command.isChangeInLongParameterNamed(clientIdParamName, this.client.getId())) {
|
||||||
|
final Long newValue = command.longValueOfParameterNamed(clientIdParamName);
|
||||||
|
actualChanges.put(clientIdParamName, newValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final String productIdParamName = "productId";
|
final String productIdParamName = "productId";
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ public final class CalculateLoanScheduleQueryFromApiJsonHelper {
|
|||||||
/**
|
/**
|
||||||
* The parameters supported for this command.
|
* The parameters supported for this command.
|
||||||
*/
|
*/
|
||||||
final Set<String> supportedParameters = new HashSet<String>(Arrays.asList("id", "clientId", "groupId", "productId", "accountNo",
|
final Set<String> supportedParameters = new HashSet<String>(Arrays.asList("id", "clientId", "groupId", "calendarId", "productId", "accountNo",
|
||||||
"externalId", "fundId", "loanOfficerId", "loanPurposeId", "transactionProcessingStrategyId", "principal", "inArrearsTolerance",
|
"externalId", "fundId", "loanOfficerId", "loanPurposeId", "transactionProcessingStrategyId", "principal", "inArrearsTolerance",
|
||||||
"interestRatePerPeriod", "repaymentEvery", "numberOfRepayments", "loanTermFrequency", "loanTermFrequencyType",
|
"interestRatePerPeriod", "repaymentEvery", "numberOfRepayments", "loanTermFrequency", "loanTermFrequencyType",
|
||||||
"repaymentFrequencyType", "interestRateFrequencyType", "amortizationType", "interestType", "interestCalculationPeriodType",
|
"repaymentFrequencyType", "interestRateFrequencyType", "amortizationType", "interestType", "interestCalculationPeriodType",
|
||||||
|
|||||||
Reference in New Issue
Block a user