Table of Contents

Class InvoiceAnalysisFoundationService

Namespace
arolariu.Backend.Domain.Invoices.Services.Foundation.InvoiceAnalysis
Assembly
arolariu.Backend.Domain.Invoices.dll

The invoice analysis foundation service interface represents the foundation analysis service for the invoice domain.

public class InvoiceAnalysisFoundationService : IInvoiceAnalysisFoundationService
Inheritance
InvoiceAnalysisFoundationService
Implements
Inherited Members

Constructors

InvoiceAnalysisFoundationService(IOpenAiBroker, ITranslatorBroker, IFormRecognizerBroker, ILoggerFactory)

DI Constructor.

public InvoiceAnalysisFoundationService(IOpenAiBroker analysisBroker, ITranslatorBroker translatorBroker, IFormRecognizerBroker receiptRecognizerBroker, ILoggerFactory loggerFactory)

Parameters

analysisBroker IOpenAiBroker
translatorBroker ITranslatorBroker
receiptRecognizerBroker IFormRecognizerBroker
loggerFactory ILoggerFactory

Fields

analysisBroker

private readonly IOpenAiBroker analysisBroker

Field Value

IOpenAiBroker

logger

private readonly ILogger<IInvoiceAnalysisFoundationService> logger

Field Value

ILogger<IInvoiceAnalysisFoundationService>

receiptRecognizerBroker

private readonly IFormRecognizerBroker receiptRecognizerBroker

Field Value

IFormRecognizerBroker

translatorBroker

private readonly ITranslatorBroker translatorBroker

Field Value

ITranslatorBroker

Methods

AnalyzeInvoiceAsync(Invoice, AnalysisOptions)

Analyze an invoice.

public Task<Invoice> AnalyzeInvoiceAsync(Invoice invoice, AnalysisOptions options)

Parameters

invoice Invoice
options AnalysisOptions

Returns

Task<Invoice>

CreateAndLogDependencyException(Exception)

private InvoiceFoundationDependencyException CreateAndLogDependencyException(Exception exception)

Parameters

exception Exception

Returns

InvoiceFoundationDependencyException

CreateAndLogDependencyValidationException(Exception)

private InvoiceFoundationDependencyValidationException CreateAndLogDependencyValidationException(Exception exception)

Parameters

exception Exception

Returns

InvoiceFoundationDependencyValidationException

CreateAndLogServiceException(Exception)

private InvoiceFoundationServiceException CreateAndLogServiceException(Exception exception)

Parameters

exception Exception

Returns

InvoiceFoundationServiceException

CreateAndLogValidationException(Exception)

private InvoiceFoundationValidationException CreateAndLogValidationException(Exception exception)

Parameters

exception Exception

Returns

InvoiceFoundationValidationException

PerformGptAnalysis(Invoice, AnalysisOptions)

private Task<Invoice> PerformGptAnalysis(Invoice invoice, AnalysisOptions options)

Parameters

invoice Invoice
options AnalysisOptions

Returns

Task<Invoice>

PerformOcrAnalysis(Invoice, AnalysisOptions)

private Task<Invoice> PerformOcrAnalysis(Invoice invoice, AnalysisOptions options)

Parameters

invoice Invoice
options AnalysisOptions

Returns

Task<Invoice>

PerformTranslationAnalysis(Invoice)

private Task<Invoice> PerformTranslationAnalysis(Invoice invoice)

Parameters

invoice Invoice

Returns

Task<Invoice>

TryCatchAsync(ReturningAnalysisFunction)

private Task<Invoice> TryCatchAsync(InvoiceAnalysisFoundationService.ReturningAnalysisFunction returningAnalysisFunction)

Parameters

returningAnalysisFunction InvoiceAnalysisFoundationService.ReturningAnalysisFunction

Returns

Task<Invoice>