aeat.domain.fincas._repository_ports module¶
Read-side repository ports for rental-register aggregation.
These Protocol declarations are the hexagonal boundary
between the pure domain.fincas aggregation logic and the
ORM-backed concrete repositories that live in the persistence adapter
(adapters.persistence.profile.fincas). The aggregation
functions in _aggregates annotate against these ports and depend
only on the read methods they call, never on SQLAlchemy or the storage
mapper rows — keeping the domain layer free of adapter coupling.
The concrete adapter repositories satisfy these ports structurally; no explicit subclassing is required. Each port declares exactly the read method the aggregation pipeline consumes (interface segregation), so a port change is a real change to what the domain needs.
The port set is FincaReader, ArrendamientoReader,
FincaRendimientoReader, FincaGastoReader, and
FincaAmortizacionLedgerReader; each returns the corresponding
Finca, Arrendamiento, FincaRendimientoRecord,
FincaGasto, or FincaAmortizacionLedgerEntry record. The
adapter implementations are
FincaRepository,
ArrendamientoRepository,
FincaRendimientoRepository,
FincaGastoRepository, and
FincaAmortizacionLedgerRepository.
- class ArrendamientoReader(*args, **kwargs)[source]¶
Bases:
ProtocolRead port over the
Arrendamiento(rental contract) register.- list_for_finca(finca_id)[source]¶
Return every
Arrendamientoattached tofinca_id.- Return type:
- Parameters:
finca_id (int)
- class FincaRendimientoReader(*args, **kwargs)[source]¶
Bases:
ProtocolRead port over the
FincaRendimientoRecordincome register.- get_for_contract_period(contract_id, period_year)[source]¶
Return the
FincaRendimientoRecordforcontract_idinperiod_year, orNone.- Return type:
- Parameters:
- class FincaGastoReader(*args, **kwargs)[source]¶
Bases:
ProtocolRead port over the
FincaGastoexpense register.- list_for_finca_period(finca_id, period_year)[source]¶
Return every
FincaGastoforfinca_idwithinperiod_year.- Return type:
- Parameters:
- class FincaAmortizacionLedgerReader(*args, **kwargs)[source]¶
Bases:
ProtocolRead port over the
FincaAmortizacionLedgerEntryledger.- list_for_finca(finca_id)[source]¶
Return every
FincaAmortizacionLedgerEntryattached tofinca_id.- Return type:
- Parameters:
finca_id (int)