feat: add on-call billing tracking#18
Merged
Merged
Conversation
dc8033e to
f90413c
Compare
- Library split: TimeTrackerCore (pure, testable) + TimeTracker executable - OnCallModels: rotation blocks, day schedules, non-billable rules, rate history - OnCallBilling: interval arithmetic for billable/passive/active minutes + rate lookup - OnCallStore: persistent on-call configuration and rotations - TimerManager: startOnCallActive() splits session at click → isRunningOnCall flag - ContentView: 4th On-call tab + orange On-call button in timer - StatsView: orange markers for active on-call sessions + income footer - OnCallView: settings, rotation list, week/month summary - 21 Swift Testing tests for billing logic (all passing)
- Move rotation list inside week/month period section (OnCallSummaryView) - Filter rotations to only those overlapping the selected period - Allow forward navigation to future weeks/months - Replace Quit with Back button when settings page is open
f90413c to
b5ab8c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TimeTrackerCorelibrary split for pure, testable billing logicWhat changed
Architecture
TimeTrackerCoreas an SPM library target;TimeTrackerexecutable depends on itTimeSession,Extensionsmoved toTimeTrackerCorewithpublicvisibility@_exported import TimeTrackerCoreinCoreImport.swiftpreserves backward compat for existing filesModels (
OnCallModels.swift)OnCallRotationBlock: date-ranged blocks with per-day-of-week schedulesOnCallSettings: passive/active multipliers, non-billable rules, rate historyDaySchedule,NonBillableRule,RateEntryBilling logic (
OnCallBilling.swift)mergeRanges,subtractRangesbillableMinutes,activeMinutesWithinBillable,passiveMinutes,rate— all static, no AppKit depsStore & timer
OnCallStore: persists rotations + settings to~/Library/Application Support/TimeTracker/oncall.jsonTimerManager:startOnCallActive()splits running session (saves elapsed as regular, restarts taggedisOnCallActive=true);isRunningOnCallpublished for UIUI
OnCallView/OnCallSettingsSection/OnCallRotationListView/OnCallSummaryViewContentView: orange timer border when on-call active; on-call toggle button in timer rowStatsView: orange bar overlay for on-call active sessions; income footer when tracking enabledTests — 21 Swift Testing tests covering all billing functions;
swift-testingadded as package depBreaking changes
None.
isOnCallActiveusesdecodeIfPresent— existingsessions.jsonfiles decode without changes.Test plan
swift test— all 21 on-call billing tests passswift build -c release— clean buildisOnCallActivesession recorded