28 lines
941 B
Go
28 lines
941 B
Go
package grpcserver
|
|
|
|
import (
|
|
"solidarity-service/internal"
|
|
"solidarity-service/servers/grpc/proto"
|
|
)
|
|
|
|
func ConvertInternalToProtoBookingStatus(internalStatus internal.BookingStatus) proto.BookingStatus {
|
|
switch internalStatus {
|
|
case internal.BookingStatusINITIATED:
|
|
return proto.BookingStatus_INITIATED
|
|
case internal.BookingStatusWAITINGPASSENGERCONFIRMATION:
|
|
return proto.BookingStatus_WAITING_PASSENGER_CONFIRMATION
|
|
case internal.BookingStatusWAITINGDRIVERCONFIRMATION:
|
|
return proto.BookingStatus_WAITING_DRIVER_CONFIRMATION
|
|
case internal.BookingStatusCONFIRMED:
|
|
return proto.BookingStatus_CONFIRMED
|
|
case internal.BookingStatusCANCELLED:
|
|
return proto.BookingStatus_CANCELLED
|
|
case internal.BookingStatusCOMPLETEDPENDINGVALIDATION:
|
|
return proto.BookingStatus_COMPLETED_PENDING_VALIDATION
|
|
case internal.BookingStatusVALIDATED:
|
|
return proto.BookingStatus_VALIDATED
|
|
default:
|
|
return proto.BookingStatus_CONFIRMED
|
|
}
|
|
}
|