Generate a luxury showcase trip itinerary for the WanderLuxe Explore page. Use when the user wants to create a new public trip, add a destination to the showcase collection, or populate the Explore page with content. Asks for destination, time of year, and duration, then produces a complete itinerary with SQL ready to insert into Supabase.
Generate a thoughtful, luxury travel itinerary and insert it as a public trip on the WanderLuxe Explore page, linked to the admin account.
Ask the user for the following (if not already provided):
Follow these principles:
Pacing & Philosophy
Accommodation
Dining
Activities
Transportation
Social Context
Generate a single DO $$ PL/pgSQL block that inserts everything in one transaction.
Admin account: user_id = 'a33fd435-65cd-4e75-9901-6db43e204b1b'
Database schema reference:
-- trips (required: user_id, destination, arrival_date, departure_date, is_public, hidden)
INSERT INTO trips (user_id, destination, arrival_date, departure_date, is_public, hidden)
VALUES (v_user_id, 'Destination Name', 'YYYY-MM-DD', 'YYYY-MM-DD', true, false)
RETURNING trip_id INTO v_trip_id;
-- trip_days (required: trip_id, date, title)
INSERT INTO trip_days (trip_id, date, title)
VALUES (v_trip_id, 'YYYY-MM-DD', 'Day Title')
RETURNING day_id INTO d1;
-- accommodations (required: trip_id, title, order_index)
-- Key fields: hotel, hotel_address, hotel_phone, hotel_url, hotel_checkin_date,
-- hotel_checkout_date, cost, currency, description
INSERT INTO accommodations (trip_id, title, hotel, hotel_address, hotel_phone, hotel_url,
hotel_checkin_date, hotel_checkout_date, cost, currency, order_index, description)
VALUES (v_trip_id, 'Hotel Name', 'Hotel Name', 'Full Address', '+phone',
'https://hotel-url', 'YYYY-MM-DD', 'YYYY-MM-DD', total_cost, 'CUR', 0, 'Description')
RETURNING stay_id INTO v_stay_id;
-- accommodations_days (link stay to each night — check-in through night before checkout)
INSERT INTO accommodations_days (stay_id, day_id, date)
VALUES (v_stay_id, d1, 'YYYY-MM-DD');
-- transportation (required: trip_id, type, start_date)
-- type enum: 'flight', 'train', 'car_service', 'shuttle', 'ferry', 'rental_car'
-- Key fields: provider, departure_location, arrival_location, start_date, start_time,
-- end_date, end_time, cost, currency, details
INSERT INTO transportation (trip_id, type, provider, departure_location, arrival_location,
start_date, start_time, end_date, end_time, cost, currency, details)
VALUES (v_trip_id, 'flight', 'Airline', 'Origin (CODE)', 'Dest (CODE)',
'YYYY-MM-DD', 'HH:MM', 'YYYY-MM-DD', 'HH:MM', cost, 'USD', 'Notes');
-- day_activities (required: day_id, title, order_index)
-- Key fields: trip_id, description, start_time, end_time, cost, currency
-- Times are 'HH:MM' format (time without time zone)
-- Activities WITHOUT cost:
INSERT INTO day_activities (day_id, trip_id, title, description, start_time, end_time, order_index)
VALUES (d1, v_trip_id, 'Activity', 'Description', '09:00', '12:00', 0);
-- Activities WITH cost:
INSERT INTO day_activities (day_id, trip_id, title, description, start_time, end_time, cost, currency, order_index)
VALUES (d1, v_trip_id, 'Activity', 'Description', '09:00', '12:00', 500, 'EUR', 0);
-- reservations (required: day_id, restaurant_name, order_index)
-- Key fields: trip_id, reservation_time, number_of_people, cost, currency, notes, address
INSERT INTO reservations (day_id, trip_id, restaurant_name, reservation_time,
number_of_people, cost, currency, notes, order_index, address)
VALUES (d1, v_trip_id, 'Restaurant Name', '20:30', 2, cost, 'CUR',
'Booking notes', 0, 'Restaurant Address');
SQL template structure:
DO $$
DECLARE
v_trip_id uuid;
v_stay_id uuid;
v_user_id uuid := 'a33fd435-65cd-4e75-9901-6db43e204b1b';
d1 uuid; d2 uuid; d3 uuid; -- ... one per day
BEGIN
-- 1. Insert trip
-- 2. Insert trip_days (one per day, RETURNING day_id INTO variables)
-- 3. Insert accommodation(s) + accommodations_days links
-- 4. Insert transportation
-- 5. Insert day_activities (grouped by day, order_index starting at 0)
-- 6. Insert reservations (linked to correct day_id)
END $$;
Important rules:
''accommodations_days links the stay to each night (check-in date through the night BEFORE checkout)order_index starts at 0 and increments per item within its parent'HH:MM' formatis_public = true flag is what makes trips visible on the Explore pageRun the SQL via the Supabase MCP execute_sql tool with project_id = 'arnengxblsfnezrqcsxw'.
After execution, verify with:
SELECT t.trip_id, t.destination, t.arrival_date,
(SELECT count(*) FROM trip_days WHERE trip_id = t.trip_id) as days,
(SELECT count(*) FROM day_activities WHERE trip_id = t.trip_id) as activities,
(SELECT count(*) FROM accommodations WHERE trip_id = t.trip_id) as hotels,
(SELECT count(*) FROM transportation WHERE trip_id = t.trip_id) as transport,
(SELECT count(*) FROM reservations WHERE trip_id = t.trip_id) as reservations
FROM trips t WHERE t.trip_id = '<new_trip_id>';
Keep track of what's already on the Explore page to avoid duplication and ensure variety:
When suggesting new destinations, complement this collection geographically and seasonally.
Before executing, verify:
accommodations_days covers check-in through night before checkoutorder_index values are sequential within each parent