FINERACT-1402:PaymentTypeMandatory

This commit is contained in:
rrpawar96
2022-07-11 17:54:29 +02:00
committed by Arnold Gálovics
parent a765cb00f1
commit 308ede861c
2 changed files with 6 additions and 1 deletions
@@ -124,6 +124,9 @@ public class SavingsAccountTransactionDataValidator {
final BigDecimal transactionAmount = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(transactionAmountParamName, element);
baseDataValidator.reset().parameter(transactionAmountParamName).value(transactionAmount).notNull().positiveAmount();
final Integer paymentType = this.fromApiJsonHelper.extractIntegerWithLocaleNamed(paymentTypeIdParamName, element);
baseDataValidator.reset().parameter(paymentTypeIdParamName).value(paymentType).notNull();
validatePaymentTypeDetails(baseDataValidator, element);
throwExceptionIfValidationWarningsExist(dataValidationErrors);
@@ -88,6 +88,7 @@ public class SavingsAccountHelper {
public static final String TRANSACTION_DATE_PLUS_ONE = "02 March 2013";
public static final String LAST_TRANSACTION_DATE = "01 March 2013";
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
public static final Integer PAYMENT_TYPE_ID = 1;
public static final String DATE_TIME_FORMAT = "dd MMMM yyyy HH:mm";
private static final Boolean IS_BLOCK = false;
@@ -456,11 +457,12 @@ public class SavingsAccountHelper {
}
private String getSavingsTransactionJSON(final String amount, final String transactionDate) {
final HashMap<String, String> map = new HashMap<>();
final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.LOCALE);
map.put("dateFormat", CommonConstants.DATE_FORMAT);
map.put("transactionDate", transactionDate);
map.put("transactionAmount", amount);
map.put("paymentTypeId", PAYMENT_TYPE_ID);
String savingsAccountWithdrawalJson = new Gson().toJson(map);
LOG.info(savingsAccountWithdrawalJson);
return savingsAccountWithdrawalJson;