summaryrefslogtreecommitdiff
path: root/internal/models
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-12 11:06:32 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-12 11:06:32 +0000
commitf31b4722243b8b69564c94e47e07678153c31815 (patch)
tree9b66a2132b7c40c3ca189aa151327aeec33cc18b /internal/models
parentb1c76cdf30b7d491f3791588c8aa8c66ee5a0950 (diff)
feat(widget): capture and forward RecurringEventID for calendar events
Diffstat (limited to 'internal/models')
-rw-r--r--internal/models/timeline.go13
-rw-r--r--internal/models/types.go25
-rw-r--r--internal/models/widget.go23
3 files changed, 32 insertions, 29 deletions
diff --git a/internal/models/timeline.go b/internal/models/timeline.go
index ab486a8..6e48f91 100644
--- a/internal/models/timeline.go
+++ b/internal/models/timeline.go
@@ -9,11 +9,11 @@ import (
type TimelineItemType string
const (
- TimelineItemTypeTask TimelineItemType = "task"
- TimelineItemTypeMeal TimelineItemType = "meal"
- TimelineItemTypeCard TimelineItemType = "card"
- TimelineItemTypeEvent TimelineItemType = "event"
- TimelineItemTypeGTask TimelineItemType = "gtask" // Google Tasks
+ TimelineItemTypeTask TimelineItemType = "task"
+ TimelineItemTypeMeal TimelineItemType = "meal"
+ TimelineItemTypeCard TimelineItemType = "card"
+ TimelineItemTypeEvent TimelineItemType = "event"
+ TimelineItemTypeGTask TimelineItemType = "gtask" // Google Tasks
)
type DaySection string
@@ -42,7 +42,8 @@ type TimelineItem struct {
Source string `json:"source"` // "trello", "plantoeat", "calendar", "gtasks"
// Source-specific metadata
- ListID string `json:"list_id,omitempty"` // For Google Tasks
+ ListID string `json:"list_id,omitempty"` // For Google Tasks
+ RecurringEventID string `json:"recurring_event_id,omitempty"` // For calendar events
}
// ComputeDaySection sets the DaySection, IsOverdue, and IsAllDay based on the item's time
diff --git a/internal/models/types.go b/internal/models/types.go
index d9dd515..b3f3a22 100644
--- a/internal/models/types.go
+++ b/internal/models/types.go
@@ -126,12 +126,13 @@ type Project struct {
// 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"`
+ 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"`
+ RecurringEventID string `json:"recurring_event_id,omitempty"` // empty = not a recurring instance
}
// GoogleTask represents a task from Google Tasks
@@ -248,12 +249,12 @@ type CompletedTask struct {
// SourceConfig represents a configurable item from a data source
type SourceConfig struct {
- ID int64 `json:"id"`
- Source string `json:"source"` // trello, gcal, gtasks
- ItemType string `json:"item_type"` // board, project, calendar, tasklist
- ItemID string `json:"item_id"`
- ItemName string `json:"item_name"`
- Enabled bool `json:"enabled"`
+ ID int64 `json:"id"`
+ Source string `json:"source"` // trello, gcal, gtasks
+ ItemType string `json:"item_type"` // board, project, calendar, tasklist
+ ItemID string `json:"item_id"`
+ ItemName string `json:"item_name"`
+ Enabled bool `json:"enabled"`
}
// FeatureToggle represents a feature flag
diff --git a/internal/models/widget.go b/internal/models/widget.go
index 54a6eee..cbaf19c 100644
--- a/internal/models/widget.go
+++ b/internal/models/widget.go
@@ -6,17 +6,18 @@ import "time"
// Source values: "doot", "trello", "plantoeat", "calendar", "gtasks"
// Type values: "task", "event"
type WidgetItem struct {
- ID string `json:"id"`
- Title string `json:"title"`
- Source string `json:"source"`
- Type string `json:"type"`
- Start *time.Time `json:"start,omitempty"` // nil = no specific time (floating task)
- End *time.Time `json:"end,omitempty"`
- IsAllDay bool `json:"is_all_day"`
- IsOverdue bool `json:"is_overdue"`
- DueDate *time.Time `json:"due_date,omitempty"` // doot tasks only -- see TimelineItemToWidgetItem
- URL string `json:"url,omitempty"`
- Completable bool `json:"completable"` // true = doot task (checkbox shown)
+ ID string `json:"id"`
+ Title string `json:"title"`
+ Source string `json:"source"`
+ Type string `json:"type"`
+ Start *time.Time `json:"start,omitempty"` // nil = no specific time (floating task)
+ End *time.Time `json:"end,omitempty"`
+ IsAllDay bool `json:"is_all_day"`
+ IsOverdue bool `json:"is_overdue"`
+ DueDate *time.Time `json:"due_date,omitempty"` // doot tasks only -- see TimelineItemToWidgetItem
+ URL string `json:"url,omitempty"`
+ Completable bool `json:"completable"` // true = doot task (checkbox shown)
+ RecurringEventID string `json:"recurring_event_id,omitempty"`
}
// WidgetResponse is the full /api/widget response body.