FINERACT-2011: Savings Account - transaction order is incorrectly mixed after certain activities

This commit is contained in:
jmarta
2023-11-20 11:50:31 +01:00
committed by Adam Saghy
parent d0341e69cb
commit 4f2400ca3e
8 changed files with 371 additions and 221 deletions
@@ -32,11 +32,13 @@ import java.time.temporal.TemporalAccessor;
import java.util.Arrays;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.infrastructure.core.domain.ExternalId;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.infrastructure.core.service.MathUtil;
import org.apache.fineract.infrastructure.security.domain.BasicPasswordEncodablePlatformUser;
import org.apache.fineract.infrastructure.security.domain.PlatformUser;
import org.apache.fineract.infrastructure.security.service.PlatformPasswordEncoder;
@@ -268,27 +270,11 @@ public final class JsonCommand {
}
private boolean differenceExists(final TemporalAccessor baseValue, final TemporalAccessor workingCopyValue) {
boolean differenceExists = false;
if (baseValue != null) {
differenceExists = !baseValue.equals(workingCopyValue);
} else {
differenceExists = workingCopyValue != null;
}
return differenceExists;
return !Objects.equals(baseValue, workingCopyValue);
}
private boolean differenceExists(final String baseValue, final String workingCopyValue) {
boolean differenceExists = false;
if (StringUtils.isNotBlank(baseValue)) {
differenceExists = !baseValue.equals(workingCopyValue);
} else {
differenceExists = StringUtils.isNotBlank(workingCopyValue);
}
return differenceExists;
return !Objects.equals(baseValue, workingCopyValue);
}
private boolean differenceExists(final String[] baseValue, final String[] workingCopyValue) {
@@ -298,47 +284,15 @@ public final class JsonCommand {
}
private boolean differenceExists(final Number baseValue, final Number workingCopyValue) {
boolean differenceExists = false;
if (baseValue != null) {
if (workingCopyValue != null) {
differenceExists = !baseValue.equals(workingCopyValue);
} else {
differenceExists = true;
}
} else {
differenceExists = workingCopyValue != null;
}
return differenceExists;
return !Objects.equals(baseValue, workingCopyValue);
}
private boolean differenceExists(final BigDecimal baseValue, final BigDecimal workingCopyValue) {
boolean differenceExists = false;
if (baseValue != null) {
if (workingCopyValue != null) {
differenceExists = baseValue.compareTo(workingCopyValue) != 0;
} else {
differenceExists = true;
}
} else {
differenceExists = workingCopyValue != null;
}
return differenceExists;
return !MathUtil.isEqualTo(baseValue, workingCopyValue);
}
private boolean differenceExists(final Boolean baseValue, final Boolean workingCopyValue) {
boolean differenceExists = false;
if (baseValue != null) {
differenceExists = !baseValue.equals(workingCopyValue);
} else {
differenceExists = workingCopyValue != null;
}
return differenceExists;
return !Objects.equals(baseValue, workingCopyValue);
}
public boolean parameterExists(final String parameterName) {