Skip to content

Commit

Permalink
Merge branch 'FINERACT-2090/restructure_loan_submit_modify' into FINE…
Browse files Browse the repository at this point in the history
…RACT-2090/restructure_loan_approve
  • Loading branch information
kjozsa committed Jun 5, 2024
2 parents 5b164bd + d544a35 commit c4b014b
Show file tree
Hide file tree
Showing 31 changed files with 2,389 additions and 2,409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,47 +143,51 @@ public static ChargeTimeType fromInt(final Integer chargeTime) {
}

public boolean isTimeOfDisbursement() {
return ChargeTimeType.DISBURSEMENT.getValue().equals(this.value);
return ChargeTimeType.DISBURSEMENT.equals(this);
}

public boolean isOnSpecifiedDueDate() {
return this.value.equals(ChargeTimeType.SPECIFIED_DUE_DATE.getValue());
return this.equals(ChargeTimeType.SPECIFIED_DUE_DATE);
}

public boolean isSavingsActivation() {
return this.value.equals(ChargeTimeType.SAVINGS_ACTIVATION.getValue());
return this.equals(ChargeTimeType.SAVINGS_ACTIVATION);
}

public boolean isSavingsClosure() {
return this.value.equals(ChargeTimeType.SAVINGS_CLOSURE.getValue());
return this.equals(ChargeTimeType.SAVINGS_CLOSURE);
}

public boolean isWithdrawalFee() {
return this.value.equals(ChargeTimeType.WITHDRAWAL_FEE.getValue());
return this.equals(ChargeTimeType.WITHDRAWAL_FEE);
}

public boolean isSavingsNoActivityFee() {
return this.value.equals(ChargeTimeType.SAVINGS_NOACTIVITY_FEE.getValue());
return this.equals(ChargeTimeType.SAVINGS_NOACTIVITY_FEE);
}

public boolean isAnnualFee() {
return this.value.equals(ChargeTimeType.ANNUAL_FEE.getValue());
return this.equals(ChargeTimeType.ANNUAL_FEE);
}

public boolean isMonthlyFee() {
return this.value.equals(ChargeTimeType.MONTHLY_FEE.getValue());
return this.equals(ChargeTimeType.MONTHLY_FEE);
}

public boolean isWeeklyFee() {
return this.value.equals(ChargeTimeType.WEEKLY_FEE.getValue());
return this.equals(ChargeTimeType.WEEKLY_FEE);
}

public boolean isInstalmentFee() {
return this.value.equals(ChargeTimeType.INSTALMENT_FEE.getValue());
return this.equals(ChargeTimeType.INSTALMENT_FEE);
}

public boolean isSpecifiedDueDate() {
return this.equals(ChargeTimeType.SPECIFIED_DUE_DATE);
}

public boolean isOverdueInstallment() {
return this.value.equals(ChargeTimeType.OVERDUE_INSTALLMENT.getValue());
return this.equals(ChargeTimeType.OVERDUE_INSTALLMENT);
}

public boolean isAllowedLoanChargeTime() {
Expand All @@ -200,22 +204,22 @@ public boolean isAllowedSavingsChargeTime() {
}

public boolean isOverdraftFee() {
return this.value.equals(ChargeTimeType.OVERDRAFT_FEE.getValue());
return this.equals(ChargeTimeType.OVERDRAFT_FEE);
}

public boolean isTrancheDisbursement() {
return this.value.equals(ChargeTimeType.TRANCHE_DISBURSEMENT.getValue());
return this.equals(ChargeTimeType.TRANCHE_DISBURSEMENT);
}

public boolean isShareAccountActivation() {
return this.value.equals(ChargeTimeType.SHAREACCOUNT_ACTIVATION.getValue());
return this.equals(ChargeTimeType.SHAREACCOUNT_ACTIVATION);
}

public boolean isSharesPurchase() {
return this.value.equals(ChargeTimeType.SHARE_PURCHASE.getValue());
return this.equals(ChargeTimeType.SHARE_PURCHASE);
}

public boolean isSharesRedeem() {
return this.value.equals(ChargeTimeType.SHARE_REDEEM.getValue());
return this.equals(ChargeTimeType.SHARE_REDEEM);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public interface LoanApiConstants {

String emiAmountParameterName = "fixedEmiAmount";
String fixedEmiAmountParameterName = "fixedEmiAmount";
String maxOutstandingBalanceParameterName = "maxOutstandingLoanBalance";
String disbursementDataParameterName = "disbursementData";
String expectedDisbursementDateParameterName = "expectedDisbursementDate";
Expand All @@ -36,6 +36,7 @@ public interface LoanApiConstants {
String amountParameterName = "amount";
String chargeTimeTypeParameterName = "chargeTimeType";
String chargeCalculationTypeParameterName = "chargeCalculationType";
String chargePaymentModeParameterName = "chargePaymentMode";
String principalDisbursedParameterName = "transactionAmount";
String chargesParameterName = "charges";
String loanIdTobeApproved = "loanId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,26 @@
*/
package org.apache.fineract.portfolio.loanaccount.command;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import lombok.Data;
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;

/**
* Java object representation of {@link LoanCharge} API JSON.
*/
public class LoanChargeCommand implements Comparable<LoanChargeCommand> {
@Data
public class LoanChargeCommand implements Serializable {

@SuppressWarnings("unused")
private final Long id;
private final Long chargeId;
private final BigDecimal amount;
private Long id;
private Long chargeId;
private BigDecimal amount;
@SuppressWarnings("unused")
private final Integer chargeTimeType;
private Integer chargeTimeType;
@SuppressWarnings("unused")
private final Integer chargeCalculationType;
private Integer chargeCalculationType;
@SuppressWarnings("unused")
private final LocalDate dueDate;

public LoanChargeCommand(final Long id, final Long chargeId, final BigDecimal amount, final Integer chargeTimeType,
final Integer chargeCalculationType, final LocalDate dueDate) {
this.id = id;
this.chargeId = chargeId;
this.amount = amount;
this.chargeTimeType = chargeTimeType;
this.chargeCalculationType = chargeCalculationType;
this.dueDate = dueDate;
}

@Override
@SuppressFBWarnings(value = "EQ_COMPARETO_USE_OBJECT_EQUALS", justification = "TODO: fix this! See: https://stackoverflow.com/questions/2609037/findbugs-how-to-solve-eq-compareto-use-object-equals")
public int compareTo(final LoanChargeCommand o) {
int comparison = this.chargeId.compareTo(o.chargeId);
if (comparison == 0) {
comparison = this.amount.compareTo(o.amount);
}
return comparison;
}
private LocalDate dueDate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
package org.apache.fineract.portfolio.loanaccount.data;

import java.math.BigDecimal;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Data;

@RequiredArgsConstructor
@Getter
@Data
@AllArgsConstructor
public class LoanCollateralManagementData {

private final Long clientCollateralId;
private Long clientCollateralId;

private final BigDecimal quantity;
private BigDecimal quantity;

private final BigDecimal total;
private BigDecimal total;

private final BigDecimal totalCollateral;
private BigDecimal totalCollateral;

private final Long id;
private Long id;
}
Loading

0 comments on commit c4b014b

Please sign in to comment.