{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/mobile-n10n/pulls/comments/41005391","id":41005391,"diff_hunk":"@@ -0,0 +1,29 @@\n+package tracking\n+\n+import models.NotificationReport\n+import org.joda.time.DateTime\n+import tracking.Repository.RepositoryResult\n+\n+import scala.concurrent.Future\n+import scalaz.\\/\n+import scalaz.std.option.optionSyntax._\n+\n+class InMemoryNotificationReportRepository extends SentNotificationReportRepository {\n+\n+  val db = scala.collection.mutable.MutableList.empty[NotificationReport]\n+\n+  def store(report: NotificationReport): Future[RepositoryResult[Unit]] = {\n+    db += report\n+    Future.successful(\\/.right(()))\n+  }\n+\n+  def getByUuid(uuid: String): Future[RepositoryResult[NotificationReport]] = {\n+    Future.successful(db.find(_.notification.uuid == uuid) \\/> RepositoryError(\"Notification report not found\"))\n+  }\n+\n+  def getByDateRange(from: DateTime, to: DateTime): Future[RepositoryResult[List[NotificationReport]]] = {\n+    Future.successful(\\/.right(db.filter({report =>\n+      (report.sentTime isAfter from) && (report.sentTime isBefore to)","path":"common/src/main/scala/tracking/InMemoryNotificationReportRepository.scala","position":26,"original_position":26,"commit_id":"15a3f83ad2f0732f404596055cd4a8a50461d637","original_commit_id":"15a3f83ad2f0732f404596055cd4a8a50461d637","user":{"login":"alexduf","id":3389563,"avatar_url":"https://avatars.githubusercontent.com/u/3389563?v=3","gravatar_id":"","url":"https://api.github.com/users/alexduf","html_url":"https://github.com/alexduf","followers_url":"https://api.github.com/users/alexduf/followers","following_url":"https://api.github.com/users/alexduf/following{/other_user}","gists_url":"https://api.github.com/users/alexduf/gists{/gist_id}","starred_url":"https://api.github.com/users/alexduf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexduf/subscriptions","organizations_url":"https://api.github.com/users/alexduf/orgs","repos_url":"https://api.github.com/users/alexduf/repos","events_url":"https://api.github.com/users/alexduf/events{/privacy}","received_events_url":"https://api.github.com/users/alexduf/received_events","type":"User","site_admin":false},"body":"I think this filter should be inclusive, as in \"from <= report.sentTime <= to \"","created_at":"2015-10-02T09:37:13Z","updated_at":"2015-10-02T09:37:13Z","html_url":"https://github.com/guardian/mobile-n10n/pull/13#discussion_r41005391","pull_request_url":"https://api.github.com/repos/guardian/mobile-n10n/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/guardian/mobile-n10n/pulls/comments/41005391"},"html":{"href":"https://github.com/guardian/mobile-n10n/pull/13#discussion_r41005391"},"pull_request":{"href":"https://api.github.com/repos/guardian/mobile-n10n/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/mobile-n10n/pulls/13","id":46615887,"html_url":"https://github.com/guardian/mobile-n10n/pull/13","diff_url":"https://github.com/guardian/mobile-n10n/pull/13.diff","patch_url":"https://github.com/guardian/mobile-n10n/pull/13.patch","issue_url":"https://api.github.com/repos/guardian/mobile-n10n/issues/13","number":13,"state":"open","locked":false,"title":"Add reporting to notification push","user":{"login":"davidfurey","id":2619836,"avatar_url":"https://avatars.githubusercontent.com/u/2619836?v=3","gravatar_id":"","url":"https://api.github.com/users/davidfurey","html_url":"https://github.com/davidfurey","followers_url":"https://api.github.com/users/davidfurey/followers","following_url":"https://api.github.com/users/davidfurey/following{/other_user}","gists_url":"https://api.github.com/users/davidfurey/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfurey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfurey/subscriptions","organizations_url":"https://api.github.com/users/davidfurey/orgs","repos_url":"https://api.github.com/users/davidfurey/repos","events_url":"https://api.github.com/users/davidfurey/events{/privacy}","received_events_url":"https://api.github.com/users/davidfurey/received_events","type":"User","site_admin":false},"body":"In-memory only for now.  Also need to add topic registration tracking\r\nto registration end-point","created_at":"2015-10-02T09:13:23Z","updated_at":"2015-10-02T09:37:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"385acfaccfc3385c2d13072dd7a75155c1b10221","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guardian/mobile-n10n/pulls/13/commits","review_comments_url":"https://api.github.com/repos/guardian/mobile-n10n/pulls/13/comments","review_comment_url":"https://api.github.com/repos/guardian/mobile-n10n/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/mobile-n10n/issues/13/comments","statuses_url":"https://api.github.com/repos/guardian/mobile-n10n/statuses/15a3f83ad2f0732f404596055cd4a8a50461d637","head":{"label":"guardian:mapi-902-tracking-pushes","ref":"mapi-902-tracking-pushes","sha":"15a3f83ad2f0732f404596055cd4a8a50461d637","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":42113608,"name":"mobile-n10n","full_name":"guardian/mobile-n10n","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/mobile-n10n","description":"Next generation of notifications","fork":false,"url":"https://api.github.com/repos/guardian/mobile-n10n","forks_url":"https://api.github.com/repos/guardian/mobile-n10n/forks","keys_url":"https://api.github.com/repos/guardian/mobile-n10n/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/mobile-n10n/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/mobile-n10n/teams","hooks_url":"https://api.github.com/repos/guardian/mobile-n10n/hooks","issue_events_url":"https://api.github.com/repos/guardian/mobile-n10n/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/mobile-n10n/events","assignees_url":"https://api.github.com/repos/guardian/mobile-n10n/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/mobile-n10n/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/mobile-n10n/tags","blobs_url":"https://api.github.com/repos/guardian/mobile-n10n/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/mobile-n10n/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/mobile-n10n/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/mobile-n10n/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/mobile-n10n/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/mobile-n10n/languages","stargazers_url":"https://api.github.com/repos/guardian/mobile-n10n/stargazers","contributors_url":"https://api.github.com/repos/guardian/mobile-n10n/contributors","subscribers_url":"https://api.github.com/repos/guardian/mobile-n10n/subscribers","subscription_url":"https://api.github.com/repos/guardian/mobile-n10n/subscription","commits_url":"https://api.github.com/repos/guardian/mobile-n10n/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/mobile-n10n/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/mobile-n10n/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/mobile-n10n/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/mobile-n10n/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/mobile-n10n/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/mobile-n10n/merges","archive_url":"https://api.github.com/repos/guardian/mobile-n10n/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/mobile-n10n/downloads","issues_url":"https://api.github.com/repos/guardian/mobile-n10n/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/mobile-n10n/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/mobile-n10n/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/mobile-n10n/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/mobile-n10n/labels{/name}","releases_url":"https://api.github.com/repos/guardian/mobile-n10n/releases{/id}","created_at":"2015-09-08T13:24:20Z","updated_at":"2015-09-09T13:58:05Z","pushed_at":"2015-10-02T09:13:24Z","git_url":"git://github.com/guardian/mobile-n10n.git","ssh_url":"git@github.com:guardian/mobile-n10n.git","clone_url":"https://github.com/guardian/mobile-n10n.git","svn_url":"https://github.com/guardian/mobile-n10n","homepage":null,"size":1400,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"4306eb305e0f20696558ec2d66023ed7d151c1f5","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":42113608,"name":"mobile-n10n","full_name":"guardian/mobile-n10n","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/mobile-n10n","description":"Next generation of notifications","fork":false,"url":"https://api.github.com/repos/guardian/mobile-n10n","forks_url":"https://api.github.com/repos/guardian/mobile-n10n/forks","keys_url":"https://api.github.com/repos/guardian/mobile-n10n/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/mobile-n10n/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/mobile-n10n/teams","hooks_url":"https://api.github.com/repos/guardian/mobile-n10n/hooks","issue_events_url":"https://api.github.com/repos/guardian/mobile-n10n/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/mobile-n10n/events","assignees_url":"https://api.github.com/repos/guardian/mobile-n10n/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/mobile-n10n/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/mobile-n10n/tags","blobs_url":"https://api.github.com/repos/guardian/mobile-n10n/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/mobile-n10n/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/mobile-n10n/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/mobile-n10n/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/mobile-n10n/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/mobile-n10n/languages","stargazers_url":"https://api.github.com/repos/guardian/mobile-n10n/stargazers","contributors_url":"https://api.github.com/repos/guardian/mobile-n10n/contributors","subscribers_url":"https://api.github.com/repos/guardian/mobile-n10n/subscribers","subscription_url":"https://api.github.com/repos/guardian/mobile-n10n/subscription","commits_url":"https://api.github.com/repos/guardian/mobile-n10n/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/mobile-n10n/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/mobile-n10n/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/mobile-n10n/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/mobile-n10n/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/mobile-n10n/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/mobile-n10n/merges","archive_url":"https://api.github.com/repos/guardian/mobile-n10n/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/mobile-n10n/downloads","issues_url":"https://api.github.com/repos/guardian/mobile-n10n/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/mobile-n10n/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/mobile-n10n/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/mobile-n10n/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/mobile-n10n/labels{/name}","releases_url":"https://api.github.com/repos/guardian/mobile-n10n/releases{/id}","created_at":"2015-09-08T13:24:20Z","updated_at":"2015-09-09T13:58:05Z","pushed_at":"2015-10-02T09:13:24Z","git_url":"git://github.com/guardian/mobile-n10n.git","ssh_url":"git@github.com:guardian/mobile-n10n.git","clone_url":"https://github.com/guardian/mobile-n10n.git","svn_url":"https://github.com/guardian/mobile-n10n","homepage":null,"size":1400,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/mobile-n10n/pulls/13"},"html":{"href":"https://github.com/guardian/mobile-n10n/pull/13"},"issue":{"href":"https://api.github.com/repos/guardian/mobile-n10n/issues/13"},"comments":{"href":"https://api.github.com/repos/guardian/mobile-n10n/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/mobile-n10n/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/mobile-n10n/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/mobile-n10n/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/mobile-n10n/statuses/15a3f83ad2f0732f404596055cd4a8a50461d637"}}}}