public override Gateway.UpdateTripStatusResponse UpdateTripStatus(Gateway.UpdateTripStatusRequest request) { Logger.BeginRequest("UpdateTripStatus sent to " + server.name, request); UpdateTripStatusResponse response = server.UpdateTripStatus(request); Logger.EndRequest(response); return(response); }
public override Gateway.UpdateTripStatusResponse UpdateTripStatus(Gateway.UpdateTripStatusRequest request) { Logger.BeginRequest("UpdateTripStatus received from " + gateway.GetName(request.clientID), request); UpdateTripStatusResponse response = gateway.UpdateTripStatus(request); Logger.EndRequest(response); return(response); }
private void NotifyForeignPartner(Status status, Location driverLocation, DateTime? eta) { Logger.Log("Since trip has foreign dependency, notify partner through TripThru"); Logger.Tab(); Gateway.UpdateTripStatusRequest request = new Gateway.UpdateTripStatusRequest( clientID: partner.ID, tripID: ID, status: status, driverLocation: driverLocation, eta: eta ); partner.tripthru.UpdateTripStatus(request); Logger.Untab(); }
public void UpdateBooking(string tripID, TDispatchAPI.Booking value) { Status activeTrip = ConvertTDispatchStatusToTripThruStatus(activeTrips[tripID].status, activeTrips[tripID].sub_status); Status valueTrip = ConvertTDispatchStatusToTripThruStatus(value.status, value.sub_status); if (activeTrip == valueTrip) return; Logger.BeginRequest("TDispatch trip " + tripID + " update", null, tripID); string bookingPK = activeTrips[tripID].pk; if (value.pk == null) value.pk = bookingPK; activeTrips[tripID] = value; Logger.Log("BookingStatus changed ", value); Logger.Log("Notify originating partner through TripThru"); Logger.Tab(); Location newLocation = null; TDispatchAPI.GetBookingStatusResponse getBookingStatusResponse = api.GetBookingStatus(bookingPK); if (getBookingStatusResponse.booking.driver != null) if (getBookingStatusResponse.booking.driver.location != null) if (getBookingStatusResponse.booking.driver.location.lat != null) if (getBookingStatusResponse.booking.driver.location.lng != null) newLocation = new Location((double)getBookingStatusResponse.booking.driver.location.lat, (double)getBookingStatusResponse.booking.driver.location.lng); Gateway.UpdateTripStatusRequest request = new Gateway.UpdateTripStatusRequest( clientID: ID, tripID: tripID, status: ConvertTDispatchStatusToTripThruStatus(value.status, value.sub_status), driverLocation: newLocation); tripthru.UpdateTripStatus(request); Logger.Untab(); if (activeTrips[tripID].status == "completed" || activeTrips[tripID].status == "cancelled" || activeTrips[tripID].status == "rejected" || activeTrips[tripID].status == "missed") activeTrips.Remove(tripID); Logger.EndRequest(null); }
public void UpdateBooking(string tripID, TDispatchAPI.Booking value) { if (activeTrips[tripID].status == value.status) return; Logger.BeginRequest("TDispatch trip " + tripID + " update", null, tripID); string bookingPK = activeTrips[tripID].pk; if (value.pk == null) value.pk = bookingPK; activeTrips[tripID] = value; Logger.Log("BookingStatus changed ", value); Logger.Log("Notify originating partner through TripThru"); Logger.Tab(); Gateway.UpdateTripStatusRequest request = new Gateway.UpdateTripStatusRequest( clientID: ID, tripID: tripID, status: ConvertTDispatchStatusToTripThruStatus(value.status, value.sub_status)); tripthru.UpdateTripStatus(request); Logger.Untab(); if (activeTrips[tripID].status == "completed" || activeTrips[tripID].status == "cancelled" || activeTrips[tripID].status == "rejected" || activeTrips[tripID].status == "missed") activeTrips.Remove(tripID); Logger.EndRequest(null); }