diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java index 297ce1b0e46..0e471a0a6f5 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java @@ -28,6 +28,7 @@ import java.util.List; import java.util.Set; import lombok.Getter; +import lombok.Setter; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.infrastructure.core.service.MathUtil; import org.apache.fineract.organisation.monetary.data.CurrencyData; @@ -69,31 +70,48 @@ public final class LoanApplicationTerms { + @Getter private CurrencyData currency; + @Getter private Calendar loanCalendar; + @Getter private Integer loanTermFrequency; + @Getter private PeriodFrequencyType loanTermPeriodFrequencyType; + @Getter private Integer numberOfRepayments; private Integer actualNumberOfRepayments; + @Getter private Integer repaymentEvery; + @Getter private PeriodFrequencyType repaymentPeriodFrequencyType; private long variationDays = 0L; + @Getter private Integer fixedLength; + @Getter private Integer nthDay; + @Getter private DayOfWeekType weekDayType; + @Getter private AmortizationMethod amortizationMethod; + @Getter private InterestMethod interestMethod; private BigDecimal interestRatePerPeriod; private PeriodFrequencyType interestRatePeriodFrequencyType; + @Getter private BigDecimal annualNominalInterestRate; + @Getter private InterestCalculationPeriodMethod interestCalculationPeriodMethod; private boolean allowPartialPeriodInterestCalculation; + @Setter + @Getter private Money principal; + @Getter private LocalDate expectedDisbursementDate; private LocalDate repaymentsStartingFromDate; private LocalDate calculatedRepaymentsStartingFromDate; @@ -132,6 +150,7 @@ public final class LoanApplicationTerms { * interest should be charged. *

*/ + @Getter private LocalDate interestChargedFromDate; private Money inArrearsTolerance; @@ -140,20 +159,29 @@ public final class LoanApplicationTerms { // added private LocalDate loanEndDate; + @Getter private List disbursementDatas; private boolean multiDisburseLoan; + @Setter private BigDecimal fixedEmiAmount; + @Setter private BigDecimal fixedPrincipalAmount; + @Getter + @Setter private BigDecimal currentPeriodFixedEmiAmount; + @Getter + @Setter private BigDecimal currentPeriodFixedPrincipalAmount; + @Getter private BigDecimal actualFixedEmiAmount; + @Getter private BigDecimal maxOutstandingBalance; private Money totalInterestDue; @@ -162,34 +190,47 @@ public final class LoanApplicationTerms { private DaysInYearType daysInYearType; + @Getter private boolean interestRecalculationEnabled; + @Getter private LoanRescheduleStrategyMethod rescheduleStrategyMethod; + @Getter private InterestRecalculationCompoundingMethod interestRecalculationCompoundingMethod; + @Getter private CalendarInstance restCalendarInstance; + @Getter private RecalculationFrequencyType recalculationFrequencyType; + @Getter private CalendarInstance compoundingCalendarInstance; + @Getter private RecalculationFrequencyType compoundingFrequencyType; private boolean allowCompoundingOnEod; private BigDecimal principalThresholdForLastInstalment; + @Getter private Integer installmentAmountInMultiplesOf; + @Getter private LoanPreCloseInterestCalculationStrategy preClosureInterestCalculationStrategy; + @Getter private Money approvedPrincipal; private LoanTermVariationsDataWrapper variationsDataWrapper; private Money adjustPrincipalForFlatLoans; + @Getter + @Setter private LocalDate seedDate; + @Getter private CalendarHistoryDataWrapper calendarHistoryDataWrapper; private Boolean isInterestChargedFromDateSameAsDisbursalDateEnabled; @@ -220,18 +261,27 @@ public final class LoanApplicationTerms { private int periodsCompleted = 0; private int extraPeriods = 0; private boolean isEqualAmortization; + @Setter private Money interestTobeApproppriated; private BigDecimal fixedPrincipalPercentagePerInstallment; + @Getter + @Setter private LocalDate newScheduledDueDateStart; private boolean isDownPaymentEnabled; + @Getter private BigDecimal disbursedAmountPercentageForDownPayment; + @Getter private Money downPaymentAmount; private boolean isAutoRepaymentForDownPaymentEnabled; + @Getter private RepaymentStartDateType repaymentStartDateType; + @Getter private LocalDate submittedOnDate; + @Setter private Money disbursedPrincipal; + @Getter private LoanScheduleType loanScheduleType; private LoanScheduleProcessingType loanScheduleProcessingType; private boolean enableAccrualActivityPosting; @@ -1504,19 +1554,11 @@ private Integer calculateLastInterestGracePeriod(int periodNumber) { } public boolean isPrincipalGraceApplicableForThisPeriod(final int periodNumber) { - boolean isPrincipalGraceApplicableForThisPeriod = false; - if (this.periodNumbersApplicableForPrincipalGrace.contains(periodNumber)) { - isPrincipalGraceApplicableForThisPeriod = true; - } - return isPrincipalGraceApplicableForThisPeriod; + return this.periodNumbersApplicableForPrincipalGrace.contains(periodNumber); } public boolean isInterestPaymentGraceApplicableForThisPeriod(final int periodNumber) { - boolean isInterestPaymentGraceApplicableForThisPeriod = false; - if (this.periodNumbersApplicableForInterestGrace.contains(periodNumber)) { - isInterestPaymentGraceApplicableForThisPeriod = true; - } - return isInterestPaymentGraceApplicableForThisPeriod; + return this.periodNumbersApplicableForInterestGrace.contains(periodNumber); } private boolean isFirstPeriodAfterInterestPaymentGracePeriod(final int periodNumber) { @@ -1662,12 +1704,7 @@ private Integer calculateNumberOfRemainingPrincipalPaymentPeriods(final Integer principalFeePeriods++; } } - Integer periodsRemaining = totalNumberOfRepaymentPeriods - periodsElapsed - principalFeePeriods; - return periodsRemaining; - } - - public void setFixedPrincipalAmount(BigDecimal fixedPrincipalAmount) { - this.fixedPrincipalAmount = fixedPrincipalAmount; + return totalNumberOfRepaymentPeriods - periodsElapsed - principalFeePeriods; } private Money calculatePrincipalDueForInstallment(final int periodNumber, final Money totalDuePerInstallment, @@ -1718,62 +1755,14 @@ public ILoanConfigurationDetails toLoanConfigurationDetails() { preClosureInterestCalculationStrategy, allowFullTermForTranche); } - public Integer getLoanTermFrequency() { - return this.loanTermFrequency; - } - - public PeriodFrequencyType getLoanTermPeriodFrequencyType() { - return this.loanTermPeriodFrequencyType; - } - - public Integer getRepaymentEvery() { - return this.repaymentEvery; - } - - public PeriodFrequencyType getRepaymentPeriodFrequencyType() { - return this.repaymentPeriodFrequencyType; - } - public LocalDate getRepaymentStartFromDate() { return this.repaymentsStartingFromDate; } - public LocalDate getInterestChargedFromDate() { - return this.interestChargedFromDate; - } - - public void setPrincipal(Money principal) { - this.principal = principal; - } - - public void setDisbursedPrincipal(Money disbursedPrincipal) { - this.disbursedPrincipal = disbursedPrincipal; - } - public LocalDate getInterestChargedFromLocalDate() { return this.interestChargedFromDate; } - public InterestMethod getInterestMethod() { - return this.interestMethod; - } - - public AmortizationMethod getAmortizationMethod() { - return this.amortizationMethod; - } - - public CurrencyData getCurrency() { - return currency; - } - - public Integer getNumberOfRepayments() { - return this.numberOfRepayments; - } - - public LocalDate getExpectedDisbursementDate() { - return this.expectedDisbursementDate; - } - public LocalDate getRepaymentsStartingFromLocalDate() { return this.repaymentsStartingFromDate; } @@ -1782,18 +1771,6 @@ public LocalDate getCalculatedRepaymentsStartingFromLocalDate() { return this.calculatedRepaymentsStartingFromDate; } - public Money getPrincipal() { - return this.principal; - } - - public Money getApprovedPrincipal() { - return this.approvedPrincipal; - } - - public List getDisbursementDatas() { - return this.disbursementDatas; - } - public boolean isMultiDisburseLoan() { return this.multiDisburseLoan; } @@ -1803,10 +1780,6 @@ public Money getMaxOutstandingBalanceMoney() { return Money.of(getCurrency(), this.maxOutstandingBalance); } - public BigDecimal getMaxOutstandingBalance() { - return maxOutstandingBalance; - } - public BigDecimal getFixedEmiAmount() { BigDecimal fixedEmiAmount = this.fixedEmiAmount; if (getCurrentPeriodFixedEmiAmount() != null) { @@ -1815,18 +1788,6 @@ public BigDecimal getFixedEmiAmount() { return fixedEmiAmount; } - public Integer getNthDay() { - return this.nthDay; - } - - public DayOfWeekType getWeekDayType() { - return this.weekDayType; - } - - public void setFixedEmiAmount(BigDecimal fixedEmiAmount) { - this.fixedEmiAmount = fixedEmiAmount; - } - public void resetFixedEmiAmount() { this.fixedEmiAmount = this.actualFixedEmiAmount; } @@ -1843,22 +1804,6 @@ public boolean isInterestBearingAndInterestRecalculationEnabled() { return isInterestBearing() && isInterestRecalculationEnabled(); } - public boolean isInterestRecalculationEnabled() { - return this.interestRecalculationEnabled; - } - - public LoanRescheduleStrategyMethod getRescheduleStrategyMethod() { - return this.rescheduleStrategyMethod; - } - - public InterestRecalculationCompoundingMethod getInterestRecalculationCompoundingMethod() { - return this.interestRecalculationCompoundingMethod; - } - - public CalendarInstance getRestCalendarInstance() { - return this.restCalendarInstance; - } - private boolean isFallingInRepaymentPeriod(LocalDate fromDate, LocalDate toDate) { boolean isSameAsRepaymentPeriod = false; if (this.interestCalculationPeriodMethod.getValue().equals(InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD.getValue())) { @@ -1868,14 +1813,8 @@ private boolean isFallingInRepaymentPeriod(LocalDate fromDate, LocalDate toDate) isSameAsRepaymentPeriod = (days % 7) == 0; break; case MONTHS: - boolean isFromDateOnEndDate = false; - if (fromDate.getDayOfMonth() > fromDate.plusDays(1).getDayOfMonth()) { - isFromDateOnEndDate = true; - } - boolean isToDateOnEndDate = false; - if (toDate.getDayOfMonth() > toDate.plusDays(1).getDayOfMonth()) { - isToDateOnEndDate = true; - } + boolean isFromDateOnEndDate = fromDate.getDayOfMonth() > fromDate.plusDays(1).getDayOfMonth(); + boolean isToDateOnEndDate = toDate.getDayOfMonth() > toDate.plusDays(1).getDayOfMonth(); if (isFromDateOnEndDate && isToDateOnEndDate) { isSameAsRepaymentPeriod = true; @@ -1915,10 +1854,6 @@ private Integer getPeriodsBetween(LocalDate fromDate, LocalDate toDate) { return numberOfPeriods; } - public RecalculationFrequencyType getRecalculationFrequencyType() { - return this.recalculationFrequencyType; - } - public void updateNumberOfRepayments(final Integer numberOfRepayments) { this.numberOfRepayments = numberOfRepayments; this.actualNumberOfRepayments = numberOfRepayments + getLoanTermVariations().adjustNumberOfRepayments(); @@ -1945,10 +1880,6 @@ public void updateAnnualNominalInterestRate(BigDecimal annualNominalInterestRate } } - public BigDecimal getAnnualNominalInterestRate() { - return this.annualNominalInterestRate; - } - public void updateInterestChargedFromDate(LocalDate interestChargedFromDate) { if (interestChargedFromDate != null) { this.interestChargedFromDate = interestChargedFromDate; @@ -1965,30 +1896,6 @@ public void updateTotalInterestDue(Money totalInterestDue) { this.totalInterestDue = totalInterestDue; } - public InterestCalculationPeriodMethod getInterestCalculationPeriodMethod() { - return this.interestCalculationPeriodMethod; - } - - public LoanPreCloseInterestCalculationStrategy getPreClosureInterestCalculationStrategy() { - return this.preClosureInterestCalculationStrategy; - } - - public CalendarInstance getCompoundingCalendarInstance() { - return this.compoundingCalendarInstance; - } - - public RecalculationFrequencyType getCompoundingFrequencyType() { - return this.compoundingFrequencyType; - } - - public BigDecimal getActualFixedEmiAmount() { - return this.actualFixedEmiAmount; - } - - public Calendar getLoanCalendar() { - return loanCalendar; - } - public BigDecimal getFixedPrincipalAmount() { BigDecimal fixedPrincipalAmount = this.fixedPrincipalAmount; if (getCurrentPeriodFixedPrincipalAmount() != null) { @@ -2001,34 +1908,10 @@ public LoanTermVariationsDataWrapper getLoanTermVariations() { return this.variationsDataWrapper; } - public BigDecimal getCurrentPeriodFixedEmiAmount() { - return this.currentPeriodFixedEmiAmount; - } - - public void setCurrentPeriodFixedEmiAmount(BigDecimal currentPeriodFixedEmiAmount) { - this.currentPeriodFixedEmiAmount = currentPeriodFixedEmiAmount; - } - - public BigDecimal getCurrentPeriodFixedPrincipalAmount() { - return this.currentPeriodFixedPrincipalAmount; - } - - public void setCurrentPeriodFixedPrincipalAmount(BigDecimal currentPeriodFixedPrincipalAmount) { - this.currentPeriodFixedPrincipalAmount = currentPeriodFixedPrincipalAmount; - } - public Integer fetchNumberOfRepaymentsAfterExceptions() { return this.actualNumberOfRepayments; } - public LocalDate getSeedDate() { - return this.seedDate; - } - - public CalendarHistoryDataWrapper getCalendarHistoryDataWrapper() { - return this.calendarHistoryDataWrapper; - } - public Boolean isInterestChargedFromDateSameAsDisbursalDateEnabled() { return this.isInterestChargedFromDateSameAsDisbursalDateEnabled; } @@ -2150,10 +2033,6 @@ public void updateTotalInterestAccounted(Money totalInterestAccounted) { this.totalInterestAccounted = totalInterestAccounted; } - public void setSeedDate(LocalDate seedDate) { - this.seedDate = seedDate; - } - public boolean isEqualAmortization() { return isEqualAmortization; } @@ -2170,10 +2049,6 @@ public Money getInterestTobeApproppriated() { return interestTobeApproppriated == null ? this.principal.zero() : interestTobeApproppriated; } - public void setInterestTobeApproppriated(Money interestTobeApproppriated) { - this.interestTobeApproppriated = interestTobeApproppriated; - } - public Boolean isInterestTobeApproppriated() { return interestTobeApproppriated != null && interestTobeApproppriated.isGreaterThanZero(); } @@ -2186,46 +2061,10 @@ public boolean isPrincipalCompoundingDisabledForOverdueLoans() { return isPrincipalCompoundingDisabledForOverdueLoans; } - public LocalDate getNewScheduledDueDateStart() { - return newScheduledDueDateStart; - } - - public void setNewScheduledDueDateStart(LocalDate newScheduledDueDateStart) { - this.newScheduledDueDateStart = newScheduledDueDateStart; - } - public boolean isDownPaymentEnabled() { return isDownPaymentEnabled; } - public BigDecimal getDisbursedAmountPercentageForDownPayment() { - return disbursedAmountPercentageForDownPayment; - } - - public RepaymentStartDateType getRepaymentStartDateType() { - return repaymentStartDateType; - } - - public LocalDate getSubmittedOnDate() { - return submittedOnDate; - } - - public Integer getInstallmentAmountInMultiplesOf() { - return installmentAmountInMultiplesOf; - } - - public LoanScheduleType getLoanScheduleType() { - return loanScheduleType; - } - - public Money getDownPaymentAmount() { - return downPaymentAmount; - } - - public Integer getFixedLength() { - return fixedLength; - } - public LocalDate calculateMaxDateForFixedLength() { final LocalDate startDate = getRepaymentStartDate(); LocalDate maxDateForFixedLength = null; diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestData.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestData.java index 017abc198ac..1312be79dab 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestData.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestData.java @@ -20,12 +20,14 @@ import java.time.LocalDate; import java.util.Collection; +import lombok.Getter; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.portfolio.loanaccount.data.LoanTermVariationsData; /** * Immutable data object representing loan reschedule request data. **/ +@Getter public final class LoanRescheduleRequestData { private final Long id; @@ -126,41 +128,6 @@ public static LoanRescheduleRequestData instance(Long id, Long loanId, LoanResch rescheduleReasonCodeValue); } - /** - * @return the id - */ - public Long getId() { - return id; - } - - /** - * @return the loanId - */ - public Long getLoanId() { - return loanId; - } - - /** - * @return the statusEnum - */ - public LoanRescheduleRequestStatusEnumData getStatusEnum() { - return statusEnum; - } - - /** - * @return the reschedule from installment number - */ - public Integer getRescheduleFromInstallment() { - return rescheduleFromInstallment; - } - - /** - * @return the reschedule from date - */ - public LocalDate getRescheduleFromDate() { - return rescheduleFromDate; - } - /** * @return the rescheduleReasonCodeValueId */ @@ -168,41 +135,6 @@ public CodeValueData getRescheduleReasonCodeValueId() { return rescheduleReasonCodeValue; } - /** - * @return the rescheduleReasonText - */ - public String getRescheduleReasonComment() { - return rescheduleReasonComment; - } - - /** - * @return the timeline - **/ - public LoanRescheduleRequestTimelineData getTimeline() { - return this.timeline; - } - - /** - * @return the clientName - */ - public String getClientName() { - return clientName; - } - - /** - * @return the loanAccountNumber - */ - public String getLoanAccountNumber() { - return loanAccountNumber; - } - - /** - * @return the clientId - */ - public Long getClientId() { - return clientId; - } - /** * @return the recalculateInterest */ diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestStatusEnumData.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestStatusEnumData.java index 087cdd6c464..6685101639c 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestStatusEnumData.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestStatusEnumData.java @@ -18,11 +18,15 @@ */ package org.apache.fineract.portfolio.loanaccount.rescheduleloan.data; +import lombok.Getter; +import lombok.experimental.Accessors; import org.apache.fineract.portfolio.loanaccount.domain.LoanStatus; /** * Immutable data object represent loan reschedule request status enumerations. **/ +@Getter +@Accessors(fluent = true) public class LoanRescheduleRequestStatusEnumData { private final Long id; @@ -46,18 +50,6 @@ public LoanRescheduleRequestStatusEnumData(Long id, String code, String value) { this.rejected = Long.valueOf(LoanStatus.REJECTED.getValue()).equals(this.id); } - public Long id() { - return this.id; - } - - public String code() { - return this.code; - } - - public String value() { - return this.value; - } - public boolean isPendingApproval() { return this.pendingApproval; } diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestTimelineData.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestTimelineData.java index 8715f016435..d9b70f18fac 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestTimelineData.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/data/LoanRescheduleRequestTimelineData.java @@ -19,11 +19,13 @@ package org.apache.fineract.portfolio.loanaccount.rescheduleloan.data; import java.time.LocalDate; +import lombok.Data; /** * Immutable data object represent the timeline events of a loan reschedule request **/ @SuppressWarnings("unused") +@Data public class LoanRescheduleRequestTimelineData { private final LocalDate submittedOnDate; diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleModelRepaymentPeriod.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleModelRepaymentPeriod.java index 06a5428ac46..b487c862c40 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleModelRepaymentPeriod.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleModelRepaymentPeriod.java @@ -20,9 +20,11 @@ import java.math.BigDecimal; import java.time.LocalDate; +import lombok.Setter; import org.apache.fineract.organisation.monetary.domain.Money; import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanSchedulePeriodData; +@Setter public final class LoanRescheduleModelRepaymentPeriod implements LoanRescheduleModalPeriod { private int periodNumber; diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java index b8211af7e41..ef743f0038e 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/rescheduleloan/domain/LoanRescheduleRequest.java @@ -30,6 +30,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import lombok.Getter; import org.apache.fineract.infrastructure.codes.domain.CodeValue; import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom; import org.apache.fineract.portfolio.loanaccount.domain.Loan; @@ -40,6 +41,7 @@ @Entity @Table(name = "m_loan_reschedule_request") +@Getter public class LoanRescheduleRequest extends AbstractPersistableCustom { @ManyToOne @@ -129,83 +131,6 @@ public static LoanRescheduleRequest instance(final Loan loan, final Integer stat rejectedOnDate, rejectedByUser); } - /** - * @return the reschedule request loan object - **/ - public Loan getLoan() { - return this.loan; - } - - /** - * @return the status enum - **/ - public Integer getStatusEnum() { - return this.statusEnum; - } - - /** - * @return installment number of the rescheduling start point - **/ - public Integer getRescheduleFromInstallment() { - return this.rescheduleFromInstallment; - } - - /** - * @return due date of the rescheduling start point - **/ - public LocalDate getRescheduleFromDate() { - return this.rescheduleFromDate; - } - - /** - * @return the reschedule reason code value object - **/ - public CodeValue getRescheduleReasonCodeValue() { - return this.rescheduleReasonCodeValue; - } - - /** - * @return the reschedule reason comment added by the "submittedByUser" - **/ - public String getRescheduleReasonComment() { - return this.rescheduleReasonComment; - } - - /** - * @return the date the request was submitted - **/ - public LocalDate getSubmittedOnDate() { - return this.submittedOnDate; - } - - /** - * @return the user that submitted the request - **/ - public AppUser getSubmittedByUser() { - return this.submittedByUser; - } - - /** - * @return the date the request was approved - **/ - public LocalDate getApprovedOnDate() { - return this.approvedOnDate; - } - - /** - * @return the user that approved the request - **/ - public AppUser getApprovedByUser() { - return this.approvedByUser; - } - - /** - * @return the date the request was rejected - **/ - public LocalDate getRejectedOnDate() { - return this.rejectedOnDate; - } - /** * @return the recalculate interest option (true/false) **/ @@ -219,13 +144,6 @@ public Boolean getRecalculateInterest() { return recalculateInterest; } - /** - * @return the user that rejected the request - **/ - public AppUser getRejectedByUser() { - return this.rejectedByUser; - } - /** * change the status of the loan reschedule request to approved, also updating the approvedByUser and approvedOnDate * properties @@ -268,10 +186,6 @@ public void updateLoanRescheduleRequestToTermVariationMappings(final List getLoanRescheduleRequestToTermVariationMappings() { - return this.loanRescheduleRequestToTermVariationMappings; - } - public LoanTermVariations getInterestRateFromInstallmentTermVariationIfExists() { return this.loanRescheduleRequestToTermVariationMappings.stream() .map(LoanRescheduleRequestToTermVariationMapping::getLoanTermVariations) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/Guarantor.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/Guarantor.java index 8b734bb764e..d7f46505401 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/Guarantor.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/domain/Guarantor.java @@ -31,6 +31,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import lombok.Getter; import org.apache.commons.lang3.StringUtils; import org.apache.fineract.infrastructure.codes.domain.CodeValue; import org.apache.fineract.infrastructure.core.api.JsonCommand; @@ -42,17 +43,21 @@ @Table(name = "m_guarantor") public class Guarantor extends AbstractPersistableCustom { + @Getter @ManyToOne @JoinColumn(name = "loan_id", nullable = false) private Loan loan; + @Getter @ManyToOne @JoinColumn(name = "client_reln_cv_id", nullable = false) private CodeValue clientRelationshipType; + @Getter @Column(name = "type_enum", nullable = false) private Integer gurantorType; + @Getter @Column(name = "entity_id") private Long entityId; @@ -95,6 +100,7 @@ public class Guarantor extends AbstractPersistableCustom { @Column(name = "is_active", nullable = false) private boolean active; + @Getter @OneToMany(cascade = CascadeType.ALL, mappedBy = "guarantor", orphanRemoval = true, fetch = FetchType.EAGER) private List guarantorFundDetails = new ArrayList<>(); @@ -202,7 +208,6 @@ private void handlePropertyUpdate(final JsonCommand command, final Map getGuarantorFundDetails() { - return this.guarantorFundDetails; - } - public boolean hasGuarantor(Long savingsId) { if (savingsId == null) { return false; @@ -354,10 +337,6 @@ public boolean hasGuarantor(Long savingsId) { } public boolean isSelfGuarantee() { - boolean isSelf = false; - if (isExistingCustomer() && getEntityId().equals(getClientId())) { - isSelf = true; - } - return isSelf; + return isExistingCustomer() && getEntityId().equals(getClientId()); } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/FixedDepositAccount.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/FixedDepositAccount.java index 8421e9ca07c..40c0e94acbf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/FixedDepositAccount.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/FixedDepositAccount.java @@ -312,10 +312,7 @@ private List calculateInterestPayable(final MathContext mc, final List savingsAccountTransactionDetailsForPostingPeriodList = toSavingsAccountTransactionDetailsForPostingPeriodList( transactions); for (final LocalDateInterval periodInterval : postingPeriodIntervals) { - boolean isUserPosting = false; - if (postedAsOnTransactionDates.contains(periodInterval.endDate())) { - isUserPosting = true; - } + boolean isUserPosting = postedAsOnTransactionDates.contains(periodInterval.endDate()); final PostingPeriod postingPeriod = PostingPeriod.createFrom(periodInterval, periodStartingBalance, savingsAccountTransactionDetailsForPostingPeriodList, this.currency, compoundingPeriodType, interestCalculationType, interestRateAsFraction, daysInYearType.getValue(), maturityDate, interestPostTransactions, isInterestTransfer, diff --git a/fineract-savings/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartFields.java b/fineract-savings/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartFields.java index e1a78a96dc3..c9f76033ae2 100644 --- a/fineract-savings/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartFields.java +++ b/fineract-savings/src/main/java/org/apache/fineract/portfolio/interestratechart/domain/InterestRateChartFields.java @@ -30,6 +30,7 @@ import jakarta.persistence.Embeddable; import java.time.LocalDate; import java.util.Map; +import lombok.Getter; import org.apache.fineract.infrastructure.core.api.JsonCommand; import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder; import org.apache.fineract.infrastructure.core.domain.LocalDateInterval; @@ -44,9 +45,11 @@ public class InterestRateChartFields { @Column(name = "description", nullable = true) private String description; + @Getter @Column(name = "from_date", nullable = false) private LocalDate fromDate; + @Getter @Column(name = "end_date", nullable = true) private LocalDate endDate; @@ -123,14 +126,6 @@ public boolean isFromDateAfter(LocalDate compare) { return compare != null && DateUtils.isAfter(getFromDate(), compare); } - public LocalDate getFromDate() { - return this.fromDate; - } - - public LocalDate getEndDate() { - return this.endDate; - } - public boolean isOverlapping(InterestRateChartFields that) { final LocalDate thisFromDate = this.getFromDate(); LocalDate thisEndDate = this.getEndDate(); @@ -142,10 +137,8 @@ public boolean isOverlapping(InterestRateChartFields that) { final LocalDateInterval thisInterval = LocalDateInterval.create(thisFromDate, thisEndDate); final LocalDateInterval thatInterval = LocalDateInterval.create(thatFromDate, thatEndDate); - if (thisInterval.containsPortionOf(thatInterval) || thatInterval.containsPortionOf(thisInterval)) { - return true; - } - return false;// no overlapping + return thisInterval.containsPortionOf(thatInterval) || thatInterval.containsPortionOf(thisInterval);// no + // overlapping } public boolean isApplicableChartFor(final LocalDate target) { diff --git a/fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java b/fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java index 360e64ada17..af1d02b92b8 100644 --- a/fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java +++ b/fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java @@ -135,9 +135,7 @@ public boolean isMinDepositTermGreaterThanMaxDepositTerm() { if (this.minDepositTerm != null && this.maxDepositTerm != null) { final Integer minDepositInDays = this.convertToSafeDays(minDepositTerm, SavingsPeriodFrequencyType.fromInt(minDepositTermType)); final Integer maxDepositInDays = this.convertToSafeDays(maxDepositTerm, SavingsPeriodFrequencyType.fromInt(maxDepositTermType)); - if (minDepositInDays.compareTo(maxDepositInDays) > 0) { - return true; - } + return minDepositInDays.compareTo(maxDepositInDays) > 0; } return false; }