This commit is contained in:
parent
9b902fb956
commit
6430a3ef4d
3 changed files with 7 additions and 4 deletions
|
|
@ -13,8 +13,8 @@ public class QuantityLotGreaterThanZero<T extends WithQuantityLot> implements IV
|
|||
@Override
|
||||
public Optional<EnumMessage> validate(ImdgValidationContext<T> ctx) {
|
||||
T validatedObject = ctx.getValidatedObject();
|
||||
if (validatedObject.getQuantityLot() == null || validatedObject.getQuantityLot() < 0) {
|
||||
return of(DefaultManagementErrors.RequiredFieldIsEmpty, "quantityLot");
|
||||
if (validatedObject.getQuantityLot() == null || validatedObject.getQuantityLot() <= 0) {
|
||||
return of(DefaultManagementErrors.OperationNotAllowed, "quantityLot");
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,6 +242,7 @@ public class ValidationConfig {
|
|||
return new ValidatorImpl<>(ctx,
|
||||
orderCurrencyPresentById,
|
||||
securityPresent,
|
||||
QuantityLotGreaterThanZero.INSTANCE,
|
||||
DictionaryPresentRule.instance(
|
||||
"side",
|
||||
OrderCurrencyUpdateRequest::getSide,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package ru.spcex.clearing.platform.messaging.domain.cud.order;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.math.BigDecimal;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithId;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithQuantityLot;
|
||||
|
||||
public class OrderCurrencyUpdateRequest implements WithId {
|
||||
public class OrderCurrencyUpdateRequest implements WithId, WithQuantityLot {
|
||||
@JsonProperty
|
||||
private Long id;
|
||||
@JsonProperty
|
||||
|
|
@ -56,6 +57,7 @@ public class OrderCurrencyUpdateRequest implements WithId {
|
|||
this.price = price;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getQuantityLot() {
|
||||
return quantityLot;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue