aeat.domain.fincas package

Public facade for the LIRPF fincas register.

Per-Finca and per-Arrendamiento register backing factual LIRPF rental aggregates (arts. 22-24 and 85), the LIRPF art. 23.2 four-tier auto-resolver introduced by Ley 12/2023, and the LIRPF art. 23.1.f FincaAmortizacionLedgerEntry multi-year ledger with a per-finca cost-basis cap. The fincas stem is intentional: this package models the registral / cadastral unit, while filing targets remain registry-owned.

The main public calculations are compute_finca_aggregates(), compute_amortization_for_year(), compute_gastos_for_year(), and resolve_reduccion(). They return typed audit records such as FincaAggregates, FincaAttribution, ContractTierAttribution, AmortizationComputation, GastosForYear, and TierResolution; no function here encodes a Modelo 100 casilla id or filing-line authority.

Callers outside domain.fincas import only from this module. Internal modules (_models, _enums, _errors, _repository_ports, _tier_resolver, _amortization_ledger, _expense_rollup, and _aggregates) are implementation details.

The concrete ORM-backed repositories that satisfy the reader ports declared here live in the persistence adapter (adapters.persistence.profile.fincas), not in this domain package — keeping the SQLAlchemy / mapper-row coupling out of the domain layer.

Art. 85 imputation rates and the catastral-revision window enter through the registry legal-parameter catalogue before the aggregate functions run. The aggregate records are factual source material for registry-backed Modelo 100 bindings; domain.calculations.registry.RegistrySnapshot and domain.calculations.registry.CasillaObservation remain the filing line and provenance authorities.

See also

adapters.persistence.profile.fincas

Concrete SQLAlchemy repositories implementing the reader ports exported by this domain facade.

domain.calculations.registry

Registry authority that turns finca-derived factual inputs into typed modelo casilla observations.

domain.manuals

Bundled manual corpus that grounds the same LIRPF rental concepts without storing operator finca records.

Submodules