PublicPresentationSeminarState mostRecentState = process.getMostRecentState();
switch (type) {
case WAITING_FOR_COMMISSION_CONSTITUTION:
if (process.getPresentationRequestDate() == null) {
throw new PhdDomainOperationException(
"error.phd.seminar.PublicPresentationSeminarState.presentationRequestDate.required");
}
stateDate = process.getPresentationRequestDate().toDateTimeAtStartOfDay();
break;
case COMMISSION_WAITING_FOR_VALIDATION:
stateDate = mostRecentState.getStateDate().plusMinutes(1);
break;
case COMMISSION_VALIDATED:
stateDate = mostRecentState.getStateDate().plusMinutes(1);
break;
case PUBLIC_PRESENTATION_DATE_SCHEDULED:
stateDate = mostRecentState.getStateDate().plusMinutes(1);
break;
case REPORT_WAITING_FOR_VALIDATION:
if (process.getMostRecentStateByType(PublicPresentationSeminarProcessStateType.REPORT_WAITING_FOR_VALIDATION) != null) {
stateDate = mostRecentState.getStateDate().plusMinutes(1);
break;
}
if (process.getPresentationDate() == null) {
throw new PhdDomainOperationException(
"error.phd.seminar.PublicPresentationSeminarState.presentationDate.required");
}
stateDate = process.getPresentationDate().toDateTimeAtStartOfDay();
break;