Return handling
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 40s
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 40s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package transformers
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.coopgo.io/coopgo-platform/solidarity-transport/servers/grpc/proto/gen"
|
||||
"git.coopgo.io/coopgo-platform/solidarity-transport/types"
|
||||
)
|
||||
@@ -11,12 +13,13 @@ func BookingTypeToProto(booking *types.Booking) (*gen.SolidarityTransportBooking
|
||||
return nil, err
|
||||
}
|
||||
return &gen.SolidarityTransportBooking{
|
||||
Id: booking.Id,
|
||||
GroupId: booking.GroupId,
|
||||
DriverId: booking.DriverId,
|
||||
PassengerId: booking.PassengerId,
|
||||
Status: booking.Status,
|
||||
Journey: journey,
|
||||
Id: booking.Id,
|
||||
GroupId: booking.GroupId,
|
||||
DriverId: booking.DriverId,
|
||||
PassengerId: booking.PassengerId,
|
||||
Status: booking.Status,
|
||||
ReturnWaitingDuration: int64(booking.ReturnWaitingDuration),
|
||||
Journey: journey,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -26,11 +29,12 @@ func BookingProtoToType(booking *gen.SolidarityTransportBooking) (*types.Booking
|
||||
return nil, err
|
||||
}
|
||||
return &types.Booking{
|
||||
Id: booking.Id,
|
||||
GroupId: booking.GroupId,
|
||||
DriverId: booking.DriverId,
|
||||
PassengerId: booking.PassengerId,
|
||||
Status: booking.Status,
|
||||
Journey: journey,
|
||||
Id: booking.Id,
|
||||
GroupId: booking.GroupId,
|
||||
DriverId: booking.DriverId,
|
||||
PassengerId: booking.PassengerId,
|
||||
Status: booking.Status,
|
||||
ReturnWaitingDuration: time.Duration(booking.ReturnWaitingDuration),
|
||||
Journey: journey,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ func DriverJourneyTypeToProto(j *types.DriverJourney) (*gen.SolidarityTransportD
|
||||
Amount: 0,
|
||||
Currency: "EUR",
|
||||
},
|
||||
Noreturn: j.Noreturn,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -96,5 +97,6 @@ func DriverJourneyProtoToType(j *gen.SolidarityTransportDriverJourney) (*types.D
|
||||
Amount: j.Price.Amount,
|
||||
Currency: j.Price.Currency,
|
||||
},
|
||||
Noreturn: j.Noreturn,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user