Package in.partake.model.dto

Examples of in.partake.model.dto.EventTicket


    @Test
    public void testToBuildUserNotificationMessageBodyForOnedayBeforeReservationReminder() throws Exception{
        UserNotification notification = loadUserNotification(USER_NOTIFICATION_INQUEUE_ID);
        Event event = loadEvent(DEFAULT_EVENT_ID);
        EventTicket ticket = loadEventTicket(DEFAULT_EVENT_TICKET_ID);

        UserNotification userNotification = new UserNotification(notification);
        userNotification.setNotificationType(NotificationType.ONE_DAY_BEFORE_REMINDER_FOR_RESERVATION);

        String messageBody = SendMessageEnvelopeTask.buildUserNotificationMessageBody(userNotification, event, ticket);
View Full Code Here


    @Test
    public void testToBuildUserNotificationMessageBodyForHalfdayBeforeReservationReminder() throws Exception{
        UserNotification notification = loadUserNotification(USER_NOTIFICATION_INQUEUE_ID);
        Event event = loadEvent(DEFAULT_EVENT_ID);
        EventTicket ticket = loadEventTicket(DEFAULT_EVENT_TICKET_ID);

        UserNotification userNotification = new UserNotification(notification);
        userNotification.setNotificationType(NotificationType.HALF_DAY_BEFORE_REMINDER_FOR_RESERVATION);

        String messageBody = SendMessageEnvelopeTask.buildUserNotificationMessageBody(userNotification, event, ticket);
View Full Code Here

    @Test
    public void testToBuildUserNotificationMessageBodyForEnrolledReminder() throws Exception{
        UserNotification notification = loadUserNotification(USER_NOTIFICATION_INQUEUE_ID);
        Event event = loadEvent(DEFAULT_EVENT_ID);
        EventTicket ticket = loadEventTicket(DEFAULT_EVENT_TICKET_ID);

        UserNotification userNotification = new UserNotification(notification);
        userNotification.setNotificationType(NotificationType.BECAME_TO_BE_ENROLLED);

        String messageBody = SendMessageEnvelopeTask.buildUserNotificationMessageBody(userNotification, event, ticket);
View Full Code Here

    @Test
    public void testToBuildUserNotificationMessageBodyForCancelledReminder() throws Exception{
        UserNotification notification = loadUserNotification(USER_NOTIFICATION_INQUEUE_ID);
        Event event = loadEvent(DEFAULT_EVENT_ID);
        EventTicket ticket = loadEventTicket(DEFAULT_EVENT_TICKET_ID);

        UserNotification userNotification = new UserNotification(notification);
        userNotification.setNotificationType(NotificationType.BECAME_TO_BE_CANCELLED);

        String messageBody = SendMessageEnvelopeTask.buildUserNotificationMessageBody(userNotification, event, ticket);
View Full Code Here

        this.status = status;
    }

    @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_TICKET_ID);

        if (!EventEditParticipantsPermission.check(event, user))
            throw new PartakeException(UserErrorCode.FORBIDDEN_EVENT_ATTENDANT_EDIT);
View Full Code Here

        try {
            for (int i = 0; i < N; ++i) {
                if (!StringUtils.isBlank(ids[i]) && !Util.isUUID(ids[i]))
                    return renderInvalid(UserErrorCode.INVALID_ARGUMENT);
                UUID id = StringUtils.isBlank(ids[i]) ? null : UUID.fromString(ids[i]);
                EventTicket ticket = new EventTicket(id, eventId, i, names[i],
                        TicketApplicationStart.safeValueOf(startDateTypes[i]), Integer.parseInt(startDateDays[i]), TimeUtil.parseForEvent(customStartDates[i]),
                        TicketApplicationEnd.safeValueOf(endDateTypes[i]), Integer.parseInt(endDateDays[i]), TimeUtil.parseForEvent(customEndDates[i]),
                        TicketReservationEnd.safeValueOf(reservationEndDateTypes[i]), Integer.parseInt(reservationEndHourBeforeApplications[i]), TimeUtil.parseForEvent(customReservationEndDates[i]),
                        TicketPriceType.safeValueOf(priceTypes[i]), Integer.parseInt(prices[i]),
                        TicketAmountType.safeValueOf(amountTypes[i]), Integer.parseInt(amounts[i]),
                        TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime());

                if (!ticket.validate())
                    return renderInvalid(UserErrorCode.INVALID_ARGUMENT);

                tickets.add(ticket);
            }
        } catch (NumberFormatException e) {
View Full Code Here

        List<EventTicket> originalTickets = dao.findEventTicketsByEventId(con, eventId);
        boolean[] processed = new boolean[originalTickets.size()];

        // |tickets| should contain all the original ticket.
        for (EventTicket ticket : tickets) {
            EventTicket originalTicket = null;

            for (int i = 0; i < originalTickets.size(); ++i) {
                if (!originalTickets.get(i).getId().equals(ticket.getId()))
                    continue;
                if (processed[i])
View Full Code Here

    }

    // 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;
    }
View Full Code Here

    @Override
    protected String doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        String eventId = EventDAOFacade.create(con, daos, event);
        event.setId(eventId);

        EventTicket ticket = EventTicket.createDefaultTicket(daos.getEventTicketAccess().getFreshId(con), eventId);
        daos.getEventTicketAccess().put(con, ticket);

        return eventId;
    }
View Full Code Here

        newEvent.setId(newEventId);

        // --- copy ticket.
        List<EventTicket> tickets = daos.getEventTicketAccess().findEventTicketsByEventId(con, event.getId());
        for (EventTicket ticket : tickets) {
            EventTicket newTicket = new EventTicket(ticket);
            newTicket.setId(daos.getEventTicketAccess().getFreshId(con));
            newTicket.setEventId(newEventId);
            daos.getEventTicketAccess().put(con, newTicket);
        }

        return newEventId;
    }
View Full Code Here

TOP

Related Classes of in.partake.model.dto.EventTicket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.