Exemplo n.º 1
0
        public async Task <Unit> Handle(UpdateInvoiceCommand request, CancellationToken cancellationToken)
        {
            await _invoiceDomainEntity.GetAsync(request.Id, cancellationToken);

            _invoiceDomainEntity.MapFrom(request, _mapper);

            await _invoiceDomainEntity.UpdateAsync(cancellationToken);

            return(Unit.Value);
        }
Exemplo n.º 2
0
        public async Task <Unit> Handle(MarkInvoiceAsPaidCommand request, CancellationToken cancellationToken)
        {
            await _invoiceDomainEntity.GetAsync(request.Id, cancellationToken);

            _invoiceDomainEntity.SetStatus(InvoiceStatus.Paid);

            await _invoiceDomainEntity.UpdateAsync(cancellationToken);

            return(Unit.Value);
        }