{"action":"created","comment":{"url":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/comments/47628594","id":47628594,"diff_hunk":"@@ -0,0 +1,210 @@\n+/*\n+ * Copyright 2015, TeamDev Ltd. All rights reserved.\n+ *\n+ * Redistribution and use in source and/or binary forms, with or without\n+ * modification, must retain the above copyright notice and the following\n+ * disclaimer.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+package sample.lobby.registration.projection;\n+\n+import com.google.common.base.Predicate;\n+import com.google.common.collect.ImmutableList;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.spine3.base.CommandContext;\n+import org.spine3.client.CommandRequest;\n+import org.spine3.eventbus.Subscribe;\n+import org.spine3.server.BoundedContext;\n+import org.spine3.server.projection.Projection;\n+import sample.lobby.contracts.common.ConferenceId;\n+import sample.lobby.contracts.common.SeatType;\n+import sample.lobby.contracts.common.SeatTypeId;\n+import sample.lobby.contracts.conference.*;\n+import sample.lobby.registration.Conference;\n+import sample.lobby.registration.seat.availability.AddSeats;\n+import sample.lobby.registration.seat.availability.RemoveSeats;\n+\n+import javax.annotation.Nullable;\n+import java.util.List;\n+\n+import static com.google.common.collect.Iterables.filter;\n+import static java.lang.Math.abs;\n+import static java.lang.String.format;\n+import static org.spine3.util.Commands.newCommandRequest;\n+import static sample.lobby.registration.Conference.PublishingStatus.NOT_PUBLISHED;\n+import static sample.lobby.registration.Conference.PublishingStatus.PUBLISHED;\n+\n+/**\n+ * The projection of a conference.\n+ *\n+ * @author Alexander Litus\n+ * @see Projection\n+ */\n+@SuppressWarnings(\"TypeMayBeWeakened\")\n+public class ConferenceProjection extends Projection<ConferenceId, Conference> {","path":"registration/src/main/java/sample/lobby/registration/projection/ConferenceProjection.java","position":57,"original_position":57,"commit_id":"e89e9c1e8411f90a3acb407e9c4cecd7eda84806","original_commit_id":"dadf38a066a4e5c746daac222bea88f6f6271ff4","user":{"login":"AlexanderLitus","id":8298183,"avatar_url":"https://avatars.githubusercontent.com/u/8298183?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderLitus","html_url":"https://github.com/AlexanderLitus","followers_url":"https://api.github.com/users/AlexanderLitus/followers","following_url":"https://api.github.com/users/AlexanderLitus/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderLitus/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderLitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderLitus/subscriptions","organizations_url":"https://api.github.com/users/AlexanderLitus/orgs","repos_url":"https://api.github.com/users/AlexanderLitus/repos","events_url":"https://api.github.com/users/AlexanderLitus/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderLitus/received_events","type":"User","site_admin":false},"body":"Added docs.","created_at":"2015-12-15T12:15:04Z","updated_at":"2015-12-15T12:15:04Z","html_url":"https://github.com/SpineEventEngine/Lobby/pull/7#discussion_r47628594","pull_request_url":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/comments/47628594"},"html":{"href":"https://github.com/SpineEventEngine/Lobby/pull/7#discussion_r47628594"},"pull_request":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/7","id":53400741,"html_url":"https://github.com/SpineEventEngine/Lobby/pull/7","diff_url":"https://github.com/SpineEventEngine/Lobby/pull/7.diff","patch_url":"https://github.com/SpineEventEngine/Lobby/pull/7.patch","issue_url":"https://api.github.com/repos/SpineEventEngine/Lobby/issues/7","number":7,"state":"open","locked":false,"title":"Conference contracts module, conference projection","user":{"login":"AlexanderLitus","id":8298183,"avatar_url":"https://avatars.githubusercontent.com/u/8298183?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderLitus","html_url":"https://github.com/AlexanderLitus","followers_url":"https://api.github.com/users/AlexanderLitus/followers","following_url":"https://api.github.com/users/AlexanderLitus/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderLitus/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderLitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderLitus/subscriptions","organizations_url":"https://api.github.com/users/AlexanderLitus/orgs","repos_url":"https://api.github.com/users/AlexanderLitus/repos","events_url":"https://api.github.com/users/AlexanderLitus/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderLitus/received_events","type":"User","site_admin":false},"body":"Depends on [#6](https://github.com/SpineEventEngine/Lobby/pull/6).","created_at":"2015-12-11T14:48:15Z","updated_at":"2015-12-15T12:15:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"565fd86afea5cfae9af9c9893b7c0e12a7d9efed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/7/commits","review_comments_url":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/7/comments","review_comment_url":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpineEventEngine/Lobby/issues/7/comments","statuses_url":"https://api.github.com/repos/SpineEventEngine/Lobby/statuses/e89e9c1e8411f90a3acb407e9c4cecd7eda84806","head":{"label":"SpineEventEngine:conference-contracts","ref":"conference-contracts","sha":"e89e9c1e8411f90a3acb407e9c4cecd7eda84806","user":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars.githubusercontent.com/u/12821626?v=3","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":45702464,"name":"Lobby","full_name":"SpineEventEngine/Lobby","owner":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars.githubusercontent.com/u/12821626?v=3","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpineEventEngine/Lobby","description":"A sample conference management application","fork":false,"url":"https://api.github.com/repos/SpineEventEngine/Lobby","forks_url":"https://api.github.com/repos/SpineEventEngine/Lobby/forks","keys_url":"https://api.github.com/repos/SpineEventEngine/Lobby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpineEventEngine/Lobby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpineEventEngine/Lobby/teams","hooks_url":"https://api.github.com/repos/SpineEventEngine/Lobby/hooks","issue_events_url":"https://api.github.com/repos/SpineEventEngine/Lobby/issues/events{/number}","events_url":"https://api.github.com/repos/SpineEventEngine/Lobby/events","assignees_url":"https://api.github.com/repos/SpineEventEngine/Lobby/assignees{/user}","branches_url":"https://api.github.com/repos/SpineEventEngine/Lobby/branches{/branch}","tags_url":"https://api.github.com/repos/SpineEventEngine/Lobby/tags","blobs_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpineEventEngine/Lobby/statuses/{sha}","languages_url":"https://api.github.com/repos/SpineEventEngine/Lobby/languages","stargazers_url":"https://api.github.com/repos/SpineEventEngine/Lobby/stargazers","contributors_url":"https://api.github.com/repos/SpineEventEngine/Lobby/contributors","subscribers_url":"https://api.github.com/repos/SpineEventEngine/Lobby/subscribers","subscription_url":"https://api.github.com/repos/SpineEventEngine/Lobby/subscription","commits_url":"https://api.github.com/repos/SpineEventEngine/Lobby/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpineEventEngine/Lobby/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpineEventEngine/Lobby/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpineEventEngine/Lobby/contents/{+path}","compare_url":"https://api.github.com/repos/SpineEventEngine/Lobby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpineEventEngine/Lobby/merges","archive_url":"https://api.github.com/repos/SpineEventEngine/Lobby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpineEventEngine/Lobby/downloads","issues_url":"https://api.github.com/repos/SpineEventEngine/Lobby/issues{/number}","pulls_url":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls{/number}","milestones_url":"https://api.github.com/repos/SpineEventEngine/Lobby/milestones{/number}","notifications_url":"https://api.github.com/repos/SpineEventEngine/Lobby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpineEventEngine/Lobby/labels{/name}","releases_url":"https://api.github.com/repos/SpineEventEngine/Lobby/releases{/id}","created_at":"2015-11-06T19:23:38Z","updated_at":"2015-11-16T09:05:59Z","pushed_at":"2015-12-15T11:53:38Z","git_url":"git://github.com/SpineEventEngine/Lobby.git","ssh_url":"git@github.com:SpineEventEngine/Lobby.git","clone_url":"https://github.com/SpineEventEngine/Lobby.git","svn_url":"https://github.com/SpineEventEngine/Lobby","homepage":null,"size":244,"stargazers_count":0,"watchers_count":0,"language":"Protocol Buffer","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":0,"default_branch":"master"}},"base":{"label":"SpineEventEngine:master","ref":"master","sha":"8f3229e19670c0fa4892ce40f2633ea4accdee8b","user":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars.githubusercontent.com/u/12821626?v=3","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":45702464,"name":"Lobby","full_name":"SpineEventEngine/Lobby","owner":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars.githubusercontent.com/u/12821626?v=3","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpineEventEngine/Lobby","description":"A sample conference management application","fork":false,"url":"https://api.github.com/repos/SpineEventEngine/Lobby","forks_url":"https://api.github.com/repos/SpineEventEngine/Lobby/forks","keys_url":"https://api.github.com/repos/SpineEventEngine/Lobby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpineEventEngine/Lobby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpineEventEngine/Lobby/teams","hooks_url":"https://api.github.com/repos/SpineEventEngine/Lobby/hooks","issue_events_url":"https://api.github.com/repos/SpineEventEngine/Lobby/issues/events{/number}","events_url":"https://api.github.com/repos/SpineEventEngine/Lobby/events","assignees_url":"https://api.github.com/repos/SpineEventEngine/Lobby/assignees{/user}","branches_url":"https://api.github.com/repos/SpineEventEngine/Lobby/branches{/branch}","tags_url":"https://api.github.com/repos/SpineEventEngine/Lobby/tags","blobs_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpineEventEngine/Lobby/statuses/{sha}","languages_url":"https://api.github.com/repos/SpineEventEngine/Lobby/languages","stargazers_url":"https://api.github.com/repos/SpineEventEngine/Lobby/stargazers","contributors_url":"https://api.github.com/repos/SpineEventEngine/Lobby/contributors","subscribers_url":"https://api.github.com/repos/SpineEventEngine/Lobby/subscribers","subscription_url":"https://api.github.com/repos/SpineEventEngine/Lobby/subscription","commits_url":"https://api.github.com/repos/SpineEventEngine/Lobby/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpineEventEngine/Lobby/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpineEventEngine/Lobby/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpineEventEngine/Lobby/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpineEventEngine/Lobby/contents/{+path}","compare_url":"https://api.github.com/repos/SpineEventEngine/Lobby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpineEventEngine/Lobby/merges","archive_url":"https://api.github.com/repos/SpineEventEngine/Lobby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpineEventEngine/Lobby/downloads","issues_url":"https://api.github.com/repos/SpineEventEngine/Lobby/issues{/number}","pulls_url":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls{/number}","milestones_url":"https://api.github.com/repos/SpineEventEngine/Lobby/milestones{/number}","notifications_url":"https://api.github.com/repos/SpineEventEngine/Lobby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpineEventEngine/Lobby/labels{/name}","releases_url":"https://api.github.com/repos/SpineEventEngine/Lobby/releases{/id}","created_at":"2015-11-06T19:23:38Z","updated_at":"2015-11-16T09:05:59Z","pushed_at":"2015-12-15T11:53:38Z","git_url":"git://github.com/SpineEventEngine/Lobby.git","ssh_url":"git@github.com:SpineEventEngine/Lobby.git","clone_url":"https://github.com/SpineEventEngine/Lobby.git","svn_url":"https://github.com/SpineEventEngine/Lobby","homepage":null,"size":244,"stargazers_count":0,"watchers_count":0,"language":"Protocol Buffer","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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/7"},"html":{"href":"https://github.com/SpineEventEngine/Lobby/pull/7"},"issue":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/issues/7"},"comments":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/SpineEventEngine/Lobby/statuses/e89e9c1e8411f90a3acb407e9c4cecd7eda84806"}}}}