{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/paas-admin/pulls/comments/275270729","pull_request_review_id":226532982,"id":275270729,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3NTI3MDcyOQ==","diff_hunk":"@@ -83,6 +83,7 @@ interface IUsageEvent {\n \n interface IBillableEvent extends IUsageEvent {\n   readonly price: IPrice;\n+  readonly quotaGUID: string;","path":"src/lib/billing/types.ts","position":4,"original_position":4,"commit_id":"bba3152a2caa4f479f72fc55bd8cd032b6048616","original_commit_id":"bba3152a2caa4f479f72fc55bd8cd032b6048616","user":{"login":"richardTowers","id":1696784,"node_id":"MDQ6VXNlcjE2OTY3ODQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1696784?v=4","gravatar_id":"","url":"https://api.github.com/users/richardTowers","html_url":"https://github.com/richardTowers","followers_url":"https://api.github.com/users/richardTowers/followers","following_url":"https://api.github.com/users/richardTowers/following{/other_user}","gists_url":"https://api.github.com/users/richardTowers/gists{/gist_id}","starred_url":"https://api.github.com/users/richardTowers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardTowers/subscriptions","organizations_url":"https://api.github.com/users/richardTowers/orgs","repos_url":"https://api.github.com/users/richardTowers/repos","events_url":"https://api.github.com/users/richardTowers/events{/privacy}","received_events_url":"https://api.github.com/users/richardTowers/received_events","type":"User","site_admin":false},"body":"This might be better as a nullable type (I can't remember if the syntax is `string?` or `string | null`) because not all billable events will have quotas on them (presumably, since we only just started writing them).","created_at":"2019-04-15T09:14:40Z","updated_at":"2019-04-15T09:14:40Z","html_url":"https://github.com/alphagov/paas-admin/pull/125#discussion_r275270729","pull_request_url":"https://api.github.com/repos/alphagov/paas-admin/pulls/125","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/alphagov/paas-admin/pulls/comments/275270729"},"html":{"href":"https://github.com/alphagov/paas-admin/pull/125#discussion_r275270729"},"pull_request":{"href":"https://api.github.com/repos/alphagov/paas-admin/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/paas-admin/pulls/125","id":270061156,"node_id":"MDExOlB1bGxSZXF1ZXN0MjcwMDYxMTU2","html_url":"https://github.com/alphagov/paas-admin/pull/125","diff_url":"https://github.com/alphagov/paas-admin/pull/125.diff","patch_url":"https://github.com/alphagov/paas-admin/pull/125.patch","issue_url":"https://api.github.com/repos/alphagov/paas-admin/issues/125","number":125,"state":"open","locked":false,"title":"[#164763735] Pull quota from the billing response","user":{"login":"mogds","id":46566088,"node_id":"MDQ6VXNlcjQ2NTY2MDg4","avatar_url":"https://avatars1.githubusercontent.com/u/46566088?v=4","gravatar_id":"","url":"https://api.github.com/users/mogds","html_url":"https://github.com/mogds","followers_url":"https://api.github.com/users/mogds/followers","following_url":"https://api.github.com/users/mogds/following{/other_user}","gists_url":"https://api.github.com/users/mogds/gists{/gist_id}","starred_url":"https://api.github.com/users/mogds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mogds/subscriptions","organizations_url":"https://api.github.com/users/mogds/orgs","repos_url":"https://api.github.com/users/mogds/repos","events_url":"https://api.github.com/users/mogds/events{/privacy}","received_events_url":"https://api.github.com/users/mogds/received_events","type":"User","site_admin":false},"body":"What\r\n----\r\n\r\nThe paas-admin cost report (`/reports/cost/2018-01-01`) currently queries the cf api for the quota guid and the billing endpoint for the events. Therefore the quota doesn't reflect the quota applied during the billing period.\r\n\r\nPaas-billing has been [updated](https://github.com/alphagov/paas-billing/pull/64) to include the quota_definition_guid so it has the correct quota. This updates the cost report to pull the quota from the billing response if available.\r\n\r\nMerge Steps\r\n-------------\r\n\r\n**Deploy https://github.com/alphagov/paas-billing/pull/64 before merging this PR**\r\n\r\nHow to review\r\n-------------\r\n\r\n- Code review \r\n- Run tests\r\n\r\nWho can review\r\n---------------\r\n\r\nNot me, @AP-Hunt ","created_at":"2019-04-12T15:40:05Z","updated_at":"2019-04-15T09:14:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7502169b4a360ddd64f43879686ee0f9b89416dd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/paas-admin/pulls/125/commits","review_comments_url":"https://api.github.com/repos/alphagov/paas-admin/pulls/125/comments","review_comment_url":"https://api.github.com/repos/alphagov/paas-admin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/paas-admin/issues/125/comments","statuses_url":"https://api.github.com/repos/alphagov/paas-admin/statuses/bba3152a2caa4f479f72fc55bd8cd032b6048616","head":{"label":"alphagov:set-org-quota-164763735","ref":"set-org-quota-164763735","sha":"bba3152a2caa4f479f72fc55bd8cd032b6048616","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":113037599,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMwMzc1OTk=","name":"paas-admin","full_name":"alphagov/paas-admin","private":false,"owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/alphagov/paas-admin","description":"Administration tool for GOV.UK PaaS","fork":false,"url":"https://api.github.com/repos/alphagov/paas-admin","forks_url":"https://api.github.com/repos/alphagov/paas-admin/forks","keys_url":"https://api.github.com/repos/alphagov/paas-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/paas-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/paas-admin/teams","hooks_url":"https://api.github.com/repos/alphagov/paas-admin/hooks","issue_events_url":"https://api.github.com/repos/alphagov/paas-admin/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/paas-admin/events","assignees_url":"https://api.github.com/repos/alphagov/paas-admin/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/paas-admin/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/paas-admin/tags","blobs_url":"https://api.github.com/repos/alphagov/paas-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/paas-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/paas-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/paas-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/paas-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/paas-admin/languages","stargazers_url":"https://api.github.com/repos/alphagov/paas-admin/stargazers","contributors_url":"https://api.github.com/repos/alphagov/paas-admin/contributors","subscribers_url":"https://api.github.com/repos/alphagov/paas-admin/subscribers","subscription_url":"https://api.github.com/repos/alphagov/paas-admin/subscription","commits_url":"https://api.github.com/repos/alphagov/paas-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/paas-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/paas-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/paas-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/paas-admin/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/paas-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/paas-admin/merges","archive_url":"https://api.github.com/repos/alphagov/paas-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/paas-admin/downloads","issues_url":"https://api.github.com/repos/alphagov/paas-admin/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/paas-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/paas-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/paas-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/paas-admin/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/paas-admin/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/paas-admin/deployments","created_at":"2017-12-04T12:07:40Z","updated_at":"2019-03-24T00:55:42Z","pushed_at":"2019-04-12T16:20:18Z","git_url":"git://github.com/alphagov/paas-admin.git","ssh_url":"git@github.com:alphagov/paas-admin.git","clone_url":"https://github.com/alphagov/paas-admin.git","svn_url":"https://github.com/alphagov/paas-admin","homepage":"","size":1986,"stargazers_count":7,"watchers_count":7,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":7,"watchers":7,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"160eb61529f52c4d57f1694d0c29b41fb02c9a3a","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":113037599,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMwMzc1OTk=","name":"paas-admin","full_name":"alphagov/paas-admin","private":false,"owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/alphagov/paas-admin","description":"Administration tool for GOV.UK PaaS","fork":false,"url":"https://api.github.com/repos/alphagov/paas-admin","forks_url":"https://api.github.com/repos/alphagov/paas-admin/forks","keys_url":"https://api.github.com/repos/alphagov/paas-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/paas-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/paas-admin/teams","hooks_url":"https://api.github.com/repos/alphagov/paas-admin/hooks","issue_events_url":"https://api.github.com/repos/alphagov/paas-admin/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/paas-admin/events","assignees_url":"https://api.github.com/repos/alphagov/paas-admin/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/paas-admin/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/paas-admin/tags","blobs_url":"https://api.github.com/repos/alphagov/paas-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/paas-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/paas-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/paas-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/paas-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/paas-admin/languages","stargazers_url":"https://api.github.com/repos/alphagov/paas-admin/stargazers","contributors_url":"https://api.github.com/repos/alphagov/paas-admin/contributors","subscribers_url":"https://api.github.com/repos/alphagov/paas-admin/subscribers","subscription_url":"https://api.github.com/repos/alphagov/paas-admin/subscription","commits_url":"https://api.github.com/repos/alphagov/paas-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/paas-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/paas-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/paas-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/paas-admin/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/paas-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/paas-admin/merges","archive_url":"https://api.github.com/repos/alphagov/paas-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/paas-admin/downloads","issues_url":"https://api.github.com/repos/alphagov/paas-admin/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/paas-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/paas-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/paas-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/paas-admin/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/paas-admin/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/paas-admin/deployments","created_at":"2017-12-04T12:07:40Z","updated_at":"2019-03-24T00:55:42Z","pushed_at":"2019-04-12T16:20:18Z","git_url":"git://github.com/alphagov/paas-admin.git","ssh_url":"git@github.com:alphagov/paas-admin.git","clone_url":"https://github.com/alphagov/paas-admin.git","svn_url":"https://github.com/alphagov/paas-admin","homepage":"","size":1986,"stargazers_count":7,"watchers_count":7,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":7,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/paas-admin/pulls/125"},"html":{"href":"https://github.com/alphagov/paas-admin/pull/125"},"issue":{"href":"https://api.github.com/repos/alphagov/paas-admin/issues/125"},"comments":{"href":"https://api.github.com/repos/alphagov/paas-admin/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/paas-admin/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/paas-admin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/paas-admin/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/paas-admin/statuses/bba3152a2caa4f479f72fc55bd8cd032b6048616"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"richardTowers"}}