cadrumo.application.ledger.usage_ratio_repository module¶
Explicit lifetime binding for usage-ratio profile persistence.
- class UsageRatioCensoGuardLoader(*args, **kwargs)[source]¶
Bases:
ProtocolLoad one profile’s persisted usage ratios under its censo guard.
- class UsageRatioProfileLoader(*args, **kwargs)[source]¶
Bases:
ProtocolLoad one profile’s persisted usage ratios.
- class UsageRatioProfileSaver(*args, **kwargs)[source]¶
Bases:
ProtocolPersist 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:
- Parameters:
loader (UsageRatioProfileLoader)
saver (UsageRatioProfileSaver)
- bind_usage_ratio_censo_guard_loader(loader)[source]¶
Bind one outward-composed censo-guarded usage-ratio loader.
- Return type:
- 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:
- Parameters:
bucket_id (str)
raw_afectacion_ratio (Decimal | None)
year (int)
operation (PinnedAuthorityOperation)
- load_usage_ratio_profile(*, bucket_id, operation)[source]¶
Load the usage-ratio profile through the explicitly composed authority.
- Return type:
- Parameters:
bucket_id (str)
operation (PinnedAuthorityOperation)
- save_usage_ratio_profile(profile, *, bucket_id)[source]¶
Persist the usage-ratio profile through the explicitly composed authority.
- Return type:
- Parameters:
profile (UsageRatioProfile)
bucket_id (str)