Upstream sync

This commit is contained in:
Senad Uka
2018-06-01 10:39:46 +02:00
parent f1ac874276
commit 69853b026b
20 changed files with 427 additions and 594 deletions

View File

@@ -289,7 +289,7 @@ func (c *controller) handle(ctx echo.Context) error {
requestRide.Destination = newOrigin
}
if c.cfg.LyftProd.UserUUID != createdUser.ID {
if createdUser.Test {
resp, err = c.tnc.Lyft.RequestRide(requestRide)
} else {
fmt.Println("In Production")
@@ -404,7 +404,7 @@ func (c *controller) handle(ctx echo.Context) error {
newRide.Passenger.LastName = " "
newRide.Passenger.PhoneNumber = *user.PhoneNumber
if c.cfg.LyftProd.UserUUID != createdUser.ID {
if createdUser.Test {
newRide, err = c.tnc.Lyft.RequestRide(newRide)
} else {
fmt.Println("In Production")
@@ -514,7 +514,7 @@ func (c *controller) handleRawLyft(ctx echo.Context) error {
}
var lyftRide viewmodel.RideRequest
if ride.CreatedUser.ID != c.cfg.LyftProd.UserUUID {
if user.Test {
lyftRide, err = c.tnc.Lyft.GetRideDetails(viewmodel.RideRequest{RideID: ride.InternalID})
} else {
fmt.Println("In Production")
@@ -546,7 +546,7 @@ func (c *controller) handleRideETA(ctx echo.Context) error {
if ride.Status.Key == "accepted" || ride.Status.Key == "pickedUp" || ride.Status.Key == "arrived" {
var lyftRide viewmodel.RideRequest
if ride.CreatedUser.ID != c.cfg.LyftProd.UserUUID {
if user.Test {
lyftRide, err = c.tnc.Lyft.GetRideDetails(viewmodel.RideRequest{RideID: ride.InternalID})
} else {
fmt.Println("In Production")
@@ -614,7 +614,7 @@ func (c *controller) handleCancel(ctx echo.Context) error {
requestRide.RideID = "s_" + ride.InternalID
}
if ride.CreatedUser.ID != c.cfg.LyftProd.UserUUID {
if user.Test {
err = c.tnc.Lyft.CancelRide(requestRide)
if err != nil && err.Error() == "ride_not_found" {
err = nil
@@ -719,7 +719,7 @@ func (c *controller) handleRide(ctx echo.Context) error {
if ride.Status.Key == "accepted" || ride.Status.Key == "pickedUp" || ride.Status.Key == "arrived" {
var lyftRide viewmodel.RideRequest
if ride.CreatedUser.ID != c.cfg.LyftProd.UserUUID {
if user.Test {
lyftRide, err = c.tnc.Lyft.GetRideDetails(viewmodel.RideRequest{RideID: ride.InternalID})
} else {
fmt.Println("In Production")
@@ -858,7 +858,7 @@ func (c *controller) handleReady(ctx echo.Context) error {
}
var lyftRide viewmodel.RideRequest
if ride.CreatedUser.ID != c.cfg.LyftProd.UserUUID {
if user.Test {
lyftRide, err = c.tnc.Lyft.GetRideDetails(viewmodel.RideRequest{RideID: ride.InternalID})
} else {
fmt.Println("In Production")
@@ -880,7 +880,7 @@ func (c *controller) handleReady(ctx echo.Context) error {
lyftRide.Passenger.PhoneNumber = *nextRide.User.PhoneNumber
lyftRide.RideType = "lyft"
if c.cfg.LyftProd.UserUUID != nextRide.CreatedUser.ID {
if user.Test {
lyftRide, err = c.tnc.Lyft.RequestRide(lyftRide)
} else {
fmt.Println("In Production")