aeat.domain.categories package

Public facade for AEAT spending-category taxonomy and profiles.

This package owns the closed autónomo expense vocabulary, SpendingCategory, its grouping surface SpendingCategoryFamily, and the CATEGORY_FAMILY_MEMBERS membership table. Category identifiers are the stable values used by ledger rows, invoice rows, usage-ratio overrides, Renta deductibility, and LLM classification hints; renaming an enum member is a breaking storage and calculation change.

Year-specific profile data is loaded from committed TOML under registry/aeat/categories/profiles through load_category_profile_registry(), resolve_category_profiles(), and load_category_profiles_from_manual(). Runtime Python owns validation and resolution behaviour, not legal profile values.

Each CategoryProfile binds a category to ProportionalityRule, ProportionalityKind, StatutoryCapPeriod, StatutoryCapVariant, IvaDeductibilityHint, and at least one CategoryCitation / CategoryCitationSource, preserving the explainability chain back to BOE, AEAT help, or Manual práctico evidence. effective_usage_ratio() applies only the factual proportionality multiplier; modelo applicability, casilla routing, and filing-grade legal treatment remain in domain.calculations.registry and the application source mesh.

See also

domain.usage_ratios

Stores operator overrides keyed by concrete SpendingCategory values whose proportionality kind permits a user ratio.

domain.renta

Evaluates category profiles and citations into Renta deductible-expense observations.

application.ledger

Validates ledger category_id / usage_ratio_id facts before the application source mesh feeds modelo calculation.

domain.invoices

Carries the same stable category identifiers on invoice and purchase evidence records used by aggregation.

domain.calculations.registry

Owns modelo applicability, binding declarations, formulas, and casilla routing outside this taxonomy surface.

Submodules