From 2e4203614c3cbfdc4339d2c0a96a90552ef8d3fc Mon Sep 17 00:00:00 2001 From: Pramod Nuthakki Date: Thu, 18 Sep 2014 10:09:26 +0530 Subject: [PATCH] updated API documentation --- api-docs/apiLive.htm | 119 +++++++++++------- .../loanaccount/api/LoansApiResource.java | 3 +- 2 files changed, 77 insertions(+), 45 deletions(-) diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index eeafcd99f..ef7cb31a0 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -6819,18 +6819,10 @@ An enumeration that indicates the type of transaction processing strategy to be - recalculationFrequencyType + recalculationRestFrequencyDate - Frequency at which Outstanding Principal is recalculated. This field is mandatory when interest interest recalculation is enabled for product. -
Available calculation types: -
    -
  1. 1 = Same as repayment period
  2. -
  3. 2 = Daily
  4. -
  5. 3 = Weekly
  6. -
  7. 4 = Fortnightly
  8. -
  9. 5 = Monthly
  10. -
+ Specifies rest frequency start date for interest recalculation. This date must be before or equal to disbursement date @@ -7004,7 +6996,12 @@ GET https://DomainName/api/v1/loans/template?templateType=individual&clientId=1& "id": 2, "code": "loanRescheduleStrategyMethod.reduce.number.of.installments", "value": "Reduce number of installments" - } + }, + "recalculationRestFrequencyType": { + "id":1, + "code":"interestRecalculationFrequencyType.same.as.repayment.period", + "value":"Same as repayment period" + } } "charges": [], "productOptions": [ @@ -7195,32 +7192,7 @@ GET https://DomainName/api/v1/loans/template?templateType=individual&clientId=1& "fieldOfficerId":0, "currency":{"code":"USD","name":"US Dollar","decimalPlaces":2,"displaySymbol":"$","nameCode":"currency.USD","displayLabel":"US Dollar ($)"} } - ], - "interestRecalculationFrequencyTypeOptions": [{ - "id": 1, - "code": "interestRecalculationFrequencyType.same.as.repayment.period", - "value": "Same as repayment period" - }, - { - "id": 2, - "code": "interestRecalculationFrequencyType.daily", - "value": "Daily" - }, - { - "id": 3, - "code": "interestRecalculationFrequencyType.weekly", - "value": "Weekly" - }, - { - "id": 4, - "code": "interestRecalculationFrequencyType.fortnightly", - "value": "Fortnightly" - }, - { - "id": 5, - "code": "interestRecalculationFrequencyType.monthly", - "value": "Monthly" - }], + ] } @@ -7251,6 +7223,12 @@ GET https://DomainName/api/v1/loans/template?templateType=individual&clientId=1&
'repaymentSchedule': Loan schedule data.
+
+ 'originalSchedule': Loan schedule data without interest recalculations. +
+
+ 'futureSchedule': Loan schedule data from today date(will be displayed only for interest first repayment strategy processors) +
'transactions': Loan transactions data.
@@ -7960,10 +7938,10 @@ Request Body:
- + - +
Additional Mandatory Fields if interest recalculation is enabled for product
Additional Mandatory Fields if interest recalculation is enabled for product and Rest frequency not same as repayment period
recalculationFrequencyTyperecalculationRestFrequencyDate

