/**
  * end the activity
  * @param $request
  * @route 'api/activity/endactivity'
  * @return json
  */
 public function endActivity(Request $request)
 {
     $request = $request->all();
     $token = $request['token'];
     $type = $request['type'];
     if (!$type) {
         return response()->json('error', 400);
     }
     if ($type == 'transpo' || $type == 'transport') {
         $iterinary_id = $request['iterinary_id'];
         $destination_name = $request['destination_name'];
         $lng = $request['lng'];
         $lat = $request['lat'];
         $price = $request['price'];
         return UserSessionHandler::endSegment($token, $iterinary_id, $destination_name, $lat, $lng, $price);
     }
     if ($type == 'spot') {
         $iterinary_id = $request['iterinary_id'];
         $price = $request['price'];
         $tips = $request['tips'];
         return UserSessionHandler::endSpotActivity($token, $iterinary_id, $price, $tips);
     }
     if ($type == 'eat') {
         $iterinary_id = $request['iterinary_id'];
         $price = $request['price'];
         $tips = $request['tips'];
         return UserSessionHandler::endFoodActivity($token, $iterinary_id, $price, $tips);
     }
 }