-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FINERACT-1971: RepaymentOverDueBusinessEvent should not be sent when … #3856
FINERACT-1971: RepaymentOverDueBusinessEvent should not be sent when … #3856
Conversation
@@ -933,6 +936,35 @@ public void saleExceptionHandling() { | |||
} | |||
} | |||
|
|||
@Test | |||
public void buybackOnATobeDeclinedPendingSale() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this test case as it is part of an another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Test case removed from this class
...ovider/src/main/java/org/apache/fineract/cob/loan/CheckLoanRepaymentOverdueBusinessStep.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please kindly review my comments!
@@ -175,4 +184,27 @@ public void givenLoanWithInstallmentOverdueAfterConfiguredDaysInLoanProductWhenS | |||
assertEquals(repaymentInstallment, loanPayloadForEvent); | |||
assertEquals(processedLoan, loanForProcessing); | |||
} | |||
|
|||
@Test | |||
public void givenNonDisbursedLoanWhenStepExecutionThenNoBusinessEventIsRaised() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not fully understand this test case, but please be sure to cover the following:
GIVEN Loan is SUBMITTED or APPROVED and outstanding amount is greater than ZERO and one of the instalment is OVERDUE
WHEN job got executed
THEN no overdue event
GIVEN Loan is ACTIVE, outstanding amount is ZERO, one of the installment is due date is matching with the actual date
WHEN job got executed
THEN no overdue event triggered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Test cases created:
givenActiveLoanWithZeroOutstandingWhenStepExecutionThenNoBusinessEventIsRaised
givenActiveLoanWithNonZeroOutstandingWhenStepExecutionThenBusinessEventIsRaised
8a49bd5
to
fdd362e
Compare
} | ||
|
||
@Test | ||
public void givenActiveLoanWithNonZeroOutstandingWhenStepExecutionThenBusinessEventIsRaised() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see test case to check whether the event got not raised if the loan status is SUBMITTED or APPROVED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Unit Test created:
givenSubmittedLoanWhenStepExecutionThenNoBusinessEventIsRaised
givenApprovedLoanWhenStepExecutionThenNoBusinessEventIsRaised
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please kindly see my comments!
fdd362e
to
fe1c916
Compare
private static boolean isOverDueEventNeededToBeSent(Loan loan, Long numberOfDaysBeforeDueDateToRaiseEvent, LocalDate currentDate, | ||
LoanRepaymentScheduleInstallment repaymentScheduleInstallment, LocalDate repaymentDate) { | ||
return repaymentDate.plusDays(numberOfDaysBeforeDueDateToRaiseEvent).equals(currentDate) | ||
&& loan.getLoanSummary().getTotalOutstanding().compareTo(BigDecimal.ZERO) > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to move the loan.getLoanSummary().getTotalOutstanding().compareTo(BigDecimal.ZERO) > 0
check to the top, next to the loan status check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
fe1c916
to
dfe5483
Compare
dfe5483
to
b68840a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…balance is 0
Description
Approved (orphaned) accounts with no disbursement are triggering
RepaymentOverdueDueBusinessEvent
reminder event after their maturity date.FINERACT-1971
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.