Package com.saasovation.collaboration.domain.model.calendar

Examples of com.saasovation.collaboration.domain.model.calendar.CalendarEntry


                this.calendarRepository()
                    .calendarOfId(
                            tenant,
                            new CalendarId(aCalendarId));

        CalendarEntry calendarEntry =
                calendar.scheduleCalendarEntry(
                    this.calendarIdentityService(),
                    aDescription,
                    aLocation,
                    this.collaboratorService().ownerFrom(tenant, anOwnerId),
                    new TimeSpan(aTimeSpanBegins, aTimeSpanEnds),
                    new Repetition(RepeatType.valueOf(aRepeatType), aRepeatEndsOnDate),
                    new Alarm(AlarmUnitsType.valueOf(anAlarmType), anAlarmUnits),
                    this.inviteesFrom(tenant, aParticipantsToInvite));

        this.calendarEntryRepository().save(calendarEntry);

        aCalendarCommandResult.resultingCalendarId(aCalendarId);
        aCalendarCommandResult.resultingCalendarEntryId(calendarEntry.calendarEntryId().id());
    }
View Full Code Here


            String aCalendarEntryId,
            String aDescription) {

        Tenant tenant = new Tenant(aTenantId);

        CalendarEntry calendarEntry =
                this.calendarEntryRepository()
                    .calendarEntryOfId(
                            tenant,
                            new CalendarEntryId(aCalendarEntryId));

        calendarEntry.changeDescription(aDescription);

        this.calendarEntryRepository().save(calendarEntry);
    }
View Full Code Here

            String aCalendarEntryId,
            Set<String> aParticipantsToInvite) {

        Tenant tenant = new Tenant(aTenantId);

        CalendarEntry calendarEntry =
                this.calendarEntryRepository()
                    .calendarEntryOfId(
                            tenant,
                            new CalendarEntryId(aCalendarEntryId));

        for (Participant participant : this.inviteesFrom(tenant, aParticipantsToInvite)) {
            calendarEntry.invite(participant);
        }

        this.calendarEntryRepository().save(calendarEntry);
    }
View Full Code Here

            String aCalendarEntryId,
            String aLocation) {

        Tenant tenant = new Tenant(aTenantId);

        CalendarEntry calendarEntry =
                this.calendarEntryRepository()
                    .calendarEntryOfId(
                            tenant,
                            new CalendarEntryId(aCalendarEntryId));

        calendarEntry.relocate(aLocation);

        this.calendarEntryRepository().save(calendarEntry);
    }
View Full Code Here

            String anAlarmType,
            int anAlarmUnits) {

        Tenant tenant = new Tenant(aTenantId);

        CalendarEntry calendarEntry =
                this.calendarEntryRepository()
                    .calendarEntryOfId(
                            tenant,
                            new CalendarEntryId(aCalendarEntryId));

        calendarEntry.reschedule(
                aDescription,
                aLocation,
                new TimeSpan(aTimeSpanBegins, aTimeSpanEnds),
                new Repetition(RepeatType.valueOf(aRepeatType), aRepeatEndsOnDate),
                new Alarm(AlarmUnitsType.valueOf(anAlarmType), anAlarmUnits));
View Full Code Here

            String aCalendarEntryId,
            Set<String> aParticipantsToInvite) {

        Tenant tenant = new Tenant(aTenantId);

        CalendarEntry calendarEntry =
                this.calendarEntryRepository()
                    .calendarEntryOfId(
                            tenant,
                            new CalendarEntryId(aCalendarEntryId));

        for (Participant participant : this.inviteesFrom(tenant, aParticipantsToInvite)) {
            calendarEntry.uninvite(participant);
        }

        this.calendarEntryRepository().save(calendarEntry);
    }
View Full Code Here

        EventStreamId eventId = new EventStreamId(aTenant.id(), aCalendarEntryId.id());

        EventStream eventStream = this.eventStore().eventStreamSince(eventId);

        CalendarEntry calendarEntry = new CalendarEntry(eventStream.events(), eventStream.version());

        return calendarEntry;
    }
View Full Code Here

        Calendar calendar = this.calendarAggregate();

        DomainRegistry.calendarRepository().save(calendar);

        CalendarEntry calendarEntry =
            calendar.scheduleCalendarEntry(
                    DomainRegistry.calendarIdentityService(),
                    "A Doctor Checkup.",
                    "Family Practice Offices",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
View Full Code Here

        DomainRegistry.calendarRepository().save(calendar);

        Set<Participant> invitees = new TreeSet<Participant>();
        invitees.add(new Participant("zoe", "Zoe Doe", "zoe@saasovation.com"));

        CalendarEntry calendarEntry1 =
            calendar.scheduleCalendarEntry(
                    DomainRegistry.calendarIdentityService(),
                    "A Doctor Checkup",
                    "Family Practice Offices",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
                    this.daysFromNowOneHourTimeSpan(1),
                    Repetition.doesNotRepeatInstance(new Date()),
                    this.oneHourBeforeAlarm(),
                    invitees);

        CalendarEntry calendarEntry2 =
            calendar.scheduleCalendarEntry(
                    DomainRegistry.calendarIdentityService(),
                    "A Break Replacement",
                    "Breaks R Us",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
                    this.daysFromNowOneHourTimeSpan(2),
                    Repetition.doesNotRepeatInstance(new Date()),
                    this.oneHourBeforeAlarm(),
                    invitees);

        CalendarEntry calendarEntry3 =
            calendar.scheduleCalendarEntry(
                    DomainRegistry.calendarIdentityService(),
                    "Dinner with Family",
                    "Burritos Grandes",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
View Full Code Here

        }
    }

    public void testRelocateCalendarEntry() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        calendarEntryApplicationService
            .relocateCalendarEntry(
                    calendarEntry.tenant().id(),
                    calendarEntry.calendarEntryId().id(),
                    "A changed calendar entry location.");

        CalendarEntry changedCalendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendarEntry.tenant(),
                            calendarEntry.calendarEntryId());

        assertNotNull(changedCalendarEntry);
        assertEquals("A changed calendar entry location.", changedCalendarEntry.location());
    }
View Full Code Here

TOP

Related Classes of com.saasovation.collaboration.domain.model.calendar.CalendarEntry

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.