== Actors == * **Signed-in User** == Steps == 1. The user logs into the system 2. The user clicks on the ‘My Trips’ tab {{{#!sql SELECT lf.name, lt.name, trip.free_seats, trip.date, t_o.company_name, stop_time FROM ticket as tick JOIN trip on trip.trip_id = tick.trip_id JOIN transport_organizer as t_o ON trip.transport_organizer_id = t_o.transport_organizer_id JOIN route as r ON trip.route_id = r.route_id JOIN location as lf on r.from_location_id = lf.location_id JOIN location as lt on r.to_location_id = lt.location_id JOIN trip_stops as stop on lf.location_id = stop.location_id WHERE tick.account_id = {account_lists_id}; }}} 3. (''Optional'') The user selects a status on which to filter their trips. By default, all trips are displayed. 4. (''Optional'') The user selects a company on which to filter their trips. By default, all trips are displayed. 5. (''Optional'') The user selects a date range in which their trips were completed. By default, all trips are displayed. {{{#!sql SELECT lf.name, lt.name, trip.free_seats, trip.date, t_o.company_name, stop_time FROM ticket as tick JOIN trip on trip.trip_id = tick.trip_id JOIN transport_organizer as t_o ON trip.transport_organizer_id = t_o.transport_organizer_id JOIN route as r ON trip.route_id = r.route_id JOIN location as lf on r.from_location_id = lf.location_id JOIN location as lt on r.to_location_id = lt.location_id JOIN trip_stops as stop on lf.location_id = stop.location_id WHERE tick.account_id = {account_lists_id} AND ({selected_status} IS NULL OR tick.status = {selected_status}) AND ({before_date} IS NULL OR trip.date < {before_date}) AND ({after_date} IS NULL OR trip.date > {after_date}) AND ({selected_company_name} IS NULL OR t_o.company_name = {selected_company_name}); }}} 6. The user is displayed their trips.