wiki:ViewMyTripsUseCase

Actors

  • Signed-in User

Steps

  1. The user logs into the system
  2. The user clicks on the ‘My Trips’ tab
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};
  1. (Optional) The user selects a status on which to filter their trips. By default, all trips are displayed.
  2. (Optional) The user selects a company on which to filter their trips. By default, all trips are displayed.
  3. (Optional) The user selects a date range in which their trips were completed. By default, all trips are displayed.
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});
  1. The user is displayed their trips.
Last modified 42 hours ago Last modified on 01/13/25 16:27:04
Note: See TracWiki for help on using the wiki.