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)); }
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)); }
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; }
public MeetingCommentingConfiguration CreateCommentingConfiguration() { return(MeetingCommentingConfiguration.Create(this.Id)); }
public MeetingComment AddComment(MemberId authorId, string comment, MeetingGroup meetingGroup, MeetingCommentingConfiguration meetingCommentingConfiguration) => MeetingComment.Create( this.Id, authorId, comment, meetingGroup, meetingCommentingConfiguration);
public MeetingComment Reply(MemberId replierId, string reply, MeetingGroup meetingGroup, MeetingCommentingConfiguration meetingCommentingConfiguration) => new MeetingComment( _meetingId, replierId, reply, this.Id, meetingCommentingConfiguration, meetingGroup);
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; }
public MeetingComment AddComment(MemberId authorId, string comment, MeetingCommentingConfiguration meetingCommentingConfiguration) { this.CheckRule(new CommentCanBeAddedOnlyByAttendeeRule(authorId, _attendees)); return(MeetingComment.Create(this.Id, authorId, comment, meetingCommentingConfiguration)); }