From architecture review 2026-07-19, candidate C4 ("Worth exploring").
Problem
OnCallStore.rules: [RecurrenceRule] is a real array and OnCallBilling correctly loops over all rules, but the product only ever allows one active rule — a constraint enforced only by hiding the "add rule" button in ScheduleTab.swift once store.rules is non-empty (and read via store.rules.first throughout).
Files:
Sources/TimeTracker/OnCallStore.swift
Sources/TimeTracker/ScheduleTab.swift:31,40,100,145,149,175
Sources/TimeTrackerCore/OnCallBilling.swift:86-90
Solution options
- Make
OnCallStore.rule: RecurrenceRule? a singleton if multi-rule support isn't planned, or
- Promote the "at most one" constraint to a store-level guard if multi-rule is a future goal
Either way, the constraint should live where the data lives, not in a button's visibility condition.
From architecture review 2026-07-19, candidate C4 ("Worth exploring").
Problem
OnCallStore.rules: [RecurrenceRule]is a real array andOnCallBillingcorrectly loops over all rules, but the product only ever allows one active rule — a constraint enforced only by hiding the "add rule" button inScheduleTab.swiftoncestore.rulesis non-empty (and read viastore.rules.firstthroughout).Files:
Sources/TimeTracker/OnCallStore.swiftSources/TimeTracker/ScheduleTab.swift:31,40,100,145,149,175Sources/TimeTrackerCore/OnCallBilling.swift:86-90Solution options
OnCallStore.rule: RecurrenceRule?a singleton if multi-rule support isn't planned, orEither way, the constraint should live where the data lives, not in a button's visibility condition.