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

            await _invoiceDomainEntity.DeleteAsync(cancellationToken);

            return(Unit.Value);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }