}
// TODO: We should share a lot of code with ChangeEnrollmentCommentAPI.
@Override
protected Void doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
EventTicket ticket = daos.getEventTicketAccess().find(con, ticketId);
if (ticket == null)
throw new PartakeException(UserErrorCode.INVALID_TICKET_ID);
Event event = daos.getEventAccess().find(con, ticket.getEventId());
if (event == null)
throw new PartakeException(UserErrorCode.INVALID_EVENT_ID);
// もし、締め切りを過ぎている場合、変更が出来なくなる。
if (!ticket.acceptsApplication(event, TimeUtil.getCurrentDateTime()))
throw new PartakeException(UserErrorCode.INVALID_ENROLL_TIMEOVER);
// もし、予約締切を過ぎている場合、reservation にはできない。
if (ticket.isReservationTimeOver(event) && ParticipationStatus.RESERVED.equals(status))
throw new PartakeException(UserErrorCode.INVALID_APPLICATION_RESERVATION_TIMEOVER);
EnrollmentDAOFacade.enrollImpl(con, daos, user, ticketId, event, status, comment, enqueteAnswers, false, ticket.isReservationTimeOver(event));
tweetEnrollment(con, daos, user, event, status);
return null;
}