FINERACT-2058: loan can be marked as fraud in any status

This commit is contained in:
taskain7
2024-03-01 12:06:43 +01:00
committed by Adam Saghy
parent ef1bcda368
commit 49b3c014ef
3 changed files with 82 additions and 81 deletions
@@ -2550,11 +2550,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
Loan loan = this.loanAssembler.assembleFrom(loanId);
final Map<String, Object> changes = new LinkedHashMap<>();
if (loan.isApproved() || loan.isSubmittedAndPendingApproval()) {
throw new GeneralPlatformDomainRuleException("error.msg.loan.mark.as.fraud.not.allowed",
"Loan Id: " + loanId + " mark as fraud is not allowed as loan status is not active", loan.getStatus().getCode());
}
final boolean fraud = command.booleanPrimitiveValueOfParameterNamed(LoanApiConstants.FRAUD_ATTRIBUTE_NAME);
if (loan.isFraud() != fraud) {
loan.markAsFraud(fraud);