aeat.application.ledger._protocols module¶
Application-layer port protocols for the ledger service.
Defines structural typing.Protocol interfaces consumed by
aeat.application.ledger._actions_import so that the application layer
depends only on these protocol types, not on concrete adapter classes.
- class FinancialProviderProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol satisfied by any file-backed raw transaction provider.
Covers exactly the two methods called by the ledger import service:
ingest()andvalidate_source(). Adapter-internal helpers (_build_provenance,_read_source_bytes, etc.) remain private to the adapter implementation.- ingest(path)[source]¶
Yield parsed ledger rows from
path.Each yielded item is a
ParsedLedgerRow(a magnitudeRawTransactionplus itsTransactionDirection) parsed from the provider-format file atpath.- Return type:
- Parameters:
path (Path)
- validate_source(path)[source]¶
Validate
pathand return aProviderValidationresult.- Return type:
- Parameters:
path (Path)