aeat.application.invoices._queries module¶
Application query projections for invoice CLI surfaces.
Query functions accept an InvoiceCatalogue or load one from the
InvoiceCatalogueRepository; verify_invoice_repository_links()
additionally loads the TransactionCatalogueRepository to detect
one-sided links.
- class InvoiceListRow(**data)[source]¶
Bases:
BaseModelRendered invoice summary owned by the application layer.
- Parameters:
- invoice_id: str¶
- kind: InvoiceKind¶
- issued_at: date¶
- counterparty_name: str¶
- grand_total: Decimal¶
- currency: str¶
- payment_status: str¶
- list_invoice_rows(catalogue, *, kind=None)[source]¶
Return sorted
InvoiceListRowsummary rows from anInvoiceCatalogue.- Return type:
- Parameters:
catalogue (InvoiceCatalogue)
kind (InvoiceKind | None)
- list_invoice_repository_rows(*, kind=None)[source]¶
Load the invoice catalogue and return sorted
InvoiceListRowsummaries.- Return type:
- Parameters:
kind (InvoiceKind | None)
- get_invoice_from_repository(invoice_id)[source]¶
Load and return one invoice from the secure catalogue.
Returns an
Invoicewhen found, orNonewhen the id is not present in the catalogue.
- list_unmatched_invoice_rows(catalogue, *, kind=None)[source]¶
Return sorted
InvoiceListRowsummaries for invoices that are not linked to transactions.- Parameters:
catalogue (
InvoiceCatalogue) – TheInvoiceCatalogueto query for unlinked invoices.kind (
InvoiceKind|None) – When set, restricts results to invoices of that kind.
- Return type:
- list_unmatched_invoice_repository_rows(*, kind=None)[source]¶
Load the invoice catalogue and return unmatched summary rows.
Each element is an
InvoiceListRowsorted by issue date and invoice id.- Return type:
- Parameters:
kind (InvoiceKind | None)
- verify_invoice_repository_links(*, bucket_id)[source]¶
Load both catalogues and return one-sided invoice/transaction links as a tuple of
LinkInconsistency.- Return type:
- Parameters:
bucket_id (str)