new grpc functions
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 34s
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 34s
This commit is contained in:
@@ -15,10 +15,12 @@ func (s SolidarityTransportServerImpl) BookDriverJourney(ctx context.Context, re
|
||||
passengerId := req.PassengerId
|
||||
driverId := req.DriverId
|
||||
journeyId := req.DriverJourneyId
|
||||
priceAmount := req.PriceAmount
|
||||
priceCurrency := req.PriceCurrency
|
||||
returnWaitingDuration := time.Duration(req.ReturnWaitingDuration)
|
||||
data := req.Data.AsMap()
|
||||
|
||||
booking, err := s.Handler.BookDriverJourney(passengerId, driverId, journeyId, returnWaitingDuration, data)
|
||||
booking, err := s.Handler.BookDriverJourney(passengerId, driverId, journeyId, returnWaitingDuration, priceAmount, priceCurrency, data)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("issue in BookDriverJourney handler")
|
||||
return nil, status.Errorf(codes.Internal, "could not create booking : %v", err)
|
||||
@@ -76,13 +78,31 @@ func (s SolidarityTransportServerImpl) GetSolidarityTransportBooking(ctx context
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s SolidarityTransportServerImpl) UpdateSolidarityTransportBooking(ctx context.Context, req *gen.UpdateSolidarityTransportBookingRequest) (*gen.UpdateSolidarityTransportBookingResponse, error) {
|
||||
booking := req.Booking
|
||||
b, err := transformers.BookingProtoToType(booking)
|
||||
if err != nil || b == nil {
|
||||
log.Error().Err(err).Msg("issue in UpdateBooking handler")
|
||||
return nil, status.Errorf(codes.NotFound, "cannot update booking : %v", err)
|
||||
}
|
||||
|
||||
err = s.Handler.UpdateBooking(*b)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("issue in UpdateBooking handler")
|
||||
return nil, status.Errorf(codes.NotFound, "issue on update booking : %v", err)
|
||||
}
|
||||
|
||||
return &gen.UpdateSolidarityTransportBookingResponse{}, nil
|
||||
}
|
||||
|
||||
func (s SolidarityTransportServerImpl) UpdateSolidarityTransportBookingStatus(ctx context.Context, req *gen.UpdateSolidarityTransportBookingStatusRequest) (*gen.UpdateSolidarityTransportBookingStatusResponse, error) {
|
||||
bookingid := req.BookingId
|
||||
newStatus := req.NewStatus
|
||||
reason := req.Reason
|
||||
|
||||
err := s.Handler.UpdateBookingStatus(bookingid, newStatus)
|
||||
err := s.Handler.UpdateBookingStatus(bookingid, newStatus, reason)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("issue in GetBooking handler")
|
||||
log.Error().Err(err).Msg("issue in UpdateBookingStatus handler")
|
||||
return nil, status.Errorf(codes.NotFound, "transformer issue on booking : %v", err)
|
||||
}
|
||||
|
||||
|
||||
@@ -28,8 +28,6 @@ func (s SolidarityTransportServerImpl) GetDriverJourneys(ctx context.Context, re
|
||||
return nil, status.Errorf(codes.Internal, "could not get driver journeys : %v", err)
|
||||
}
|
||||
|
||||
log.Trace().Any("driver journeys", driverJourneys).Msg("got driver journeys")
|
||||
|
||||
results := []*gen.SolidarityTransportDriverJourney{}
|
||||
|
||||
for _, j := range driverJourneys {
|
||||
|
||||
Reference in New Issue
Block a user