7 | | 3. The transport organizer clicks on the ‘Add Trip’ button. |
8 | | 4. The transport organizer fills out a form with the following details: |
| 7 | |
| 8 | {{{#!sql |
| 9 | SELECT r.route_id, |
| 10 | l1.name AS from_location, |
| 11 | l2.name AS to_location, |
| 12 | tr.company_name AS organizer_name |
| 13 | FROM route r |
| 14 | JOIN location l1 ON r.from_location_id = l1.location_id |
| 15 | JOIN location l2 ON r.to_location_id = l2.location_id |
| 16 | JOIN transport_organizer tr ON r.transport_organizer_id = tr.transport_organizer_id |
| 17 | WHERE l1.name ILIKE '%from_location%' |
| 18 | AND l2.name ILIKE '%to_location%' |
| 19 | }}} |
| 20 | |
| 21 | 3. The transport organizer selects a Route they want to add trip to. |
| 22 | 4. The transport organizer clicks on the ‘Add Trip’ button. |
| 23 | 5. The transport organizer fills out a form with the following details: |
11 | | 5. The transport organizer submits the form. |
12 | | 6. The transport organizer is redirected to the route page. |
| 26 | 6. The transport organizer submits the form. |
| 27 | |
| 28 | {{{#!sql |
| 29 | INSERT INTO trip (route_id, transport_organizer_id, free_seats, date, status) |
| 30 | VALUES (selected_route_id, logged_in_transport_organizer_id, total_seats, 'trip_date', 'NOT_STARTED') |
| 31 | RETURNING trip_id |
| 32 | }}} |
| 33 | |
| 34 | {{{#!sql |
| 35 | INSERT INTO trip_stops (trip_id, location_id, stop_time) |
| 36 | VALUES (returned_trip_id, stop_location_id, 'stop_time') |
| 37 | }}} |
| 38 | |
| 39 | 7. The transport organizer is redirected to the route page. |