ActionType fix
This commit is contained in:
parent
7e70f2ee94
commit
347aef48a2
7 changed files with 9 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ public class ClearingCalendarNewAction implements IAction<ClearingCalendarNewReq
|
|||
return clearingCalendarNewRequest;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public class ClearingCalendarUpdateAction implements IAction<ClearingCalendarUpd
|
|||
return clearingCalendarUpdateRequest;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.UPDATE;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public class PlannerNewAction implements IAction<PlannerNewRequest> {
|
|||
return plannerNewRequest;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package ru.spcex.clearing.backendapi.controller.request.cud.schedule;
|
|||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.spcex.clearing.backendapi.domain.actions.IAction;
|
||||
import ru.spcex.clearing.backendapi.errors.BackEndError;
|
||||
import ru.spcex.clearing.platform.messaging.domain.ActionType;
|
||||
|
|
@ -36,6 +37,7 @@ public class PlannerTemplateNewAction implements IAction<PlannerTemplateNewReque
|
|||
return plannerTemplateNewRequest;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ public class PlannerTemplateUpdateAction implements IAction<PlannerTemplateUpdat
|
|||
return plannerTemplateUpdateRequest;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.UPDATE;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ public class PlannerUpdateAction implements IAction<PlannerUpdateRequest>, WithI
|
|||
return plannerUpdateRequest;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.UPDATE;
|
||||
|
|
|
|||
|
|
@ -59,10 +59,12 @@ public class OperatorImpl implements IOperator {
|
|||
}
|
||||
|
||||
private void throwValidate(String destination, IAction<?> iAction) {
|
||||
//простая валидация - которую можно запилить прямо внутри класса (наличие полей, отношения между датами etc.)
|
||||
Collection<EnumMessage> validationErrors = iAction.validate();
|
||||
if (validationErrors.size() > 0) {
|
||||
throw new ActionValidationException(validationErrors);
|
||||
}
|
||||
//валидация требующая IMDG поиска других сущностей и т.д.
|
||||
IValidator validator = validation.getValidator(destination, iAction);
|
||||
if (validator != null) {
|
||||
validator.tillFirstError().ifPresent(enumMessage -> {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue