{"action":"created","comment":{"url":"https://api.github.com/repos/folio-org/mod-calendar/pulls/comments/192402067","pull_request_review_id":125175207,"id":192402067,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjQwMjA2Nw==","diff_hunk":"@@ -1,31 +1,132 @@\n package org.folio.rest.impl;\n \n-public class CalendarAPI {\n+import io.vertx.core.*;\n+import org.folio.rest.jaxrs.model.OpeningPeriod;\n+import org.folio.rest.jaxrs.model.OpeningPeriod_;\n+import org.folio.rest.jaxrs.resource.CalendarResource;\n+import org.folio.rest.persist.PostgresClient;\n+import org.folio.rest.tools.utils.TenantTool;\n+import org.joda.time.format.DateTimeFormat;\n+import org.joda.time.format.DateTimeFormatter;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import javax.ws.rs.core.Response;\n+import java.util.Date;\n+import java.util.Map;\n+\n+import static org.folio.rest.RestVerticle.OKAPI_HEADER_TENANT;\n+import static org.folio.rest.utils.CalendarConstants.CALENDAR;\n+\n+\n+public class CalendarAPI implements CalendarResource {\n   private CalendarAPI() {\n   }\n-/*\n+\n \n   private static final Logger log = LoggerFactory.getLogger(CalendarAPI.class);\n \n   private static final String FAILED_TO_UPDATE_EVENTS = \"Failed to update events.\";\n   private static final String JSONB_POSTFIX = \".jsonb\";\n   private static final String TIME_PATTERN = \"HH:mm:ss.SSS'Z'\";\n   private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormat.forPattern(TIME_PATTERN);\n+\n   @Override\n-  public void postCalendarCalendars(ModCalendarJson entity, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {\n-    String tenantId = TenantTool.calculateTenantId(okapiHeaders.get(OKAPI_HEADER_TENANT));\n-    PostgresClient postgresClient = PostgresClient.getInstance(vertxContext.owner(), tenantId);\n-    vertxContext.runOnContext(v ->\n-      postgresClient.startTx(beginTx -> postgresClient.save(beginTx, CALENDAR, entity, reply -> {\n-        if (reply.succeeded()) {\n-          postgresClient.endTx(beginTx, done -> asyncResultHandler.handle(Future.succeededFuture(PostCalendarCalendarsResponse.withJsonCreated(entity))));\n-        } else {\n-          postgresClient.rollbackTx(beginTx, done -> asyncResultHandler.handle(Future.succeededFuture(PostCalendarCalendarsResponse.withPlainInternalServerError(reply.cause().getMessage()))));\n-        }\n-      }))\n-    );\n+  public void getCalendarOpenings(String servicePointId, Date startDate, Date endDate, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {\n+\n+  }\n+\n+  @Override\n+  public void getCalendarOpeningsByServicePointIdRegular(String servicePointId, Boolean withOpeningHours, Boolean withExceptions, Boolean showPast, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {\n+\n+  }\n+\n+  @Override\n+  public void postCalendarOpeningsByServicePointIdRegular(String servicePointId, OpeningPeriod_ entity, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {\n+//    String tenantId = TenantTool.calculateTenantId(okapiHeaders.get(OKAPI_HEADER_TENANT));\n+//    entity.set\n+//    PostgresClient postgresClient = PostgresClient.getInstance(vertxContext.owner(), tenantId);\n+//    vertxContext.runOnContext(v ->\n+//      postgresClient.startTx(beginTx -> postgresClient.save(beginTx, CALENDAR, entity, reply -> {\n+//        if (reply.succeeded()) {\n+//          postgresClient.endTx(beginTx, done -> asyncResultHandler.handle(Future.succeededFuture(PostCalendarOpeningsByServicePointIdResponse.withJsonCreated(entity))));\n+//        } else {\n+//          postgresClient.rollbackTx(beginTx, done -> asyncResultHandler.handle(Future.succeededFuture(PostCalendarOpeningsByServicePointIdResponse.withInternalServerError(/*reply.cause().getMessage()*/))));\n+//        }\n+//      }))\n+//    );\n+  }\n+\n+  @Override\n+  public void deleteCalendarOpeningsByServicePointIdRegular(String servicePointId, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {\n+\n+  }\n+\n+  @Override\n+  public void putCalendarOpeningsByServicePointIdRegular(String servicePointId, OpeningPeriod_ entity, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {\n+\n+  }\n+\n+  @Override\n+  public void getCalendarOpeningsByServicePointIdRegularByOpeningId(String openingId, String servicePointId, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {","path":"src/main/java/org/folio/rest/impl/CalendarAPI.java","position":85,"original_position":85,"commit_id":"819e4e911e921daa2c8ffe89e246a0bcb6247c84","original_commit_id":"819e4e911e921daa2c8ffe89e246a0bcb6247c84","user":{"login":"id-jenkins","id":16718781,"node_id":"MDQ6VXNlcjE2NzE4Nzgx","avatar_url":"https://avatars0.githubusercontent.com/u/16718781?v=4","gravatar_id":"","url":"https://api.github.com/users/id-jenkins","html_url":"https://github.com/id-jenkins","followers_url":"https://api.github.com/users/id-jenkins/followers","following_url":"https://api.github.com/users/id-jenkins/following{/other_user}","gists_url":"https://api.github.com/users/id-jenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/id-jenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/id-jenkins/subscriptions","organizations_url":"https://api.github.com/users/id-jenkins/orgs","repos_url":"https://api.github.com/users/id-jenkins/repos","events_url":"https://api.github.com/users/id-jenkins/events{/privacy}","received_events_url":"https://api.github.com/users/id-jenkins/received_events","type":"User","site_admin":false},"body":"![CRITICAL](https://sonarsource.github.io/sonar-github/severity-critical.png 'Severity: CRITICAL') Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation. [![rule](https://sonarsource.github.io/sonar-github/rule.png)](https://sonarcloud.io/coding_rules#rule_key=squid%3AS1186)\n","created_at":"2018-06-01T13:50:26Z","updated_at":"2018-06-01T13:50:26Z","html_url":"https://github.com/folio-org/mod-calendar/pull/24#discussion_r192402067","pull_request_url":"https://api.github.com/repos/folio-org/mod-calendar/pulls/24","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/folio-org/mod-calendar/pulls/comments/192402067"},"html":{"href":"https://github.com/folio-org/mod-calendar/pull/24#discussion_r192402067"},"pull_request":{"href":"https://api.github.com/repos/folio-org/mod-calendar/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/folio-org/mod-calendar/pulls/24","id":192039928,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMDM5OTI4","html_url":"https://github.com/folio-org/mod-calendar/pull/24","diff_url":"https://github.com/folio-org/mod-calendar/pull/24.diff","patch_url":"https://github.com/folio-org/mod-calendar/pull/24.patch","issue_url":"https://api.github.com/repos/folio-org/mod-calendar/issues/24","number":24,"state":"open","locked":false,"title":"Modcal 8","user":{"login":"zerdos91","id":14941713,"node_id":"MDQ6VXNlcjE0OTQxNzEz","avatar_url":"https://avatars2.githubusercontent.com/u/14941713?v=4","gravatar_id":"","url":"https://api.github.com/users/zerdos91","html_url":"https://github.com/zerdos91","followers_url":"https://api.github.com/users/zerdos91/followers","following_url":"https://api.github.com/users/zerdos91/following{/other_user}","gists_url":"https://api.github.com/users/zerdos91/gists{/gist_id}","starred_url":"https://api.github.com/users/zerdos91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zerdos91/subscriptions","organizations_url":"https://api.github.com/users/zerdos91/orgs","repos_url":"https://api.github.com/users/zerdos91/repos","events_url":"https://api.github.com/users/zerdos91/events{/privacy}","received_events_url":"https://api.github.com/users/zerdos91/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-01T13:47:30Z","updated_at":"2018-06-01T13:50:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c3fc3f6ecd85e7598e23c7d6da13dfd88933efd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/folio-org/mod-calendar/pulls/24/commits","review_comments_url":"https://api.github.com/repos/folio-org/mod-calendar/pulls/24/comments","review_comment_url":"https://api.github.com/repos/folio-org/mod-calendar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/folio-org/mod-calendar/issues/24/comments","statuses_url":"https://api.github.com/repos/folio-org/mod-calendar/statuses/819e4e911e921daa2c8ffe89e246a0bcb6247c84","head":{"label":"folio-org:MODCAL-8","ref":"MODCAL-8","sha":"819e4e911e921daa2c8ffe89e246a0bcb6247c84","user":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"repo":{"id":111073391,"node_id":"MDEwOlJlcG9zaXRvcnkxMTEwNzMzOTE=","name":"mod-calendar","full_name":"folio-org/mod-calendar","owner":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/folio-org/mod-calendar","description":null,"fork":false,"url":"https://api.github.com/repos/folio-org/mod-calendar","forks_url":"https://api.github.com/repos/folio-org/mod-calendar/forks","keys_url":"https://api.github.com/repos/folio-org/mod-calendar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/folio-org/mod-calendar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/folio-org/mod-calendar/teams","hooks_url":"https://api.github.com/repos/folio-org/mod-calendar/hooks","issue_events_url":"https://api.github.com/repos/folio-org/mod-calendar/issues/events{/number}","events_url":"https://api.github.com/repos/folio-org/mod-calendar/events","assignees_url":"https://api.github.com/repos/folio-org/mod-calendar/assignees{/user}","branches_url":"https://api.github.com/repos/folio-org/mod-calendar/branches{/branch}","tags_url":"https://api.github.com/repos/folio-org/mod-calendar/tags","blobs_url":"https://api.github.com/repos/folio-org/mod-calendar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/folio-org/mod-calendar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/folio-org/mod-calendar/git/refs{/sha}","trees_url":"https://api.github.com/repos/folio-org/mod-calendar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/folio-org/mod-calendar/statuses/{sha}","languages_url":"https://api.github.com/repos/folio-org/mod-calendar/languages","stargazers_url":"https://api.github.com/repos/folio-org/mod-calendar/stargazers","contributors_url":"https://api.github.com/repos/folio-org/mod-calendar/contributors","subscribers_url":"https://api.github.com/repos/folio-org/mod-calendar/subscribers","subscription_url":"https://api.github.com/repos/folio-org/mod-calendar/subscription","commits_url":"https://api.github.com/repos/folio-org/mod-calendar/commits{/sha}","git_commits_url":"https://api.github.com/repos/folio-org/mod-calendar/git/commits{/sha}","comments_url":"https://api.github.com/repos/folio-org/mod-calendar/comments{/number}","issue_comment_url":"https://api.github.com/repos/folio-org/mod-calendar/issues/comments{/number}","contents_url":"https://api.github.com/repos/folio-org/mod-calendar/contents/{+path}","compare_url":"https://api.github.com/repos/folio-org/mod-calendar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/folio-org/mod-calendar/merges","archive_url":"https://api.github.com/repos/folio-org/mod-calendar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/folio-org/mod-calendar/downloads","issues_url":"https://api.github.com/repos/folio-org/mod-calendar/issues{/number}","pulls_url":"https://api.github.com/repos/folio-org/mod-calendar/pulls{/number}","milestones_url":"https://api.github.com/repos/folio-org/mod-calendar/milestones{/number}","notifications_url":"https://api.github.com/repos/folio-org/mod-calendar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/folio-org/mod-calendar/labels{/name}","releases_url":"https://api.github.com/repos/folio-org/mod-calendar/releases{/id}","deployments_url":"https://api.github.com/repos/folio-org/mod-calendar/deployments","created_at":"2017-11-17T07:43:27Z","updated_at":"2018-05-31T08:01:50Z","pushed_at":"2018-06-01T13:47:31Z","git_url":"git://github.com/folio-org/mod-calendar.git","ssh_url":"git@github.com:folio-org/mod-calendar.git","clone_url":"https://github.com/folio-org/mod-calendar.git","svn_url":"https://github.com/folio-org/mod-calendar","homepage":null,"size":172,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"folio-org:master","ref":"master","sha":"64ba7ea430336882349ef645c1bc7bba54eba0ab","user":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"repo":{"id":111073391,"node_id":"MDEwOlJlcG9zaXRvcnkxMTEwNzMzOTE=","name":"mod-calendar","full_name":"folio-org/mod-calendar","owner":{"login":"folio-org","id":16495055,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDk1MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/16495055?v=4","gravatar_id":"","url":"https://api.github.com/users/folio-org","html_url":"https://github.com/folio-org","followers_url":"https://api.github.com/users/folio-org/followers","following_url":"https://api.github.com/users/folio-org/following{/other_user}","gists_url":"https://api.github.com/users/folio-org/gists{/gist_id}","starred_url":"https://api.github.com/users/folio-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folio-org/subscriptions","organizations_url":"https://api.github.com/users/folio-org/orgs","repos_url":"https://api.github.com/users/folio-org/repos","events_url":"https://api.github.com/users/folio-org/events{/privacy}","received_events_url":"https://api.github.com/users/folio-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/folio-org/mod-calendar","description":null,"fork":false,"url":"https://api.github.com/repos/folio-org/mod-calendar","forks_url":"https://api.github.com/repos/folio-org/mod-calendar/forks","keys_url":"https://api.github.com/repos/folio-org/mod-calendar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/folio-org/mod-calendar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/folio-org/mod-calendar/teams","hooks_url":"https://api.github.com/repos/folio-org/mod-calendar/hooks","issue_events_url":"https://api.github.com/repos/folio-org/mod-calendar/issues/events{/number}","events_url":"https://api.github.com/repos/folio-org/mod-calendar/events","assignees_url":"https://api.github.com/repos/folio-org/mod-calendar/assignees{/user}","branches_url":"https://api.github.com/repos/folio-org/mod-calendar/branches{/branch}","tags_url":"https://api.github.com/repos/folio-org/mod-calendar/tags","blobs_url":"https://api.github.com/repos/folio-org/mod-calendar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/folio-org/mod-calendar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/folio-org/mod-calendar/git/refs{/sha}","trees_url":"https://api.github.com/repos/folio-org/mod-calendar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/folio-org/mod-calendar/statuses/{sha}","languages_url":"https://api.github.com/repos/folio-org/mod-calendar/languages","stargazers_url":"https://api.github.com/repos/folio-org/mod-calendar/stargazers","contributors_url":"https://api.github.com/repos/folio-org/mod-calendar/contributors","subscribers_url":"https://api.github.com/repos/folio-org/mod-calendar/subscribers","subscription_url":"https://api.github.com/repos/folio-org/mod-calendar/subscription","commits_url":"https://api.github.com/repos/folio-org/mod-calendar/commits{/sha}","git_commits_url":"https://api.github.com/repos/folio-org/mod-calendar/git/commits{/sha}","comments_url":"https://api.github.com/repos/folio-org/mod-calendar/comments{/number}","issue_comment_url":"https://api.github.com/repos/folio-org/mod-calendar/issues/comments{/number}","contents_url":"https://api.github.com/repos/folio-org/mod-calendar/contents/{+path}","compare_url":"https://api.github.com/repos/folio-org/mod-calendar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/folio-org/mod-calendar/merges","archive_url":"https://api.github.com/repos/folio-org/mod-calendar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/folio-org/mod-calendar/downloads","issues_url":"https://api.github.com/repos/folio-org/mod-calendar/issues{/number}","pulls_url":"https://api.github.com/repos/folio-org/mod-calendar/pulls{/number}","milestones_url":"https://api.github.com/repos/folio-org/mod-calendar/milestones{/number}","notifications_url":"https://api.github.com/repos/folio-org/mod-calendar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/folio-org/mod-calendar/labels{/name}","releases_url":"https://api.github.com/repos/folio-org/mod-calendar/releases{/id}","deployments_url":"https://api.github.com/repos/folio-org/mod-calendar/deployments","created_at":"2017-11-17T07:43:27Z","updated_at":"2018-05-31T08:01:50Z","pushed_at":"2018-06-01T13:47:31Z","git_url":"git://github.com/folio-org/mod-calendar.git","ssh_url":"git@github.com:folio-org/mod-calendar.git","clone_url":"https://github.com/folio-org/mod-calendar.git","svn_url":"https://github.com/folio-org/mod-calendar","homepage":null,"size":172,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/folio-org/mod-calendar/pulls/24"},"html":{"href":"https://github.com/folio-org/mod-calendar/pull/24"},"issue":{"href":"https://api.github.com/repos/folio-org/mod-calendar/issues/24"},"comments":{"href":"https://api.github.com/repos/folio-org/mod-calendar/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/folio-org/mod-calendar/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/folio-org/mod-calendar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/folio-org/mod-calendar/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/folio-org/mod-calendar/statuses/819e4e911e921daa2c8ffe89e246a0bcb6247c84"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"id-jenkins"}}