private void CancelDocument(TransactionDocument document, CancelTransaction request) { var person = document.Person; var cancelDocument = document.Void(_numberSequenceService); cancelDocument.Description = request.Description; person.Accept(cancelDocument); _transactionRepository.Add(cancelDocument); }
public void Cancel(CancelTransaction request) { var document = GetById(request.Id); if (IsLastTransaction(document) && !document.IsReferencingDocument) { DeleteDocument(document); } else { CancelDocument(document, request); } }