Ejemplo n.º 1
0
        public async Task <PayRunDetailsViewResponse> ExecuteAsync(Guid payrunId, PayRunDetailsQueryParameters parameters)
        {
            // Get pay run
            var payRun = await _payRunGateway
                         .GetPayRunAsync(payrunId)
                         .EnsureExistsAsync($"Pay Run {payrunId} not found");

            // Get pay run items
            var payRunInvoices =
                await _payRunInvoiceGateway.GetPayRunInvoicesSummaryAsync(payrunId, parameters);

            var result = PayrunExtensions.CreateDetailsViewResponse(payRun, payRunInvoices, payRunInvoices.PagingMetaData);

            return(result);
        }