2023-10-20 11:41:39 +00:00
|
|
|
package grpcserver
|
|
|
|
|
|
|
|
import (
|
|
|
|
"solidarity-service/internal"
|
|
|
|
"solidarity-service/servers/grpc/proto"
|
|
|
|
)
|
|
|
|
|
2024-08-02 13:11:52 +00:00
|
|
|
func ConvertInternalToProtoBookingStatus(internalStatus internal.BookingStatus) proto.BookingSolidarityStatus {
|
2023-10-20 11:41:39 +00:00
|
|
|
switch internalStatus {
|
|
|
|
case internal.BookingStatusINITIATED:
|
2024-08-02 13:11:52 +00:00
|
|
|
return proto.BookingSolidarityStatus_INITIATED
|
2023-10-20 11:41:39 +00:00
|
|
|
case internal.BookingStatusWAITINGPASSENGERCONFIRMATION:
|
2024-08-02 13:11:52 +00:00
|
|
|
return proto.BookingSolidarityStatus_WAITING_PASSENGER_CONFIRMATION
|
2023-10-20 11:41:39 +00:00
|
|
|
case internal.BookingStatusWAITINGDRIVERCONFIRMATION:
|
2024-08-02 13:11:52 +00:00
|
|
|
return proto.BookingSolidarityStatus_WAITING_DRIVER_CONFIRMATION
|
2023-10-20 11:41:39 +00:00
|
|
|
case internal.BookingStatusCONFIRMED:
|
2024-08-02 13:11:52 +00:00
|
|
|
return proto.BookingSolidarityStatus_CONFIRMED
|
2023-10-20 11:41:39 +00:00
|
|
|
case internal.BookingStatusCANCELLED:
|
2024-08-02 13:11:52 +00:00
|
|
|
return proto.BookingSolidarityStatus_CANCELLED
|
2023-10-20 11:41:39 +00:00
|
|
|
case internal.BookingStatusCOMPLETEDPENDINGVALIDATION:
|
2024-08-02 13:11:52 +00:00
|
|
|
return proto.BookingSolidarityStatus_COMPLETED_PENDING_VALIDATION
|
2023-10-20 11:41:39 +00:00
|
|
|
case internal.BookingStatusVALIDATED:
|
2024-08-02 13:11:52 +00:00
|
|
|
return proto.BookingSolidarityStatus_VALIDATED
|
2023-10-20 11:41:39 +00:00
|
|
|
default:
|
2024-08-02 13:11:52 +00:00
|
|
|
return proto.BookingSolidarityStatus_CONFIRMED
|
2023-10-20 11:41:39 +00:00
|
|
|
}
|
|
|
|
}
|