Package in.partake.model.dto

Examples of in.partake.model.dto.EventTicket


                return EventDAOFacade.create(con, daos, event);
            }
        }.execute();

        UUID ticketId = UUID.randomUUID();
        EventTicket ticket = EventTicket.createDefaultTicket(ticketId, eventId);
        storeEventTicket(ticket);

        PartakeApp.getEventSearchService().create(event, Collections.singletonList(ticket));
        return event;
    }
View Full Code Here


                return EventDAOFacade.create(con, daos, event);
            }
        }.execute();

        UUID ticketId = UUID.randomUUID();
        EventTicket ticket = EventTicket.createDefaultTicket(ticketId, eventId);
        storeEventTicket(ticket);

        PartakeApp.getEventSearchService().create(event, Collections.singletonList(ticket));
        return event;
    }
View Full Code Here

                    now, now, -1);

            String eventId = storeEvent(event);

            UUID uuid = UUID.randomUUID();
            EventTicket ticket = EventTicket.createDefaultTicket(uuid, eventId);
            storeEventTicket(ticket);

            ids.add(new Pair<UUID, String>(uuid, eventId));
        }
View Full Code Here

public class EventTicketTestDataProvider extends TestDataProvider<EventTicket> {

    @Override
    public EventTicket create(long pkNumber, String pkSalt, int objNumber) {
        UUID uuid = new UUID(pkNumber, ("eventticket" + pkSalt).hashCode());
        return new EventTicket(uuid, DEFAULT_EVENT_ID, 0, "name" + objNumber,
                TicketApplicationStart.ANYTIME, 0, null,
                TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null,
                TicketReservationEnd.TILL_NHOUR_BEFORE, 3, null,
                TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null);
    }
View Full Code Here

    @Override
    public List<EventTicket> createSamples() {
        List<EventTicket> list = new ArrayList<EventTicket>();

        list.add(new EventTicket(new UUID(0, 0), "eventId", 0"name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 1), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId1", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 1, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name1", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name1", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name1", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.FROM_CUSTOM_DAY, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 1, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, new DateTime(0L), TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_AFTER_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 1, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, new DateTime(0L), TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.NONFREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 1, TicketAmountType.UNLIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.LIMITED, 0, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 1, new DateTime(0), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(1), null));
        list.add(new EventTicket(new UUID(0, 0), "eventId", 0, "name", TicketApplicationStart.ANYTIME, 0, null, TicketApplicationEnd.TILL_TIME_BEFORE_EVENT, 0, null, TicketReservationEnd.TILL_NHOUR_BEFORE, 0, null, TicketPriceType.FREE, 0, TicketAmountType.UNLIMITED, 0, new DateTime(0), new DateTime(0L)));

        return list;
    }
View Full Code Here

                    now, now, -1);

            String eventId = storeEvent(event);

            UUID uuid = UUID.randomUUID();
            EventTicket ticket = EventTicket.createDefaultTicket(uuid, eventId);
            storeEventTicket(ticket);

            ids.add(new Pair<UUID, String>(uuid, eventId));
        }
View Full Code Here

        event.setOwnerId(EVENT_OWNER_ID);
        event.setBeginDate(now.nHourAfter(48));
        storeEvent(event);

        UUID ticketId = UUID.randomUUID();
        EventTicket ticket = EventTicket.createDefaultTicket(ticketId, event.getId());
        storeEventTicket(ticket);

