Package in.partake.model.dto.auxiliary

Examples of in.partake.model.dto.auxiliary.ModificationStatus


        List<String> userTicketIds = new ArrayList<String>();
        for (int i = 0; i < ids.size(); ++i) {
            UUID ticketId = ids.get(i).getFirst();
            String eventId = ids.get(i).getSecond();
            ParticipationStatus status = ParticipationStatus.ENROLLED;
            ModificationStatus modificationStatus = ModificationStatus.CHANGED;
            AttendanceStatus attendanceStatus = AttendanceStatus.UNKNOWN;
            DateTime enrolledAt = new DateTime(TimeUtil.getCurrentTime() + (ids.size() - i) * 1000);
            UserTicket enrollment = new UserTicket(null, userId, ticketId, eventId, "comment", status, modificationStatus, attendanceStatus, null, enrolledAt, enrolledAt, enrolledAt);
            userTicketIds.add(storeEnrollment(enrollment));
        }
View Full Code Here


        List<String> userTicketIds = new ArrayList<String>();
        for (int i = 0; i < ids.size(); ++i) {
            UUID ticketId = ids.get(i).getFirst();
            String eventId = ids.get(i).getSecond();
            ParticipationStatus status = ParticipationStatus.ENROLLED;
            ModificationStatus modificationStatus = ModificationStatus.CHANGED;
            AttendanceStatus attendanceStatus = AttendanceStatus.UNKNOWN;
            DateTime enrolleAt = new DateTime(TimeUtil.getCurrentTime() + (ids.size() - i) * 1000);
            UserTicket enrollment = new UserTicket(null, userId, ticketId, eventId, "comment", status, modificationStatus, attendanceStatus, null, enrolleAt, enrolleAt, enrolleAt);
            userTicketIds.add(storeEnrollment(enrollment));
        }
View Full Code Here

                {
                    con.beginTransaction();
                    List<UserTicket> storedList = dao.findByTicketId(con, ticketId, 0, Integer.MAX_VALUE);
                    UserTicket storedParticipation = storedList.get(0);
                    Assert.assertNotNull(storedParticipation);
                    ModificationStatus newStatus = ModificationStatus.NOT_ENROLLED;
                    Assert.assertFalse(newStatus.equals(storedParticipation.getModificationStatus()));
                    UserTicket newStoredParticipation = new UserTicket(storedParticipation);
                    newStoredParticipation.setModificationStatus(ModificationStatus.CHANGED);
                    dao.put(con, newStoredParticipation);
                    con.commit();
                }
View Full Code Here

        // TODO: ここのソース汚い。同一化できる。とくに、あとの2つは一緒。
        List<String> userIdsToBeEnrolled = new ArrayList<String>();
        for (UserTicket p : list.getEnrolledParticipations()) {
            // -- 参加者向

            ModificationStatus status = p.getModificationStatus();
            if (status == null) { continue; }

            switch (status) {
            case CHANGED: { // 自分自身の力で変化させていた場合は status を enrolled にのみ変更して対応
                updateLastStatus(con, daos, eventId, p, ModificationStatus.ENROLLED);
                break;
            }
            case NOT_ENROLLED: {
                userIdsToBeEnrolled.add(p.getUserId());
                updateLastStatus(con, daos, eventId, p, ModificationStatus.ENROLLED);
                break;
            }
            case ENROLLED:
                break;
            }
        }
        if (!userIdsToBeEnrolled.isEmpty()) {
            String eventNotificationId = daos.getEventNotificationAccess().getFreshId(con);
            EventTicketNotification notification = new EventTicketNotification(eventNotificationId, ticket.getId(), ticket.getEventId(), userIdsToBeEnrolled, NotificationType.BECAME_TO_BE_ENROLLED, TimeUtil.getCurrentDateTime());
            daos.getEventNotificationAccess().put(con, notification);

            for (String userId : userIdsToBeEnrolled) {
                String userNotificationid = daos.getUserNotificationAccess().getFreshId(con);
                UserNotification userNotification = new UserNotification(userNotificationid, ticket.getId(), userId, NotificationType.BECAME_TO_BE_ENROLLED, MessageDelivery.INQUEUE, TimeUtil.getCurrentDateTime(), null);
                daos.getUserNotificationAccess().put(con, userNotification);

                String envelopeId = daos.getMessageEnvelopeAccess().getFreshId(con);
                MessageEnvelope envelope = MessageEnvelope.createForUserNotification(envelopeId, userNotificationid, null);
                daos.getMessageEnvelopeAccess().put(con, envelope);
            }
        }

        List<String> userIdsToBeCancelled = new ArrayList<String>();
        for (UserTicket p : list.getSpareParticipations()) {
            ModificationStatus status = p.getModificationStatus();
            if (status == null) { continue; }

            switch (status) {
            case CHANGED: // 自分自身の力で変化させていた場合は status を not_enrolled にのみ変更して対応
                updateLastStatus(con, daos, eventId, p, ModificationStatus.NOT_ENROLLED);
                break;
            case NOT_ENROLLED:
                break;
            case ENROLLED:
                updateLastStatus(con, daos, eventId, p, ModificationStatus.NOT_ENROLLED);
                userIdsToBeCancelled.add(p.getUserId());
                break;
            }
        }

        for (UserTicket p : list.getCancelledParticipations()) {
            ModificationStatus status = p.getModificationStatus();
            if (status == null) { continue; }

            switch (status) {
            case CHANGED: // 自分自身の力で変化させていた場合は status を not_enrolled にのみ変更して対応
                updateLastStatus(con, daos, eventId, p, ModificationStatus.NOT_ENROLLED);
View Full Code Here

TOP

Related Classes of in.partake.model.dto.auxiliary.ModificationStatus

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.