From c290113bd1a8af694b648bba4c801e00b049683a Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 24 Jan 2026 20:12:07 -1000 Subject: Add Shopping tab combining Trello and PlanToEat lists - New Shopping tab aggregates items from Trello Shopping board and PlanToEat - Items grouped by store, then by category (for PlanToEat) - Trello list names treated as store names - Replace PlanToEat meals API with web scraping (uses session cookie) - Add error logging for PlanToEat fetch operations - Recipe links now point to cooking view (/recipes/{id}/cook/{event_id}) Co-Authored-By: Claude Opus 4.5 --- internal/models/types.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'internal/models/types.go') diff --git a/internal/models/types.go b/internal/models/types.go index a604b28..f45e346 100644 --- a/internal/models/types.go +++ b/internal/models/types.go @@ -26,6 +26,39 @@ type Meal struct { RecipeURL string `json:"recipe_url"` } +// ShoppingItem represents an item on the PlanToEat shopping list +type ShoppingItem struct { + ID string `json:"id"` + Name string `json:"name"` + Quantity string `json:"quantity"` + Category string `json:"category"` + Store string `json:"store"` + Checked bool `json:"checked"` +} + +// UnifiedShoppingItem combines Trello cards and PlanToEat items +type UnifiedShoppingItem struct { + ID string `json:"id"` + Name string `json:"name"` + Quantity string `json:"quantity,omitempty"` + Category string `json:"category,omitempty"` + Store string `json:"store"` + Source string `json:"source"` // "trello" or "plantoeat" + Checked bool `json:"checked"` +} + +// ShoppingStore groups items by store +type ShoppingStore struct { + Name string + Categories []ShoppingCategory +} + +// ShoppingCategory groups items within a store +type ShoppingCategory struct { + Name string + Items []UnifiedShoppingItem +} + // List represents a Trello list type List struct { ID string `json:"id"` -- cgit v1.2.3