fix conflict with fleets bookings

This commit is contained in:
2024-08-02 15:11:30 +02:00
parent f1d60881e5
commit e699ea7192
12 changed files with 976 additions and 964 deletions

View File

@@ -132,7 +132,7 @@ func (s SilvermobiGRPCService) GetAccountType(ctx context.Context, req *grpcprot
log.Info().
Str("User ID", id).
Msg("GetAccountType")
if req.Request == nil || !*req.Request {
if req.Request == false || !req.Request {
return nil, status.Errorf(codes.InvalidArgument, "request arg should be true")
}
account_type, err := s.Handler.GetAccountType(ctx, id)
@@ -150,7 +150,7 @@ func (s SilvermobiGRPCService) GetAccountType(ctx context.Context, req *grpcprot
}
response := &grpcproto.AccountTypeResponse{
Type: &responseType,
Type: responseType,
}
return response, nil

View File

@@ -23,11 +23,11 @@ func (s *SolidarityService) SetDriverPunctualAvailabilities(ctx context.Context,
return resp, err
}
func (s *SolidarityService) CreateBooking(ctx context.Context, req *proto.CreateBookingRequest) (resp *proto.CreateBookingResponse, err error) {
func (s *SolidarityService) CreateBooking(ctx context.Context, req *proto.CreateBookingSolidarityRequest) (resp *proto.CreateBookingSolidarityResponse, err error) {
log.Info().
Str("Booking ID", req.Booking.Id).
Msg("CreateBooking")
resp, err = s.SolidarityClient.CreateBooking(ctx, req)
resp, err = s.SolidarityClient.CreateBookingSolidarity(ctx, req)
if err == nil {
_ = s.Handler.SendNotification(req.Booking.DriverId, "Silvermobi", "Vous avez reçu une demande de trajet. \n Pour plus de détails, veuillez consulter l'interface \"Mes Trajets\" dans l'application SilverMobi.")
err = s.Handler.SendEmail(req.Booking.DriverId, "Silvermobi", "Vous avez reçu une demande de trajet. \n Pour plus de détails, veuillez consulter l'interface \"Mes Trajets\" dans l'application SilverMobi.")
@@ -36,19 +36,19 @@ func (s *SolidarityService) CreateBooking(ctx context.Context, req *proto.Create
return resp, err
}
func (s *SolidarityService) UpdateBooking(ctx context.Context, req *proto.UpdateBookingRequest) (resp *proto.UpdateBookingResponse, err error) {
func (s *SolidarityService) UpdateBooking(ctx context.Context, req *proto.UpdateBookingSolidarityRequest) (resp *proto.UpdateBookingSolidarityResponse, err error) {
log.Info().
Str("Booking ID", req.BookingId).
Msg("UpdateBooking")
resp, err = s.SolidarityClient.UpdateBooking(ctx, req)
resp, err = s.SolidarityClient.UpdateBookingSolidarity(ctx, req)
return resp, err
}
func (s *SolidarityService) GetBooking(ctx context.Context, req *proto.GetBookingRequest) (resp *proto.GetBookingResponse, err error) {
func (s *SolidarityService) GetBooking(ctx context.Context, req *proto.GetBookingSolidarityRequest) (resp *proto.GetBookingSolidarityResponse, err error) {
log.Info().
Str("Booking ID", req.BookingId).
Msg("GetBooking")
resp, err = s.SolidarityClient.GetBooking(ctx, req)
resp, err = s.SolidarityClient.GetBookingSolidarity(ctx, req)
return resp, err
}