summaryrefslogtreecommitdiff
path: root/internal/models/types.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-22 15:28:06 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-22 15:31:50 -1000
commite97a1bc259d3aa91956ec73a522421cdb621ae57 (patch)
treea9f424ef97673c0dd7da8cee6044413e6417b626 /internal/models/types.go
parentdb5deb2330448c75ba6b719e6a397832362b222a (diff)
Add Google Calendar integration
- Add GoogleCalendarClient for fetching upcoming events - Add GoogleCalendarAPI interface and CalendarEvent model - Add config for GOOGLE_CREDENTIALS_FILE and GOOGLE_CALENDAR_ID - Display events in Planning tab with date/time formatting - Update handlers and tests to support optional calendar client Config env vars: - GOOGLE_CREDENTIALS_FILE: Path to service account JSON - GOOGLE_CALENDAR_ID: Calendar ID (defaults to "primary") Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/models/types.go')
-rw-r--r--internal/models/types.go25
1 files changed, 18 insertions, 7 deletions
diff --git a/internal/models/types.go b/internal/models/types.go
index d9e955b..a604b28 100644
--- a/internal/models/types.go
+++ b/internal/models/types.go
@@ -57,6 +57,16 @@ type Project struct {
Name string `json:"name"`
}
+// CalendarEvent represents a Google Calendar event
+type CalendarEvent struct {
+ ID string `json:"id"`
+ Summary string `json:"summary"`
+ Description string `json:"description"`
+ Start time.Time `json:"start"`
+ End time.Time `json:"end"`
+ HTMLLink string `json:"html_link"`
+}
+
// CacheMetadata tracks when data was last fetched
type CacheMetadata struct {
Key string `json:"key"`
@@ -72,11 +82,12 @@ func (cm *CacheMetadata) IsCacheValid() bool {
// DashboardData aggregates all data for the main view
type DashboardData struct {
- Tasks []Task `json:"tasks"`
- Meals []Meal `json:"meals"`
- Boards []Board `json:"boards,omitempty"`
- TrelloTasks []Card `json:"trello_tasks,omitempty"`
- Projects []Project `json:"projects,omitempty"`
- LastUpdated time.Time `json:"last_updated"`
- Errors []string `json:"errors,omitempty"`
+ Tasks []Task `json:"tasks"`
+ Meals []Meal `json:"meals"`
+ Boards []Board `json:"boards,omitempty"`
+ TrelloTasks []Card `json:"trello_tasks,omitempty"`
+ Projects []Project `json:"projects,omitempty"`
+ Events []CalendarEvent `json:"events,omitempty"`
+ LastUpdated time.Time `json:"last_updated"`
+ Errors []string `json:"errors,omitempty"`
}