Table of Contents

Class InvoiceProcessingService

Namespace
arolariu.Backend.Domain.Invoices.Services.Processing
Assembly
arolariu.Backend.Domain.Invoices.dll

This class represents the invoice processing service.

public class InvoiceProcessingService : IInvoiceProcessingService
Inheritance
InvoiceProcessingService
Implements
Inherited Members

Constructors

InvoiceProcessingService(IInvoiceOrchestrationService, IMerchantOrchestrationService, ILoggerFactory)

Public constructor.

public InvoiceProcessingService(IInvoiceOrchestrationService invoiceOrchestrationService, IMerchantOrchestrationService merchantOrchestrationService, ILoggerFactory loggerFactory)

Parameters

invoiceOrchestrationService IInvoiceOrchestrationService
merchantOrchestrationService IMerchantOrchestrationService
loggerFactory ILoggerFactory

Fields

invoiceOrchestrationService

private readonly IInvoiceOrchestrationService invoiceOrchestrationService

Field Value

IInvoiceOrchestrationService

logger

private readonly ILogger<IInvoiceProcessingService> logger

Field Value

ILogger<IInvoiceProcessingService>

merchantOrchestrationService

private readonly IMerchantOrchestrationService merchantOrchestrationService

Field Value

IMerchantOrchestrationService

Methods

AddProduct(Guid, Product)

Adds a product to an invoice.

public Task<Invoice> AddProduct(Guid invoiceIdentifier, Product product)

Parameters

invoiceIdentifier Guid
product Product

Returns

Task<Invoice>

AddProduct(Invoice, Product)

Adds a product to an invoice.

public Task<Invoice> AddProduct(Invoice invoice, Product product)

Parameters

invoice Invoice
product Product

Returns

Task<Invoice>

AnalyzeInvoice(Guid, Guid, AnalysisOptions)

Analyze an invoice.

public Task AnalyzeInvoice(Guid identifier, Guid userIdentifier, AnalysisOptions options)

Parameters

identifier Guid
userIdentifier Guid
options AnalysisOptions

Returns

Task

AnalyzeInvoice(Guid, AnalysisOptions)

Analyze an invoice.

public Task AnalyzeInvoice(Guid identifier, AnalysisOptions options)

Parameters

identifier Guid
options AnalysisOptions

Returns

Task

AnalyzeInvoice(Invoice, AnalysisOptions)

Analyze an invoice.

public Task AnalyzeInvoice(Invoice invoice, AnalysisOptions options)

Parameters

invoice Invoice
options AnalysisOptions

Returns

Task

CreateAndLogDependencyException(Exception)

private InvoiceProcessingServiceDependencyException CreateAndLogDependencyException(Exception exception)

Parameters

exception Exception

Returns

InvoiceProcessingServiceDependencyException

CreateAndLogDependencyValidationException(Exception)

private InvoiceProcessingServiceDependencyValidationException CreateAndLogDependencyValidationException(Exception exception)

Parameters

exception Exception

Returns

InvoiceProcessingServiceDependencyValidationException

CreateAndLogServiceException(Exception)

private InvoiceProcessingServiceException CreateAndLogServiceException(Exception exception)

Parameters

exception Exception

Returns

InvoiceProcessingServiceException

CreateAndLogValidationException(Exception)

private InvoiceProcessingServiceValidationException CreateAndLogValidationException(Exception exception)

Parameters

exception Exception

Returns

InvoiceProcessingServiceValidationException

CreateInvoice(Invoice)

Creates an invoice object.

public Task<Invoice> CreateInvoice(Invoice invoice)

Parameters

invoice Invoice

Returns

Task<Invoice>

CreateMerchant(Merchant)

Creates a merchant object.

public Task<Merchant> CreateMerchant(Merchant merchant)

Parameters

merchant Merchant

Returns

Task<Merchant>

DeleteInvoice(Guid)

Deletes an invoice object, given only its identifier. This method should be called by superusers only.

public Task DeleteInvoice(Guid identifier)

