cadrumo.domain.iva.recargo_equivalencia module¶
Resolve recargo de equivalencia pairings from governed registry data.
The canonical iva-recargo-by-applied-rate mapping fact owns the legal
pairing, date window, classification, and provenance. This module retains
only typed projection, date selection, and fail-closed lookup mechanics.
- class RecargoRateRecord(**data)[source]¶
Bases:
BaseModelOne governed recargo pairing projected into the public record.
The applied rate is the selector because one classification can have more than one dated pairing. The authority supplies the legal references and date window; this record carries them without defining their values.
- Variables:
iva_rate – The IVA rate this recargo accompanies, as a fraction.
recargo_rate – The recargo rate itself, as a fraction. Zero is a legitimate value and means a rate of zero, not an absent one.
effective_from – First date the pairing applies.
effective_until – Last date it applies, or
Nonefor open-ended.legal_refs – Registry legal-reference identities establishing the value.
notes – Authoring note; carries no runtime meaning.
- Parameters:
data (Any)
- iva_rate: UnitProportion¶
- recargo_rate: Decimal¶
- effective_from: date¶
- effective_until: date | None¶
- legal_refs: tuple[str, ...]¶
- notes: str¶
- load_recargo_rate_table(*, operation)[source]¶
Return published recargo pairings from the authority artifact.
Runtime callers must provide the operation that owns the published authority generation; an unsigned authoring tree is never a fallback.
- Return type:
- Parameters:
operation (PinnedAuthorityOperation)
- recargo_rate_for_applied_rate(applied_rate, on_date, *, operation)[source]¶
Return the recargo rate paired with
applied_rateonon_date.Date-scoped lookup is keyed by the applied rate rather than a broader category, so overlapping dated pairings remain distinguishable without reproducing the authority’s classifications here.
- Parameters:
applied_rate (
Decimal) – The IVA rate the line actually carried, as a fraction.on_date (
date) – The operation date, which selects among windowed pairings.operation (
PinnedAuthorityOperation) – The pinned authority operation supplying dated recargo pairings.
- Return type:
- Returns:
The paired recargo rate, which may legitimately be zero.
Nonewhen the table models no pairing for that rate on that date – an unmodelled combination, which callers must not read as “no recargo applies”.
- resolve_recargo_rate_for_applied_rate(applied_rate, on_date, *, operation)[source]¶
Resolve the dated recargo pairing with its complete governed-fact provenance.
- Return type:
- Parameters:
applied_rate (Decimal)
on_date (date)
operation (PinnedAuthorityOperation)
- recargo_rate_record_from_fact(resolved)[source]¶
Project a provenance-bearing authority result onto the retained public record.
- Return type:
- Parameters:
resolved (ResolvedMappingFact)