aeat.application.aggregation._models module¶
Strict boundary models for financial transaction aggregation.
Carries the per-casilla CasillaProvenance trace and the aggregated
CasillaAggregation ledger shape. The aggregation package re-exports
the canonical core.Period; period construction and date-span
authority live in core, not in an application-layer wrapper.
- class CasillaProvenance(**data)[source]¶
Bases:
BaseModelTransaction trace backing one (casilla, category) subtotal.
- Variables:
casilla_id – Target canonical casilla id (e.g.
"02").transaction_ids – Sorted, frozen tuple of contributing transaction IDs.
subtotal – Sum of contributions for this casilla/category pair.
category_id – Optional category identifier when the contribution came from an expense bucket.
- Parameters:
casilla_id (CasillaId)
subtotal (Decimal)
category_id (Annotated[SpendingCategory, BeforeValidator(func=~aeat.application.aggregation._models._coerce_spending_category, json_schema_input_type=PydanticUndefined)] | None)
- casilla_id: CasillaId¶
- transaction_ids: Sequence[str]¶
- subtotal: Decimal¶
- category_id: _SpendingCategoryField | None¶
- class CasillaAggregation(**data)[source]¶
Bases:
BaseModelAggregated casilla ledger for one modelo and period.
- Variables:
modelo – Modelo identifier (
ModeloCode.value) the totals belong to.period – The
Periodcovered.casilla_values – Mapping of canonical casilla id to summed
Decimalvalue, sorted and frozen.provenance – Tuple of
CasillaProvenancerows tracing each contribution back to its source transactions.
- Parameters:
- modelo: str¶
- period: Period¶
- casilla_values: Mapping[CasillaId, Decimal]¶
- provenance: Sequence[CasillaProvenance]¶