cadrumo.application.aggregation.irnr_income_ledger module¶
Repository-backed IRNR income ledger mechanics.
The module retains transaction filtering, classification folding, period partitioning, and typed issue/provenance mechanics. Target coordinates, income-type namespaces, model applicability, source-scope membership, and binding/legal declarations belong to the selected registry revision and are read at the registry seam below.
No target, parameter prefix, applicability set, or binding identifier is declared as a Python fallback.
- class IrnrIncomeLedgerAggregationIssueReason(*values)[source]¶
Bases:
StrEnumMachine-readable reasons why a row did not reach the M210 gross-income fact.
- OUTSIDE_PERIOD¶
- UNSUPPORTED_PERIOD¶
- FOREIGN_SOURCE_OUT_OF_SCOPE¶
- SOURCE_JURISDICTION_UNRESOLVED¶
- INCOMPLETE_M210_CLASSIFICATION¶
- class IrnrIncomeLedgerAggregationIssue(**data)[source]¶
Bases:
BaseModelTraceable exclusion emitted while resolving the M210 ledger projection.
- Parameters:
data (Any)
- model_config: ClassVar[ConfigDict]¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- transaction_id: TransactionId¶
- reason: IrnrIncomeLedgerAggregationIssueReason¶
- detail: IssueDetail¶
- rejected_source_jurisdiction: str | None¶
- class IrnrIncomeObservation(**data)[source]¶
Bases:
BaseModelOne selected, ES-source, explicitly M210-classified income observation.
- Parameters:
data (Any)
- model_config: ClassVar[ConfigDict]¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- transaction_id: TransactionId¶
- target_casilla_id: CasillaId¶
- official_tipo_renta_code: str¶
- gross_income_amount: Decimal¶
- applicable_rate: UnitProportion¶
- payer_mode: M210PayerMode¶
- payer_id: str | None¶
- asset_or_right_id: str | None¶
- filing_date: date¶
- source_jurisdiction: CountryCodeAlpha2¶
- class IrnrIncomeLedgerAggregation(**data)[source]¶
Bases:
LedgerAggregationResultBase[IrnrIncomeObservation, IrnrIncomeLedgerAggregationIssue]Selected-code M210 observations for one filing period.
- Parameters:
- selected_official_tipo_renta_code: str¶
- out_of_window_summary: OutOfWindowTransactionSummary | None¶
- model_config: ClassVar[ConfigDict]¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- aggregate_irnr_income_ledger_from_repositories(*, bucket_id, period, revision, modelo, target_casilla_id, selected_official_tipo_renta_code, transaction_repository, operation=None)[source]¶
Load an injected secure transaction catalogue and aggregate one selected M210 code.
revisionis theModeloRevisionthat declares the binding.transaction_repositoryis the composition-root-ownedTransactionCatalogueRepositoryProtocolforbucket_id.The repository date partition limits decryption/classification to the filing span and returns a compact, provenance-free summary for the other dates. Full-catalogue callers retain the per-row
OUTSIDE_PERIODissues instead.- Return type:
- Parameters:
bucket_id (str)
period (Period)
revision (ModeloRevision)
modelo (str)
target_casilla_id (CasillaId)
selected_official_tipo_renta_code (str)
transaction_repository (TransactionCatalogueRepositoryProtocol)
operation (PinnedAuthorityOperation | None)
- aggregate_irnr_income_ledger(transactions, *, bucket_id, period, revision, modelo, target_casilla_id, selected_official_tipo_renta_code, operation=None)[source]¶
Aggregate selected-code, incoming, registry-admitted IRNR income.
transactionsis theTransactionCatalogueto aggregate.revisionis theModeloRevisionthat declares the binding.modeloandtarget_casilla_idare selected-revision coordinates; neither has a Python fallback.The classification’s
gross_income_amountis the declared M210 fact; it is intentionally not derived from the signed raw ledger amount. This preserves explicit operator evidence for deductions, partial rights, and the official code while leaving registry formula evaluation as the one arithmetic path after the gross-income binding has been resolved.- Return type:
- Parameters:
transactions (TransactionCatalogue)
bucket_id (str)
period (Period)
revision (ModeloRevision)
modelo (str)
target_casilla_id (CasillaId)
selected_official_tipo_renta_code (str)
operation (PinnedAuthorityOperation | None)