{"action":"created","comment":{"url":"https://api.github.com/repos/bitzesty/qae/pulls/comments/29508321","id":29508321,"diff_hunk":"@@ -0,0 +1,191 @@\n+require \"json\"\n+require \"net/http\"\n+require \"base64\"\n+\n+class PerformancePlatformService\n+  TRANSACTIONS_BY_CHANNEL_URL = \"https://www.performance.service.gov.uk/data/queens-awards-for-enterprise/transactions-by-channel\"\n+  APPLICATIONS_BY_STAGE_URL = \"https://www.performance.service.gov.uk/data/queens-awards-for-enterprise/applications-by-stage\"\n+\n+  AWARD_TYPE_MAPPING = {\n+    \"trade\" => \"international-trade\",\n+    \"innovation\" => \"innovation\",\n+    \"development\" => \"sustainable-development\",\n+    \"promotion\" => \"qaep\"\n+  }\n+\n+  POSSIBLE_RANGES = [\n+   \"0-percent\",\n+   \"1-24-percent\",\n+   \"25-49-percent\",\n+   \"50-74-percent\",\n+   \"75-99-percent\",\n+   \"100-percent\"\n+  ]\n+\n+  def self.run\n+    perform_transactions_by_channel\n+    perform_applications_by_stage\n+  end\n+\n+  #[\n+  #  {\n+  #      \"_id\": \"23456780\",\n+  #      \"_timestamp\": \"2015-03-10T00:00:00Z\",\n+  #      \"period\": \"week\",\n+  #      \"channel\": \"online\",\n+  #      \"channel_type\": \"digital\",\n+  #      \"count\": 42\n+  #  }\n+  #]","path":"app/services/performance_platform_service.rb","position":39,"original_position":39,"commit_id":"ded101336050ad544b36b1dbff8dd6c7889bcaa1","original_commit_id":"ded101336050ad544b36b1dbff8dd6c7889bcaa1","user":{"login":"matthewford","id":215,"avatar_url":"https://avatars.githubusercontent.com/u/215?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewford","html_url":"https://github.com/matthewford","followers_url":"https://api.github.com/users/matthewford/followers","following_url":"https://api.github.com/users/matthewford/following{/other_user}","gists_url":"https://api.github.com/users/matthewford/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewford/subscriptions","organizations_url":"https://api.github.com/users/matthewford/orgs","repos_url":"https://api.github.com/users/matthewford/repos","events_url":"https://api.github.com/users/matthewford/events{/privacy}","received_events_url":"https://api.github.com/users/matthewford/received_events","type":"User","site_admin":false},"body":"Missing space after #.","created_at":"2015-05-01T15:29:22Z","updated_at":"2015-05-01T15:29:22Z","html_url":"https://github.com/bitzesty/qae/pull/451#discussion_r29508321","pull_request_url":"https://api.github.com/repos/bitzesty/qae/pulls/451","_links":{"self":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/comments/29508321"},"html":{"href":"https://github.com/bitzesty/qae/pull/451#discussion_r29508321"},"pull_request":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/451"}}},"pull_request":{"url":"https://api.github.com/repos/bitzesty/qae/pulls/451","id":34543985,"html_url":"https://github.com/bitzesty/qae/pull/451","diff_url":"https://github.com/bitzesty/qae/pull/451.diff","patch_url":"https://github.com/bitzesty/qae/pull/451.patch","issue_url":"https://api.github.com/repos/bitzesty/qae/issues/451","number":451,"state":"open","locked":false,"title":"Performance platform integration","user":{"login":"dreamfall","id":332810,"avatar_url":"https://avatars.githubusercontent.com/u/332810?v=3","gravatar_id":"","url":"https://api.github.com/users/dreamfall","html_url":"https://github.com/dreamfall","followers_url":"https://api.github.com/users/dreamfall/followers","following_url":"https://api.github.com/users/dreamfall/following{/other_user}","gists_url":"https://api.github.com/users/dreamfall/gists{/gist_id}","starred_url":"https://api.github.com/users/dreamfall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreamfall/subscriptions","organizations_url":"https://api.github.com/users/dreamfall/orgs","repos_url":"https://api.github.com/users/dreamfall/repos","events_url":"https://api.github.com/users/dreamfall/events{/privacy}","received_events_url":"https://api.github.com/users/dreamfall/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-01T15:29:15Z","updated_at":"2015-05-01T15:29:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"246aaf37b87da84f1ba20ba78d0b52de05a297d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitzesty/qae/pulls/451/commits","review_comments_url":"https://api.github.com/repos/bitzesty/qae/pulls/451/comments","review_comment_url":"https://api.github.com/repos/bitzesty/qae/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitzesty/qae/issues/451/comments","statuses_url":"https://api.github.com/repos/bitzesty/qae/statuses/ded101336050ad544b36b1dbff8dd6c7889bcaa1","head":{"label":"bitzesty:performance-platform-integration","ref":"performance-platform-integration","sha":"ded101336050ad544b36b1dbff8dd6c7889bcaa1","user":{"login":"bitzesty","id":70534,"avatar_url":"https://avatars.githubusercontent.com/u/70534?v=3","gravatar_id":"","url":"https://api.github.com/users/bitzesty","html_url":"https://github.com/bitzesty","followers_url":"https://api.github.com/users/bitzesty/followers","following_url":"https://api.github.com/users/bitzesty/following{/other_user}","gists_url":"https://api.github.com/users/bitzesty/gists{/gist_id}","starred_url":"https://api.github.com/users/bitzesty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitzesty/subscriptions","organizations_url":"https://api.github.com/users/bitzesty/orgs","repos_url":"https://api.github.com/users/bitzesty/repos","events_url":"https://api.github.com/users/bitzesty/events{/privacy}","received_events_url":"https://api.github.com/users/bitzesty/received_events","type":"Organization","site_admin":false},"repo":{"id":26758825,"name":"qae","full_name":"bitzesty/qae","owner":{"login":"bitzesty","id":70534,"avatar_url":"https://avatars.githubusercontent.com/u/70534?v=3","gravatar_id":"","url":"https://api.github.com/users/bitzesty","html_url":"https://github.com/bitzesty","followers_url":"https://api.github.com/users/bitzesty/followers","following_url":"https://api.github.com/users/bitzesty/following{/other_user}","gists_url":"https://api.github.com/users/bitzesty/gists{/gist_id}","starred_url":"https://api.github.com/users/bitzesty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitzesty/subscriptions","organizations_url":"https://api.github.com/users/bitzesty/orgs","repos_url":"https://api.github.com/users/bitzesty/repos","events_url":"https://api.github.com/users/bitzesty/events{/privacy}","received_events_url":"https://api.github.com/users/bitzesty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitzesty/qae","description":"[Beta] Queens Award for Enterprise","fork":false,"url":"https://api.github.com/repos/bitzesty/qae","forks_url":"https://api.github.com/repos/bitzesty/qae/forks","keys_url":"https://api.github.com/repos/bitzesty/qae/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitzesty/qae/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitzesty/qae/teams","hooks_url":"https://api.github.com/repos/bitzesty/qae/hooks","issue_events_url":"https://api.github.com/repos/bitzesty/qae/issues/events{/number}","events_url":"https://api.github.com/repos/bitzesty/qae/events","assignees_url":"https://api.github.com/repos/bitzesty/qae/assignees{/user}","branches_url":"https://api.github.com/repos/bitzesty/qae/branches{/branch}","tags_url":"https://api.github.com/repos/bitzesty/qae/tags","blobs_url":"https://api.github.com/repos/bitzesty/qae/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitzesty/qae/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitzesty/qae/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitzesty/qae/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitzesty/qae/statuses/{sha}","languages_url":"https://api.github.com/repos/bitzesty/qae/languages","stargazers_url":"https://api.github.com/repos/bitzesty/qae/stargazers","contributors_url":"https://api.github.com/repos/bitzesty/qae/contributors","subscribers_url":"https://api.github.com/repos/bitzesty/qae/subscribers","subscription_url":"https://api.github.com/repos/bitzesty/qae/subscription","commits_url":"https://api.github.com/repos/bitzesty/qae/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitzesty/qae/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitzesty/qae/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitzesty/qae/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitzesty/qae/contents/{+path}","compare_url":"https://api.github.com/repos/bitzesty/qae/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitzesty/qae/merges","archive_url":"https://api.github.com/repos/bitzesty/qae/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitzesty/qae/downloads","issues_url":"https://api.github.com/repos/bitzesty/qae/issues{/number}","pulls_url":"https://api.github.com/repos/bitzesty/qae/pulls{/number}","milestones_url":"https://api.github.com/repos/bitzesty/qae/milestones{/number}","notifications_url":"https://api.github.com/repos/bitzesty/qae/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitzesty/qae/labels{/name}","releases_url":"https://api.github.com/repos/bitzesty/qae/releases{/id}","created_at":"2014-11-17T13:56:00Z","updated_at":"2015-05-01T15:01:01Z","pushed_at":"2015-05-01T15:29:16Z","git_url":"git://github.com/bitzesty/qae.git","ssh_url":"git@github.com:bitzesty/qae.git","clone_url":"https://github.com/bitzesty/qae.git","svn_url":"https://github.com/bitzesty/qae","homepage":"","size":44853,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":2,"default_branch":"master"}},"base":{"label":"bitzesty:master","ref":"master","sha":"2673619fe0830337c0ecaaae0e13b5a7d0174003","user":{"login":"bitzesty","id":70534,"avatar_url":"https://avatars.githubusercontent.com/u/70534?v=3","gravatar_id":"","url":"https://api.github.com/users/bitzesty","html_url":"https://github.com/bitzesty","followers_url":"https://api.github.com/users/bitzesty/followers","following_url":"https://api.github.com/users/bitzesty/following{/other_user}","gists_url":"https://api.github.com/users/bitzesty/gists{/gist_id}","starred_url":"https://api.github.com/users/bitzesty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitzesty/subscriptions","organizations_url":"https://api.github.com/users/bitzesty/orgs","repos_url":"https://api.github.com/users/bitzesty/repos","events_url":"https://api.github.com/users/bitzesty/events{/privacy}","received_events_url":"https://api.github.com/users/bitzesty/received_events","type":"Organization","site_admin":false},"repo":{"id":26758825,"name":"qae","full_name":"bitzesty/qae","owner":{"login":"bitzesty","id":70534,"avatar_url":"https://avatars.githubusercontent.com/u/70534?v=3","gravatar_id":"","url":"https://api.github.com/users/bitzesty","html_url":"https://github.com/bitzesty","followers_url":"https://api.github.com/users/bitzesty/followers","following_url":"https://api.github.com/users/bitzesty/following{/other_user}","gists_url":"https://api.github.com/users/bitzesty/gists{/gist_id}","starred_url":"https://api.github.com/users/bitzesty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitzesty/subscriptions","organizations_url":"https://api.github.com/users/bitzesty/orgs","repos_url":"https://api.github.com/users/bitzesty/repos","events_url":"https://api.github.com/users/bitzesty/events{/privacy}","received_events_url":"https://api.github.com/users/bitzesty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitzesty/qae","description":"[Beta] Queens Award for Enterprise","fork":false,"url":"https://api.github.com/repos/bitzesty/qae","forks_url":"https://api.github.com/repos/bitzesty/qae/forks","keys_url":"https://api.github.com/repos/bitzesty/qae/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitzesty/qae/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitzesty/qae/teams","hooks_url":"https://api.github.com/repos/bitzesty/qae/hooks","issue_events_url":"https://api.github.com/repos/bitzesty/qae/issues/events{/number}","events_url":"https://api.github.com/repos/bitzesty/qae/events","assignees_url":"https://api.github.com/repos/bitzesty/qae/assignees{/user}","branches_url":"https://api.github.com/repos/bitzesty/qae/branches{/branch}","tags_url":"https://api.github.com/repos/bitzesty/qae/tags","blobs_url":"https://api.github.com/repos/bitzesty/qae/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitzesty/qae/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitzesty/qae/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitzesty/qae/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitzesty/qae/statuses/{sha}","languages_url":"https://api.github.com/repos/bitzesty/qae/languages","stargazers_url":"https://api.github.com/repos/bitzesty/qae/stargazers","contributors_url":"https://api.github.com/repos/bitzesty/qae/contributors","subscribers_url":"https://api.github.com/repos/bitzesty/qae/subscribers","subscription_url":"https://api.github.com/repos/bitzesty/qae/subscription","commits_url":"https://api.github.com/repos/bitzesty/qae/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitzesty/qae/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitzesty/qae/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitzesty/qae/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitzesty/qae/contents/{+path}","compare_url":"https://api.github.com/repos/bitzesty/qae/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitzesty/qae/merges","archive_url":"https://api.github.com/repos/bitzesty/qae/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitzesty/qae/downloads","issues_url":"https://api.github.com/repos/bitzesty/qae/issues{/number}","pulls_url":"https://api.github.com/repos/bitzesty/qae/pulls{/number}","milestones_url":"https://api.github.com/repos/bitzesty/qae/milestones{/number}","notifications_url":"https://api.github.com/repos/bitzesty/qae/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitzesty/qae/labels{/name}","releases_url":"https://api.github.com/repos/bitzesty/qae/releases{/id}","created_at":"2014-11-17T13:56:00Z","updated_at":"2015-05-01T15:01:01Z","pushed_at":"2015-05-01T15:29:16Z","git_url":"git://github.com/bitzesty/qae.git","ssh_url":"git@github.com:bitzesty/qae.git","clone_url":"https://github.com/bitzesty/qae.git","svn_url":"https://github.com/bitzesty/qae","homepage":"","size":44853,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/451"},"html":{"href":"https://github.com/bitzesty/qae/pull/451"},"issue":{"href":"https://api.github.com/repos/bitzesty/qae/issues/451"},"comments":{"href":"https://api.github.com/repos/bitzesty/qae/issues/451/comments"},"review_comments":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/451/comments"},"review_comment":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitzesty/qae/pulls/451/commits"},"statuses":{"href":"https://api.github.com/repos/bitzesty/qae/statuses/ded101336050ad544b36b1dbff8dd6c7889bcaa1"}}}}