Skip to content

Commit

Permalink
FINERACT-618 Allow for Submitted On Date to be Edited for Groups
Browse files Browse the repository at this point in the history
  • Loading branch information
m-sameer committed Nov 28, 2018
1 parent 47e7f7e commit a149185
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Expand Up @@ -345,6 +345,18 @@ public Map<String, Object> update(final JsonCommand command) {
this.accountNumber = StringUtils.defaultIfEmpty(newValue, null);
}

if (command.isChangeInLocalDateParameterNamed(GroupingTypesApiConstants.submittedOnDateParamName, getSubmittedOnDate())) {
final String valueAsInput = command.stringValueOfParameterNamed(GroupingTypesApiConstants.submittedOnDateParamName);
actualChanges.put(GroupingTypesApiConstants.submittedOnDateParamName, valueAsInput);
actualChanges.put(GroupingTypesApiConstants.dateFormatParamName, dateFormatAsInput);
actualChanges.put(GroupingTypesApiConstants.localeParamName, localeAsInput);

final LocalDate newValue = command.localDateValueOfParameterNamed(GroupingTypesApiConstants.submittedOnDateParamName);
if (newValue != null) {
this.submittedOnDate = newValue.toDate();
}
}

return actualChanges;
}

Expand Down
Expand Up @@ -374,6 +374,12 @@ public void validateForUpdateGroup(final JsonCommand command) {
}
}

if (this.fromApiJsonHelper.parameterExists(GroupingTypesApiConstants.submittedOnDateParamName, element)) {
final LocalDate submittedOnDate = this.fromApiJsonHelper.extractLocalDateNamed(
GroupingTypesApiConstants.submittedOnDateParamName, element);
baseDataValidator.reset().parameter(GroupingTypesApiConstants.submittedOnDateParamName).value(submittedOnDate).notNull();
}

throwExceptionIfValidationWarningsExist(dataValidationErrors);
}

Expand Down

0 comments on commit a149185

Please sign in to comment.