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 2021/08/27 01:53:19 UTC

[GitHub] [fineract] Cadreia opened a new pull request #1843: Holiday Rescheduling

Cadreia opened a new pull request #1843:
URL: https://github.com/apache/fineract/pull/1843


   ## Description
   
   Describe the changes made and why they were made.
   
   Ignore if these details are present on the associated [Apache Fineract JIRA ticket](https://github.com/apache/fineract/pull/1284).
   
   
   ## 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/api-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] ptuomola merged pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
ptuomola merged pull request #1843:
URL: https://github.com/apache/fineract/pull/1843


   


-- 
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] xurror commented on pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
xurror commented on pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#issuecomment-918205140


   For this feature, there is no actual need for a UI change as it just an improvement on the loan rescheduling algorithm and nothing around the API.
   
   The improvement is more at the level of improving the holiday rescheduling algorithm to work better with long holidays as in the past, the feature would accumulate unpaid loans during holiday periods to a single on the next working day.
   With this update, the loans schedule instead get extended.


-- 
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] Ankit-muellner commented on pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
Ankit-muellner commented on pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#issuecomment-921357936


    This feature is part of a strategy of keeping Fineract vaccinated against pandemic. Read more here.. https://research.muellners.org/holiday-rescheduling/ 


-- 
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] awasum commented on pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
awasum commented on pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#issuecomment-914472964


   @francisguchie  and @bharathc27  Please can you find time to test this one functionally? Looks interesting.


-- 
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] xurror commented on a change in pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
xurror commented on a change in pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#discussion_r707343612



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
##########
@@ -4509,30 +4511,77 @@ private LocalDate getMaxDateLimitForNewRepayment(final PeriodFrequencyType perio
                                                    // startDate
     }
 
