cadrumo.domain.transactions.irpf_categories module

Typed shape and normalization boundary for ledger IRPF category tokens.

class LedgerIrpfCategoryDescriptor(id, purpose, directions, net_paid, related_ids)[source]

Bases: object

One registry-projected category descriptor.

Parameters:
id: str
purpose: str
directions: tuple[TransactionDirection, ...]
net_paid: bool
related_ids: tuple[str, ...]
ledger_irpf_category_catalogue(*, authority=None)[source]

Return the dated registry-projected IRPF category descriptors.

Return type:

tuple[LedgerIrpfCategoryDescriptor, ...]

Parameters:

authority (GovernedFactSource | None)

normalize_irpf_category(value)[source]

Normalize a raw category token without resolving registry meaning.

Return type:

str | None

Parameters:

value (str | None)

ledger_irpf_category(value, *, direction=None, authority=None)[source]

Resolve a normalized token through the registry-owned taxonomy.

Return type:

LedgerIrpfCategoryDescriptor | None

Parameters:
has_non_work_irpf_category(value, *, direction, authority=None)[source]

Resolve the registry-owned non-employment predicate.

Return type:

bool

Parameters:
has_activity_irpf_category(value, *, direction, authority=None)[source]

Resolve the registry-owned activity-income predicate.

Return type:

bool

Parameters:
has_rent_irpf_category(value, *, direction, authority=None)[source]

Resolve the registry-owned rental predicate.

Return type:

bool

Parameters:
has_employment_irpf_category(value, *, direction, authority=None)[source]

Resolve the registry-owned employment predicate.

Return type:

bool

Parameters:

Return whether a spending token is a registry-declared net-paid relation.

Return type:

bool

Parameters: