From 6eb126257f5461ecfe670fb22a7a5341e3041275 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Fri, 29 May 2026 16:32:26 -0400 Subject: [PATCH] feat: support dynamic multiple WhatsApp group URLs per trip config --- trip-service/server.js | 13 ++++++++-- trip-service/smoky-mountains.json | 42 +++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 trip-service/smoky-mountains.json diff --git a/trip-service/server.js b/trip-service/server.js index 01de3c4..75244f5 100644 --- a/trip-service/server.js +++ b/trip-service/server.js @@ -143,8 +143,17 @@ async function generateAndSendBriefing(trip, dayPlan) { console.log(`[TripService] Sending briefing for ${trip.name} - ${dayPlan.date}`); await sendWhatsApp(PERSONAL_NUM, message); - if (trip.sendToGroup && GROUP_URL) { - await sendWhatsApp(GROUP_URL, message); + + // Support specific groups for this trip, fallback to default if configured + let groupsToNotify = []; + if (trip.groupUrls && Array.isArray(trip.groupUrls) && trip.groupUrls.length > 0) { + groupsToNotify = trip.groupUrls; + } else if (trip.sendToGroup && GROUP_URL) { + groupsToNotify = [GROUP_URL]; + } + + for (const group of groupsToNotify) { + await sendWhatsApp(group, message); } } diff --git a/trip-service/smoky-mountains.json b/trip-service/smoky-mountains.json new file mode 100644 index 0000000..356042e --- /dev/null +++ b/trip-service/smoky-mountains.json @@ -0,0 +1,42 @@ +{ + "name": "Smoky Mountains Trip", + "briefingTime": "07:00", + "sendToGroup": true, + "groupUrls": [ + "https://chat.whatsapp.com/YOUR_GROUP_INVITE_LINK_1", + "https://chat.whatsapp.com/YOUR_GROUP_INVITE_LINK_2" + ], + "npsParkCode": "grsm", + "days": [ + { + "date": "2026-06-04", + "location": "Pigeon Forge, TN", + "activities": "Arrival Day.\n- Get groceries on the way (Walmart / Kroger).\n- Drive to cabin (approx. 20–40 mins from Pigeon Forge).\n- Check-in to cabin.\n- Assign rooms early and unpack.\n- Evening: Light dinner, snacks, and early rest.", + "meals": "Morning Tea Snack: Biscuits & Chai\nLunch: Rice + Dal, store-bought chapathi, yogurt / pickle.\nEvening Tea Snack: Samosas / Chips, juice boxes for kids.\nDinner: Rice + Chicken Curry." + }, + { + "date": "2026-06-05", + "location": "Pigeon Forge, TN", + "activities": "Cabin Day + BBQ Night.\n- Morning – Afternoon: Big breakfast, Kids play outside/games. Adults relax, music, chai. Short walk (optional). Indoor games.\n- BBQ Night (Evening): 3:30–4:00 PM Prep. 5:00 PM Grill. 6:30–7:30 PM Dinner. 8:00 PM onwards Campfire, marshmallows, stories.", + "meals": "Breakfast: Avocado toast with fruit and Chai.\nMorning Tea Snack: Muffins / Banana bread.\nLunch: Rice + Paneer Curry, store-bought chapathi.\nEvening Tea Snack: Chips + Salsa.\nDinner: Domino's Pizza takeout (Veg + chicken pizzas, garlic bread)." + }, + { + "date": "2026-06-06", + "location": "Cades Cove, TN", + "activities": "Cades Cove + The Island.\n- Morning (Cades Cove): Leave cabin 7:30–8:00 AM. 11-mile scenic loop drive. Wildlife spotting, historic cabins, viewpoints. (⚠️ Note: Cades Cove loop is closed to vehicles until 10 AM on Saturdays! Expect to walk/bike early, or do Visitor Center first).\n- Evening (The Island): Arrive 6:30–7:00 PM. Fountain show, rides, games, shopping, ice cream until 9:30 PM.", + "meals": "Breakfast: Croissants, yogurt for kids, fruit, and Chai.\nMorning Tea Snack: Cookies.\nLunch (Takeout): Chipotle (Chicken bowls, veg bowls, chips + guacamole).\nEvening Tea Snack: Popcorn, kids snacks.\nDinner: Rice + Dal, Egg Bhurji / Omelette Station, Chapathi." + }, + { + "date": "2026-06-07", + "location": "Townsend, TN", + "activities": "Little River – Water Day.\n- Morning to Afternoon (10:00 AM – 3:00 PM): Stay at Little River (Townsend Wye area). Splashing, rock stacking, relaxing, picnic.\n- Note: Bring towels, extra clothes, water shoes, chairs, cooler, sunscreen, bug spray.", + "meals": "Breakfast: Bread Toast, fruit, and Chai.\nMorning Tea Snack: Granola bars.\nLunch (Takeout): Subway (Chicken/veg sandwiches, chips, cookies).\nEvening Tea Snack: Chips + Dip.\nDinner: Rice + Chicken Curry, Yogurt, Chapathi." + }, + { + "date": "2026-06-08", + "location": "Pigeon Forge, TN", + "activities": "Departure Day.\n- Morning: Breakfast together. Pack & clean up. Check-out from cabin. Head back home.", + "meals": "Breakfast: Together at cabin." + } + ] +}