コード例 #1
0
        public void ChangeMainAttributes(
            string title,
            MeetingTerm term,
            string description,
            MeetingLocation location,
            MeetingLimits meetingLimits,
            Term rsvpTerm,
            MoneyValue eventFee,
            MemberId modifyUserId)
        {
            base.CheckRule(new AttendeesLimitCannotBeChangedToSmallerThanActiveAttendeesRule(
                               meetingLimits,
                               this.GetAllActiveAttendeesWithGuestsNumber()));

            _title         = title;
            _term          = term;
            _description   = description;
            _location      = location;
            _meetingLimits = meetingLimits;
            this.SetRsvpTerm(rsvpTerm, _term);
            _eventFee = eventFee;

            _changeDate     = SystemClock.Now;
            _changeMemberId = modifyUserId;

            this.AddDomainEvent(new MeetingMainAttributesChangedDomainEvent(this.Id));
        }
コード例 #2
0
 private void SetRsvpTerm(Term rsvpTerm, MeetingTerm meetingTerm)
 {
     if (!rsvpTerm.EndDate.HasValue || rsvpTerm.EndDate > meetingTerm.StartDate)
     {
         _rsvpTerm = Term.CreateNewBetweenDates(rsvpTerm.StartDate, meetingTerm.StartDate);
     }
     else
     {
         _rsvpTerm = rsvpTerm;
     }
 }
コード例 #3
0
 private void SetRsvpTerm(Term rsvpTerm, MeetingTerm meetingTerm)
 {
     if (!rsvpTerm.EndDate.HasValue || rsvpTerm.EndDate > meetingTerm.StartDate)
     {
         _rsvpTerm = new Term(rsvpTerm.StartDate, meetingTerm.StartDate);
     }
     else
     {
         _rsvpTerm = rsvpTerm;
     }
 }
コード例 #4
0
 internal static Meeting CreateNew(MeetingGroupId meetingGroupId,
                                   string title,
                                   MeetingTerm term,
                                   string description,
                                   MeetingLocation location,
                                   MeetingLimits meetingLimits,
                                   Term rsvpTerm,
                                   MoneyValue eventFee,
                                   List <MemberId> hostsMembersIds,
                                   MemberId creatorId)
 {
     return(new Meeting(meetingGroupId, title, term, description,
                        location, meetingLimits, rsvpTerm, eventFee, hostsMembersIds, creatorId));
 }
コード例 #5
0
        internal Meeting(
            MeetingGroupId meetingGroupId,
            string title,
            MeetingTerm term,
            string description,
            MeetingLocation location,
            int?attendeesLimit,
            int guestsLimit,
            Term rsvpTerm,
            MoneyValue eventFee,
            List <MemberId> hostsMembersIds,
            MemberId creatorId)
        {
            Id = new MeetingId(Guid.NewGuid());
            _meetingGroupId = meetingGroupId;
            _title          = title;
            _term           = term;
            _description    = description;
            _location       = location;
            _attendeesLimit = attendeesLimit;
            _guestsLimit    = guestsLimit;

            this.SetRsvpTerm(rsvpTerm, _term);
            _eventFee   = eventFee;
            _creatorId  = creatorId;
            _createDate = SystemClock.Now;

            _attendees       = new List <MeetingAttendee>();
            _notAttendees    = new List <MeetingNotAttendee>();
            _waitlistMembers = new List <MeetingWaitlistMember>();

            this.AddDomainEvent(new MeetingCreatedDomainEvent(this.Id));
            var rsvpDate = SystemClock.Now;

            if (hostsMembersIds.Any())
            {
                foreach (var hostMemberId in hostsMembersIds)
                {
                    _attendees.Add(new MeetingAttendee(this.Id, hostMemberId, rsvpDate, MeetingAttendeeRole.Host, 0, MoneyValue.Zero));
                }
            }
            else
            {
                _attendees.Add(new MeetingAttendee(this.Id, creatorId, rsvpDate, MeetingAttendeeRole.Host, 0, MoneyValue.Zero));
            }
        }