FINERACT-2326: Fix UserLoanPermissionTest

This commit is contained in:
mariiaKraievska
2025-08-18 14:14:55 +02:00
committed by Adam Saghy
parent 7214f55d58
commit 3fb9b94e47
@@ -2839,20 +2839,22 @@ public final class LoanProductDataValidator {
baseDataValidator.reset().parameter(LoanProductConstants.BUY_DOWN_FEE_INCOME_TYPE_PARAM_NAME).value(buyDownFeeIncomeType) baseDataValidator.reset().parameter(LoanProductConstants.BUY_DOWN_FEE_INCOME_TYPE_PARAM_NAME).value(buyDownFeeIncomeType)
.isOneOfEnumValues(LoanBuyDownFeeIncomeType.class) .isOneOfEnumValues(LoanBuyDownFeeIncomeType.class)
.cantBeBlankWhenParameterProvidedIs(LoanProductConstants.ENABLE_BUY_DOWN_FEE_PARAM_NAME, true); .cantBeBlankWhenParameterProvidedIs(LoanProductConstants.ENABLE_BUY_DOWN_FEE_PARAM_NAME, true);
Boolean merchantBuyDownFee = this.fromApiJsonHelper
.extractBooleanNamed(LoanProductConstants.MERCHANT_BUY_DOWN_FEE_PARAM_NAME, element);
baseDataValidator.reset().parameter(LoanProductConstants.MERCHANT_BUY_DOWN_FEE_PARAM_NAME).value(merchantBuyDownFee)
.ignoreIfNull().validateForBooleanValue();
// Accounting // Accounting
if (AccountingValidations.isAccrualBasedAccounting(accountingRuleType)) { if (AccountingValidations.isAccrualBasedAccounting(accountingRuleType)) {
if (merchantBuyDownFee) { if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.MERCHANT_BUY_DOWN_FEE_PARAM_NAME, element)) {
final Long deferredIncomeLiabilityAccountId = this.fromApiJsonHelper final Boolean merchantBuyDownFee = this.fromApiJsonHelper
.extractLongNamed(LoanProductAccountingParams.BUY_DOWN_EXPENSE.getValue(), element); .extractBooleanNamed(LoanProductConstants.MERCHANT_BUY_DOWN_FEE_PARAM_NAME, element);
baseDataValidator.reset().parameter(LoanProductAccountingParams.BUY_DOWN_EXPENSE.getValue()) baseDataValidator.reset().parameter(LoanProductConstants.MERCHANT_BUY_DOWN_FEE_PARAM_NAME).value(merchantBuyDownFee)
.value(deferredIncomeLiabilityAccountId).notNull() .ignoreIfNull().validateForBooleanValue();
.cantBeBlankWhenParameterProvidedIs(LoanProductConstants.ENABLE_BUY_DOWN_FEE_PARAM_NAME, true) if (Boolean.TRUE.equals(merchantBuyDownFee)) {
.integerGreaterThanZero(); final Long deferredIncomeLiabilityAccountId = this.fromApiJsonHelper
.extractLongNamed(LoanProductAccountingParams.BUY_DOWN_EXPENSE.getValue(), element);
baseDataValidator.reset().parameter(LoanProductAccountingParams.BUY_DOWN_EXPENSE.getValue())
.value(deferredIncomeLiabilityAccountId).notNull()
.cantBeBlankWhenParameterProvidedIs(LoanProductConstants.ENABLE_BUY_DOWN_FEE_PARAM_NAME, true)
.integerGreaterThanZero();
}
} }
final Long incomeFromDeferredIncomeAccountId = this.fromApiJsonHelper final Long incomeFromDeferredIncomeAccountId = this.fromApiJsonHelper
.extractLongNamed(LoanProductAccountingParams.INCOME_FROM_BUY_DOWN.getValue(), element); .extractLongNamed(LoanProductAccountingParams.INCOME_FROM_BUY_DOWN.getValue(), element);