Fixing validations for update deposit products
This commit is contained in:
@@ -7030,10 +7030,10 @@ Request Body:
|
||||
</div>
|
||||
<div class="method-example">
|
||||
<code class="method-declaration">
|
||||
DELETE https://Domain Name/api/v1/savingproducts/{productId}
|
||||
DELETE https://Domain Name/api/v1/depositproducts/{productId}
|
||||
</code>
|
||||
<code class="method-request">
|
||||
DELETE savingproducts/1
|
||||
DELETE depositproducts/1
|
||||
Content-Type: application/json
|
||||
</code>
|
||||
<code class="method-response">{ "resourceId": 1 } </code>
|
||||
|
||||
+8
-8
@@ -145,16 +145,16 @@ public final class DepositProductCommandFromApiJsonDeserializer {
|
||||
final JsonElement element = fromApiJsonHelper.parse(json);
|
||||
|
||||
final String name = fromApiJsonHelper.extractStringNamed("name", element);
|
||||
baseDataValidator.reset().parameter("name").value(name).notBlank().ignoreIfNull().notExceedingLengthOf(100);
|
||||
baseDataValidator.reset().parameter("name").value(name).ignoreIfNull().notBlank().notExceedingLengthOf(100);
|
||||
|
||||
final String externalId = fromApiJsonHelper.extractStringNamed("externalId", element);
|
||||
baseDataValidator.reset().parameter("externalId").value(externalId).ignoreIfNull().notExceedingLengthOf(100);
|
||||
|
||||
final String description = fromApiJsonHelper.extractStringNamed("description", element);
|
||||
baseDataValidator.reset().parameter("description").value(description).notExceedingLengthOf(500);
|
||||
baseDataValidator.reset().parameter("description").value(description).ignoreIfNull().notExceedingLengthOf(500);
|
||||
|
||||
final String currencyCode = fromApiJsonHelper.extractStringNamed("currencyCode", element);
|
||||
baseDataValidator.reset().parameter("currencyCode").value(currencyCode).notBlank();
|
||||
baseDataValidator.reset().parameter("currencyCode").value(currencyCode).ignoreIfNull().notBlank();
|
||||
|
||||
final Integer digitsAfterDecimal = fromApiJsonHelper.extractIntegerNamed("digitsAfterDecimal", element, Locale.getDefault());
|
||||
baseDataValidator.reset().parameter("digitsAfterDecimal").value(digitsAfterDecimal).ignoreIfNull().inMinMaxRange(0, 6);
|
||||
@@ -163,7 +163,7 @@ public final class DepositProductCommandFromApiJsonDeserializer {
|
||||
baseDataValidator.reset().parameter("minimumBalance").value(minimumBalance).ignoreIfNull().zeroOrPositiveAmount();
|
||||
|
||||
final BigDecimal maximumBalance = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maximumBalance", element);
|
||||
baseDataValidator.reset().parameter("maximumBalance").value(maximumBalance).zeroOrPositiveAmount();
|
||||
baseDataValidator.reset().parameter("maximumBalance").value(maximumBalance).ignoreIfNull().zeroOrPositiveAmount();
|
||||
baseDataValidator.reset().parameter("minimumBalance").comapareMinimumAndMaximumAmounts(minimumBalance, maximumBalance);
|
||||
|
||||
final Integer tenureInMonths = fromApiJsonHelper.extractIntegerNamed("tenureInMonths", element, Locale.getDefault());
|
||||
@@ -196,15 +196,15 @@ public final class DepositProductCommandFromApiJsonDeserializer {
|
||||
.inMinMaxRange(1, 3);
|
||||
|
||||
final Boolean renewalAllowed = fromApiJsonHelper.extractBooleanNamed("renewalAllowed", element);
|
||||
baseDataValidator.reset().parameter("renewalAllowed").value(renewalAllowed)
|
||||
baseDataValidator.reset().parameter("renewalAllowed").value(renewalAllowed).ignoreIfNull()
|
||||
.trueOrFalseRequired(isBooleanValueUpdated(renewalAllowed));
|
||||
|
||||
final Boolean preClosureAllowed = fromApiJsonHelper.extractBooleanNamed("preClosureAllowed", element);
|
||||
baseDataValidator.reset().parameter("preClosureAllowed").value(preClosureAllowed)
|
||||
baseDataValidator.reset().parameter("preClosureAllowed").value(preClosureAllowed).ignoreIfNull()
|
||||
.trueOrFalseRequired(isBooleanValueUpdated(preClosureAllowed));
|
||||
|
||||
final Boolean interestCompoundingAllowed = fromApiJsonHelper.extractBooleanNamed("interestCompoundingAllowed", element);
|
||||
baseDataValidator.reset().parameter("interestCompoundingAllowed").value(interestCompoundingAllowed)
|
||||
baseDataValidator.reset().parameter("interestCompoundingAllowed").value(interestCompoundingAllowed).ignoreIfNull()
|
||||
.trueOrFalseRequired(isBooleanValueUpdated(interestCompoundingAllowed));
|
||||
|
||||
final BigDecimal preClosureInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("preClosureInterestRate", element);
|
||||
@@ -213,7 +213,7 @@ public final class DepositProductCommandFromApiJsonDeserializer {
|
||||
.comapareMinAndMaxOfTwoBigDecmimalNos(preClosureInterestRate, maturityMinInterestRate);
|
||||
|
||||
final Boolean lockinPeriodAllowed = fromApiJsonHelper.extractBooleanNamed("isLockinPeriodAllowed", element);
|
||||
baseDataValidator.reset().parameter("isLockinPeriodAllowed").value(lockinPeriodAllowed)
|
||||
baseDataValidator.reset().parameter("isLockinPeriodAllowed").value(lockinPeriodAllowed).ignoreIfNull()
|
||||
.trueOrFalseRequired(isBooleanValueUpdated(lockinPeriodAllowed));
|
||||
|
||||
final Integer lockinPeriod = fromApiJsonHelper.extractIntegerNamed("lockinPeriod", element, Locale.getDefault());
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead
|
||||
@Override
|
||||
public DepositProductData retrieveDepositProductData(Long productId) {
|
||||
DepositProductMapper depositProductMapper = new DepositProductMapper();
|
||||
String sql = "select " + depositProductMapper.depositProductSchema() + " where dp.id = ? and dp.is_deleted=0";
|
||||
String sql = "select " + depositProductMapper.depositProductSchema() + " where dp.id = ? ";
|
||||
|
||||
return this.jdbcTemplate.queryForObject(sql, depositProductMapper, new Object[] { productId });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user