public void GenerateInvoice_NullInput_ReturnsNotFoundResult()
        {
            _mockPvmService.GenerateInvoice(null).Returns((InvoiceDto)null);

            var actual = this._target.GenerateInvoice(null);

            actual.Result.ShouldBeOfType <NotFoundResult>();
        }
        public async Task <IActionResult> GenerateInvoice([FromQuery] InvoiceBuilderParams properties)
        {
            try
            {
                InvoiceDto invoice = await _pvmService.GenerateInvoice(properties);

                if (invoice == null)
                {
                    return(NotFound());
                }
                return(Ok(invoice));
            }
            catch (Exception)
            {
                _logger.LogError("Error in PvmController GenerateInvoice().");
                throw;
            }
        }