cadrumo.domain.calculations.registry.iva_flow_catalogue module¶
Typed projection of the governed IVA flow-direction vocabulary.
Flow direction and settlement-side membership are legal facts. This module is the only production boundary that turns the free-form values in fact 0083 into the opaque domain tokens used by IVA consumers. Keeping the projection here also makes an incomplete or stale fact fail closed instead of silently falling back to a Python catalogue.
- class IvaSettlementSideDefinition(token, description, legal_refs)[source]¶
Bases:
objectOne registry-declared IVA settlement-side token and its semantics.
- Parameters:
token (IvaSettlementSide)
description (str)
-
token:
IvaSettlementSide¶
- class IvaFlowDirectionDefinition(token, description, legal_refs, settlement_sides)[source]¶
Bases:
objectOne registry-declared IVA flow token and its settlement projection.
- Parameters:
token (IvaFlowDirection)
description (str)
settlement_sides (frozenset[IvaSettlementSide])
-
token:
IvaFlowDirection¶
-
settlement_sides:
frozenset[IvaSettlementSide]¶
- class IvaFlowDirectionCatalogue(declarations, definitions, settlement_definitions, no_settlement_token, issued_token, received_token, recipient_reverse_charge_token, supplier_reverse_charge_token, devengada_token, deducible_token)[source]¶
Bases:
objectComplete dated projection of fact 0083’s flow vocabulary.
- Parameters:
definitions (tuple[IvaFlowDirectionDefinition, ...])
settlement_definitions (tuple[IvaSettlementSideDefinition, ...])
no_settlement_token (str)
issued_token (IvaFlowDirection)
received_token (IvaFlowDirection)
recipient_reverse_charge_token (IvaFlowDirection)
supplier_reverse_charge_token (IvaFlowDirection)
devengada_token (IvaSettlementSide)
deducible_token (IvaSettlementSide)
-
definitions:
tuple[IvaFlowDirectionDefinition,...]¶
-
settlement_definitions:
tuple[IvaSettlementSideDefinition,...]¶
-
issued_token:
IvaFlowDirection¶
-
received_token:
IvaFlowDirection¶
-
recipient_reverse_charge_token:
IvaFlowDirection¶
-
supplier_reverse_charge_token:
IvaFlowDirection¶
-
devengada_token:
IvaSettlementSide¶
-
deducible_token:
IvaSettlementSide¶
- property choices: tuple[IvaFlowDirection, ...]¶
Return flow tokens in the order authored by the facts registry.
- property settlement_choices: tuple[IvaSettlementSide, ...]¶
Return settlement-side tokens in the authored registry order.
- require(value)[source]¶
Project one flow token only when the selected fact declares it.
- Return type:
- Parameters:
value (object)
- settlement_side(value)[source]¶
Project one settlement-side token only when fact 0083 declares it.
- Return type:
- Parameters:
value (object)
- definition(value)[source]¶
Return the full registry definition for a flow token.
- Return type:
- Parameters:
value (object)
- settlement_sides_for(value)[source]¶
Return the registry-declared settlement sides for one flow.
- Return type:
- Parameters:
value (object)
- resolve_iva_flow_direction_catalogue(*, effective_date=None, authority=None)[source]¶
Resolve the dated IVA flow and settlement vocabulary from fact 0083.
Core types:
ValidatedRegistryAuthority.- Return type:
- Parameters:
effective_date (date | None)
authority (ValidatedRegistryAuthority | None)
- require_iva_flow_direction(value, *, effective_date=None, authority=None)[source]¶
Return a flow token only when the selected registry declares it.
Core types:
ValidatedRegistryAuthority.- Return type:
- Parameters:
value (object)
effective_date (date | None)
authority (ValidatedRegistryAuthority | None)
- require_registry_declared_iva_flow_direction(value)[source]¶
Return one flow token declared by the facts a validation is validating.
Like the rate-kind check, a registry validator resolves this vocabulary from the candidate in scope and refuses when none is: reading the published bundle while that bundle is being decoded is the deadlock this avoids.
- Return type:
- Parameters:
value (object)