Changes between Version 1 and Version 2 of ManageTripUseCase


Ignore:
Timestamp:
01/12/25 22:51:52 (3 days ago)
Author:
221514
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ManageTripUseCase

    v1 v2  
    88 4. The transport organizer selects the ‘To destination’ and enters a location.
    99 5. (Optional) The transport organizer selects a date range in which their trips were completed. By default, all trips with an **UPCOMING** status are displayed.
     10
     11{{{#!sql
     12SELECT lf.name, lt.name, trip.free_seats, trip.date, t_o.company_name, stop_time
     13FROM trip
     14JOIN transport_organizer as t_o ON trip.transport_organizer_id = t_o.transport_organizer_id
     15JOIN route as r ON trip.route_id = r.route_id
     16JOIN location as lf on r.from_location_id = lf.location_id
     17JOIN location as lt on r.to_location_id = lt.location_id
     18JOIN trip_stops as stop on lf.location_id = stop.location_id
     19WHERE status = 'NOT_STARTED'
     20ORDER BY date, stop_time;
     21}}}
     22
     23{{{#!sql
     24SELECT lf.name, lt.name, trip.free_seats, trip.date, t_o.company_name, stop_time
     25FROM trip
     26JOIN transport_organizer as t_o ON trip.transport_organizer_id = t_o.transport_organizer_id
     27JOIN route as r ON trip.route_id = r.route_id
     28JOIN location as lf on r.from_location_id = lf.location_id
     29JOIN location as lt on r.to_location_id = lt.location_id
     30JOIN trip_stops as stop on lf.location_id = stop.location_id
     31WHERE status = 'NOT_STARTED' AND date > {date_after} AND date < {date_before}
     32ORDER BY date, stop_time;
     33}}}
    1034 6. The transport organizer clicks on the ‘Search’ button.
    1135 7. The transport organizer selects the trip they wish to modify.
    1236 8. The system displays a form with information related to the trip’s stops and their timestamps.
     37
     38{{{#!sql
     39DELETE
     40FROM trip_stops as ts
     41WHERE ts.trip_stop_id = {trip_stop_selected};
     42
     43INSERT INTO
     44trip_stops(trip_id, location_id, stop_time)
     45VALUES({selected_trip_id}, {selected_location_id}, {entered_time});
     46
     47UPDATE trip_stops
     48SET {field} = {new_value}
     49WHERE trip_stops = {selected_trip_stop_id};
     50}}}
     51
    1352 9. The transport organizer clicks on the ‘Save changes’ button.