Пример #1
0
        private MeetingComment(
            MeetingId meetingId,
            MemberId authorId,
            string comment,
            MeetingCommentingConfiguration meetingCommentingConfiguration,
            MeetingCommentId inReplyToCommentId)
        {
            this.CheckRule(new CommentTextMustBeProvidedRule(comment));
            this.CheckRule(new CommentCanBeCreatedOnlyIfCommentingForMeetingEnabledRule(meetingCommentingConfiguration));

            this.Id    = new MeetingCommentId(Guid.NewGuid());
            _meetingId = meetingId;
            _authorId  = authorId;
            _comment   = comment;

            _inReplyToCommentId = inReplyToCommentId;

            _createDate = SystemClock.Now;
            _editDate   = null;

            _isRemoved       = false;
            _removedByReason = null;

            this.AddDomainEvent(new MeetingCommentCreatedDomainEvent(Id));
        }
Пример #2
0
        public void Edit(MemberId editorId, string editedComment, MeetingCommentingConfiguration meetingCommentingConfiguration)
        {
            this.CheckRule(new CommentTextMustBeProvidedRule(editedComment));
            this.CheckRule(new MeetingCommentCanBeEditedOnlyByAuthorRule(this._authorId, editorId));
            this.CheckRule(new CommentCanBeEditedOnlyIfCommentingForMeetingEnabledRule(meetingCommentingConfiguration));

            _comment  = editedComment;
            _editDate = SystemClock.Now;

            this.AddDomainEvent(new MeetingCommentEditedDomainEvent(this.Id, editedComment));
        }
Пример #3
0
 internal static MeetingComment Create(
     MeetingId meetingId,
     MemberId authorId,
     string comment,
     MeetingGroup meetingGroup,
     MeetingCommentingConfiguration meetingCommentingConfiguration)
 => new MeetingComment(
     meetingId,
     authorId,
     comment,
     inReplyToCommentId: null,
     meetingCommentingConfiguration,
     meetingGroup);
 public CommentCanBeCreatedOnlyIfCommentingForMeetingEnabledRule(MeetingCommentingConfiguration meetingCommentingConfiguration)
 {
     _meetingCommentingConfiguration = meetingCommentingConfiguration;
 }
Пример #5
0
 public MeetingCommentingConfiguration CreateCommentingConfiguration()
 {
     return(MeetingCommentingConfiguration.Create(this.Id));
 }
Пример #6
0
 public MeetingComment AddComment(MemberId authorId, string comment, MeetingGroup meetingGroup, MeetingCommentingConfiguration meetingCommentingConfiguration)
 => MeetingComment.Create(
     this.Id,
     authorId,
     comment,
     meetingGroup,
     meetingCommentingConfiguration);
Пример #7
0
 public MeetingComment Reply(MemberId replierId, string reply, MeetingGroup meetingGroup, MeetingCommentingConfiguration meetingCommentingConfiguration)
 => new MeetingComment(
     _meetingId,
     replierId,
     reply,
     this.Id,
     meetingCommentingConfiguration,
     meetingGroup);
Пример #8
0
 public async Task AddAsync(MeetingCommentingConfiguration meetingCommentingConfiguration)
 {
     await _meetingsContext.MeetingCommentingConfigurations.AddAsync(meetingCommentingConfiguration);
 }
 public MeetingTestData(MeetingGroup meetingGroup, Meeting meeting, MeetingCommentingConfiguration meetingCommentingConfiguration)
 {
     MeetingGroup = meetingGroup;
     Meeting      = meeting;
     MeetingCommentingConfiguration = meetingCommentingConfiguration;
 }
Пример #10
0
        public MeetingComment AddComment(MemberId authorId, string comment, MeetingCommentingConfiguration meetingCommentingConfiguration)
        {
            this.CheckRule(new CommentCanBeAddedOnlyByAttendeeRule(authorId, _attendees));

            return(MeetingComment.Create(this.Id, authorId, comment, meetingCommentingConfiguration));
        }