-    public void applyHolidayToRepaymentScheduleDates(final Holiday holiday) {
+    public void applyHolidayToRepaymentScheduleDates(final Holiday holiday, final LoanUtilService loanUtilService) {
+        final DefaultScheduledDateGenerator scheduledDateGenerator = new DefaultScheduledDateGenerator();
+        ScheduleGeneratorDTO scheduleGeneratorDTO = loanUtilService.buildScheduleGeneratorDTO(this, holiday.getFromDateLocalDate());
+        final LoanApplicationTerms loanApplicationTerms = this.constructLoanApplicationTerms(scheduleGeneratorDTO);
+
+        // LocalDate rescheduleFromDate = holiday.getFromDateLocalDate();
+        LocalDate adjustedRescheduleToDate = null;
+
+        if (holiday.getReScheduleType().isResheduleToNextRepaymentDate()) {
+            final LocalDate rescheduleToDate = holiday.getToDateLocalDate();
+            for (final LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment : this.getRepaymentScheduleInstallments()) {
+                if (rescheduleToDate.isEqual(loanRepaymentScheduleInstallment.getDueDate())) {
+                    adjustedRescheduleToDate = rescheduleToDate;
+                    break;
+                } else {
+                    // Account for a Bimonthly Loan Product
+                    // if (loanApplicationTerms.getRepaymentPeriodFrequencyType().isSemiMonthly()) {
+                    // if (rescheduleToDate.isAfter(loanRepaymentScheduleInstallment.getDueDate())
+                    // && rescheduleToDate.isBefore(loanRepaymentScheduleInstallment.getDueDate().plusDays(15))) {

Review comment:
       The commented code is more for a future proof for an upcoming feature that I think is still WIP progress at Muellners around a bi-monthly product.
   The commented code is meant to retrofit the holiday rescheduling to new feature once it's rolled out.




-- 
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] Ankit-muellner commented on a change in pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
Ankit-muellner commented on a change in pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#discussion_r710604338



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
##########
@@ -4509,30 +4511,77 @@ private LocalDate getMaxDateLimitForNewRepayment(final PeriodFrequencyType perio
                                                    // startDate
     }
 
-    public void applyHolidayToRepaymentScheduleDates(final Holiday holiday) {
+    public void applyHolidayToRepaymentScheduleDates(final Holiday holiday, final LoanUtilService loanUtilService) {
+        final DefaultScheduledDateGenerator scheduledDateGenerator = new DefaultScheduledDateGenerator();
+        ScheduleGeneratorDTO scheduleGeneratorDTO = loanUtilService.buildScheduleGeneratorDTO(this, holiday.getFromDateLocalDate());
+        final LoanApplicationTerms loanApplicationTerms = this.constructLoanApplicationTerms(scheduleGeneratorDTO);
+
+        // LocalDate rescheduleFromDate = holiday.getFromDateLocalDate();
+        LocalDate adjustedRescheduleToDate = null;
+
+        if (holiday.getReScheduleType().isResheduleToNextRepaymentDate()) {
+            final LocalDate rescheduleToDate = holiday.getToDateLocalDate();
+            for (final LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment : this.getRepaymentScheduleInstallments()) {
+                if (rescheduleToDate.isEqual(loanRepaymentScheduleInstallment.getDueDate())) {
+                    adjustedRescheduleToDate = rescheduleToDate;
+                    break;
+                } else {
+                    // Account for a Bimonthly Loan Product
+                    // if (loanApplicationTerms.getRepaymentPeriodFrequencyType().isSemiMonthly()) {
+                    // if (rescheduleToDate.isAfter(loanRepaymentScheduleInstallment.getDueDate())
+                    // && rescheduleToDate.isBefore(loanRepaymentScheduleInstallment.getDueDate().plusDays(15))) {

Review comment:
       thanks Kaze for focusing on detail here. very thoughtful!




-- 
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] awasum commented on pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
awasum commented on pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#issuecomment-918195833


   Is there a UI component to this? @Cadreia  @xurror ??
   
   


-- 
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] xurror edited a comment on pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
xurror edited a comment on pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#issuecomment-918205140


   For this feature, there is no actual need for a UI change as it just an improvement on the loan rescheduling algorithm and nothing around the API.
   
   The improvement is more at the level of improving the holiday rescheduling algorithm to work better with long holidays as in the past, the feature would accumulate unpaid loans during holiday periods to a single on the next working day.
   With this update, the loans schedule instead get extended.
   
   So same UI from before works for this.


-- 
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] awasum commented on a change in pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
awasum commented on a change in pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#discussion_r707337218



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
##########
@@ -4509,30 +4511,77 @@ private LocalDate getMaxDateLimitForNewRepayment(final PeriodFrequencyType perio
                                                    // startDate
     }
 
-    public void applyHolidayToRepaymentScheduleDates(final Holiday holiday) {
+    public void applyHolidayToRepaymentScheduleDates(final Holiday holiday, final LoanUtilService loanUtilService) {
+        final DefaultScheduledDateGenerator scheduledDateGenerator = new DefaultScheduledDateGenerator();
+        ScheduleGeneratorDTO scheduleGeneratorDTO = loanUtilService.buildScheduleGeneratorDTO(this, holiday.getFromDateLocalDate());
+        final LoanApplicationTerms loanApplicationTerms = this.constructLoanApplicationTerms(scheduleGeneratorDTO);
+
+        // LocalDate rescheduleFromDate = holiday.getFromDateLocalDate();
+        LocalDate adjustedRescheduleToDate = null;
+
+        if (holiday.getReScheduleType().isResheduleToNextRepaymentDate()) {
+            final LocalDate rescheduleToDate = holiday.getToDateLocalDate();
+            for (final LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment : this.getRepaymentScheduleInstallments()) {
+                if (rescheduleToDate.isEqual(loanRepaymentScheduleInstallment.getDueDate())) {
+                    adjustedRescheduleToDate = rescheduleToDate;
+                    break;
+                } else {
+                    // Account for a Bimonthly Loan Product
+                    // if (loanApplicationTerms.getRepaymentPeriodFrequencyType().isSemiMonthly()) {
+                    // if (rescheduleToDate.isAfter(loanRepaymentScheduleInstallment.getDueDate())
+                    // && rescheduleToDate.isBefore(loanRepaymentScheduleInstallment.getDueDate().plusDays(15))) {

Review comment:
       Why are you commenting all these lines if its not needed maybe we remove them? is it important?




-- 
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] awasum commented on pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
awasum commented on pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#issuecomment-918195660


   Is there a UI component to this? @Cadreia  @xurror ??
   
   


-- 
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] francisguchie commented on pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
francisguchie commented on pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#issuecomment-918297685


   > For this feature, there is no actual need for a UI change as it just an improvement on the loan rescheduling algorithm and nothing around the API.
   > 
   > The improvement is more at the level of improving the holiday rescheduling algorithm to work better with long holidays as in the past, the feature would accumulate unpaid loans during holiday periods to a single on the next working day.
   > With this update, the loans schedule instead get extended.
   > 
   > So same UI from before works for this.
   
   I have not used the reschedule before but if this is what is being updated, its a +1 from me - This is really a good improvement 


-- 
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] awasum commented on pull request #1843: Holiday Rescheduling (FINERACT-1313)

Posted by GitBox <gi...@apache.org>.
awasum commented on pull request #1843:
URL: https://github.com/apache/fineract/pull/1843#issuecomment-918193965


   Is there a UI component to this?
   
   @ptuomola  Do you have an opinion?


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