wiki:ViewMyTripsUseCase

Version 2 (modified by 221514, 2 days ago) ( diff )

--

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 status = {selected_status}
AND (trip.date < {before_date} AND trip.date < {after_date})
AND t_o.company_name = {selected_company_name};
  1. The user is displayed their trips.
Note: See TracWiki for help on using the wiki.