update loan creation and retrieval.
This commit is contained in:
+106
-105
@@ -626,7 +626,7 @@ Request Body:
|
||||
</code>
|
||||
<code class="method-response">
|
||||
{
|
||||
"entityId":23
|
||||
"resourceId":23
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -644,7 +644,7 @@ Request Body:
|
||||
</code>
|
||||
<code class="method-response">
|
||||
{
|
||||
"entityId":26
|
||||
"resourceId":26
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -666,7 +666,7 @@ Request Body:
|
||||
"joiningDate": "09 June 2006"
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{ "entityId": 23}</code>
|
||||
<code class="method-response">{ "resourceId": 23}</code>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -794,7 +794,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 40
|
||||
"resourceId": 40
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -848,7 +848,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 20
|
||||
"resourceId": 20
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -1150,70 +1150,67 @@ Request Body:
|
||||
<div class="method-example">
|
||||
<code class="method-declaration">GET https://Domain Name/api/v1/loans/{loanId}</code>
|
||||
<code class="method-response">{
|
||||
"id" : 1,
|
||||
"externalId" : null,
|
||||
"loanProductName" : "Agricultural Loan",
|
||||
"submittedOnDate" : [ 2009, 1, 5 ],
|
||||
"approvedOnDate" : [ 2009, 1, 8 ],
|
||||
"expectedDisbursementDate" : [ 2009, 1, 15 ],
|
||||
"actualDisbursementDate" : [ 2009, 1, 15 ],
|
||||
"expectedFirstRepaymentOnDate" : null,
|
||||
"interestChargedFromDate" : null,
|
||||
"closedOnDate" : [ 2009, 11, 13 ],
|
||||
"expectedMaturityDate" : [ 2009, 11, 15 ],
|
||||
"principal" : {
|
||||
"currencyCode" : "XOF",
|
||||
"digitsAfterDecimal" : 0,
|
||||
"amount" : 100000,
|
||||
"defaultName" : "CFA Franc BCEAO",
|
||||
"nameCode" : "currency.XOF",
|
||||
"displaySymbol" : "CFA",
|
||||
"zero" : false,
|
||||
"greaterThanZero" : true,
|
||||
"displaySymbolValue" : "100000 CFA"
|
||||
{
|
||||
"id": 1,
|
||||
"clientId": 1,
|
||||
"clientName": "Willie O'Meara",
|
||||
"loanProductId": 1,
|
||||
"loanProductName": "Agricultural Loan",
|
||||
"loanProductDescription": "An agricultural loan given to farmers to help buy crop, stock and machinery. With an arrears tolerance setting of 1,000 CFA, loans are not marked as 'in arrears' or 'in bad standing' if the amount outstanding is less than this. Interest rate is described using monthly percentage rate (MPR) even though the loan typically lasts a year and requires one repayment (typically at time when farmer sells crop)",
|
||||
"status": {
|
||||
"id": 100,
|
||||
"code": "loanStatusType.submitted.and.pending.approval",
|
||||
"value": "Submitted and pending approval"
|
||||
},
|
||||
"inArrearsTolerance" : {
|
||||
"currencyCode" : "XOF",
|
||||
"digitsAfterDecimal" : 0,
|
||||
"amount" : 1000,
|
||||
"defaultName" : "CFA Franc BCEAO",
|
||||
"nameCode" : "currency.XOF",
|
||||
"displaySymbol" : "CFA",
|
||||
"zero" : false,
|
||||
"greaterThanZero" : true,
|
||||
"displaySymbolValue" : "1000 CFA"
|
||||
"currency": {
|
||||
"code": "XOF",
|
||||
"name": "CFA Franc BCEAO",
|
||||
"decimalPlaces": 0,
|
||||
"displaySymbol": "CFA",
|
||||
"nameCode": "currency.XOF",
|
||||
"displayLabel": "CFA Franc BCEAO (CFA)"
|
||||
},
|
||||
"numberOfRepayments" : 1,
|
||||
"repaymentEvery" : 10,
|
||||
"interestRatePerPeriod" : 1.75,
|
||||
"annualInterestRate" : 21.0,
|
||||
"repaymentFrequencyType" : {
|
||||
"id" : 2,
|
||||
"code" : "repaymentFrequency.periodFrequencyType.months",
|
||||
"value" : "Months"
|
||||
"principal": 100000,
|
||||
"termFrequency": 12,
|
||||
"termPeriodFrequencyType": {
|
||||
"id": 2,
|
||||
"code": "termFrequency.periodFrequencyType.months",
|
||||
"value": "Months"
|
||||
},
|
||||
"interestRateFrequencyType" : {
|
||||
"id" : 2,
|
||||
"code" : "interestRateFrequency.periodFrequencyType.months",
|
||||
"value" : "Per month"
|
||||
"numberOfRepayments": 12,
|
||||
"repaymentEvery": 1,
|
||||
"repaymentFrequencyType": {
|
||||
"id": 2,
|
||||
"code": "repaymentFrequency.periodFrequencyType.months",
|
||||
"value": "Months"
|
||||
},
|
||||
"amortizationType" : {
|
||||
"id" : 1,
|
||||
"code" : "amortizationType.equal.installments",
|
||||
"value" : "Equal installments"
|
||||
"transactionProcessingStrategyId": 1,
|
||||
"amortizationType": {
|
||||
"id": 1,
|
||||
"code": "amortizationType.equal.installments",
|
||||
"value": "Equal installments"
|
||||
},
|
||||
"interestType" : {
|
||||
"id" : 0,
|
||||
"code" : "interestType.declining.balance",
|
||||
"value" : "Declining Balance"
|
||||
"interestRatePerPeriod": 2,
|
||||
"interestRateFrequencyType": {
|
||||
"id": 2,
|
||||
"code": "interestRateFrequency.periodFrequencyType.months",
|
||||
"value": "Per month"
|
||||
},
|
||||
"interestCalculationPeriodType" : {
|
||||
"id" : 1,
|
||||
"code" : "interestCalculationPeriodType.same.as.repayment.period",
|
||||
"value" : "Same as repayment period"
|
||||
"annualInterestRate": 24,
|
||||
"interestType": {
|
||||
"id": 0,
|
||||
"code": "interestType.declining.balance",
|
||||
"value": "Declining Balance"
|
||||
},
|
||||
"lifeCycleStatusText" : "Closed",
|
||||
"lifeCycleStatusDate" : [ 2009, 11, 13 ]
|
||||
"interestCalculationPeriodType": {
|
||||
"id": 1,
|
||||
"code": "interestCalculationPeriodType.same.as.repayment.period",
|
||||
"value": "Same as repayment period"
|
||||
},
|
||||
"submittedOnDate": [2011,9,20],
|
||||
"expectedDisbursementDate": [2011,9,20],
|
||||
"expectedMaturityDate": [2012,9,20],
|
||||
"lifeCycleStatusDate": [2011,9,20]
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -1235,9 +1232,9 @@ Request Body:
|
||||
<br>
|
||||
<table class=matrixHeading>
|
||||
<tr class="matrixHeadingBG"><td><div class="mifosXHeading2">Mandatory Fields</div></td></tr>
|
||||
<tr class=alt><td>clientId, productId, inArrearsTolerance, submittedOnDate, principal,
|
||||
repaymentFrequencyType, repaymentEvery, numberOfRepayments, interestRatePerPeriod, interestRateFrequencyType, amortizationType,
|
||||
interestType, interestCalculationPeriodType, expectedDisbursementDate</td></tr>
|
||||
<tr class=alt><td>clientId, productId, principal, loanTermFrequency, loanTermFrequencyType, numberOfRepayments,
|
||||
repaymentEvery, repaymentFrequencyType, interestRatePerPeriod, interestRateFrequencyType, amortizationType,
|
||||
interestType, interestCalculationPeriodType, expectedDisbursementDate, submittedOnDate, transactionProcessingStrategyId</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="method-example">
|
||||
@@ -1246,26 +1243,29 @@ Request Body:
|
||||
Content-Type: application/json
|
||||
Request Body:
|
||||
{
|
||||
"clientId": 1,
|
||||
"productId": 1,
|
||||
"locale": "en_GB",
|
||||
"principal": "100,000.00",
|
||||
"inArrearsTolerance": "1,000.00",
|
||||
"repaymentFrequencyType": 2,
|
||||
"repaymentEvery": "1",
|
||||
"numberOfRepayments": "12",
|
||||
"interestRatePerPeriod": "1.75",
|
||||
"interestRateFrequencyType": 2,
|
||||
"amortizationType": 1,
|
||||
"interestCalculationPeriodType": 1,
|
||||
"interestType": 0,
|
||||
"dateFormat": "dd MMMM yyyy",
|
||||
"expectedDisbursementDate": "01 July 2007",
|
||||
"submittedOnDate": "25 June 2007"
|
||||
"dateFormat": "dd MMMM yyyy",
|
||||
"locale": "en_GB",
|
||||
"clientId": 1,
|
||||
"productId": 1,
|
||||
"principal": "100,000.00",
|
||||
"loanTermFrequency": 12,
|
||||
"loanTermFrequencyType": 2,
|
||||
"numberOfRepayments": 12,
|
||||
"repaymentEvery": 1,
|
||||
"repaymentFrequencyType": 2,
|
||||
"interestRatePerPeriod": 2,
|
||||
"interestRateFrequencyType": 2,
|
||||
"amortizationType": 1,
|
||||
"interestType": 0,
|
||||
"interestCalculationPeriodType": 1,
|
||||
"expectedDisbursementDate": "20 September 2011",
|
||||
"submittedOnDate": "20 September 2011",
|
||||
"transactionProcessingStrategyId": 1
|
||||
}
|
||||
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 42
|
||||
"resourceId": 42
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -1274,7 +1274,7 @@ Request Body:
|
||||
<a id="loans_approve_etc" name="loans_approve_etc" class="old-syle-anchor"> </a>
|
||||
<div class="method-section">
|
||||
<div class="method-description">
|
||||
<h4>Approve, Undo Approval, Disburse, Undo Disbursal, Reject a Loan or Withdraw a Loan Application</h4>
|
||||
<h4>Approve, Undo Approval, Disburse, Undo Disbursal, Reject or Withdraw a Loan Application</h4>
|
||||
<h5>Arguments</h5>
|
||||
<dl class="argument-list">
|
||||
<dt>command</dt>
|
||||
@@ -1302,8 +1302,9 @@ Request Body:
|
||||
"eventDate": "07 May 2012",
|
||||
"note": "and event note is added"
|
||||
} </code>
|
||||
<code class="method-response">{
|
||||
"entityId": 37
|
||||
<code class="method-response">
|
||||
{
|
||||
"resourceId": 37
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -1323,7 +1324,7 @@ Content-Type: application/json
|
||||
No Request Body:
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 1
|
||||
"resourceId": 1
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -1403,7 +1404,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 37
|
||||
"resourceId": 37
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -1465,7 +1466,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 16
|
||||
"resourceId": 16
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -1618,7 +1619,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 9
|
||||
"resourceId": 9
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -1639,7 +1640,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 1
|
||||
"resourceId": 1
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2105,7 +2106,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 9
|
||||
"resourceId": 9
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2128,7 +2129,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 1
|
||||
"resourceId": 1
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2299,7 +2300,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": null
|
||||
"resourceId": null
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2323,7 +2324,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": null
|
||||
"resourceId": null
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2361,7 +2362,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 1
|
||||
"resourceId": 1
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2439,7 +2440,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 1
|
||||
"resourceId": 1
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2469,7 +2470,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 1
|
||||
"resourceId": 1
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2493,7 +2494,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 1
|
||||
"resourceId": 1
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2516,7 +2517,7 @@ Request Body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 1
|
||||
"resourceId": 1
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -2992,7 +2993,7 @@ Request body:
|
||||
</code>
|
||||
<code class="method-response">
|
||||
{
|
||||
"entityId": 11
|
||||
"resourceId": 11
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -3019,7 +3020,7 @@ Request body:
|
||||
</code>
|
||||
<code class="method-response">
|
||||
{
|
||||
"entityId": 3
|
||||
"resourceId": 3
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -3038,7 +3039,7 @@ Content-Type: application/json
|
||||
No Request Body
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 20
|
||||
"resourceId": 20
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -3131,7 +3132,7 @@ Request body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 8
|
||||
"resourceId": 8
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -3152,7 +3153,7 @@ Request body:
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 8
|
||||
"resourceId": 8
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
@@ -3218,7 +3219,7 @@ ALL_FUNCTIONS_READ: "true"
|
||||
}
|
||||
</code>
|
||||
<code class="method-response">{
|
||||
"entityId": 8
|
||||
"resourceId": 8
|
||||
}
|
||||
</code>
|
||||
</div>
|
||||
|
||||
+12
-12
@@ -5,20 +5,20 @@ package org.mifosplatform.audit.api;
|
||||
*/
|
||||
public class ProcessingResultLookup {
|
||||
|
||||
private final Long id;
|
||||
private final String processingResult;
|
||||
private final Long id;
|
||||
private final String processingResult;
|
||||
|
||||
public ProcessingResultLookup(final Long id, final String processingResult) {
|
||||
this.id = id;
|
||||
this.processingResult = processingResult;
|
||||
}
|
||||
public ProcessingResultLookup(final Long id, final String processingResult) {
|
||||
this.id = id;
|
||||
this.processingResult = processingResult;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getProcessingResult() {
|
||||
return this.processingResult;
|
||||
}
|
||||
public String getProcessingResult() {
|
||||
return this.processingResult;
|
||||
}
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package org.mifosplatform.infrastructure.security.data;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.time.StopWatch;
|
||||
|
||||
/**
|
||||
* Immutable data object representing platform API request used for
|
||||
* logging/debugging.
|
||||
*/
|
||||
public class PlatformRequestLog {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private long startTime;
|
||||
@SuppressWarnings("unused")
|
||||
private long totalTime;
|
||||
@SuppressWarnings("unused")
|
||||
private final String method;
|
||||
@SuppressWarnings("unused")
|
||||
private String url;
|
||||
@SuppressWarnings("unused")
|
||||
private Map<String, String> parameters;
|
||||
|
||||
public static PlatformRequestLog from(final StopWatch task, final HttpServletRequest request) throws IOException {
|
||||
|
||||
final String requestUrl = request.getRequestURL().toString();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String> parameters = new HashMap<String, String>(request.getParameterMap());
|
||||
parameters.remove("password");
|
||||
parameters.remove("_");
|
||||
|
||||
return new PlatformRequestLog(task.getStartTime(), task.getTime(), request.getMethod(), requestUrl, parameters);
|
||||
}
|
||||
|
||||
private PlatformRequestLog(final long startTime, final long time, final String method, final String requestUrl,
|
||||
final Map<String, String> parameters) {
|
||||
this.startTime = startTime;
|
||||
this.totalTime = time;
|
||||
this.method = method;
|
||||
this.url = requestUrl;
|
||||
this.parameters = parameters;
|
||||
}
|
||||
}
|
||||
+16
-1
@@ -9,10 +9,15 @@ import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.time.StopWatch;
|
||||
import org.mifosplatform.infrastructure.core.domain.MifosPlatformTenant;
|
||||
import org.mifosplatform.infrastructure.core.serialization.ToApiJsonSerializer;
|
||||
import org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil;
|
||||
import org.mifosplatform.infrastructure.security.data.PlatformRequestLog;
|
||||
import org.mifosplatform.infrastructure.security.exception.InvalidTenantIdentiferException;
|
||||
import org.mifosplatform.infrastructure.security.service.TenantDetailsService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
@@ -36,9 +41,14 @@ import org.springframework.security.web.authentication.www.BasicAuthenticationFi
|
||||
*/
|
||||
public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFilter {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(TenantAwareBasicAuthenticationFilter.class);
|
||||
|
||||
@Autowired
|
||||
private TenantDetailsService tenantDetailsService;
|
||||
|
||||
@Autowired
|
||||
private ToApiJsonSerializer<PlatformRequestLog> toApiJsonSerializer;
|
||||
|
||||
private String tenantRequestHeader = "X-Mifos-Platform-TenantId";
|
||||
private boolean exceptionIfHeaderMissing = true;
|
||||
|
||||
@@ -53,6 +63,9 @@ public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFil
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
HttpServletResponse response = (HttpServletResponse) res;
|
||||
|
||||
StopWatch task = new StopWatch();
|
||||
task.start();
|
||||
|
||||
try {
|
||||
|
||||
if ("OPTIONS".equalsIgnoreCase(request.getMethod())) {
|
||||
@@ -83,7 +96,9 @@ public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFil
|
||||
response.addHeader("WWW-Authenticate", "Basic realm=\"" + "Mifos Platform API" + "\"");
|
||||
response.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
|
||||
} finally {
|
||||
|
||||
task.stop();
|
||||
final PlatformRequestLog log = PlatformRequestLog.from(task, request);
|
||||
logger.info(toApiJsonSerializer.serialize(log));
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -117,6 +117,12 @@ public class LoanApplicationCommand {
|
||||
.longGreaterThanZero();
|
||||
}
|
||||
|
||||
if (this.clientId == null && this.groupId == null) {
|
||||
baseDataValidator.reset().parameter("clientId").value(this.clientId).notNull().integerGreaterThanZero();
|
||||
}
|
||||
|
||||
baseDataValidator.reset().parameter("productId").value(this.productId).notNull().integerGreaterThanZero();
|
||||
|
||||
if (this.submittedOnDate == null) {
|
||||
ApiParameterError error = ApiParameterError.parameterError("validation.msg.loan.submitted.on.date.cannot.be.blank",
|
||||
"The parameter submittedOnDate cannot be empty.", "submittedOnDate");
|
||||
|
||||
+137
-156
@@ -20,174 +20,155 @@ import org.mifosplatform.portfolio.loanproduct.data.TransactionProcessingStrateg
|
||||
@SuppressWarnings("unused")
|
||||
public class LoanAccountData {
|
||||
|
||||
// basic loan details
|
||||
private final Long id;
|
||||
private final String externalId;
|
||||
private final Long clientId;
|
||||
private final String clientName;
|
||||
private final Long groupId;
|
||||
private final String groupName;
|
||||
private final Long loanProductId;
|
||||
private final String loanProductName;
|
||||
private final String loanProductDescription;
|
||||
private final EnumOptionData status;
|
||||
private final Long fundId;
|
||||
private final String fundName;
|
||||
private final Long loanOfficerId;
|
||||
private final String loanOfficerName;
|
||||
private final CurrencyData currency;
|
||||
private final BigDecimal principal;
|
||||
private final BigDecimal inArrearsTolerance;
|
||||
// basic loan details
|
||||
private final Long id;
|
||||
private final String externalId;
|
||||
private final Long clientId;
|
||||
private final String clientName;
|
||||
private final Long groupId;
|
||||
private final String groupName;
|
||||
private final Long loanProductId;
|
||||
private final String loanProductName;
|
||||
private final String loanProductDescription;
|
||||
private final EnumOptionData status;
|
||||
private final Long fundId;
|
||||
private final String fundName;
|
||||
private final Long loanOfficerId;
|
||||
private final String loanOfficerName;
|
||||
private final CurrencyData currency;
|
||||
private final BigDecimal principal;
|
||||
private final BigDecimal inArrearsTolerance;
|
||||
|
||||
private final Integer termFrequency;
|
||||
private final EnumOptionData termPeriodFrequencyType;
|
||||
private final Integer numberOfRepayments;
|
||||
private final Integer repaymentEvery;
|
||||
private final EnumOptionData repaymentFrequencyType;
|
||||
private final Integer transactionStrategyId;
|
||||
private final EnumOptionData amortizationType;
|
||||
private final BigDecimal interestRatePerPeriod;
|
||||
private final EnumOptionData interestRateFrequencyType;
|
||||
private final BigDecimal annualInterestRate;
|
||||
private final EnumOptionData interestType;
|
||||
private final EnumOptionData interestCalculationPeriodType;
|
||||
private final Integer termFrequency;
|
||||
private final EnumOptionData termPeriodFrequencyType;
|
||||
private final Integer numberOfRepayments;
|
||||
private final Integer repaymentEvery;
|
||||
private final EnumOptionData repaymentFrequencyType;
|
||||
private final Integer transactionProcessingStrategyId;
|
||||
private final EnumOptionData amortizationType;
|
||||
private final BigDecimal interestRatePerPeriod;
|
||||
private final EnumOptionData interestRateFrequencyType;
|
||||
private final BigDecimal annualInterestRate;
|
||||
private final EnumOptionData interestType;
|
||||
private final EnumOptionData interestCalculationPeriodType;
|
||||
|
||||
private final LocalDate submittedOnDate;
|
||||
private final LocalDate approvedOnDate;
|
||||
private final LocalDate expectedDisbursementDate;
|
||||
private final LocalDate actualDisbursementDate;
|
||||
private final LocalDate repaymentsStartingFromDate;
|
||||
private final LocalDate interestChargedFromDate;
|
||||
private final LocalDate closedOnDate;
|
||||
private final LocalDate expectedMaturityDate;
|
||||
private final LocalDate lifeCycleStatusDate;
|
||||
private final LocalDate submittedOnDate;
|
||||
private final LocalDate approvedOnDate;
|
||||
private final LocalDate expectedDisbursementDate;
|
||||
private final LocalDate actualDisbursementDate;
|
||||
private final LocalDate repaymentsStartingFromDate;
|
||||
private final LocalDate interestChargedFromDate;
|
||||
private final LocalDate closedOnDate;
|
||||
private final LocalDate expectedMaturityDate;
|
||||
private final LocalDate lifeCycleStatusDate;
|
||||
|
||||
// associations
|
||||
private final LoanScheduleData repaymentSchedule;
|
||||
private final Collection<LoanTransactionData> transactions;
|
||||
private final Collection<LoanChargeData> charges;
|
||||
private final LoanPermissionData permissions;
|
||||
private final LoanConvenienceData convenienceData;
|
||||
private final GuarantorData guarantorData;
|
||||
// associations
|
||||
private final LoanScheduleData repaymentSchedule;
|
||||
private final Collection<LoanTransactionData> transactions;
|
||||
private final Collection<LoanChargeData> charges;
|
||||
private final LoanPermissionData permissions;
|
||||
private final LoanConvenienceData convenienceData;
|
||||
private final GuarantorData guarantorData;
|
||||
|
||||
// template
|
||||
private final Collection<StaffData> loanOfficerOptions;
|
||||
private final Collection<LoanProductData> productOptions;
|
||||
private final Collection<EnumOptionData> termFrequencyTypeOptions;
|
||||
private final Collection<EnumOptionData> repaymentFrequencyTypeOptions;
|
||||
private final Collection<TransactionProcessingStrategyData> repaymentStrategyOptions;
|
||||
private final Collection<EnumOptionData> interestRateFrequencyTypeOptions;
|
||||
private final Collection<EnumOptionData> amortizationTypeOptions;
|
||||
private final Collection<EnumOptionData> interestTypeOptions;
|
||||
private final Collection<EnumOptionData> interestCalculationPeriodTypeOptions;
|
||||
private final Collection<FundData> fundOptions;
|
||||
private final Collection<ChargeData> chargeOptions;
|
||||
private final ChargeData chargeTemplate;
|
||||
// template
|
||||
private final Collection<StaffData> loanOfficerOptions;
|
||||
private final Collection<LoanProductData> productOptions;
|
||||
private final Collection<EnumOptionData> termFrequencyTypeOptions;
|
||||
private final Collection<EnumOptionData> repaymentFrequencyTypeOptions;
|
||||
private final Collection<TransactionProcessingStrategyData> repaymentStrategyOptions;
|
||||
private final Collection<EnumOptionData> interestRateFrequencyTypeOptions;
|
||||
private final Collection<EnumOptionData> amortizationTypeOptions;
|
||||
private final Collection<EnumOptionData> interestTypeOptions;
|
||||
private final Collection<EnumOptionData> interestCalculationPeriodTypeOptions;
|
||||
private final Collection<FundData> fundOptions;
|
||||
private final Collection<ChargeData> chargeOptions;
|
||||
private final ChargeData chargeTemplate;
|
||||
|
||||
public LoanAccountData(
|
||||
final LoanBasicDetailsData basicDetails,
|
||||
final boolean convenienceDataRequired,
|
||||
final LoanScheduleData repaymentSchedule,
|
||||
final Collection<LoanTransactionData> transactions,
|
||||
final LoanPermissionData permissions,
|
||||
final Collection<LoanChargeData> charges,
|
||||
final Collection<LoanProductData> productOptions,
|
||||
final Collection<EnumOptionData> termFrequencyTypeOptions,
|
||||
final Collection<EnumOptionData> repaymentFrequencyTypeOptions,
|
||||
final Collection<TransactionProcessingStrategyData> repaymentStrategyOptions,
|
||||
final Collection<EnumOptionData> interestRateFrequencyTypeOptions,
|
||||
final Collection<EnumOptionData> amortizationTypeOptions,
|
||||
final Collection<EnumOptionData> interestTypeOptions,
|
||||
final Collection<EnumOptionData> interestCalculationPeriodTypeOptions,
|
||||
final Collection<FundData> fundOptions,
|
||||
final Collection<ChargeData> chargeOptions,
|
||||
final ChargeData chargeTemplate,
|
||||
final Collection<StaffData> loanOfficerOptions,
|
||||
final GuarantorData guarantorData) {
|
||||
this.repaymentSchedule = repaymentSchedule;
|
||||
this.transactions = transactions;
|
||||
this.permissions = permissions;
|
||||
public LoanAccountData(final LoanBasicDetailsData basicDetails, final boolean convenienceDataRequired,
|
||||
final LoanScheduleData repaymentSchedule, final Collection<LoanTransactionData> transactions,
|
||||
final LoanPermissionData permissions, final Collection<LoanChargeData> charges,
|
||||
final Collection<LoanProductData> productOptions, final Collection<EnumOptionData> termFrequencyTypeOptions,
|
||||
final Collection<EnumOptionData> repaymentFrequencyTypeOptions,
|
||||
final Collection<TransactionProcessingStrategyData> repaymentStrategyOptions,
|
||||
final Collection<EnumOptionData> interestRateFrequencyTypeOptions, final Collection<EnumOptionData> amortizationTypeOptions,
|
||||
final Collection<EnumOptionData> interestTypeOptions, final Collection<EnumOptionData> interestCalculationPeriodTypeOptions,
|
||||
final Collection<FundData> fundOptions, final Collection<ChargeData> chargeOptions, final ChargeData chargeTemplate,
|
||||
final Collection<StaffData> loanOfficerOptions, final GuarantorData guarantorData) {
|
||||
this.repaymentSchedule = repaymentSchedule;
|
||||
this.transactions = transactions;
|
||||
this.permissions = permissions;
|
||||
this.charges = charges;
|
||||
this.productOptions = productOptions;
|
||||
this.termFrequencyTypeOptions = termFrequencyTypeOptions;
|
||||
this.repaymentFrequencyTypeOptions = repaymentFrequencyTypeOptions;
|
||||
this.repaymentStrategyOptions = repaymentStrategyOptions;
|
||||
this.interestRateFrequencyTypeOptions = interestRateFrequencyTypeOptions;
|
||||
this.amortizationTypeOptions = amortizationTypeOptions;
|
||||
this.interestTypeOptions = interestTypeOptions;
|
||||
this.interestCalculationPeriodTypeOptions = interestCalculationPeriodTypeOptions;
|
||||
this.fundOptions = fundOptions;
|
||||
this.chargeOptions = chargeOptions;
|
||||
this.productOptions = productOptions;
|
||||
this.termFrequencyTypeOptions = termFrequencyTypeOptions;
|
||||
this.repaymentFrequencyTypeOptions = repaymentFrequencyTypeOptions;
|
||||
this.repaymentStrategyOptions = repaymentStrategyOptions;
|
||||
this.interestRateFrequencyTypeOptions = interestRateFrequencyTypeOptions;
|
||||
this.amortizationTypeOptions = amortizationTypeOptions;
|
||||
this.interestTypeOptions = interestTypeOptions;
|
||||
this.interestCalculationPeriodTypeOptions = interestCalculationPeriodTypeOptions;
|
||||
this.fundOptions = fundOptions;
|
||||
this.chargeOptions = chargeOptions;
|
||||
this.chargeTemplate = chargeTemplate;
|
||||
this.loanOfficerOptions = loanOfficerOptions;
|
||||
this.guarantorData = guarantorData;
|
||||
this.loanOfficerOptions = loanOfficerOptions;
|
||||
this.guarantorData = guarantorData;
|
||||
|
||||
if (convenienceDataRequired) {
|
||||
int maxSubmittedOnOffsetFromToday = basicDetails
|
||||
.getMaxSubmittedOnOffsetFromToday();
|
||||
int maxApprovedOnOffsetFromToday = basicDetails
|
||||
.getMaxApprovedOnOffsetFromToday();
|
||||
int maxDisbursedOnOffsetFromToday = basicDetails
|
||||
.getMaxDisbursedOnOffsetFromToday();
|
||||
int expectedLoanTermInDays = basicDetails.getLoanTermInDays();
|
||||
int expectedLoanTermInMonths = basicDetails.getLoanTermInMonths();
|
||||
int actualLoanTermInDays = basicDetails.getActualLoanTermInDays();
|
||||
int actualLoanTermInMonths = basicDetails.getActualLoanTermInMonths();
|
||||
if (convenienceDataRequired) {
|
||||
int maxSubmittedOnOffsetFromToday = basicDetails.getMaxSubmittedOnOffsetFromToday();
|
||||
int maxApprovedOnOffsetFromToday = basicDetails.getMaxApprovedOnOffsetFromToday();
|
||||
int maxDisbursedOnOffsetFromToday = basicDetails.getMaxDisbursedOnOffsetFromToday();
|
||||
int expectedLoanTermInDays = basicDetails.getLoanTermInDays();
|
||||
int expectedLoanTermInMonths = basicDetails.getLoanTermInMonths();
|
||||
int actualLoanTermInDays = basicDetails.getActualLoanTermInDays();
|
||||
int actualLoanTermInMonths = basicDetails.getActualLoanTermInMonths();
|
||||
|
||||
this.convenienceData = new LoanConvenienceData(
|
||||
maxSubmittedOnOffsetFromToday, maxApprovedOnOffsetFromToday,
|
||||
maxDisbursedOnOffsetFromToday, expectedLoanTermInDays,
|
||||
actualLoanTermInDays, expectedLoanTermInMonths,
|
||||
actualLoanTermInMonths);
|
||||
} else {
|
||||
this.convenienceData = null;
|
||||
}
|
||||
this.convenienceData = new LoanConvenienceData(maxSubmittedOnOffsetFromToday, maxApprovedOnOffsetFromToday,
|
||||
maxDisbursedOnOffsetFromToday, expectedLoanTermInDays, actualLoanTermInDays, expectedLoanTermInMonths,
|
||||
actualLoanTermInMonths);
|
||||
} else {
|
||||
this.convenienceData = null;
|
||||
}
|
||||
|
||||
this.id = basicDetails.getId();
|
||||
this.externalId = basicDetails.getExternalId();
|
||||
this.clientId = basicDetails.getClientId();
|
||||
this.clientName = basicDetails.getClientName();
|
||||
this.groupId = basicDetails.getGroupId();
|
||||
this.groupName = basicDetails.getGroupName();
|
||||
this.loanProductId = basicDetails.getLoanProductId();
|
||||
this.loanProductName = basicDetails.getLoanProductName();
|
||||
this.loanProductDescription = basicDetails.getLoanProductDescription();
|
||||
this.fundId = basicDetails.getFundId();
|
||||
this.fundName = basicDetails.getFundName();
|
||||
this.loanOfficerId = basicDetails.getLoanOfficerId();
|
||||
this.loanOfficerName = basicDetails.getLoanOfficerName();
|
||||
this.id = basicDetails.getId();
|
||||
this.externalId = basicDetails.getExternalId();
|
||||
this.clientId = basicDetails.getClientId();
|
||||
this.clientName = basicDetails.getClientName();
|
||||
this.groupId = basicDetails.getGroupId();
|
||||
this.groupName = basicDetails.getGroupName();
|
||||
this.loanProductId = basicDetails.getLoanProductId();
|
||||
this.loanProductName = basicDetails.getLoanProductName();
|
||||
this.loanProductDescription = basicDetails.getLoanProductDescription();
|
||||
this.fundId = basicDetails.getFundId();
|
||||
this.fundName = basicDetails.getFundName();
|
||||
this.loanOfficerId = basicDetails.getLoanOfficerId();
|
||||
this.loanOfficerName = basicDetails.getLoanOfficerName();
|
||||
|
||||
this.submittedOnDate = basicDetails.getSubmittedOnDate();
|
||||
this.approvedOnDate = basicDetails.getApprovedOnDate();
|
||||
this.expectedDisbursementDate = basicDetails.getExpectedDisbursementDate();
|
||||
this.actualDisbursementDate = basicDetails.getActualDisbursementDate();
|
||||
this.closedOnDate = basicDetails.getClosedOnDate();
|
||||
this.expectedMaturityDate = basicDetails.getExpectedMaturityDate();
|
||||
this.repaymentsStartingFromDate = basicDetails.getRepaymentsStartingFromDate();
|
||||
this.interestChargedFromDate = basicDetails.getInterestChargedFromDate();
|
||||
|
||||
this.submittedOnDate = basicDetails.getSubmittedOnDate();
|
||||
this.approvedOnDate = basicDetails.getApprovedOnDate();
|
||||
this.expectedDisbursementDate = basicDetails
|
||||
.getExpectedDisbursementDate();
|
||||
this.actualDisbursementDate = basicDetails.getActualDisbursementDate();
|
||||
this.closedOnDate = basicDetails.getClosedOnDate();
|
||||
this.expectedMaturityDate = basicDetails.getExpectedMaturityDate();
|
||||
this.repaymentsStartingFromDate = basicDetails.getRepaymentsStartingFromDate();
|
||||
this.interestChargedFromDate = basicDetails.getInterestChargedFromDate();
|
||||
this.currency = basicDetails.getCurrency();
|
||||
this.principal = basicDetails.getPrincipal();
|
||||
this.inArrearsTolerance = basicDetails.getInArrearsTolerance();
|
||||
|
||||
this.currency = basicDetails.getCurrency();
|
||||
this.principal = basicDetails.getPrincipal();
|
||||
this.inArrearsTolerance = basicDetails.getInArrearsTolerance();
|
||||
this.termFrequency = basicDetails.getTermFrequency();
|
||||
this.termPeriodFrequencyType = basicDetails.getTermPeriodFrequencyType();
|
||||
this.numberOfRepayments = basicDetails.getNumberOfRepayments();
|
||||
this.repaymentEvery = basicDetails.getRepaymentEvery();
|
||||
this.transactionProcessingStrategyId = basicDetails.getTransactionStrategyId();
|
||||
this.interestRatePerPeriod = basicDetails.getInterestRatePerPeriod();
|
||||
this.annualInterestRate = basicDetails.getAnnualInterestRate();
|
||||
this.repaymentFrequencyType = basicDetails.getRepaymentFrequencyType();
|
||||
this.interestRateFrequencyType = basicDetails.getInterestRateFrequencyType();
|
||||
this.amortizationType = basicDetails.getAmortizationType();
|
||||
this.interestType = basicDetails.getInterestType();
|
||||
this.interestCalculationPeriodType = basicDetails.getInterestCalculationPeriodType();
|
||||
|
||||
this.termFrequency = basicDetails.getTermFrequency();
|
||||
this.termPeriodFrequencyType = basicDetails.getTermPeriodFrequencyType();
|
||||
this.numberOfRepayments = basicDetails.getNumberOfRepayments();
|
||||
this.repaymentEvery = basicDetails.getRepaymentEvery();
|
||||
this.transactionStrategyId = basicDetails.getTransactionStrategyId();
|
||||
this.interestRatePerPeriod = basicDetails.getInterestRatePerPeriod();
|
||||
this.annualInterestRate = basicDetails.getAnnualInterestRate();
|
||||
this.repaymentFrequencyType = basicDetails.getRepaymentFrequencyType();
|
||||
this.interestRateFrequencyType = basicDetails
|
||||
.getInterestRateFrequencyType();
|
||||
this.amortizationType = basicDetails.getAmortizationType();
|
||||
this.interestType = basicDetails.getInterestType();
|
||||
this.interestCalculationPeriodType = basicDetails
|
||||
.getInterestCalculationPeriodType();
|
||||
|
||||
this.status = basicDetails.getStatus();
|
||||
this.lifeCycleStatusDate = basicDetails.getLifeCycleStatusDate();
|
||||
}
|
||||
this.status = basicDetails.getStatus();
|
||||
this.lifeCycleStatusDate = basicDetails.getLifeCycleStatusDate();
|
||||
}
|
||||
}
|
||||
+447
-495
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user