onebusaway-android icon indicating copy to clipboard operation
onebusaway-android copied to clipboard

Allow saving planned trips

Open barbeau opened this issue 6 years ago • 1 comments

Summary:

From user:

i love this feature to plan trips can there be a future feauture to save planned trips?

Saving planned trips allows users to quickly see real-time info along their entire trip

Steps to reproduce:

  1. Plan a trip

Expected behavior:

Allow me to save that trip, and plan a future trip using that same origin/destination

Observed behavior:

I can't save my origin and destination to use in a future trip plan

Device and Android version:

N/A

barbeau avatar Oct 01 '18 14:10 barbeau

Hi Sean, I would like to attempt to add this feature.

graceschae avatar Apr 02 '24 17:04 graceschae

Hi, I came across this issue and would love to work on it. Saving planned trips seems like a valuable feature, and I’d like to implement it. Could you confirm if this is still relevant and assign it to me?

Thanks!

Akshatb2006 avatar Jan 23 '25 07:01 Akshatb2006

@Akshatb2006 you can work on that but you can first write a technical plan for that would be great!

amrhossamdev avatar Jan 23 '25 17:01 amrhossamdev

Technical Plan: Saved Planned Trips Feature

User Flow

  1. Plan a Trip: User plans a trip (origin → destination).
  2. Save Trip Option: User sees an option to "Save Trip" on the trip details page.
  3. Access Saved Trips: Saved trips are accessible via a "Saved Trips" section in the app.
  4. Use Saved Trips: Users can:
    • Select a saved trip.
    • View real-time updates (e.g., delays, arrival times).
    • Reuse the trip to plan another journey.

Feature Overview

The "Save Planned Trips" feature will:

  • Allow users to save a planned trip (including origin, destination, travel time, and trip preferences).
  • Display saved trips in a user-accessible list or dashboard.
  • Provide real-time updates (e.g., delays, disruptions, or route changes) for saved trips.
  • Enable users to modify or delete saved trips as needed.

Key Components

1. Frontend Changes

Save Trip UI

  • Add a "Save Trip" button to the trip planning interface.
  • Display saved trips in a dedicated section (e.g., "Saved Trips" menu or dashboard).

Manage Saved Trips

  • Allow users to:
    • View saved trips.
    • Edit, delete, or activate saved trips.
  • Include a real-time status indicator for each saved trip when activated.

2. Backend Changes

Trip Data Storage

Design a database schema to store saved trips for each user. Suggested fields:

  • trip_id: Unique identifier for the trip.
  • user_id: Reference to the user saving the trip.
  • origin: Starting location.
  • destination: Ending location.
  • trip_preferences: Options like preferred modes of transportation, travel time, etc.
  • timestamp: Time of creation.

API Endpoints

Develop RESTful API endpoints:

  • Save a Trip: POST /api/trips/save
  • Fetch Saved Trips: GET /api/trips
  • Edit a Saved Trip: PUT /api/trips/{trip_id}
  • Delete a Saved Trip: DELETE /api/trips/{trip_id}
  • Activate a Saved Trip for Real-Time Updates: POST /api/trips/{trip_id}/activate

3. Real-Time Updates

  • Integrate the existing trip planner's real-time API to fetch updates for active saved trips.
  • Use WebSockets or push notifications to notify users about:
    • Disruptions.
    • Delays.
    • Route changes.

Future Enhancements

  • Multiple Saved Trips:
    Currently, the "Save Trips" feature will allow saving only one trip. Based on its success and user reviews, we can expand this feature to support multiple trips in the future.
  • Enhanced Management Options:
    Add advanced filtering, sorting, and sharing options for saved trips.

Collaboration and Timeline

  • Complexity of the Issue:
    Since this is a large and complex feature, it might take significant time to implement.
  • Team Collaboration:
    If possible, we can schedule a meeting to discuss the implementation in detail. Alternatively, the task can be assigned to multiple contributors to work collaboratively.

Akshatb2006 avatar Jan 24 '25 16:01 Akshatb2006

@Akshatb2006 please don't put a meeting on my calendar to discuss bugs.

aaronbrethorst avatar Jan 25 '25 16:01 aaronbrethorst

Hi, I came across this issue and reviewed the technical plan. I’d like to work on it and collaborate with @akshatb2006. Could you please assign the task to both of us?

Thankyou!!

Manishym946 avatar Jan 29 '25 12:01 Manishym946

Hi @amrhossamdev

I shared my technical plan for this issue three weeks ago, but I haven't received any feedback yet. Could you please review it and let me know if any modifications are needed? I’d love to proceed further based on your input.

Thanks!

Akshatb2006 avatar Feb 12 '25 11:02 Akshatb2006