You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2022/12/05 06:55:27 UTC

[GitHub] [fineract] josehernandezfintecheandomx opened a new pull request, #2788: Fix to set obligation met date for installment with chargeback transa…

josehernandezfintecheandomx opened a new pull request, #2788:
URL: https://github.com/apache/fineract/pull/2788

   …ction
   
   ## Description
   
   In case if a loan is fully paid and there was a chargeback transaction the last installment is not marked as paid/completed.
   
   Ignore if these details are present on the associated [Apache Fineract JIRA ticket](https://github.com/apache/fineract/pull/1284).
   
   <img width="1444" alt="Screenshot 2022-12-05 at 0 48 11" src="https://user-images.githubusercontent.com/44206706/205568630-c4c1f0bf-b37a-40df-a72d-b4262fc4be2b.png">
   
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per https://github.com/apache/fineract/#pull-requests
   
   - [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
   
   - [ ] Create/update unit or integration tests for verifying the changes made.
   
   - [ ] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
   
   - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
   
   - [ ] Submission is not a "code dump".  (Large changes can be made "in repository" via a branch.  Ask on the developer mailing list for guidance, if required.)
   
   FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2788: FINERACT-1827: Fix to set obligation met date for installment with chargeback transa…

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on code in PR #2788:
URL: https://github.com/apache/fineract/pull/2788#discussion_r1041003032


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {
+                    log.info("Period number {} completed on date {}", period.getPeriod(), period.getObligationsMetOnDate());
+                    assertNotNull(period.getObligationsMetOnDate());

Review Comment:
   The result gets all the periods and It includes the first period (disbursement) and this period has not due date, obligations date, period number, etc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2788: FINERACT-1827: Fix to set obligation met date for installment with chargeback transa…

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on code in PR #2788:
URL: https://github.com/apache/fineract/pull/2788#discussion_r1041003032


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {
+                    log.info("Period number {} completed on date {}", period.getPeriod(), period.getObligationsMetOnDate());
+                    assertNotNull(period.getObligationsMetOnDate());

Review Comment:
   The result gets all the periods and It includes the first period (disbursement) and this period has not due date, obligations date, period number, etc



##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {
+                    log.info("Period number {} completed on date {}", period.getPeriod(), period.getObligationsMetOnDate());
+                    assertNotNull(period.getObligationsMetOnDate());

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2788: FINERACT-1827: Fix to set obligation met date for installment with chargeback transa…

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on code in PR #2788:
URL: https://github.com/apache/fineract/pull/2788#discussion_r1041012950


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {

Review Comment:
   Done! now use an assertion



##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {
+                    log.info("Period number {} completed on date {}", period.getPeriod(), period.getObligationsMetOnDate());
+                    assertNotNull(period.getObligationsMetOnDate());
+                    assertEquals(true, period.getComplete());

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] josehernandezfintecheandomx commented on a diff in pull request #2788: FINERACT-1827: Fix to set obligation met date for installment with chargeback transa…

Posted by GitBox <gi...@apache.org>.
josehernandezfintecheandomx commented on code in PR #2788:
URL: https://github.com/apache/fineract/pull/2788#discussion_r1041016880


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {

Review Comment:
   The result gets all the periods and It includes the first period (disbursement) and this period has not due date, obligations date, period number, etc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] galovics commented on a diff in pull request #2788: FINERACT-1827: Fix to set obligation met date for installment with chargeback transa…

Posted by GitBox <gi...@apache.org>.
galovics commented on code in PR #2788:
URL: https://github.com/apache/fineract/pull/2788#discussion_r1039567356


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {
+                    log.info("Period number {} completed on date {}", period.getPeriod(), period.getObligationsMetOnDate());
+                    assertNotNull(period.getObligationsMetOnDate());

Review Comment:
   Why checking only that it's not null. The exact date obligations were met is just as important.



##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {
+                    log.info("Period number {} completed on date {}", period.getPeriod(), period.getObligationsMetOnDate());
+                    assertNotNull(period.getObligationsMetOnDate());
+                    assertEquals(true, period.getComplete());

Review Comment:
   assertTrue



##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {

Review Comment:
   Null check again



##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyAndChargebackIntegrationTest.java:
##########
@@ -281,6 +285,26 @@ public void testLoanClassificationStepAsPartOfCOBRepeated() {
         getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
         validateLoanAccount(getLoansLoanIdResponse, amountVal, "400.00", 7, Double.valueOf("400.00"));
 
+        // Pay the Loan to get this as Closed
+        loanIdTransactionsResponse = loanTransactionHelper.makeLoanRepayment(operationDate, transactionAmount, loanId);
+        assertNotNull(loanIdTransactionsResponse);
+        getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
+        assertEquals(LoanStatus.CLOSED_OBLIGATIONS_MET.getValue(), getLoansLoanIdResponse.getStatus().getId());
+        log.info("Loan id {} with status {}", loanId, getLoansLoanIdResponse.getStatus().getCode());
+
+        // Evaluate Installments
+        GetLoansLoanIdRepaymentSchedule getLoanRepaymentSchedule = getLoansLoanIdResponse.getRepaymentSchedule();
+        if (getLoanRepaymentSchedule != null) {

Review Comment:
   I don't like the fact that there's a null check here cause it can hide issues.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] galovics merged pull request #2788: FINERACT-1827: Last installment is not closed if there is a chargeback transaction

Posted by GitBox <gi...@apache.org>.
galovics merged PR #2788:
URL: https://github.com/apache/fineract/pull/2788


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org