{"action":"created","comment":{"url":"https://api.github.com/repos/andela/prometheus-ah/pulls/comments/218887559","pull_request_review_id":156927207,"id":218887559,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODg4NzU1OQ==","diff_hunk":"@@ -0,0 +1,12 @@\n+import express from 'express';\n+import ReadingStatsController from '../../controllers/ReadingStatsController';\n+import OptionalAuthentication from '../../middlewares/validations/OptionalAuthentication';\n+import QueryValidation from '../../middlewares/validations/QueryValidation';\n+\n+const router = express.Router();\n+\n+router.get('/readstats', OptionalAuthentication.auth,\n+  QueryValidation.readStatsValidation,\n+  ReadingStatsController.getAllStats);","path":"server/routes/api/readStats.js","position":10,"original_position":10,"commit_id":"2492acf12d0d548be9302de0232148ede31688ea","original_commit_id":"2492acf12d0d548be9302de0232148ede31688ea","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Expected a newline before ')'  function-paren-newline","created_at":"2018-09-19T17:08:39Z","updated_at":"2018-09-19T17:08:39Z","html_url":"https://github.com/andela/prometheus-ah/pull/36#discussion_r218887559","pull_request_url":"https://api.github.com/repos/andela/prometheus-ah/pulls/36","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/prometheus-ah/pulls/comments/218887559"},"html":{"href":"https://github.com/andela/prometheus-ah/pull/36#discussion_r218887559"},"pull_request":{"href":"https://api.github.com/repos/andela/prometheus-ah/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/andela/prometheus-ah/pulls/36","id":216556242,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NTU2MjQy","html_url":"https://github.com/andela/prometheus-ah/pull/36","diff_url":"https://github.com/andela/prometheus-ah/pull/36.diff","patch_url":"https://github.com/andela/prometheus-ah/pull/36.patch","issue_url":"https://api.github.com/repos/andela/prometheus-ah/issues/36","number":36,"state":"open","locked":false,"title":"#159987753 users can get their reading stats","user":{"login":"DinmaOtutu","id":39683587,"node_id":"MDQ6VXNlcjM5NjgzNTg3","avatar_url":"https://avatars3.githubusercontent.com/u/39683587?v=4","gravatar_id":"","url":"https://api.github.com/users/DinmaOtutu","html_url":"https://github.com/DinmaOtutu","followers_url":"https://api.github.com/users/DinmaOtutu/followers","following_url":"https://api.github.com/users/DinmaOtutu/following{/other_user}","gists_url":"https://api.github.com/users/DinmaOtutu/gists{/gist_id}","starred_url":"https://api.github.com/users/DinmaOtutu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DinmaOtutu/subscriptions","organizations_url":"https://api.github.com/users/DinmaOtutu/orgs","repos_url":"https://api.github.com/users/DinmaOtutu/repos","events_url":"https://api.github.com/users/DinmaOtutu/events{/privacy}","received_events_url":"https://api.github.com/users/DinmaOtutu/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\n- Users should be able to get their reading stats.\r\n\r\n#### Description of tasks to be completed\r\n- User's userId is logged to the ReadView model when they view an article\r\n- Users can get their reading stats.\r\n- Reading stats include the following\r\n- The articles a user has read\r\n\r\n#### How can this be manually tested\r\n- After cloning the app\r\n- run npm install to install all the dependencies\r\n- install and setup Postgresql\r\n- create a .env file using the .envsample file\r\n- on Postman, log in as a user and view an article at /api/articles/:article-slug\r\n- Goto /api/readstats to view the reading stats of the user\r\n\r\n#### Relevant Pivotal Tracker stories\r\n- #159987753","created_at":"2018-09-19T08:35:06Z","updated_at":"2018-09-19T17:08:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fad1c91c45ea7406ba084396b9cbf6e3d6147020","assignee":null,"assignees":[],"requested_reviewers":[{"login":"eshaibu","id":25608317,"node_id":"MDQ6VXNlcjI1NjA4MzE3","avatar_url":"https://avatars3.githubusercontent.com/u/25608317?v=4","gravatar_id":"","url":"https://api.github.com/users/eshaibu","html_url":"https://github.com/eshaibu","followers_url":"https://api.github.com/users/eshaibu/followers","following_url":"https://api.github.com/users/eshaibu/following{/other_user}","gists_url":"https://api.github.com/users/eshaibu/gists{/gist_id}","starred_url":"https://api.github.com/users/eshaibu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eshaibu/subscriptions","organizations_url":"https://api.github.com/users/eshaibu/orgs","repos_url":"https://api.github.com/users/eshaibu/repos","events_url":"https://api.github.com/users/eshaibu/events{/privacy}","received_events_url":"https://api.github.com/users/eshaibu/received_events","type":"User","site_admin":false},{"login":"justega247","id":31142281,"node_id":"MDQ6VXNlcjMxMTQyMjgx","avatar_url":"https://avatars3.githubusercontent.com/u/31142281?v=4","gravatar_id":"","url":"https://api.github.com/users/justega247","html_url":"https://github.com/justega247","followers_url":"https://api.github.com/users/justega247/followers","following_url":"https://api.github.com/users/justega247/following{/other_user}","gists_url":"https://api.github.com/users/justega247/gists{/gist_id}","starred_url":"https://api.github.com/users/justega247/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justega247/subscriptions","organizations_url":"https://api.github.com/users/justega247/orgs","repos_url":"https://api.github.com/users/justega247/repos","events_url":"https://api.github.com/users/justega247/events{/privacy}","received_events_url":"https://api.github.com/users/justega247/received_events","type":"User","site_admin":false},{"login":"omobosteven","id":33634109,"node_id":"MDQ6VXNlcjMzNjM0MTA5","avatar_url":"https://avatars0.githubusercontent.com/u/33634109?v=4","gravatar_id":"","url":"https://api.github.com/users/omobosteven","html_url":"https://github.com/omobosteven","followers_url":"https://api.github.com/users/omobosteven/followers","following_url":"https://api.github.com/users/omobosteven/following{/other_user}","gists_url":"https://api.github.com/users/omobosteven/gists{/gist_id}","starred_url":"https://api.github.com/users/omobosteven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omobosteven/subscriptions","organizations_url":"https://api.github.com/users/omobosteven/orgs","repos_url":"https://api.github.com/users/omobosteven/repos","events_url":"https://api.github.com/users/omobosteven/events{/privacy}","received_events_url":"https://api.github.com/users/omobosteven/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1054776816,"node_id":"MDU6TGFiZWwxMDU0Nzc2ODE2","url":"https://api.github.com/repos/andela/prometheus-ah/labels/Work%20in%20Progress","name":"Work in Progress","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/andela/prometheus-ah/pulls/36/commits","review_comments_url":"https://api.github.com/repos/andela/prometheus-ah/pulls/36/comments","review_comment_url":"https://api.github.com/repos/andela/prometheus-ah/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/prometheus-ah/issues/36/comments","statuses_url":"https://api.github.com/repos/andela/prometheus-ah/statuses/2492acf12d0d548be9302de0232148ede31688ea","head":{"label":"andela:ft-reading-stats-159987753","ref":"ft-reading-stats-159987753","sha":"2492acf12d0d548be9302de0232148ede31688ea","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":145832303,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MzIzMDM=","name":"prometheus-ah","full_name":"andela/prometheus-ah","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/prometheus-ah","description":null,"fork":false,"url":"https://api.github.com/repos/andela/prometheus-ah","forks_url":"https://api.github.com/repos/andela/prometheus-ah/forks","keys_url":"https://api.github.com/repos/andela/prometheus-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/prometheus-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/prometheus-ah/teams","hooks_url":"https://api.github.com/repos/andela/prometheus-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/prometheus-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/prometheus-ah/events","assignees_url":"https://api.github.com/repos/andela/prometheus-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/prometheus-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/prometheus-ah/tags","blobs_url":"https://api.github.com/repos/andela/prometheus-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/prometheus-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/prometheus-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/prometheus-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/prometheus-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/prometheus-ah/languages","stargazers_url":"https://api.github.com/repos/andela/prometheus-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/prometheus-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/prometheus-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/prometheus-ah/subscription","commits_url":"https://api.github.com/repos/andela/prometheus-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/prometheus-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/prometheus-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/prometheus-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/prometheus-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/prometheus-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/prometheus-ah/merges","archive_url":"https://api.github.com/repos/andela/prometheus-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/prometheus-ah/downloads","issues_url":"https://api.github.com/repos/andela/prometheus-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/prometheus-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/prometheus-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/prometheus-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/prometheus-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/prometheus-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/prometheus-ah/deployments","created_at":"2018-08-23T09:34:39Z","updated_at":"2018-09-19T11:56:08Z","pushed_at":"2018-09-19T17:02:26Z","git_url":"git://github.com/andela/prometheus-ah.git","ssh_url":"git@github.com:andela/prometheus-ah.git","clone_url":"https://github.com/andela/prometheus-ah.git","svn_url":"https://github.com/andela/prometheus-ah","homepage":null,"size":606,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":1,"open_issues":6,"watchers":2,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"3bcda826d1e7fd5afe28d35e5e408bc143b66aa3","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":145832303,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MzIzMDM=","name":"prometheus-ah","full_name":"andela/prometheus-ah","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/prometheus-ah","description":null,"fork":false,"url":"https://api.github.com/repos/andela/prometheus-ah","forks_url":"https://api.github.com/repos/andela/prometheus-ah/forks","keys_url":"https://api.github.com/repos/andela/prometheus-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/prometheus-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/prometheus-ah/teams","hooks_url":"https://api.github.com/repos/andela/prometheus-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/prometheus-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/prometheus-ah/events","assignees_url":"https://api.github.com/repos/andela/prometheus-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/prometheus-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/prometheus-ah/tags","blobs_url":"https://api.github.com/repos/andela/prometheus-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/prometheus-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/prometheus-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/prometheus-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/prometheus-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/prometheus-ah/languages","stargazers_url":"https://api.github.com/repos/andela/prometheus-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/prometheus-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/prometheus-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/prometheus-ah/subscription","commits_url":"https://api.github.com/repos/andela/prometheus-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/prometheus-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/prometheus-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/prometheus-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/prometheus-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/prometheus-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/prometheus-ah/merges","archive_url":"https://api.github.com/repos/andela/prometheus-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/prometheus-ah/downloads","issues_url":"https://api.github.com/repos/andela/prometheus-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/prometheus-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/prometheus-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/prometheus-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/prometheus-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/prometheus-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/prometheus-ah/deployments","created_at":"2018-08-23T09:34:39Z","updated_at":"2018-09-19T11:56:08Z","pushed_at":"2018-09-19T17:02:26Z","git_url":"git://github.com/andela/prometheus-ah.git","ssh_url":"git@github.com:andela/prometheus-ah.git","clone_url":"https://github.com/andela/prometheus-ah.git","svn_url":"https://github.com/andela/prometheus-ah","homepage":null,"size":606,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":1,"open_issues":6,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/prometheus-ah/pulls/36"},"html":{"href":"https://github.com/andela/prometheus-ah/pull/36"},"issue":{"href":"https://api.github.com/repos/andela/prometheus-ah/issues/36"},"comments":{"href":"https://api.github.com/repos/andela/prometheus-ah/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/prometheus-ah/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/prometheus-ah/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/prometheus-ah/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/andela/prometheus-ah/statuses/2492acf12d0d548be9302de0232148ede31688ea"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}