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/10/14 09:58:08 UTC

[GitHub] [fineract] adamsaghy opened a new pull request, #2672: FINERACT-1773: Allow 'specific due date charges' to be applied after the maturity date

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

   ## Description
   
   **Use case**
   As a user
   I want to add a specific due date after the maturity instalment date
   in order to add and collect the fee charges from the customer
   
   **Background and details:**
   When the customer payment bounces due to non-sufficient funds, an NSF fee is added to the account and collected on the next repayment.
   However if the last instalment amount bounces, currently the system doesn’t allow to add of the fees after the instalment date
   example:
   
   - last instalment date: 05-07-2022
   - repayment made:05-07-2022
   - repayment bounced due to NSF:10-05-2022
   - NSF due date to be added: 10-05-2022
   
   The system doesn’t allow the 4th step due to validation of not allowing to add a “specified due date charge” after the maturity date
   
   
   ## 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] adamsaghy commented on a diff in pull request #2672: FINERACT-1773: Allow 'specific due date charges' to be applied after the maturity date

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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachine.java:
##########
@@ -62,7 +65,7 @@ private LoanStatus getNextState(LoanEvent loanEvent, Loan loan) {
         }
 
         LoanStatus from = loan.status();
-        LoanStatus newState = from;
+        LoanStatus newState = null;

Review Comment:
   To avoid sending out from "ACTIVE" to "ACTIVE" events. Either we are not indicating with the result that there was no state change or we need to check the before & after and decide based on that.



-- 
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 #2672: FINERACT-1773: Allow 'specific due date charges' to be applied after the maturity date

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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachine.java:
##########
@@ -37,17 +37,20 @@ public DefaultLoanLifecycleStateMachine(LoanStatus[] allowedLoanStatuses, Busine
 
     @Override
     public LoanStatus dryTransition(final LoanEvent loanEvent, final Loan loan) {
-        return getNextState(loanEvent, loan);
+        LoanStatus nextStatus = getNextState(loanEvent, loan);
+        return nextStatus != null ? nextStatus : loan.status();
     }
 
     @Override
     public void transition(final LoanEvent loanEvent, final Loan loan) {
         LoanStatus newState = getNextState(loanEvent, loan);
-        loan.setLoanStatus(newState.getValue());
+        if (newState != null) {

Review Comment:
   With this logic in place, the dryTransition is having a different behavior. They should be the same (nextStatus != null ...).



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachine.java:
##########
@@ -62,7 +65,7 @@ private LoanStatus getNextState(LoanEvent loanEvent, Loan loan) {
         }
 
         LoanStatus from = loan.status();
-        LoanStatus newState = from;
+        LoanStatus newState = null;

Review Comment:
   Why was this needed, could you please explain?



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanEvent.java:
##########
@@ -49,5 +49,6 @@ public enum LoanEvent {
     LOAN_REJECT_TRANSFER, //
     LOAN_WITHDRAW_TRANSFER, //
     LOAN_CREDIT_BALANCE_REFUND, //
-    LOAN_CHARGEBACK;
+    LOAN_CHARGEBACK, //
+    Loan_CHARGE_ADDED;

Review Comment:
   Enum naming is not according to the standards, should be LOAN_CHARGE_ADDED.



-- 
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] adamsaghy commented on a diff in pull request #2672: FINERACT-1773: Allow 'specific due date charges' to be applied after the maturity date

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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachine.java:
##########
@@ -37,17 +37,20 @@ public DefaultLoanLifecycleStateMachine(LoanStatus[] allowedLoanStatuses, Busine
 
     @Override
     public LoanStatus dryTransition(final LoanEvent loanEvent, final Loan loan) {
-        return getNextState(loanEvent, loan);
+        LoanStatus nextStatus = getNextState(loanEvent, loan);
+        return nextStatus != null ? nextStatus : loan.status();
     }
 
     @Override
     public void transition(final LoanEvent loanEvent, final Loan loan) {
         LoanStatus newState = getNextState(loanEvent, loan);
-        loan.setLoanStatus(newState.getValue());
+        if (newState != null) {

Review Comment:
   Discussed. it works properly



-- 
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] adamsaghy commented on a diff in pull request #2672: FINERACT-1773: Allow 'specific due date charges' to be applied after the maturity date

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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanEvent.java:
##########
@@ -49,5 +49,6 @@ public enum LoanEvent {
     LOAN_REJECT_TRANSFER, //
     LOAN_WITHDRAW_TRANSFER, //
     LOAN_CREDIT_BALANCE_REFUND, //
-    LOAN_CHARGEBACK;
+    LOAN_CHARGEBACK, //
+    Loan_CHARGE_ADDED;

Review Comment:
   Nice catch!



-- 
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 #2672: FINERACT-1773: Allow 'specific due date charges' to be applied after the maturity date

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


-- 
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