cadrumo.domain.calculations.registry.iva_category_catalogue module

Typed projection of the governed IVA-category catalogue.

class IvaCategoryDefinition(token, description)[source]

Bases: object

One registry-declared IVA category token and its metadata.

Parameters:
token: IvaCategory
description: str
class IvaCategoryCatalogue(definitions, projections, reasons, hints, operation_types, operation_type_categories, untdid_categories)[source]

Bases: object

Typed projection of the dated IVA category vocabulary.

Parameters:
definitions: tuple[IvaCategoryDefinition, ...]
projections: Mapping[str, frozenset[IvaCategory]]
reasons: Mapping[str, str]
hints: Mapping[str, str]
operation_types: Mapping[str, str]
operation_type_categories: Mapping[str, str]
untdid_categories: Mapping[str, str]
property all_categories: tuple[IvaCategory, ...]

Return the registry-declared categories in authored order.

property all_category_set: frozenset[IvaCategory]

Return the registry-declared category membership.

require(value)[source]

Return one category only when this projection declares it.

Return type:

IvaCategory

Parameters:

value (object)

projection(name)[source]

Return one explicit category membership projection.

Return type:

frozenset[IvaCategory]

Parameters:

name (str)

reason(token)[source]

Return the registry-declared operator reason for a category.

Return type:

str

Parameters:

token (object)

hint(token)[source]

Return the registry-declared concise classifier hint.

Return type:

str

Parameters:

token (object)

operation_type(key)[source]

Return a registry-declared Modelo 349 operation-type token.

Return type:

str

Parameters:

key (str)

category_for_operation_type(operation_type)[source]

Return the category declared for an operation-type token.

Return type:

IvaCategory | None

Parameters:

operation_type (str)

category_for_untdid_code(code)[source]

Project an EN 16931/UNTDID 5305 code through registry data.

Return type:

IvaCategory | None

Parameters:

code (str)

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

Resolve the complete IVA category vocabulary through fact 0084.

Return type:

IvaCategoryCatalogue

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

Return one registry-declared IVA category or refuse it.

Return type:

IvaCategory

Parameters:
registry_category_projection(name, *, effective_date=None, authority=None)[source]

Return one explicit category projection from fact 0084.

Return type:

frozenset[IvaCategory]

Parameters: