solidarity-service/servers/grpc/server/booking_status.go

28 lines
1.0 KiB
Go

package grpcserver
import (
"solidarity-service/internal"
"solidarity-service/servers/grpc/proto"
)
func ConvertInternalToProtoBookingStatus(internalStatus internal.BookingStatus) proto.BookingSolidarityStatus {
switch internalStatus {
case internal.BookingStatusINITIATED:
return proto.BookingSolidarityStatus_INITIATED
case internal.BookingStatusWAITINGPASSENGERCONFIRMATION:
return proto.BookingSolidarityStatus_WAITING_PASSENGER_CONFIRMATION
case internal.BookingStatusWAITINGDRIVERCONFIRMATION:
return proto.BookingSolidarityStatus_WAITING_DRIVER_CONFIRMATION
case internal.BookingStatusCONFIRMED:
return proto.BookingSolidarityStatus_CONFIRMED
case internal.BookingStatusCANCELLED:
return proto.BookingSolidarityStatus_CANCELLED
case internal.BookingStatusCOMPLETEDPENDINGVALIDATION:
return proto.BookingSolidarityStatus_COMPLETED_PENDING_VALIDATION
case internal.BookingStatusVALIDATED:
return proto.BookingSolidarityStatus_VALIDATED
default:
return proto.BookingSolidarityStatus_CONFIRMED
}
}