FINERACT-2178: Ability to retrieve a loan's balance at a certain point in time in the past
This commit is contained in:
committed by
Arnold Gálovics
parent
986dceea1c
commit
0f1be3c913
+16
@@ -30,6 +30,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import net.fortuna.ical4j.model.property.RRule;
|
||||
import net.fortuna.ical4j.validate.ValidationException;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
|
||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||
@@ -616,6 +617,21 @@ public class DataValidatorBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValidatorBuilder listNotEmpty() {
|
||||
if (this.value == null && this.ignoreNullValue) {
|
||||
return this;
|
||||
}
|
||||
|
||||
final List<Object> list = (List<Object>) this.value;
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
String validationErrorCode = "validation.msg." + this.resource + "." + this.parameter + ".cannot.be.empty";
|
||||
String defaultEnglishMessage = "The parameter `" + this.parameter + "` cannot be empty. You must select at least one.";
|
||||
final ApiParameterError error = ApiParameterError.parameterError(validationErrorCode, defaultEnglishMessage, this.parameter);
|
||||
this.dataValidationErrors.add(error);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValidatorBuilder jsonArrayNotEmpty() {
|
||||
if (this.value == null && this.ignoreNullValue) {
|
||||
return this;
|
||||
|
||||
+7
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.core.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||
@@ -35,6 +37,11 @@ public class ExternalIdFactory {
|
||||
return StringUtils.isBlank(value) ? ExternalId.empty() : new ExternalId(value);
|
||||
}
|
||||
|
||||
public static List<ExternalId> produce(List<String> values) {
|
||||
Objects.requireNonNull(values, "values must not be null");
|
||||
return values.stream().map(ExternalIdFactory::produce).toList();
|
||||
}
|
||||
|
||||
public ExternalId createFromCommand(JsonCommand command, final String externalIdKey) {
|
||||
String externalIdStr = null;
|
||||
if (command.parsedJson() != null) {
|
||||
|
||||
+10
@@ -21,6 +21,8 @@ package org.apache.fineract.organisation.monetary.data;
|
||||
import java.io.Serializable;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.core.config.MapstructMapperConfig;
|
||||
import org.apache.fineract.organisation.monetary.domain.MonetaryCurrency;
|
||||
|
||||
/**
|
||||
* Immutable data object representing currency.
|
||||
@@ -87,4 +89,12 @@ public class CurrencyData implements Serializable {
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@org.mapstruct.Mapper(config = MapstructMapperConfig.class)
|
||||
public interface Mapper {
|
||||
|
||||
default CurrencyData map(MonetaryCurrency source) {
|
||||
return source.toData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user