Parameters

identifier Guid

Returns

Task

DeleteInvoice(Guid, Guid)

Deletes an invoice object, given its identifier and the user identifier.

public Task DeleteInvoice(Guid identifier, Guid userIdentifier)

Parameters

identifier Guid
userIdentifier Guid

Returns

Task

DeleteMerchant(Guid)

Deletes a merchant object, given only its identifier. This method should be called by superusers only.

public Task DeleteMerchant(Guid identifier)

Parameters

identifier Guid

Returns

Task

DeleteMerchant(Guid, Guid)

Deletes a merchant object.

public Task DeleteMerchant(Guid identifier, Guid parentCompanyId)

Parameters

identifier Guid
parentCompanyId Guid

Returns

Task

DeleteProduct(Guid, string)

Deletes a product.

public Task<Invoice> DeleteProduct(Guid invoiceIdentifier, string productName)

Parameters

invoiceIdentifier Guid
productName string

Returns

Task<Invoice>

DeleteProduct(Guid, Product)

Deletes a product.

public Task<Invoice> DeleteProduct(Guid invoiceIdentifier, Product product)

Parameters

invoiceIdentifier Guid
product Product

Returns

Task<Invoice>

DeleteProduct(Invoice, string)

Deletes a product.

public Task<Invoice> DeleteProduct(Invoice invoice, string productName)

Parameters

invoice Invoice
productName string

Returns

Task<Invoice>

DeleteProduct(Invoice, Product)

Deletes a product.

public Task<Invoice> DeleteProduct(Invoice invoice, Product product)

Parameters

invoice Invoice
product Product

Returns

Task<Invoice>

GetProduct(Guid, string)

Gets the products from an invoice.

public Task<Product> GetProduct(Guid invoiceIdentifier, string productName)

Parameters

invoiceIdentifier Guid
productName string

Returns

Task<Product>

GetProduct(Invoice, string)

Gets a product from an invoice.

public Task<Product> GetProduct(Invoice invoice, string productName)

Parameters

invoice Invoice
productName string

Returns

Task<Product>

GetProducts(Guid)

Gets the products from an invoice.

public Task<IEnumerable<Product>> GetProducts(Guid invoiceIdentifier)

Parameters

invoiceIdentifier Guid

Returns

Task<IEnumerable<Product>>

GetProducts(Guid, Guid)

Gets the products from an invoice.

public Task<IEnumerable<Product>> GetProducts(Guid invoiceIdentifier, Guid userIdentifier)

Parameters

invoiceIdentifier Guid
userIdentifier Guid

Returns

Task<IEnumerable<Product>>

GetProducts(Invoice)

Gets the products from an invoice.

public Task<IEnumerable<Product>> GetProducts(Invoice invoice)

Parameters

invoice Invoice

Returns

Task<IEnumerable<Product>>

ReadInvoice(Guid)

Reads an invoice object, given only its identifier.

public Task<Invoice> ReadInvoice(Guid identifier)

Parameters

identifier Guid

Returns

Task<Invoice>

ReadInvoice(Guid, Guid)

Reads an invoice object, given its identifier and the user identifier.

public Task<Invoice> ReadInvoice(Guid identifier, Guid userIdentifier)

Parameters

identifier Guid
userIdentifier Guid

Returns

Task<Invoice>

ReadInvoices()

Reads all invoice objects, regardless of the user identifier. This method should be called by superusers only.

public Task<IEnumerable<Invoice>> ReadInvoices()

Returns

Task<IEnumerable<Invoice>>

ReadInvoices(Guid)

Reads all invoice objects, given the user identifier (partition key).

public Task<IEnumerable<Invoice>> ReadInvoices(Guid userIdentifier)

Parameters

userIdentifier Guid

Returns

Task<IEnumerable<Invoice>>

ReadMerchant(Guid)

Reads a merchant object, given only its identifier.

public Task<Merchant> ReadMerchant(Guid identifier)

Parameters

identifier Guid

Returns

