summaryrefslogtreecommitdiff
path: root/internal/models/widget.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/models/widget.go')
-rw-r--r--internal/models/widget.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/models/widget.go b/internal/models/widget.go
new file mode 100644
index 0000000..94deec7
--- /dev/null
+++ b/internal/models/widget.go
@@ -0,0 +1,24 @@
+package models
+
+import "time"
+
+// WidgetItem is a single item in the widget API response.
+// Source values: "todoist", "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"`
+ URL string `json:"url,omitempty"`
+ Completable bool `json:"completable"` // true = todoist task (checkbox shown)
+}
+
+// WidgetResponse is the full /api/widget response body.
+type WidgetResponse struct {
+ Now time.Time `json:"now"`
+ Items []WidgetItem `json:"items"`
+}