Beispiel #1
0
        public async Task MarkOutgoingInvoiceAsOverdue(MarkOutgoingInvoiceAsOverdueModel model)
        {
            var command = new MarkOutgoingInvoiceAsOverdueCommand(
                model.UserId,
                model.InvoiceId);

            await Bus.Send(command);
        }
Beispiel #2
0
        public async Task Handle(OutgoingInvoiceOverdueTimeout message)
        {
            var invoice = Repository.GetById <OutgoingInvoice>(message.InvoiceId);

            if (!invoice.PaymentDate.HasValue)
            {
                var cmd = new MarkOutgoingInvoiceAsOverdueCommand(message.UserId, message.InvoiceId);
                await Bus.Send(cmd);
            }
        }
Beispiel #3
0
        public async Task Handle(MarkOutgoingInvoiceAsOverdueCommand message)
        {
            var invoice = Repository.GetById <OutgoingInvoice>(message.InvoiceId);

            if (!invoice.PaymentDate.HasValue)
            {
                invoice.MarkAsOverdue(message.UserId);
            }
            await Repository.SaveAsync(invoice);
        }
Beispiel #4
0
 public Task Handle(MarkOutgoingInvoiceAsOverdueCommand message)
 {
     return(Task.Factory.StartNew(() =>
     {
         var invoice = Repository.GetById <OutgoingInvoice>(message.InvoiceId);
         if (!invoice.PaymentDate.HasValue)
         {
             invoice.MarkAsOverdue();
         }
     }));
 }
Beispiel #5
0
 public Task Handle(OutgoingInvoiceExpiredTimeout message)
 {
     return(Task.Factory.StartNew(() =>
     {
         var invoice = Repository.GetById <OutgoingInvoice>(message.InvoiceId);
         if (!invoice.PaymentDate.HasValue)
         {
             var cmd = new MarkOutgoingInvoiceAsOverdueCommand(message.InvoiceId);
             Bus.Send(cmd);
         }
     }));
 }