FINERACT-632 Make description field non mandatory in saving product
This commit is contained in:
+5
-3
@@ -137,9 +137,6 @@ public class SavingsProductDataValidator {
|
|||||||
final String shortName = this.fromApiJsonHelper.extractStringNamed(shortNameParamName, element);
|
final String shortName = this.fromApiJsonHelper.extractStringNamed(shortNameParamName, element);
|
||||||
baseDataValidator.reset().parameter(shortNameParamName).value(shortName).notBlank().notExceedingLengthOf(4);
|
baseDataValidator.reset().parameter(shortNameParamName).value(shortName).notBlank().notExceedingLengthOf(4);
|
||||||
|
|
||||||
final String description = this.fromApiJsonHelper.extractStringNamed(descriptionParamName, element);
|
|
||||||
baseDataValidator.reset().parameter(descriptionParamName).value(description).notBlank().notExceedingLengthOf(500);
|
|
||||||
|
|
||||||
final String currencyCode = this.fromApiJsonHelper.extractStringNamed(currencyCodeParamName, element);
|
final String currencyCode = this.fromApiJsonHelper.extractStringNamed(currencyCodeParamName, element);
|
||||||
baseDataValidator.reset().parameter(currencyCodeParamName).value(currencyCode).notBlank();
|
baseDataValidator.reset().parameter(currencyCodeParamName).value(currencyCode).notBlank();
|
||||||
|
|
||||||
@@ -175,6 +172,11 @@ public class SavingsProductDataValidator {
|
|||||||
baseDataValidator.reset().parameter(interestCalculationDaysInYearTypeParamName).value(interestCalculationDaysInYearType).notNull()
|
baseDataValidator.reset().parameter(interestCalculationDaysInYearTypeParamName).value(interestCalculationDaysInYearType).notNull()
|
||||||
.isOneOfTheseValues(SavingsInterestCalculationDaysInYearType.integerValues());
|
.isOneOfTheseValues(SavingsInterestCalculationDaysInYearType.integerValues());
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(descriptionParamName, element)) {
|
||||||
|
final String description = this.fromApiJsonHelper.extractStringNamed(descriptionParamName, element);
|
||||||
|
baseDataValidator.reset().parameter(descriptionParamName).value(description).ignoreIfNull().notExceedingLengthOf(500);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.fromApiJsonHelper.parameterExists(minRequiredOpeningBalanceParamName, element)) {
|
if (this.fromApiJsonHelper.parameterExists(minRequiredOpeningBalanceParamName, element)) {
|
||||||
final BigDecimal minOpeningBalance = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(
|
final BigDecimal minOpeningBalance = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(
|
||||||
minRequiredOpeningBalanceParamName, element);
|
minRequiredOpeningBalanceParamName, element);
|
||||||
|
|||||||
+1
-1
@@ -107,7 +107,7 @@ public class SavingsProduct extends AbstractPersistableCustom<Long> {
|
|||||||
@Column(name = "short_name", nullable = false, unique = true)
|
@Column(name = "short_name", nullable = false, unique = true)
|
||||||
protected String shortName;
|
protected String shortName;
|
||||||
|
|
||||||
@Column(name = "description", length = 500, nullable = false)
|
@Column(name = "description", length = 500, nullable = true)
|
||||||
protected String description;
|
protected String description;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ public class SavingsProductAssembler {
|
|||||||
|
|
||||||
final String name = command.stringValueOfParameterNamed(nameParamName);
|
final String name = command.stringValueOfParameterNamed(nameParamName);
|
||||||
final String shortName = command.stringValueOfParameterNamed(shortNameParamName);
|
final String shortName = command.stringValueOfParameterNamed(shortNameParamName);
|
||||||
final String description = command.stringValueOfParameterNamed(descriptionParamName);
|
final String description = command.stringValueOfParameterNamedAllowingNull(descriptionParamName);
|
||||||
|
|
||||||
final String currencyCode = command.stringValueOfParameterNamed(currencyCodeParamName);
|
final String currencyCode = command.stringValueOfParameterNamed(currencyCodeParamName);
|
||||||
final Integer digitsAfterDecimal = command.integerValueOfParameterNamed(digitsAfterDecimalParamName);
|
final Integer digitsAfterDecimal = command.integerValueOfParameterNamed(digitsAfterDecimalParamName);
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
--
|
||||||
|
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
-- or more contributor license agreements. See the NOTICE file
|
||||||
|
-- distributed with this work for additional information
|
||||||
|
-- regarding copyright ownership. The ASF licenses this file
|
||||||
|
-- to you under the Apache License, Version 2.0 (the
|
||||||
|
-- "License"); you may not use this file except in compliance
|
||||||
|
-- with the License. You may obtain a copy of the License at
|
||||||
|
--
|
||||||
|
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
--
|
||||||
|
-- Unless required by applicable law or agreed to in writing,
|
||||||
|
-- software distributed under the License is distributed on an
|
||||||
|
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
-- KIND, either express or implied. See the License for the
|
||||||
|
-- specific language governing permissions and limitations
|
||||||
|
-- under the License.
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE `m_savings_product` MODIFY `description` VARCHAR(500) NULL DEFAULT NULL;
|
||||||
Reference in New Issue
Block a user