package transformers import ( "git.coopgo.io/coopgo-platform/solidarity-transport/servers/grpc/proto/gen" "git.coopgo.io/coopgo-platform/solidarity-transport/types" ) func BookingTypeToProto(booking *types.Booking) (*gen.SolidarityTransportBooking, error) { journey, err := DriverJourneyTypeToProto(booking.Journey) if err != nil { return nil, err } return &gen.SolidarityTransportBooking{ Id: booking.Id, GroupId: booking.GroupId, DriverId: booking.DriverId, PassengerId: booking.PassengerId, Status: booking.Status, Journey: journey, }, nil } func BookingProtoToType(booking *gen.SolidarityTransportBooking) (*types.Booking, error) { journey, err := DriverJourneyProtoToType(booking.Journey) if err != nil { return nil, err } return &types.Booking{ Id: booking.Id, GroupId: booking.GroupId, DriverId: booking.DriverId, PassengerId: booking.PassengerId, Status: booking.Status, Journey: journey, }, nil }