Exemplo n.º 1
0
def ride_request_with_status_dtos():
    ride_request_with_status_dtos = [
        RideRequestWithStatusDto(ride_request_dto=ride_request_dto1,
                                 status=StatusValue.Confirmed.value),
        RideRequestWithStatusDto(ride_request_dto=ride_request_dto2,
                                 status=StatusValue.Pending.value)
    ]
    return ride_request_with_status_dtos
Exemplo n.º 2
0
def my_ride_request_dto(ride_request_dto1,ride_request_dto2):
    my_ride_request_dto=MyRideRequestsDto(
        total_requests=2,
        request_dtos=[
            RideRequestWithStatusDto(
                ride_request_dto=ride_request_dto1,
                status=StatusValue.Confirmed.value),
                RideRequestWithStatusDto(
                ride_request_dto=ride_request_dto2,
                status= StatusValue.Confirmed.value
                )],
        limit=2,
        offset=1
        )
    return my_ride_request_dto
Exemplo n.º 3
0
def my_ride_request_dto_with_accepted_person_none(ride_request_dto1_with_accepted_person_none,
                            ride_request_dto2):
    my_ride_request_dto=MyRideRequestsDto(
        total_requests=2,
        request_dtos=[
            RideRequestWithStatusDto(
                ride_request_dto=ride_request_dto1_with_accepted_person_none,
                status=StatusValue.Confirmed.value),
                RideRequestWithStatusDto(
                ride_request_dto=ride_request_dto2,
                status= StatusValue.Confirmed.value
                )],
        limit=2,
        offset=1
        )
    return my_ride_request_dto
Exemplo n.º 4
0
    def _get_ride_request_with_status(self, ride_request_dtos):
        list_of_ride_requests = []
        for request in ride_request_dtos:
            if not request.flexible:
                status = self.check_status_if_flexible_is_false(request)
            else:
                status = self.check_status_if_flexible_is_true(request)
            status = self.check_accepted_person_exists_for_the_request(request)

            list_of_ride_requests.append(
                RideRequestWithStatusDto(ride_request_dto=request,
                                         status=status))
        return list_of_ride_requests
Exemplo n.º 5
0
def ride_request_with_status_dto1():
    ride_request_with_status_dtos = [
        RideRequestWithStatusDto(ride_request_dto=ride_request_dto1,
                                 status=StatusValue.Pending.value),
    ]
    return ride_request_with_status_dtos