Пример #1
0
        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));
        }
        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));
        }
        internal MeetingNotAttendee(MeetingId meetingId, MemberId memberId)
        {
            this.MemberId  = memberId;
            this.MeetingId = meetingId;
            _decisionDate  = DateTime.UtcNow;

            this.AddDomainEvent(new MeetingNotAttendeeAddedDomainEvent(this.MeetingId, this.MemberId));
        }
Пример #4
0
        internal MeetingWaitlistMember(MeetingId meetingId, MemberId memberId)
        {
            this.MemberId       = memberId;
            this.MeetingId      = meetingId;
            this.SignUpDate     = SystemClock.Now;
            _isMovedToAttendees = false;

            this.AddDomainEvent(new MeetingWaitlistMemberAddedDomainEvent(this.MeetingId, this.MemberId));
        }
 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 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));
            }
        }
 internal static MeetingWaitlistMember CreateNew(MeetingId meetingId, MemberId memberId)
 {
     return(new MeetingWaitlistMember(meetingId, memberId));
 }
Пример #8
0
 internal static MeetingNotAttendee CreateNew(MeetingId meetingId, MemberId memberId)
 {
     return(new MeetingNotAttendee(meetingId, memberId));
 }