Task<Merchant>

ReadMerchant(Guid, Guid)

Reads a merchant object, given its identifier and the parent company identifier.

public Task<Merchant> ReadMerchant(Guid identifier, Guid parentCompanyId)

Parameters

identifier Guid
parentCompanyId Guid

Returns

Task<Merchant>

ReadMerchants()

Reads all merchant objects, regardless of the parent company identifier. This method should be called by superusers only.

public Task<IEnumerable<Merchant>> ReadMerchants()

Returns

Task<IEnumerable<Merchant>>

ReadMerchants(Guid)

Reads all merchant objects.

public Task<IEnumerable<Merchant>> ReadMerchants(Guid parentCompanyId)

Parameters

parentCompanyId Guid

Returns

Task<IEnumerable<Merchant>>

TryCatchAsync(CallbackFunctionForTasksWithInvoiceListReturn)

private Task<IEnumerable<Invoice>> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithInvoiceListReturn callbackFunction)

Parameters

callbackFunction InvoiceProcessingService.CallbackFunctionForTasksWithInvoiceListReturn

Returns

Task<IEnumerable<Invoice>>

TryCatchAsync(CallbackFunctionForTasksWithInvoiceReturn)

private Task<Invoice> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithInvoiceReturn callbackFunction)

Parameters

callbackFunction InvoiceProcessingService.CallbackFunctionForTasksWithInvoiceReturn

Returns

Task<Invoice>

TryCatchAsync(CallbackFunctionForTasksWithMerchantListReturn)

private Task<IEnumerable<Merchant>> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithMerchantListReturn callbackFunction)

Parameters

callbackFunction InvoiceProcessingService.CallbackFunctionForTasksWithMerchantListReturn

Returns

Task<IEnumerable<Merchant>>

TryCatchAsync(CallbackFunctionForTasksWithMerchantReturn)

private Task<Merchant> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithMerchantReturn callbackFunction)

Parameters

callbackFunction InvoiceProcessingService.CallbackFunctionForTasksWithMerchantReturn

Returns

Task<Merchant>

TryCatchAsync(CallbackFunctionForTasksWithNoReturn)

private Task TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithNoReturn callbackFunction)

Parameters

callbackFunction InvoiceProcessingService.CallbackFunctionForTasksWithNoReturn

Returns

Task

TryCatchAsync(CallbackFunctionForTasksWithProductListReturn)

private Task<IEnumerable<Product>> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithProductListReturn callbackFunction)

Parameters

callbackFunction InvoiceProcessingService.CallbackFunctionForTasksWithProductListReturn

Returns

Task<IEnumerable<Product>>

TryCatchAsync(CallbackFunctionForTasksWithProductReturn)

private Task<Product> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithProductReturn callbackFunction)

Parameters

callbackFunction InvoiceProcessingService.CallbackFunctionForTasksWithProductReturn

Returns

Task<Product>

UpdateInvoice(Guid, Invoice)

Updates an invoice object, given only its identifier.

public Task<Invoice> UpdateInvoice(Guid invoiceIdentifier, Invoice updatedInvoice)

Parameters

invoiceIdentifier Guid
updatedInvoice Invoice

Returns

Task<Invoice>

UpdateInvoice(Invoice, Invoice)

public Task<Invoice> UpdateInvoice(Invoice currentInvoice, Invoice updatedInvoice)

Parameters

currentInvoice Invoice
updatedInvoice Invoice

Returns

Task<Invoice>

UpdateMerchant(Guid, Merchant)

Updates a merchant object.

public Task<Merchant> UpdateMerchant(Guid identifier, Merchant updatedMerchant)

Parameters

identifier Guid
updatedMerchant Merchant

Returns

Task<Merchant>

UpdateMerchant(Merchant, Merchant)

public Task<Merchant> UpdateMerchant(Merchant currentMerchant, Merchant updatedMerchant)

Parameters

currentMerchant Merchant
updatedMerchant Merchant

Returns

Task<Merchant>