{"action":"created","comment":{"url":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/comments/39236539","id":39236539,"diff_hunk":"@@ -44,11 +47,101 @@ def valet_pick_up\n     end\n   end\n \n+  #user confirms auth code\n+  def car_pick_up\n+    @request = User.find(params[:user_id]).requests.find(params[:id])\n+    auth_code = request_auth_code_params[:auth_code]\n+    if @request.auth_code_check?(auth_code)\n+      @request.record_time\n+      @request.auth_code_matched_pick_up!\n+    else\n+      render json: {error: \"Incorrect auth code\"}, status: :bad_request\n+    end\n+  end\n+\n+  #valet has parked the car\n+  def car_parked\n+    valet = Valet.find(params[:valet_id])\n+    bay_number = valet_car_parked_params[:bay_number]\n+    @request = Request.find_by!('valet_pick_up_id = ? AND id = ?', valet.id, params[:id])\n+    @request.update(bay_number: bay_number)\n+    @request.keys_dropped!\n+    render 'okay'\n+  end\n+  #user requests drop off\n+  def request_drop_off\n+    @request = User.find(params[:user_id]).requests.find(params[:id])\n+    destination = request_create_params\n+    @request.drop_off_requested\n+    destination_location = Location.new(latitude: destination[:latitude], longitude: destination[:longitude])\n+    @request.update(destination_location: destination_location)\n+    @request.record_time(true)\n+    @request.calculate_total\n+  end\n+  #valet accepts drop off\n+  def valet_drop_off\n+    valet = Valet.find(params[:valet_id])\n+    @request = Request.find(params[:id])\n+    @request.drop_off_retrieved!\n+    @request.update(valet_drop_off: valet)\n+    @request.calculate_total\n+  end\n+\n+  #valet has arrived at the car\n+  def valet_delivery\n+    valet = Valet.find(params[:valet_id])\n+    @request = Request.find_by!('valet_drop_off_id = ? AND id = ?', valet.id, params[:id])\n+    @request.generate_auth_code(true)","path":"app/controllers/requests_controller.rb","position":70,"original_position":70,"commit_id":"de0befe2f5b0870f2d7390765fd324db02091c51","original_commit_id":"de0befe2f5b0870f2d7390765fd324db02091c51","user":{"login":"ggharry","id":1697380,"avatar_url":"https://avatars.githubusercontent.com/u/1697380?v=3","gravatar_id":"","url":"https://api.github.com/users/ggharry","html_url":"https://github.com/ggharry","followers_url":"https://api.github.com/users/ggharry/followers","following_url":"https://api.github.com/users/ggharry/following{/other_user}","gists_url":"https://api.github.com/users/ggharry/gists{/gist_id}","starred_url":"https://api.github.com/users/ggharry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggharry/subscriptions","organizations_url":"https://api.github.com/users/ggharry/orgs","repos_url":"https://api.github.com/users/ggharry/repos","events_url":"https://api.github.com/users/ggharry/events{/privacy}","received_events_url":"https://api.github.com/users/ggharry/received_events","type":"User","site_admin":false},"body":"Why do you need to put a boolean as a param?","created_at":"2015-09-11T02:28:18Z","updated_at":"2015-09-11T02:28:18Z","html_url":"https://github.com/WDI-HK-8/VALA-api/pull/8#discussion_r39236539","pull_request_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/comments/39236539"},"html":{"href":"https://github.com/WDI-HK-8/VALA-api/pull/8#discussion_r39236539"},"pull_request":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/8","id":44665382,"html_url":"https://github.com/WDI-HK-8/VALA-api/pull/8","diff_url":"https://github.com/WDI-HK-8/VALA-api/pull/8.diff","patch_url":"https://github.com/WDI-HK-8/VALA-api/pull/8.patch","issue_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues/8","number":8,"state":"open","locked":false,"title":"Requests","user":{"login":"teelu","id":5920331,"avatar_url":"https://avatars.githubusercontent.com/u/5920331?v=3","gravatar_id":"","url":"https://api.github.com/users/teelu","html_url":"https://github.com/teelu","followers_url":"https://api.github.com/users/teelu/followers","following_url":"https://api.github.com/users/teelu/following{/other_user}","gists_url":"https://api.github.com/users/teelu/gists{/gist_id}","starred_url":"https://api.github.com/users/teelu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teelu/subscriptions","organizations_url":"https://api.github.com/users/teelu/orgs","repos_url":"https://api.github.com/users/teelu/repos","events_url":"https://api.github.com/users/teelu/events{/privacy}","received_events_url":"https://api.github.com/users/teelu/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-10T13:11:29Z","updated_at":"2015-09-11T02:28:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"850f2abfc8eff23ec08ecf6be315d7e6840eddb4","assignee":{"login":"ggharry","id":1697380,"avatar_url":"https://avatars.githubusercontent.com/u/1697380?v=3","gravatar_id":"","url":"https://api.github.com/users/ggharry","html_url":"https://github.com/ggharry","followers_url":"https://api.github.com/users/ggharry/followers","following_url":"https://api.github.com/users/ggharry/following{/other_user}","gists_url":"https://api.github.com/users/ggharry/gists{/gist_id}","starred_url":"https://api.github.com/users/ggharry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggharry/subscriptions","organizations_url":"https://api.github.com/users/ggharry/orgs","repos_url":"https://api.github.com/users/ggharry/repos","events_url":"https://api.github.com/users/ggharry/events{/privacy}","received_events_url":"https://api.github.com/users/ggharry/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/8/commits","review_comments_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/8/comments","review_comment_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues/8/comments","statuses_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/statuses/de0befe2f5b0870f2d7390765fd324db02091c51","head":{"label":"WDI-HK-8:requests","ref":"requests","sha":"de0befe2f5b0870f2d7390765fd324db02091c51","user":{"login":"WDI-HK-8","id":12110100,"avatar_url":"https://avatars.githubusercontent.com/u/12110100?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-HK-8","html_url":"https://github.com/WDI-HK-8","followers_url":"https://api.github.com/users/WDI-HK-8/followers","following_url":"https://api.github.com/users/WDI-HK-8/following{/other_user}","gists_url":"https://api.github.com/users/WDI-HK-8/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-HK-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-HK-8/subscriptions","organizations_url":"https://api.github.com/users/WDI-HK-8/orgs","repos_url":"https://api.github.com/users/WDI-HK-8/repos","events_url":"https://api.github.com/users/WDI-HK-8/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-HK-8/received_events","type":"Organization","site_admin":false},"repo":{"id":42048110,"name":"VALA-api","full_name":"WDI-HK-8/VALA-api","owner":{"login":"WDI-HK-8","id":12110100,"avatar_url":"https://avatars.githubusercontent.com/u/12110100?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-HK-8","html_url":"https://github.com/WDI-HK-8","followers_url":"https://api.github.com/users/WDI-HK-8/followers","following_url":"https://api.github.com/users/WDI-HK-8/following{/other_user}","gists_url":"https://api.github.com/users/WDI-HK-8/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-HK-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-HK-8/subscriptions","organizations_url":"https://api.github.com/users/WDI-HK-8/orgs","repos_url":"https://api.github.com/users/WDI-HK-8/repos","events_url":"https://api.github.com/users/WDI-HK-8/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-HK-8/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WDI-HK-8/VALA-api","description":"","fork":false,"url":"https://api.github.com/repos/WDI-HK-8/VALA-api","forks_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/forks","keys_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/teams","hooks_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/hooks","issue_events_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues/events{/number}","events_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/events","assignees_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/assignees{/user}","branches_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/branches{/branch}","tags_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/tags","blobs_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/statuses/{sha}","languages_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/languages","stargazers_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/stargazers","contributors_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/contributors","subscribers_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/subscribers","subscription_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/subscription","commits_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/contents/{+path}","compare_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/merges","archive_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/downloads","issues_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues{/number}","pulls_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls{/number}","milestones_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/milestones{/number}","notifications_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/labels{/name}","releases_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/releases{/id}","created_at":"2015-09-07T11:00:08Z","updated_at":"2015-09-08T00:04:39Z","pushed_at":"2015-09-11T01:47:09Z","git_url":"git://github.com/WDI-HK-8/VALA-api.git","ssh_url":"git@github.com:WDI-HK-8/VALA-api.git","clone_url":"https://github.com/WDI-HK-8/VALA-api.git","svn_url":"https://github.com/WDI-HK-8/VALA-api","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"WDI-HK-8:master","ref":"master","sha":"3eef4065951a149dc4ab74a67fc24b6a3a425868","user":{"login":"WDI-HK-8","id":12110100,"avatar_url":"https://avatars.githubusercontent.com/u/12110100?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-HK-8","html_url":"https://github.com/WDI-HK-8","followers_url":"https://api.github.com/users/WDI-HK-8/followers","following_url":"https://api.github.com/users/WDI-HK-8/following{/other_user}","gists_url":"https://api.github.com/users/WDI-HK-8/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-HK-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-HK-8/subscriptions","organizations_url":"https://api.github.com/users/WDI-HK-8/orgs","repos_url":"https://api.github.com/users/WDI-HK-8/repos","events_url":"https://api.github.com/users/WDI-HK-8/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-HK-8/received_events","type":"Organization","site_admin":false},"repo":{"id":42048110,"name":"VALA-api","full_name":"WDI-HK-8/VALA-api","owner":{"login":"WDI-HK-8","id":12110100,"avatar_url":"https://avatars.githubusercontent.com/u/12110100?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-HK-8","html_url":"https://github.com/WDI-HK-8","followers_url":"https://api.github.com/users/WDI-HK-8/followers","following_url":"https://api.github.com/users/WDI-HK-8/following{/other_user}","gists_url":"https://api.github.com/users/WDI-HK-8/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-HK-8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-HK-8/subscriptions","organizations_url":"https://api.github.com/users/WDI-HK-8/orgs","repos_url":"https://api.github.com/users/WDI-HK-8/repos","events_url":"https://api.github.com/users/WDI-HK-8/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-HK-8/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WDI-HK-8/VALA-api","description":"","fork":false,"url":"https://api.github.com/repos/WDI-HK-8/VALA-api","forks_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/forks","keys_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/teams","hooks_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/hooks","issue_events_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues/events{/number}","events_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/events","assignees_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/assignees{/user}","branches_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/branches{/branch}","tags_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/tags","blobs_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/statuses/{sha}","languages_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/languages","stargazers_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/stargazers","contributors_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/contributors","subscribers_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/subscribers","subscription_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/subscription","commits_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/contents/{+path}","compare_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/merges","archive_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/downloads","issues_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues{/number}","pulls_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls{/number}","milestones_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/milestones{/number}","notifications_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/labels{/name}","releases_url":"https://api.github.com/repos/WDI-HK-8/VALA-api/releases{/id}","created_at":"2015-09-07T11:00:08Z","updated_at":"2015-09-08T00:04:39Z","pushed_at":"2015-09-11T01:47:09Z","git_url":"git://github.com/WDI-HK-8/VALA-api.git","ssh_url":"git@github.com:WDI-HK-8/VALA-api.git","clone_url":"https://github.com/WDI-HK-8/VALA-api.git","svn_url":"https://github.com/WDI-HK-8/VALA-api","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/8"},"html":{"href":"https://github.com/WDI-HK-8/VALA-api/pull/8"},"issue":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues/8"},"comments":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/WDI-HK-8/VALA-api/statuses/de0befe2f5b0870f2d7390765fd324db02091c51"}}}}