This is an automated email from the ASF dual-hosted git repository.
arnold pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new 308ede861 FINERACT-1402:PaymentTypeMandatory
308ede861 is described below
commit 308ede861cf8c72344fe431c79949d74e1c1135e
Author: rrpawar96 <[email protected]>
AuthorDate: Mon Jul 11 15:55:58 2022 +0530
FINERACT-1402:PaymentTypeMandatory
---
.../savings/data/SavingsAccountTransactionDataValidator.java | 3 +++
.../integrationtests/common/savings/SavingsAccountHelper.java | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
index c625404c3..2a0047ef3 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
@@ -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);
diff --git
a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java
b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java
index 5f3016e2b..e76abd6f6 100644
---
a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java
+++
b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/savings/SavingsAccountHelper.java
@@ -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;