{"action":"created","comment":{"url":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/comments/31994492","id":31994492,"diff_hunk":"@@ -1,5 +1,34 @@\n 'use strict';\n \n-app.controller('CheckoutCtrl', function($scope, Basket) {\n+app.controller('CheckoutCtrl', function($scope, Basket, Order, AuthenticationService) {\n   $scope.basket = Basket;\n+  $scope.currentUser = AuthenticationService.currentUser();\n+  var hour = 60 * 60 * 1000; // 1 Hour in ms\n+  $scope.pickupTime = new Date() + (2 * hour);\n+\n+\n+  $scope.createOrder = function() {\n+    console.log('Building the order...');\n+    var orderItems = [];\n+    angular.forEach($scope.basket.get(), function(item) {\n+      orderItems.push({'menu_id': item.menu, 'menu_item': item.id, 'quantity': item.quantity});\n+    });\n+\n+    // var order = null;\n+    var order = {\n+      'order': {\n+        // 'user_id': $scope.currentUser.id,\n+        // 'menu_id': 2,\n+        'order_time': new Date(),","path":"app/scripts/controllers/checkout.js","position":23,"original_position":23,"commit_id":"08885276331cf8ea4c37d26153cb03fca065b17c","original_commit_id":"08885276331cf8ea4c37d26153cb03fca065b17c","user":{"login":"diraulo","id":4028374,"avatar_url":"https://avatars.githubusercontent.com/u/4028374?v=3","gravatar_id":"","url":"https://api.github.com/users/diraulo","html_url":"https://github.com/diraulo","followers_url":"https://api.github.com/users/diraulo/followers","following_url":"https://api.github.com/users/diraulo/following{/other_user}","gists_url":"https://api.github.com/users/diraulo/gists{/gist_id}","starred_url":"https://api.github.com/users/diraulo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diraulo/subscriptions","organizations_url":"https://api.github.com/users/diraulo/orgs","repos_url":"https://api.github.com/users/diraulo/repos","events_url":"https://api.github.com/users/diraulo/events{/privacy}","received_events_url":"https://api.github.com/users/diraulo/received_events","type":"User","site_admin":false},"body":"check discussions here: https://github.com/AgileVentures/TakeMeAway/pull/31#issuecomment-104643385","created_at":"2015-06-09T09:03:34Z","updated_at":"2015-06-09T09:03:34Z","html_url":"https://github.com/AgileVentures/TMA-client/pull/15#discussion_r31994492","pull_request_url":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/comments/31994492"},"html":{"href":"https://github.com/AgileVentures/TMA-client/pull/15#discussion_r31994492"},"pull_request":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/15","id":37191879,"html_url":"https://github.com/AgileVentures/TMA-client/pull/15","diff_url":"https://github.com/AgileVentures/TMA-client/pull/15.diff","patch_url":"https://github.com/AgileVentures/TMA-client/pull/15.patch","issue_url":"https://api.github.com/repos/AgileVentures/TMA-client/issues/15","number":15,"state":"open","locked":false,"title":"Process and submit orders","user":{"login":"diraulo","id":4028374,"avatar_url":"https://avatars.githubusercontent.com/u/4028374?v=3","gravatar_id":"","url":"https://api.github.com/users/diraulo","html_url":"https://github.com/diraulo","followers_url":"https://api.github.com/users/diraulo/followers","following_url":"https://api.github.com/users/diraulo/following{/other_user}","gists_url":"https://api.github.com/users/diraulo/gists{/gist_id}","starred_url":"https://api.github.com/users/diraulo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diraulo/subscriptions","organizations_url":"https://api.github.com/users/diraulo/orgs","repos_url":"https://api.github.com/users/diraulo/repos","events_url":"https://api.github.com/users/diraulo/events{/privacy}","received_events_url":"https://api.github.com/users/diraulo/received_events","type":"User","site_admin":false},"body":"**PT Story: https://www.pivotaltracker.com/story/show/93267568**\r\n\r\n- Display Menu items images\r\n- Refactor some of the application views\r\n- Add loading bar to indicate request is being processed\r\n- WIP: Checkout order [Getting a `401 (Unauthorized)` from response from server]","created_at":"2015-06-08T20:22:50Z","updated_at":"2015-06-09T09:03:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e378c6ee96898ee42ce45a0386edcbc6a017fa5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/15/commits","review_comments_url":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/15/comments","review_comment_url":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AgileVentures/TMA-client/issues/15/comments","statuses_url":"https://api.github.com/repos/AgileVentures/TMA-client/statuses/08885276331cf8ea4c37d26153cb03fca065b17c","head":{"label":"diraulo:process-and-submit-orders","ref":"process-and-submit-orders","sha":"08885276331cf8ea4c37d26153cb03fca065b17c","user":{"login":"diraulo","id":4028374,"avatar_url":"https://avatars.githubusercontent.com/u/4028374?v=3","gravatar_id":"","url":"https://api.github.com/users/diraulo","html_url":"https://github.com/diraulo","followers_url":"https://api.github.com/users/diraulo/followers","following_url":"https://api.github.com/users/diraulo/following{/other_user}","gists_url":"https://api.github.com/users/diraulo/gists{/gist_id}","starred_url":"https://api.github.com/users/diraulo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diraulo/subscriptions","organizations_url":"https://api.github.com/users/diraulo/orgs","repos_url":"https://api.github.com/users/diraulo/repos","events_url":"https://api.github.com/users/diraulo/events{/privacy}","received_events_url":"https://api.github.com/users/diraulo/received_events","type":"User","site_admin":false},"repo":{"id":34634460,"name":"TMA-client","full_name":"diraulo/TMA-client","owner":{"login":"diraulo","id":4028374,"avatar_url":"https://avatars.githubusercontent.com/u/4028374?v=3","gravatar_id":"","url":"https://api.github.com/users/diraulo","html_url":"https://github.com/diraulo","followers_url":"https://api.github.com/users/diraulo/followers","following_url":"https://api.github.com/users/diraulo/following{/other_user}","gists_url":"https://api.github.com/users/diraulo/gists{/gist_id}","starred_url":"https://api.github.com/users/diraulo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diraulo/subscriptions","organizations_url":"https://api.github.com/users/diraulo/orgs","repos_url":"https://api.github.com/users/diraulo/repos","events_url":"https://api.github.com/users/diraulo/events{/privacy}","received_events_url":"https://api.github.com/users/diraulo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diraulo/TMA-client","description":"Client application for TakeMeAway API","fork":true,"url":"https://api.github.com/repos/diraulo/TMA-client","forks_url":"https://api.github.com/repos/diraulo/TMA-client/forks","keys_url":"https://api.github.com/repos/diraulo/TMA-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diraulo/TMA-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diraulo/TMA-client/teams","hooks_url":"https://api.github.com/repos/diraulo/TMA-client/hooks","issue_events_url":"https://api.github.com/repos/diraulo/TMA-client/issues/events{/number}","events_url":"https://api.github.com/repos/diraulo/TMA-client/events","assignees_url":"https://api.github.com/repos/diraulo/TMA-client/assignees{/user}","branches_url":"https://api.github.com/repos/diraulo/TMA-client/branches{/branch}","tags_url":"https://api.github.com/repos/diraulo/TMA-client/tags","blobs_url":"https://api.github.com/repos/diraulo/TMA-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diraulo/TMA-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diraulo/TMA-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/diraulo/TMA-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diraulo/TMA-client/statuses/{sha}","languages_url":"https://api.github.com/repos/diraulo/TMA-client/languages","stargazers_url":"https://api.github.com/repos/diraulo/TMA-client/stargazers","contributors_url":"https://api.github.com/repos/diraulo/TMA-client/contributors","subscribers_url":"https://api.github.com/repos/diraulo/TMA-client/subscribers","subscription_url":"https://api.github.com/repos/diraulo/TMA-client/subscription","commits_url":"https://api.github.com/repos/diraulo/TMA-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/diraulo/TMA-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/diraulo/TMA-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/diraulo/TMA-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/diraulo/TMA-client/contents/{+path}","compare_url":"https://api.github.com/repos/diraulo/TMA-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diraulo/TMA-client/merges","archive_url":"https://api.github.com/repos/diraulo/TMA-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diraulo/TMA-client/downloads","issues_url":"https://api.github.com/repos/diraulo/TMA-client/issues{/number}","pulls_url":"https://api.github.com/repos/diraulo/TMA-client/pulls{/number}","milestones_url":"https://api.github.com/repos/diraulo/TMA-client/milestones{/number}","notifications_url":"https://api.github.com/repos/diraulo/TMA-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diraulo/TMA-client/labels{/name}","releases_url":"https://api.github.com/repos/diraulo/TMA-client/releases{/id}","created_at":"2015-04-26T22:32:36Z","updated_at":"2015-06-04T23:57:13Z","pushed_at":"2015-06-08T20:31:04Z","git_url":"git://github.com/diraulo/TMA-client.git","ssh_url":"git@github.com:diraulo/TMA-client.git","clone_url":"https://github.com/diraulo/TMA-client.git","svn_url":"https://github.com/diraulo/TMA-client","homepage":null,"size":333,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"AgileVentures:develop","ref":"develop","sha":"8aa736101bd99b1c0a47b82ea25958a3f245325b","user":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"repo":{"id":34601545,"name":"TMA-client","full_name":"AgileVentures/TMA-client","owner":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AgileVentures/TMA-client","description":"Client application for TakeMeAway API","fork":false,"url":"https://api.github.com/repos/AgileVentures/TMA-client","forks_url":"https://api.github.com/repos/AgileVentures/TMA-client/forks","keys_url":"https://api.github.com/repos/AgileVentures/TMA-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AgileVentures/TMA-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AgileVentures/TMA-client/teams","hooks_url":"https://api.github.com/repos/AgileVentures/TMA-client/hooks","issue_events_url":"https://api.github.com/repos/AgileVentures/TMA-client/issues/events{/number}","events_url":"https://api.github.com/repos/AgileVentures/TMA-client/events","assignees_url":"https://api.github.com/repos/AgileVentures/TMA-client/assignees{/user}","branches_url":"https://api.github.com/repos/AgileVentures/TMA-client/branches{/branch}","tags_url":"https://api.github.com/repos/AgileVentures/TMA-client/tags","blobs_url":"https://api.github.com/repos/AgileVentures/TMA-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AgileVentures/TMA-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AgileVentures/TMA-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/AgileVentures/TMA-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AgileVentures/TMA-client/statuses/{sha}","languages_url":"https://api.github.com/repos/AgileVentures/TMA-client/languages","stargazers_url":"https://api.github.com/repos/AgileVentures/TMA-client/stargazers","contributors_url":"https://api.github.com/repos/AgileVentures/TMA-client/contributors","subscribers_url":"https://api.github.com/repos/AgileVentures/TMA-client/subscribers","subscription_url":"https://api.github.com/repos/AgileVentures/TMA-client/subscription","commits_url":"https://api.github.com/repos/AgileVentures/TMA-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/AgileVentures/TMA-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/AgileVentures/TMA-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/AgileVentures/TMA-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/AgileVentures/TMA-client/contents/{+path}","compare_url":"https://api.github.com/repos/AgileVentures/TMA-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AgileVentures/TMA-client/merges","archive_url":"https://api.github.com/repos/AgileVentures/TMA-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AgileVentures/TMA-client/downloads","issues_url":"https://api.github.com/repos/AgileVentures/TMA-client/issues{/number}","pulls_url":"https://api.github.com/repos/AgileVentures/TMA-client/pulls{/number}","milestones_url":"https://api.github.com/repos/AgileVentures/TMA-client/milestones{/number}","notifications_url":"https://api.github.com/repos/AgileVentures/TMA-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AgileVentures/TMA-client/labels{/name}","releases_url":"https://api.github.com/repos/AgileVentures/TMA-client/releases{/id}","created_at":"2015-04-26T07:03:12Z","updated_at":"2015-05-25T20:37:28Z","pushed_at":"2015-06-08T20:31:04Z","git_url":"git://github.com/AgileVentures/TMA-client.git","ssh_url":"git@github.com:AgileVentures/TMA-client.git","clone_url":"https://github.com/AgileVentures/TMA-client.git","svn_url":"https://github.com/AgileVentures/TMA-client","homepage":null,"size":431,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/15"},"html":{"href":"https://github.com/AgileVentures/TMA-client/pull/15"},"issue":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/issues/15"},"comments":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/AgileVentures/TMA-client/statuses/08885276331cf8ea4c37d26153cb03fca065b17c"}}}}