{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/comments/52456860","id":52456860,"diff_hunk":"@@ -0,0 +1,45 @@\n+'use strict';\n+\n+const schema = {\n+\tfollow_events_last_30_days: 'int',\n+\tsave_events_last_30_days: 'int',\n+\tpreference_on_events_last_30_days: 'int',\n+\tpush_notifications_clicked_last_30_days: 'int',\n+\temail_clicked_events_last_30_days: 'int',\n+\tfeature_usage_events_last_30_days: 'int',\n+\tpush_notifications_shown_last_7_days: 'int',\n+\temail_open_events_last_7_days: 'int',\n+\tfollowing: 'int',\n+\topted_into_daily_email: 'bool',\n+\topted_into_weekly_email: 'bool',\n+\tis_myft_user: 'bool'\n+};\n+\n+module.exports = engFromRedis => {\n+\tif(engFromRedis) {\n+\n+\t\tconst eng = {};\n+\n+\t\tfor (var key in engFromRedis) {\n+\t\t\tif (!engFromRedis.hasOwnProperty(key)) {","path":"server/v2/lib/format-redis-engagement.js","position":24,"original_position":24,"commit_id":"b9743ef5cb780c51c730dbd2be8f3199eb225bd0","original_commit_id":"b9743ef5cb780c51c730dbd2be8f3199eb225bd0","user":{"login":"phamann","id":80089,"avatar_url":"https://avatars.githubusercontent.com/u/80089?v=3","gravatar_id":"","url":"https://api.github.com/users/phamann","html_url":"https://github.com/phamann","followers_url":"https://api.github.com/users/phamann/followers","following_url":"https://api.github.com/users/phamann/following{/other_user}","gists_url":"https://api.github.com/users/phamann/gists{/gist_id}","starred_url":"https://api.github.com/users/phamann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamann/subscriptions","organizations_url":"https://api.github.com/users/phamann/orgs","repos_url":"https://api.github.com/users/phamann/repos","events_url":"https://api.github.com/users/phamann/events{/privacy}","received_events_url":"https://api.github.com/users/phamann/received_events","type":"User","site_admin":false},"body":"If you use an `Object.keys().forEach()` loop instead above you would not need this check.","created_at":"2016-02-10T13:35:29Z","updated_at":"2016-02-10T13:35:29Z","html_url":"https://github.com/Financial-Times/next-myft-api/pull/187#discussion_r52456860","pull_request_url":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/187","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/comments/52456860"},"html":{"href":"https://github.com/Financial-Times/next-myft-api/pull/187#discussion_r52456860"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/187"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/187","id":58889364,"html_url":"https://github.com/Financial-Times/next-myft-api/pull/187","diff_url":"https://github.com/Financial-Times/next-myft-api/pull/187.diff","patch_url":"https://github.com/Financial-Times/next-myft-api/pull/187.patch","issue_url":"https://api.github.com/repos/Financial-Times/next-myft-api/issues/187","number":187,"state":"open","locked":false,"title":"Eng route json fix","user":{"login":"laurieboyes","id":4622378,"avatar_url":"https://avatars.githubusercontent.com/u/4622378?v=3","gravatar_id":"","url":"https://api.github.com/users/laurieboyes","html_url":"https://github.com/laurieboyes","followers_url":"https://api.github.com/users/laurieboyes/followers","following_url":"https://api.github.com/users/laurieboyes/following{/other_user}","gists_url":"https://api.github.com/users/laurieboyes/gists{/gist_id}","starred_url":"https://api.github.com/users/laurieboyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurieboyes/subscriptions","organizations_url":"https://api.github.com/users/laurieboyes/orgs","repos_url":"https://api.github.com/users/laurieboyes/repos","events_url":"https://api.github.com/users/laurieboyes/events{/privacy}","received_events_url":"https://api.github.com/users/laurieboyes/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-10T13:22:04Z","updated_at":"2016-02-10T13:35:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fd4cb401c0fa7122714598a17d5b73a1693e56e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/187/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/187/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/next-myft-api/issues/187/comments","statuses_url":"https://api.github.com/repos/Financial-Times/next-myft-api/statuses/b9743ef5cb780c51c730dbd2be8f3199eb225bd0","head":{"label":"Financial-Times:eng-route-json-fix","ref":"eng-route-json-fix","sha":"b9743ef5cb780c51c730dbd2be8f3199eb225bd0","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":40488712,"name":"next-myft-api","full_name":"Financial-Times/next-myft-api","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-myft-api","description":"API to read/write data concerning all myFT functionality on next.ft.com","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-myft-api","forks_url":"https://api.github.com/repos/Financial-Times/next-myft-api/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-myft-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-myft-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-myft-api/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-myft-api/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-myft-api/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-myft-api/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-myft-api/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-myft-api/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-myft-api/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-myft-api/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-myft-api/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-myft-api/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-myft-api/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-myft-api/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-myft-api/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-myft-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-myft-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-myft-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-myft-api/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-myft-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-myft-api/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-myft-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-myft-api/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-myft-api/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-myft-api/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-myft-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-myft-api/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-myft-api/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-myft-api/deployments","created_at":"2015-08-10T15:00:26Z","updated_at":"2016-01-13T11:36:00Z","pushed_at":"2016-02-10T13:22:04Z","git_url":"git://github.com/Financial-Times/next-myft-api.git","ssh_url":"git@github.com:Financial-Times/next-myft-api.git","clone_url":"https://github.com/Financial-Times/next-myft-api.git","svn_url":"https://github.com/Financial-Times/next-myft-api","homepage":"","size":1386,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"f300735a8c14b21962e9b07605e2eb485c8f2913","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":40488712,"name":"next-myft-api","full_name":"Financial-Times/next-myft-api","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-myft-api","description":"API to read/write data concerning all myFT functionality on next.ft.com","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-myft-api","forks_url":"https://api.github.com/repos/Financial-Times/next-myft-api/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-myft-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-myft-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-myft-api/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-myft-api/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-myft-api/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-myft-api/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-myft-api/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-myft-api/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-myft-api/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-myft-api/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-myft-api/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-myft-api/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-myft-api/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-myft-api/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-myft-api/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-myft-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-myft-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-myft-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-myft-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-myft-api/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-myft-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-myft-api/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-myft-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-myft-api/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-myft-api/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-myft-api/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-myft-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-myft-api/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-myft-api/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-myft-api/deployments","created_at":"2015-08-10T15:00:26Z","updated_at":"2016-01-13T11:36:00Z","pushed_at":"2016-02-10T13:22:04Z","git_url":"git://github.com/Financial-Times/next-myft-api.git","ssh_url":"git@github.com:Financial-Times/next-myft-api.git","clone_url":"https://github.com/Financial-Times/next-myft-api.git","svn_url":"https://github.com/Financial-Times/next-myft-api","homepage":"","size":1386,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/187"},"html":{"href":"https://github.com/Financial-Times/next-myft-api/pull/187"},"issue":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/issues/187"},"comments":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/issues/187/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/187/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/pulls/187/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/next-myft-api/statuses/b9743ef5cb780c51c730dbd2be8f3199eb225bd0"}}}}