feat(contracts): hour-balance consumption, rate resolution, lifecycle (PMS-64) #75
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-64-contracts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements PMS-64 working components. consume_hours decrements current-period contract_hour_balances, computes overage at overage_rate, roll_to_next_period rolls unused hours capped at max_rollover_hours (periods derived from start_date + billing_cycle). resolve_rate returns emergency/after-hours/standard per work type. expire_due_contracts expires or auto-renews past-end contracts, driven hourly by a ContractLifecycleWorker (scheduler::Job). list_recurring_items feeds PMS-33. Migration 025 adds the balance unique constraint. tests/contracts.rs 6/6 green (within-allotment, overage, rollover-cap, renewal/expiry). rust_decimal throughout; clippy -D warnings clean. Contract audit hooks follow after PMS-117 merges.