Beispiel #1
0
        public async Task Handle(MarkOutgoingInvoiceAsPaidCommand message)
        {
            var invoice = Repository.GetById <OutgoingInvoice>(message.InvoiceId);

            invoice.MarkAsPaid(message.PaymentDate, message.UserId);
            await Repository.SaveAsync(invoice);

            this.MarkAsComplete();
        }
Beispiel #2
0
        public async Task MarkOutgoingInvoiceAsPaid(MarkOutgoingInvoiceAsPaidModel model)
        {
            var command = new MarkOutgoingInvoiceAsPaidCommand(
                model.UserId,
                model.InvoiceId,
                model.PaymentDate);

            await Bus.Send(command);
        }
Beispiel #3
0
 public Task Handle(MarkOutgoingInvoiceAsPaidCommand message)
 {
     return(Task.Factory.StartNew(() =>
     {
         var invoice = Repository.GetById <OutgoingInvoice>(message.InvoiceId);
         invoice.MarkAsPaid(message.PaymentDate);
         Repository.Save(invoice);
         this.MarkAsComplete();
     }));
 }