aeat.application.invoices._linking module

Application service for explicit invoice-to-transaction linking.

link_invoice_transaction_repositories() loads both the InvoiceCatalogue via InvoiceCatalogueRepository and the TransactionCatalogue via TransactionCatalogueRepository, applies the bidirectional link, and persists both updated catalogues.

class InvoiceTransactionLinkResult(**data)[source]

Bases: BaseModel

Result of a persisted bidirectional invoice link command.

Parameters:
invoice_id: str
transaction_id: str
invoice: Invoice
invoices: InvoiceCatalogue
transactions: TransactionCatalogue

Link one invoice to one transaction, returning the updated catalogues.

Returns an InvoiceTransactionLinkResult where the invoice and transaction cite each other.

Parameters:
Return type:

InvoiceTransactionLinkResult

Persist a bidirectional invoice link through the backend repositories.

Returns an InvoiceTransactionLinkResult with the updated invoice and transaction catalogues after the link is written.

Return type:

InvoiceTransactionLinkResult

Parameters: