aeat.application.ledger._actions_import module

Ledger source import services for bucket-scoped transaction catalogues.

Provider rows arrive as ParsedLedgerRow objects. This module classifies them against a loaded TransactionCatalogue, persists imported Transaction instances, records LEDGER_TRANSACTION_IMPORTED bucket events, and returns LedgerImportOperationResult or LedgerSourceImportResult.

class LedgerProviderID(*values)[source]

Bases: StrEnum

Canonical provider ID strings accepted by the ledger import dispatch.

AUTO
CSV
OFX
QFX
XLSX
EXCEL
N26
PDF
PDF_N26
import_ledger_transactions(*, bucket_id, parsed_rows, transaction_repository=None, bucket_event_repository=None, actor='operator', source_command='aeat app ledger import', occurred_at=None, currency_normalizer=None)[source]

Import provider rows into one bucket catalogue and emit events.

Each ParsedLedgerRow carries the magnitude RawTransaction plus the authoritative direction the provider derived at the parse boundary, so the import path never re-derives flow from a sign.

Returns a LedgerImportOperationResult summarising the imported, skipped, and likely-duplicate transactions.

Return type:

LedgerImportOperationResult

Parameters:
import_ledger_source(command, *, transaction_repository=None, bucket_event_repository=None, currency_normalizer=None)[source]

Validate, ingest, and optionally persist one ledger source file.

Returns a LedgerSourceImportResult.

Return type:

LedgerSourceImportResult

Parameters: