Skip to content

Commit

Permalink
SU-442 (#1289)
Browse files Browse the repository at this point in the history
* SU-442
  • Loading branch information
faheem205 authored Nov 14, 2024
1 parent 81ba0f0 commit 75e6a98
Show file tree
Hide file tree
Showing 7 changed files with 1,002 additions and 263 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,14 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
@Embedded
private LoanCustomizationDetail loanCustomizationDetail;

@Column(name = "excluded_from_reclaim", nullable = false)
private boolean excludedFromReclaim = false;
@Column(name = "excluded_for_insurance_claim")
private String excludedForInsuranceClaim;

@Column(name = "excluded_for_claim_type")
private String excludedForClaimType;
@Column(name = "excluded_for_aval_claim")
private String excludedForAvalClaim;

@Column(name = "excluded_for_castigado_claim")
private String excludedForCastigadoClaim;
// This attribute is used only to capture the repayment strategy (VERTICAL/HORIZONTAL). Updating all the related
// methods to add this attribute as a parameter was creating a mess
@Transient
Expand Down Expand Up @@ -8030,12 +8032,28 @@ public void setRecalculateEMI(boolean recalculateEMI) {
this.recalculateEMI = recalculateEMI;
}

public boolean excludedFromReclaim() {
return excludedFromReclaim;
public String excludedForInsuranceClaim() {
return excludedForInsuranceClaim;
}

public void setExcludedFromReclaim(boolean excludedFromReclaim) {
this.excludedFromReclaim = excludedFromReclaim;
public void setExcludedForInsuranceClaim(String excludedForInsuranceClaim) {
this.excludedForInsuranceClaim = excludedForInsuranceClaim;
}

public String excludedForAvalClaim() {
return excludedForAvalClaim;
}

public void setExcludedForAvalClaim(String excludedForAvalClaim) {
this.excludedForAvalClaim = excludedForAvalClaim;
}

public String excludedForCastigadoClaim() {
return excludedForCastigadoClaim;
}

public void setExcludedForCastigadoClaim(String excludedForCastigadoClaim) {
this.excludedForCastigadoClaim = excludedForCastigadoClaim;
}

public String claimType() {
Expand All @@ -8054,14 +8072,6 @@ public void setClaimDate(LocalDate claimDate) {
this.claimDate = claimDate;
}

public String excludedForClaimType() {
return excludedForClaimType;
}

public void setExcludedForClaimType(String excludedForClaimType) {
this.excludedForClaimType = excludedForClaimType;
}

public Integer getLastInstallmentChargeCalculatedOn() {
return lastInstallmentChargeCalculatedOn;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ List<Long> findAllNonClosedLoansByLastClosedBusinessDateNotNullAndMinAndMaxLoanI
List<Long> findLoanIdByStatusId(@Param("statusId") Integer statusId);

@Modifying
@Query("update Loan l set l.excludedFromReclaim = false, l.excludedForClaimType = null WHERE l.excludedForClaimType = :claimType")
void removeLoanExclusion(@Param("claimType") String claimType);
@Query("update Loan l set l.excludedForInsuranceClaim = null")
void removeLoanInsuranceExclusion();

@Modifying
@Query("update Loan l set l.excludedForAvalClaim = null")
void removeLoanAvalExclusion();

@Modifying
@Query("update Loan l set l.excludedForCastigadoClaim = null")
void removeLoanCastigadoExclusion();
}
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,13 @@ public List<Long> findLoanIdsByStatusId(Integer statusId) {
}

public void removeLoanExclusion(String claimType) {
repository.removeLoanExclusion(claimType);
if (claimType.equals("insurance")) {
repository.removeLoanInsuranceExclusion();
} else if (claimType.equals("guarantor")) {
repository.removeLoanAvalExclusion();
} else {
repository.removeLoanCastigadoExclusion();
}
}

}
Loading

0 comments on commit 75e6a98

Please sign in to comment.