Class InvoiceProcessingService
- 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
IInvoiceOrchestrationServicemerchantOrchestrationService
IMerchantOrchestrationServiceloggerFactory
ILoggerFactory
Fields
invoiceOrchestrationService
private readonly IInvoiceOrchestrationService invoiceOrchestrationService
Field Value
logger
private readonly ILogger<IInvoiceProcessingService> logger
Field Value
merchantOrchestrationService
private readonly IMerchantOrchestrationService merchantOrchestrationService
Field Value
Methods
AddProduct(Guid, Product)
Adds a product to an invoice.
public Task<Invoice> AddProduct(Guid invoiceIdentifier, Product product)
Parameters
Returns
AddProduct(Invoice, Product)
Adds a product to an invoice.
public Task<Invoice> AddProduct(Invoice invoice, Product product)
Parameters
Returns
AnalyzeInvoice(Guid, Guid, AnalysisOptions)
Analyze an invoice.
public Task AnalyzeInvoice(Guid identifier, Guid userIdentifier, AnalysisOptions options)
Parameters
identifier
GuiduserIdentifier
Guidoptions
AnalysisOptions
Returns
AnalyzeInvoice(Guid, AnalysisOptions)
Analyze an invoice.
public Task AnalyzeInvoice(Guid identifier, AnalysisOptions options)
Parameters
identifier
Guidoptions
AnalysisOptions
Returns
AnalyzeInvoice(Invoice, AnalysisOptions)
Analyze an invoice.
public Task AnalyzeInvoice(Invoice invoice, AnalysisOptions options)
Parameters
invoice
Invoiceoptions
AnalysisOptions
Returns
CreateAndLogDependencyException(Exception)
private InvoiceProcessingServiceDependencyException CreateAndLogDependencyException(Exception exception)
Parameters
exception
Exception
Returns
CreateAndLogDependencyValidationException(Exception)
private InvoiceProcessingServiceDependencyValidationException CreateAndLogDependencyValidationException(Exception exception)
Parameters
exception
Exception
Returns
CreateAndLogServiceException(Exception)
private InvoiceProcessingServiceException CreateAndLogServiceException(Exception exception)
Parameters
exception
Exception
Returns
CreateAndLogValidationException(Exception)
private InvoiceProcessingServiceValidationException CreateAndLogValidationException(Exception exception)
Parameters
exception
Exception
Returns
CreateInvoice(Invoice)
Creates an invoice object.
public Task<Invoice> CreateInvoice(Invoice invoice)
Parameters
invoice
Invoice
Returns
CreateMerchant(Merchant)
Creates a merchant object.
public Task<Merchant> CreateMerchant(Merchant merchant)
Parameters
merchant
Merchant
Returns
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
DeleteInvoice(Guid, Guid)
Deletes an invoice object, given its identifier and the user identifier.
public Task DeleteInvoice(Guid identifier, Guid userIdentifier)
Parameters
Returns
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
DeleteMerchant(Guid, Guid)
Deletes a merchant object.
public Task DeleteMerchant(Guid identifier, Guid parentCompanyId)
Parameters
Returns
DeleteProduct(Guid, string)
Deletes a product.
public Task<Invoice> DeleteProduct(Guid invoiceIdentifier, string productName)
Parameters
Returns
DeleteProduct(Guid, Product)
Deletes a product.
public Task<Invoice> DeleteProduct(Guid invoiceIdentifier, Product product)
Parameters
Returns
DeleteProduct(Invoice, string)
Deletes a product.
public Task<Invoice> DeleteProduct(Invoice invoice, string productName)
Parameters
Returns
DeleteProduct(Invoice, Product)
Deletes a product.
public Task<Invoice> DeleteProduct(Invoice invoice, Product product)
Parameters
Returns
GetProduct(Guid, string)
Gets the products from an invoice.
public Task<Product> GetProduct(Guid invoiceIdentifier, string productName)
Parameters
Returns
GetProduct(Invoice, string)
Gets a product from an invoice.
public Task<Product> GetProduct(Invoice invoice, string productName)
Parameters
Returns
GetProducts(Guid)
Gets the products from an invoice.
public Task<IEnumerable<Product>> GetProducts(Guid invoiceIdentifier)
Parameters
invoiceIdentifier
Guid
Returns
GetProducts(Guid, Guid)
Gets the products from an invoice.
public Task<IEnumerable<Product>> GetProducts(Guid invoiceIdentifier, Guid userIdentifier)
Parameters
Returns
GetProducts(Invoice)
Gets the products from an invoice.
public Task<IEnumerable<Product>> GetProducts(Invoice invoice)
Parameters
invoice
Invoice
Returns
ReadInvoice(Guid)
Reads an invoice object, given only its identifier.
public Task<Invoice> ReadInvoice(Guid identifier)
Parameters
identifier
Guid
Returns
ReadInvoice(Guid, Guid)
Reads an invoice object, given its identifier and the user identifier.
public Task<Invoice> ReadInvoice(Guid identifier, Guid userIdentifier)
Parameters
Returns
ReadInvoices()
Reads all invoice objects, regardless of the user identifier. This method should be called by superusers only.
public Task<IEnumerable<Invoice>> ReadInvoices()
Returns
ReadInvoices(Guid)
Reads all invoice objects, given the user identifier (partition key).
public Task<IEnumerable<Invoice>> ReadInvoices(Guid userIdentifier)
Parameters
userIdentifier
Guid
Returns
ReadMerchant(Guid)
Reads a merchant object, given only its identifier.
public Task<Merchant> ReadMerchant(Guid identifier)
Parameters
identifier
Guid
Returns
ReadMerchant(Guid, Guid)
Reads a merchant object, given its identifier and the parent company identifier.
public Task<Merchant> ReadMerchant(Guid identifier, Guid parentCompanyId)
Parameters
Returns
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
ReadMerchants(Guid)
Reads all merchant objects.
public Task<IEnumerable<Merchant>> ReadMerchants(Guid parentCompanyId)
Parameters
parentCompanyId
Guid
Returns
TryCatchAsync(CallbackFunctionForTasksWithInvoiceListReturn)
private Task<IEnumerable<Invoice>> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithInvoiceListReturn callbackFunction)
Parameters
callbackFunction
InvoiceProcessingService.CallbackFunctionForTasksWithInvoiceListReturn
Returns
TryCatchAsync(CallbackFunctionForTasksWithInvoiceReturn)
private Task<Invoice> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithInvoiceReturn callbackFunction)
Parameters
callbackFunction
InvoiceProcessingService.CallbackFunctionForTasksWithInvoiceReturn
Returns
TryCatchAsync(CallbackFunctionForTasksWithMerchantListReturn)
private Task<IEnumerable<Merchant>> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithMerchantListReturn callbackFunction)
Parameters
callbackFunction
InvoiceProcessingService.CallbackFunctionForTasksWithMerchantListReturn
Returns
TryCatchAsync(CallbackFunctionForTasksWithMerchantReturn)
private Task<Merchant> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithMerchantReturn callbackFunction)
Parameters
callbackFunction
InvoiceProcessingService.CallbackFunctionForTasksWithMerchantReturn
Returns
TryCatchAsync(CallbackFunctionForTasksWithNoReturn)
private Task TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithNoReturn callbackFunction)
Parameters
callbackFunction
InvoiceProcessingService.CallbackFunctionForTasksWithNoReturn
Returns
TryCatchAsync(CallbackFunctionForTasksWithProductListReturn)
private Task<IEnumerable<Product>> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithProductListReturn callbackFunction)
Parameters
callbackFunction
InvoiceProcessingService.CallbackFunctionForTasksWithProductListReturn
Returns
TryCatchAsync(CallbackFunctionForTasksWithProductReturn)
private Task<Product> TryCatchAsync(InvoiceProcessingService.CallbackFunctionForTasksWithProductReturn callbackFunction)
Parameters
callbackFunction
InvoiceProcessingService.CallbackFunctionForTasksWithProductReturn
Returns
UpdateInvoice(Guid, Invoice)
Updates an invoice object, given only its identifier.
public Task<Invoice> UpdateInvoice(Guid invoiceIdentifier, Invoice updatedInvoice)
Parameters
Returns
UpdateInvoice(Invoice, Invoice)
public Task<Invoice> UpdateInvoice(Invoice currentInvoice, Invoice updatedInvoice)
Parameters
Returns
UpdateMerchant(Guid, Merchant)
Updates a merchant object.
public Task<Merchant> UpdateMerchant(Guid identifier, Merchant updatedMerchant)
Parameters
Returns
UpdateMerchant(Merchant, Merchant)
public Task<Merchant> UpdateMerchant(Merchant currentMerchant, Merchant updatedMerchant)