IMC-UAS-Krems / 2024-DBST2VO-Public

The Public Repository linked to the Assignment of DBST2VO 2024
3 stars 1 forks source link

Missing arguments on the metohd `search_connection` #24

Closed dfoddav2 closed 3 months ago

dfoddav2 commented 3 months ago

@alessiogambi I believe travel_time_hour and travel_time_minute are missing from the method search_connection, as surely we would like for the user to be also able to pick those freely.

Solution: update the expected arguments

    @abstractmethod
    def search_connections(self, starting_station_key: TraitsKey, ending_station_key: TraitsKey,
                           travel_time_minute: int = None, travel_time_hour: int = None, 
                           travel_time_day: int = None, travel_time_month : int = None, travel_time_year : int = None,
                           is_departure_time=True,
                           sort_by : SortingCriteria = SortingCriteria.OVERALL_TRAVEL_TIME, is_ascending : bool =True,
                           limit : int = 5) -> List:
        """
        Search Train Connections (between two stations).
        Sorting criteria can be one of the following:overall travel time, number of train changes, waiting time, and estimated price

        Return the connections from a starting and ending stations, possibly including changes at interchanging stations.
        Returns an empty list if no connections are possible
        Raise a ValueError in case of errors and if the starting or ending stations are the same
        """
        pass
dfoddav2 commented 3 months ago

Additionally, since estimated price is also a possible sorting criteria it might make sense to have reserved as an argument showing that the user would like to make seat reservations.

Of course this may not be necessary as we could argue that the price is just estimated at this stage and the actual price is calculated / shown to the user at a later stage.

alessiogambi commented 3 months ago

@dfoddav2 Yes, adding minutes and hours would be sensible. I can add them to the interface; however, to avoid breaking submissions that already exist, I will not change the tests.

alessiogambi commented 3 months ago

Regarding reserved, adding a parameter for it is unnecessary. Usually, the ticketing systems show the lowest (e.g., no reservation) possible prices.