@@ -8007,7 +7985,6 @@ Request Body: "submittedOnDate": "10 Jun 2013", "linkAccountId" : "1", "fixedEmiAmount":1100, - "recalculationFrequencyType":"1", "maxOutstandingLoanBalance":"35000", "disbursementData":[{"expectedDisbursementDate":"01 November 2013", "principal":22000,"approvedPrincipal":22000}] @@ -10854,6 +10831,25 @@ An enumeration that indicates the type of transaction processing strategy to be Specifies what action should perform on loan repayment schedule for advance payments.
Example Values:1=Reschedule next repayments, 2=Reduce number of installments, 3=Reduce EMI amount + + recalculationRestFrequencyType + + + Specifies effective date from which the late or advanced payment amounts will be considered in recalculation.
+ Example Values:1=Same as repayment period, 2=Daily, 3=Weekly, 4=Monthly + + + recalculationRestFrequencyInterval + + + Specifies rest frequency interval for interest recalculation.
+ + + recalculationRestFrequencyDate + + + Specifies rest frequency start date for interest recalculation.
+ @@ -10963,7 +10959,12 @@ GET https://DomainName/api/v1/loanproducts "id": 2, "code": "loanRescheduleStrategyMethod.reduce.number.of.installments", "value": "Reduce number of installments" - } + }, + "recalculationRestFrequencyType": { + "id":1, + "code":"interestRecalculationFrequencyType.same.as.repayment.period", + "value":"Same as repayment period" + } }, "accountingRule": { "id": 2, @@ -11811,7 +11812,28 @@ GET https://DomainName/api/v1/loanproducts/template "id": 1, "code": "loanRescheduleStrategyMethod.reschedule.next.repayments", "value": "Reschedule next repayments" - }] + }], + "interestRecalculationFrequencyTypeOptions": [ + { + "id":1, + "code":"interestRecalculationFrequencyType.same.as.repayment.period", + "value":"Same as repayment period" + }, + { + "id":2, + "code":"interestRecalculationFrequencyType.daily", + "value":"Daily" + }, + { + "id":3, + "code":"interestRecalculationFrequencyType.weekly", + "value":"Weekly" + }, + { + "id":4, + "code":"interestRecalculationFrequencyType.monthly", + "value":"Monthly" + }] } @@ -12100,7 +12122,15 @@ GET https://DomainName/api/v1/loanproducts/{productId}
Additional Mandatory Fields if interest recalculation is enabled(true)
- interestRecalculationCompoundingMethod,rescheduleStrategyMethod + interestRecalculationCompoundingMethod, rescheduleStrategyMethod, recalculationRestFrequencyType + + + + + + + +
Additional Optional Fields if interest recalculation is enabled(true) and recalculationRestFrequencyType is not same as repayment period
recalculationRestFrequencyInterval, recalculationRestFrequencyDate
@@ -12199,6 +12229,7 @@ Request Body: "isInterestRecalculationEnabled":"true", "interestRecalculationCompoundingMethod":"0", "rescheduleStrategyMethod":"3", + "recalculationRestFrequencyType":"1", "accountingRule":"2", "fundSourceAccountId":"4", "loanPortfolioAccountId":"8", @@ -12321,6 +12352,7 @@ Request Body: "isInterestRecalculationEnabled":"true", "interestRecalculationCompoundingMethod":"0", "rescheduleStrategyMethod":"3", + "recalculationRestFrequencyType":"1" } @@ -12331,6 +12363,7 @@ Request Body: "isInterestRecalculationEnabled":"true", "interestRecalculationCompoundingMethod":"0", "rescheduleStrategyMethod":"3", + "recalculationRestFrequencyType":"1" } } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/api/LoansApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/api/LoansApiResource.java index fefed4eb7..28b8cac87 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/api/LoansApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/api/LoansApiResource.java @@ -365,8 +365,7 @@ public class LoansApiResource { this.calculationPlatformService.updateFutureSchedule(repaymentSchedule, loanId); } - if (associationParameters.contains("originalSchedule") && loanBasicDetails.isInterestRecalculationEnabled() - && loanBasicDetails.isInterestRecalculationEnabled()) { + if (associationParameters.contains("originalSchedule") && loanBasicDetails.isInterestRecalculationEnabled()) { mandatoryResponseParameters.add("originalSchedule"); LoanScheduleData loanScheduleData = this.loanScheduleHistoryReadPlatformService.retrieveRepaymentArchiveSchedule( loanId, repaymentScheduleRelatedData, disbursementData);