cadrumo.domain.calculations.registry.iva_rate_kind_catalogue module

Typed projection of the governed IVA rate-kind catalogue.

class IvaRateKindDefinition(token, description, category)[source]

Bases: object

One registry-declared IVA rate tier and its category projection.

Parameters:
token: IvaRateKind
description: str
category: str
class IvaRateKindCatalogue(definitions, positive_kinds, zero_token, exempt_token, non_rate_token)[source]

Bases: object

Typed projection of the dated IVA rate-kind vocabulary.

Parameters:
definitions: tuple[IvaRateKindDefinition, ...]
positive_kinds: tuple[IvaRateKind, ...]
zero_token: IvaRateKind
exempt_token: IvaRateKind
non_rate_token: str
property all_kinds: frozenset[IvaRateKind]

Return every rate-kind token declared by the registry.

require(value)[source]

Return one token only when it belongs to this registry projection.

Return type:

IvaRateKind

Parameters:

value (object)

definition(value)[source]

Return the registry definition for one rate-kind token.

Return type:

IvaRateKindDefinition

Parameters:

value (object)

for_category(category)[source]

Return the unique rate kind projected for one IVA category token.

Return type:

IvaRateKind

Parameters:

category (str)

resolve_iva_rate_kind_catalogue(*, effective_date=None, authority=None)[source]

Resolve the complete IVA rate-kind vocabulary through fact 0094.

Return type:

IvaRateKindCatalogue

Parameters:
require_iva_rate_kind(value, *, effective_date=None, authority=None)[source]

Return one rate-kind token only when fact 0094 declares it.

Return type:

IvaRateKind

Parameters:
require_registry_declared_iva_rate_kind(value, *, effective_date)[source]

Return one rate-kind token declared by the facts a validation is validating.

A registry validator resolves its vocabulary from the candidate in scope, never from the published authority: the artifact reader validates the document it has just decoded while holding the shared-artifact lock, so a validator reaching for the bundle asks that lock for the artifact it is in the middle of producing and the process stops there. Absence of a scope is a refusal rather than a fallback, because the fallback is the deadlock.

Return type:

IvaRateKind

Parameters: