public Validation <Error, Document> Reject(RejectReason reason) { if (Status != DocumentStatus.WaitingForApproval) { return(new InvalidStatusError(DocumentStatus.WaitingForApproval, Status)); } return(new RejectedDocument(Id, UserId, Number, Description, Files, reason)); }
public RejectedDocument(DocumentId id, UserId userId, DocumentNumber number, Option <DocumentDescription> description, IEnumerable <File> files, RejectReason reason) : base(id, userId, number, description, DocumentStatus.Rejected, files) { Reason = reason; }