summaryrefslogtreecommitdiff
path: root/internal/models/budget.go
blob: 8a3917acbbadcb80de0633f912d76f4884a2cd42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package models

// AvailabilityBlock is one recurring weekly window of time the user has
// manually declared as available (e.g. "weekday evenings 18:00-20:00").
// Reduced by real calendar events at computation time -- see
// handlers.ComputeBudgetPeriod.
type AvailabilityBlock struct {
	ID        string `json:"id"`
	Weekday   int    `json:"weekday"` // 0-6, Sun-Sat
	StartTime string `json:"start_time"` // "18:00"
	EndTime   string `json:"end_time"`   // "20:00"
	Label     string `json:"label"`
}

// BudgetPeriod is the scheduled-vs-available load for one window of time.
// Purely informational -- no field here ever drives auto-scheduling.
type BudgetPeriod struct {
	ScheduledMinutes int `json:"scheduled_minutes"`
	AvailableMinutes int `json:"available_minutes"`
}

// BudgetStatus bundles today's and this rolling week's load. Only present
// on API responses when at least one budget-tracked task exists in the
// wider (Week) window.
type BudgetStatus struct {
	Today BudgetPeriod `json:"today"`
	Week  BudgetPeriod `json:"week"`
}