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: object

One registry-declared IVA settlement-side token and its semantics.

Parameters:
token: IvaSettlementSide
description: str
legal_refs: tuple[str, ...]
class IvaFlowDirectionDefinition(token, description, legal_refs, settlement_sides)[source]

Bases: object

One registry-declared IVA flow token and its settlement projection.

Parameters:
token: IvaFlowDirection
description: str
legal_refs: tuple[str, ...]
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: object

Complete dated projection of fact 0083’s flow vocabulary.

Parameters:
declarations: Mapping[str, str]
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
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:

IvaFlowDirection

Parameters:

value (object)

settlement_side(value)[source]

Project one settlement-side token only when fact 0083 declares it.

Return type:

IvaSettlementSide

Parameters:

value (object)

definition(value)[source]

Return the full registry definition for a flow token.

Return type:

IvaFlowDirectionDefinition

Parameters:

value (object)

settlement_sides_for(value)[source]

Return the registry-declared settlement sides for one flow.

Return type:

frozenset[IvaSettlementSide]

Parameters:

value (object)

is_devengada(value)[source]

Return whether a flow contributes to the devengada side.

Return type:

bool

Parameters:

value (object)

is_deducible(value)[source]

Return whether a flow contributes to the deducible side.

Return type:

bool

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:

IvaFlowDirectionCatalogue

Parameters:
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:

IvaFlowDirection

Parameters:
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:

IvaFlowDirection

Parameters:

value (object)