Changes between Version 1 and Version 2 of UseCaseImplementation


Ignore:
Timestamp:
02/17/25 11:32:27 (5 days ago)
Author:
222077
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCaseImplementation

    v1 v2  
    1010
    1111=== ID 1 - Search Routes
     12
     13===
     14The `/search-routes` endpoint provides users with the ability to search for available transport routes from different organizers.
     15It supports both **viewing all routes** by default and **filtering routes** based on user input (departure and arrival locations).
     16The request is handled by `UserRouteController`, which interacts with `RouteService` to retrieve the relevant data.
     17
     18==== Controller Details: 
     19- **URL Mapping:** `/search-routes` 
     20- **Method:** `GET` 
     21- **Functionality:** 
     22  - Displays **all routes** when the page is accessed without search criteria. 
     23  - Filters results based on the user's input (`from` and `to`). 
     24- **View:** Uses the `master` template and dynamically embeds `user/search-routes`.
     25
     26==== Breakdown: 
     27- When users first visit `/search-routes`, the controller calls `routeService.findAll()` to display all available routes. 
     28- When users provide search criteria (`from` and/or `to`), it filters results using `routeService.findRouteByFromAndToDest(from, to)`. 
     29- If no matching routes are found, a **"No routes found for your search."** message is displayed instead of an empty table. 
     30- The retrieved data is added to the `Model`, ensuring the front-end can render the appropriate content.
     31
     32