Uploaded image for project: 'Fineract Cloud Native'
  1. Fineract Cloud Native
  2. FINCN-51

Fix: Planned payment fetch more failed

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • fineract-cn-mobile
    • None

    Description

      initially, we are fetching the 50 planned payments at the page 0 and getting the planned payments as a response

      {
      "chargeNames": [

      { "identifier": "processing-fee", "name": "Processing fee" }

      ,

      { "identifier": "loan-origination-fee", "name": "Loan origination fee" }

      ,

      { "identifier": "disburse-payment", "name": "Disburse payment" }

      ,

      { "identifier": "return-disbursement", "name": "Return disbursement" }

      ,

      { "identifier": "disbursement-fee", "name": "Disbursement fee" }

      ,

      { "identifier": "track-return-principal", "name": "Track return principal" }

      ,

      { "identifier": "loan-funds-allocation", "name": "loan-funds-allocation" }

      ,

      { "identifier": "track-disburse-payment", "name": "Track disburse payment" }

      ,

      { "identifier": "repayment", "name": "Repayment" }

      ,

      { "identifier": "interest", "name": "Interest" }

      ],
      "elements": [
      {
      "interestRate": null,
      "costComponents": [

      { "chargeIdentifier": "loan-funds-allocation", "amount": 1500 }

      ,

      { "chargeIdentifier": "processing-fee", "amount": 15 }

      ,

      { "chargeIdentifier": "disbursement-fee", "amount": 1.5 }

      ,

      { "chargeIdentifier": "loan-origination-fee", "amount": 15 }

      ,

      { "chargeIdentifier": "return-disbursement", "amount": 1500 }

      ,

      { "chargeIdentifier": "track-disburse-payment", "amount": 0 }

      ,

      { "chargeIdentifier": "disburse-payment", "amount": 0 }

      ],
      "remainingPrincipal": 1500,
      "date": null
      },
      {
      "interestRate": null,
      "costComponents": [

      { "chargeIdentifier": "repayment", "amount": 752.7 }

      ,

      { "chargeIdentifier": "interest", "amount": 1.03 }

      ,

      { "chargeIdentifier": "track-return-principal", "amount": 751.67 }

      ],
      "remainingPrincipal": 748.33,
      "date": "2017-09-01Z"
      },
      {
      "interestRate": null,
      "costComponents": [

      { "chargeIdentifier": "repayment", "amount": 755.7 }

      ,

      { "chargeIdentifier": "interest", "amount": 3.08 }

      ,

      { "chargeIdentifier": "track-return-principal", "amount": 748.33 }

      ],
      "remainingPrincipal": 0,
      "date": "2017-10-01Z"
      }
      ],
      "totalPages": 1,
      "totalElements": 3
      }

      You can see in response we are getting totalPages and totalElements. We need to refactor our current load more REST API call according to these two parameter otherwise server is giving this error.

      { "timestamp": 1503811590076, "status": 500, "error": "Internal Server Error", "exception": "java.lang.IllegalArgumentException", "message": "org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: fromIndex(50) > toIndex(3)", "path": "/portfolio/v1/individuallending/products/lending/cases/lending_loan_001/plannedpayments" }

      Attachments

        Activity

          People

            Unassigned Unassigned
            dilpreet96 Dilpreet Singh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: