cadrumo.application.ledger.usage_ratio_repository module

Explicit lifetime binding for usage-ratio profile persistence.

class UsageRatioCensoGuardLoader(*args, **kwargs)[source]

Bases: Protocol

Load one profile’s persisted usage ratios under its censo guard.

class UsageRatioProfileLoader(*args, **kwargs)[source]

Bases: Protocol

Load one profile’s persisted usage ratios.

class UsageRatioProfileSaver(*args, **kwargs)[source]

Bases: Protocol

Persist one profile’s usage ratios.

bind_usage_ratio_profile_persistence(*, loader, saver)[source]

Bind the load/save pair as one atomic usage-ratio persistence lifetime.

Return type:

Generator[None]

Parameters:
bind_usage_ratio_censo_guard_loader(loader)[source]

Bind one outward-composed censo-guarded usage-ratio loader.

Return type:

Generator[UsageRatioCensoGuardLoader]

Parameters:

loader (UsageRatioCensoGuardLoader)

usage_ratio_profile_with_censo_guard(*, bucket_id, raw_afectacion_ratio, year, operation)[source]

Resolve and invoke the composed censo-guarded ratio loader for year.

Return type:

UsageRatioProfile

Parameters:
load_usage_ratio_profile(*, bucket_id, operation)[source]

Load the usage-ratio profile through the explicitly composed authority.

Return type:

UsageRatioProfile

Parameters:
save_usage_ratio_profile(profile, *, bucket_id)[source]

Persist the usage-ratio profile through the explicitly composed authority.

Return type:

None

Parameters: