summaryrefslogtreecommitdiff
path: root/internal/models
diff options
context:
space:
mode:
Diffstat (limited to 'internal/models')
-rw-r--r--internal/models/atom.go31
-rw-r--r--internal/models/types.go1
2 files changed, 17 insertions, 15 deletions
diff --git a/internal/models/atom.go b/internal/models/atom.go
index 3745917..767ccdd 100644
--- a/internal/models/atom.go
+++ b/internal/models/atom.go
@@ -12,6 +12,7 @@ const (
SourceTrello AtomSource = "trello"
SourceTodoist AtomSource = "todoist"
SourceMeal AtomSource = "plantoeat"
+ SourceGTasks AtomSource = "gtasks"
)
type AtomType string
@@ -122,24 +123,24 @@ func CardToAtom(c Card) Atom {
}
}
-// MealToAtom converts a PlanToEat Meal to an Atom
-func MealToAtom(m Meal) Atom {
- // Meals don't have priority, default to low (1)
- priority := 1
+// GoogleTaskToAtom converts a Google Task to an Atom
+func GoogleTaskToAtom(t GoogleTask) Atom {
+ // Google Tasks don't have explicit priority, default to medium (2)
+ priority := 2
return Atom{
- ID: m.ID,
- Title: m.RecipeName,
- Description: m.MealType, // breakfast, lunch, dinner
- Source: SourceMeal,
- Type: TypeMeal,
- URL: m.RecipeURL,
- DueDate: &m.Date, // Meal date is effectively the "due date"
- CreatedAt: time.Time{},
+ ID: t.ID,
+ Title: t.Title,
+ Description: t.Notes,
+ Source: SourceGTasks,
+ Type: TypeTask,
+ URL: t.URL,
+ DueDate: t.DueDate,
+ CreatedAt: t.UpdatedAt,
Priority: priority,
- SourceIcon: "🍽️", // Fork and knife emoji for meals
- ColorClass: "border-green-500",
- Raw: m,
+ SourceIcon: "🔵", // Blue circle for Google Tasks
+ ColorClass: "border-blue-400",
+ Raw: t,
}
}
diff --git a/internal/models/types.go b/internal/models/types.go
index 194eca9..0b025ce 100644
--- a/internal/models/types.go
+++ b/internal/models/types.go
@@ -175,6 +175,7 @@ func (cm *CacheMetadata) IsCacheValid() bool {
// DashboardData aggregates all data for the main view
type DashboardData struct {
Tasks []Task `json:"tasks"`
+ GoogleTasks []GoogleTask `json:"google_tasks,omitempty"`
Meals []Meal `json:"meals"`
Boards []Board `json:"boards,omitempty"`
TrelloTasks []Card `json:"trello_tasks,omitempty"`