        String[] enrollmentIds = new String[] { UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), };

        UserTicket[] enrollments = new UserTicket[] {
                new UserTicket(enrollmentIds[0], DEFAULT_USER_IDS[0], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.NOT_ENROLLED, AttendanceStatus.PRESENT, null, now, now, null),
                new UserTicket(enrollmentIds[1], DEFAULT_USER_IDS[1], ticketId, event.getId(), "comment", ParticipationStatus.RESERVED,
                        ModificationStatus.NOT_ENROLLED, AttendanceStatus.PRESENT, null, now, now, null),
                new UserTicket(enrollmentIds[2], DEFAULT_USER_IDS[2], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, now, now, null)
        };

        for (UserTicket enrollment : enrollments)
            storeEnrollment(enrollment);
        new SendParticipationStatusChangeNotificationsTask().run();

        // The status should be changed to ENROLLED
        UserTicket[] changed = new UserTicket[] {
                loadEnrollment(enrollmentIds[0]), loadEnrollment(enrollmentIds[1]), loadEnrollment(enrollmentIds[2]),
        };
        assertThat(changed[0].getModificationStatus(), is(ModificationStatus.ENROLLED));
        assertThat(changed[1].getModificationStatus(), is(ModificationStatus.ENROLLED));
        assertThat(changed[2].getModificationStatus(), is(ModificationStatus.ENROLLED));

        // The user should received notification.
        {
            List<UserNotification> notifications = loadUserNotificationsByUserId(DEFAULT_USER_IDS[0]);
            assertThat(notifications.size(), is(1));
            assertThat(notifications.get(0).getTicketId(), is(ticket.getId()));
            assertThat(notifications.get(0).getNotificationType(), is(NotificationType.BECAME_TO_BE_ENROLLED));
            assertThat(notifications.get(0).getDelivery(), is(MessageDelivery.INQUEUE));
        }
        {
            List<UserNotification> notifications = loadUserNotificationsByUserId(DEFAULT_USER_IDS[1]);
            assertThat(notifications.size(), is(1));
            assertThat(notifications.get(0).getTicketId(), is(ticket.getId()));
            assertThat(notifications.get(0).getNotificationType(), is(NotificationType.BECAME_TO_BE_ENROLLED));
            assertThat(notifications.get(0).getDelivery(), is(MessageDelivery.INQUEUE));
        }
        {
            List<UserNotification> notifications = loadUserNotificationsByUserId(DEFAULT_USER_IDS[2]);
View Full Code Here

        event.setOwnerId(EVENT_OWNER_ID);
        event.setBeginDate(now.nHourAfter(48));
        storeEvent(event);

        UUID ticketId = UUID.randomUUID();
        EventTicket ticket = EventTicket.createDefaultTicket(ticketId, event.getId());
        ticket.setAmount(1);
        ticket.setAmountType(TicketAmountType.LIMITED);
        storeEventTicket(ticket);

        String[] enrollmentIds = new String[] {
                UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(),
        };

        UserTicket[] enrollments = new UserTicket[] {
                new UserTicket(enrollmentIds[0], DEFAULT_USER_IDS[0], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, now, now, null),
                new UserTicket(enrollmentIds[1], DEFAULT_USER_IDS[1], ticketId, event.getId(), "comment", ParticipationStatus.RESERVED,
                        ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(now.getTime() + 1), now, null),
                new UserTicket(enrollmentIds[2], DEFAULT_USER_IDS[2], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(now.getTime() + 2), now, null),
                new UserTicket(enrollmentIds[3], DEFAULT_USER_IDS[3], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, new DateTime(now.getTime() + 3), now, null)
        };

        for (UserTicket enrollment : enrollments)
            storeEnrollment(enrollment);
        new SendParticipationStatusChangeNotificationsTask().run();

        // The status should be changed to NOT_ENROLLED.
        // Only the first person can enroll.
        UserTicket[] changed = new UserTicket[] {
                loadEnrollment(enrollmentIds[0]), loadEnrollment(enrollmentIds[1]), loadEnrollment(enrollmentIds[2]), loadEnrollment(enrollmentIds[3]),
        };
        assertThat(changed[0].getModificationStatus(), is(ModificationStatus.ENROLLED));
        assertThat(changed[1].getModificationStatus(), is(ModificationStatus.NOT_ENROLLED));
        assertThat(changed[2].getModificationStatus(), is(ModificationStatus.NOT_ENROLLED));
        assertThat(changed[3].getModificationStatus(), is(ModificationStatus.NOT_ENROLLED));

        // The user should received notification.
        {
            List<UserNotification> notifications = loadUserNotificationsByUserId(DEFAULT_USER_IDS[0]);
            assertThat(notifications.size(), is(0));
        }
        {
            List<UserNotification> notifications = loadUserNotificationsByUserId(DEFAULT_USER_IDS[1]);
            assertThat(notifications.size(), is(1));
            assertThat(notifications.get(0).getTicketId(), is(ticket.getId()));
            assertThat(notifications.get(0).getNotificationType(), is(NotificationType.BECAME_TO_BE_CANCELLED));
            assertThat(notifications.get(0).getDelivery(), is(MessageDelivery.INQUEUE));
        }
        {
            List<UserNotification> notifications = loadUserNotificationsByUserId(DEFAULT_USER_IDS[2]);
            assertThat(notifications.size(), is(1));
            assertThat(notifications.get(0).getTicketId(), is(ticket.getId()));
            assertThat(notifications.get(0).getNotificationType(), is(NotificationType.BECAME_TO_BE_CANCELLED));
            assertThat(notifications.get(0).getDelivery(), is(MessageDelivery.INQUEUE));
        }
        {
            List<UserNotification> notifications = loadUserNotificationsByUserId(DEFAULT_USER_IDS[3]);
View Full Code Here

        event.setOwnerId(DEFAULT_USER_ID);
        event.setBeginDate(now.nHourAfter(12));
        storeEvent(event);

        UUID ticketId = UUID.randomUUID();
        EventTicket ticket = EventTicket.createDefaultTicket(ticketId, event.getId());
        storeEventTicket(ticket);

        String id = UUID.randomUUID().toString();
        UserTicket enrollment = new UserTicket(id, DEFAULT_USER_ID, ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, now, now, now);
        storeEnrollment(enrollment);

        // This event should be reminded.
        new EventReminderTask().run();

        // Check EventNotification and UserNotification.
        List<UserNotification> userNotifications = loadUserNotificationsByUserId(DEFAULT_USER_ID);
        assertThat(userNotifications.size(), is(1));
        UserNotification userNotification = userNotifications.get(0);
        assertThat(userNotification.getTicketId(), is(ticket.getId()));
        assertThat(userNotification.getDelivery(), is(MessageDelivery.INQUEUE));
        assertThat(userNotification.getNotificationType(), is(NotificationType.EVENT_ONEDAY_BEFORE_REMINDER));

        List<EventTicketNotification> eventNotifications = loadEventTicketNotificationsByEventId(ticketId);
        assertThat(eventNotifications.size(), is(3));
View Full Code Here

    @Test
    public void testToBuildUserNotificationMessageBodyForOnedayBeforeReminder() 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.EVENT_ONEDAY_BEFORE_REMINDER);

        String messageBody = SendMessageEnvelopeTask.buildUserNotificationMessageBody(userNotification, event, ticket);
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.