fehermar / Project-Indigo

0 stars 2 forks source link

API design #4

Open halkszavu opened 7 months ago

halkszavu commented 7 months ago

An HTTP API: this is what the backend and the frontend will use to communicate between each other. It should describe the endpoints, and the individual contents for the endpoints.

halkszavu commented 6 months ago

User endpoints: Add new user with password Modify an existing user: change password Deleting an existing user is not desirable, so we will not have an endpoint for that

halkszavu commented 6 months ago

Itinerary endpoints: Create a new itinerary Search itineraries by their starting points Search itineraries by their endpoints Search itineraries by the owner Modify an itinerary

halkszavu commented 6 months ago

Route endpoints: Create a new route Modify existing route - this should create a new copy, so it won't interfere with the already existing recordings, that used the old route.

halkszavu commented 6 months ago

Route endpoints: Create a new route Modify existing route - this should create a new copy, so it won't interfere with the already existing recordings, that used the old route.

Routes are associated with one line - in both directions. They are defined by a route number (which has to include the service providers, as there might be a route 1 in Budapest and another route 1 in Debrecen). They include the endpoints of the route, and the stops between the endpoints in order.

halkszavu commented 6 months ago

Recording endpoints: Create a new recording Modifying a new recording does not make sense Get a recording Get all recordings Get some recordings based on certain criteria.

halkszavu commented 6 months ago

All endpoints that have a request body, require it in JSON format. All endpoints that return a response, do it in JSON format.

halkszavu commented 6 months ago

Route endpoints: Create a new route Modify existing route - this should create a new copy, so it won't interfere with the already existing recordings, that used the old route.

Get a route by its route number Get all routes that match the specified route number Get all routes for a stop

halkszavu commented 6 months ago

Itinerary endpoints: Create a new itinerary Search itineraries by their starting points Search itineraries by their endpoints Search itineraries by the owner Modify an itinerary

Needs a GET where the itinerary id is supplied.

halkszavu commented 6 months ago

Itinerary endpoints: Create a new itinerary Search itineraries by their starting points Search itineraries by their endpoints Search itineraries by the owner Modify an itinerary

Needs a GET where the itinerary id is supplied.

This still needed.