private MeetingAttendee( MeetingId meetingId, MemberId attendeeId, DateTime decisionDate, MeetingAttendeeRole role, int guestsNumber, MoneyValue eventFee) { this.AttendeeId = attendeeId; this.MeetingId = meetingId; this._decisionDate = decisionDate; this._role = role; _guestsNumber = guestsNumber; _decisionChanged = false; _isFeePaid = false; if (eventFee != MoneyValue.Undefined) { _fee = (1 + guestsNumber) * eventFee; } else { _fee = MoneyValue.Undefined; } this.AddDomainEvent(new MeetingAttendeeAddedDomainEvent( this.MeetingId, AttendeeId, decisionDate, role.Value, guestsNumber, _fee.Value, _fee.Currency)); }
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)); }
internal MeetingAttendee( MeetingId meetingId, MemberId attendeeId, DateTime decisionDate, MeetingAttendeeRole role, int guestsNumber, MoneyValue eventFee) { this.AttendeeId = attendeeId; this.MeetingId = meetingId; this._decisionDate = decisionDate; this._role = role; _guestsNumber = guestsNumber; _decisionChanged = false; MoneyValue fee; if (eventFee != MoneyValue.Zero) { fee = (1 + guestsNumber) * eventFee; } else { fee = MoneyValue.Zero; } this.AddDomainEvent(new MeetingAttendeeAddedDomainEvent(this.MeetingId, AttendeeId, decisionDate, role, guestsNumber, fee)); }
internal static MeetingAttendee CreateNew( MeetingId meetingId, MemberId attendeeId, DateTime decisionDate, MeetingAttendeeRole role, int guestsNumber, MoneyValue eventFee) { return(new MeetingAttendee(meetingId, attendeeId, decisionDate, role, guestsNumber, eventFee)); }
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)); }
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)); } }