diff options
Diffstat (limited to 'internal/models/atom.go')
| -rw-r--r-- | internal/models/atom.go | 31 |
1 files changed, 16 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, } } |
