예제 #1
0
        internal void Reject(UserId userId, string rejectReason)
        {
            _decision = MeetingGroupProposalDecision.RejectDecision(DateTime.UtcNow, userId, rejectReason);

            _status = _decision.GetStatusForDecision();

            this.AddDomainEvent(new MeetingGroupProposalRejectedDomainEvent(this.Id));
        }
예제 #2
0
        public void Accept(UserId userId)
        {
            this.CheckRule(new MeetingGroupProposalCanBeVerifiedOnceRule(_decision));

            _decision = MeetingGroupProposalDecision.AcceptDecision(DateTime.UtcNow, userId);

            _status = _decision.GetStatusForDecision();

            this.AddDomainEvent(new MeetingGroupProposalAcceptedDomainEvent(this.Id));
        }
        public void Reject(UserId userId, string rejectReason)
        {
            this.CheckRule(new MeetingGroupProposalCanBeVerifiedOnceRule(_decision));
            this.CheckRule(new MeetingGroupProposalRejectionMustHaveAReasonRule(rejectReason));

            _decision = MeetingGroupProposalDecision.RejectDecision(DateTime.UtcNow, userId, rejectReason);

            _status = _decision.GetStatusForDecision();

            this.AddDomainEvent(new MeetingGroupProposalRejectedDomainEvent(this.Id));
        }
        internal MeetingGroupProposalStatus GetStatusForDecision()
        {
            if (this.IsAccepted)
            {
                return MeetingGroupProposalStatus.Create("Verified");
            }

            if (this.IsRejected)
            {
                return MeetingGroupProposalStatus.Create("Rejected");
            }

            return MeetingGroupProposalStatus.ToVerify;
        }
예제 #5
0
        private MeetingGroupProposal(
            MeetingGroupProposalId id,
            string name,
            string description,
            MeetingGroupLocation location,
            UserId proposalUserId,
            DateTime proposalDate)
        {
            Id              = id;
            _name           = name;
            _description    = description;
            _location       = location;
            _proposalUserId = proposalUserId;
            _proposalDate   = proposalDate;

            _status   = MeetingGroupProposalStatus.ToVerify;
            _decision = MeetingGroupProposalDecision.NoDecision;

            this.AddDomainEvent(new MeetingGroupProposalVerificationRequestedDomainEvent(this.Id));
        }