{"action":"created","comment":{"url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/comments/227308570","pull_request_review_id":167317658,"id":227308570,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzMwODU3MA==","diff_hunk":"@@ -185,6 +185,66 @@ module.exports = async (robot) => {\n     }\n   }\n \n+  /**\n+   * Send reminder one day before vacation if the user is not reported to customer.\n+   *\n+   * @param {Robot} robot - Hubot instance.\n+   */\n+  function checkIfNotReported (robot) {\n+    const users = Object.values(robot.brain.data.users)\n+    const tomorrow = moment().add(1, 'day')\n+\n+    for (const user of users) {\n+      const vivaLasVegas = user.vivaLasVegas\n+      if (!vivaLasVegas || vivaLasVegas.requestStatus !== APPROVED_STATUS) {\n+        continue\n+      }\n+      const leaveStart = moment(user.leaveStart)\n+\n+      if (isEqualMonthDay(leaveStart, tomorrow)) {\n+        const isReport = vivaLasVegas.reportToCustomer ? 'в курсе' : 'не предупрежден'\n+        const message = `${user.name} уходит в отпуск с завтрашнего дня. Заказчик ${isReport}.`\n+\n+        robot.messageRoom(LEAVE_COORDINATION_CHANNEL, message)\n+      }\n+    }\n+  }\n+\n+  /**\n+   * Send reminders of the upcoming vacation to HR.\n+   *","path":"src/viva.js","position":31,"original_position":31,"commit_id":"55ec754dd144ea4bbd1fa5c51db419a6b505a74a","original_commit_id":"55ec754dd144ea4bbd1fa5c51db419a6b505a74a","user":{"login":"polina-popova","id":42995454,"node_id":"MDQ6VXNlcjQyOTk1NDU0","avatar_url":"https://avatars3.githubusercontent.com/u/42995454?v=4","gravatar_id":"","url":"https://api.github.com/users/polina-popova","html_url":"https://github.com/polina-popova","followers_url":"https://api.github.com/users/polina-popova/followers","following_url":"https://api.github.com/users/polina-popova/following{/other_user}","gists_url":"https://api.github.com/users/polina-popova/gists{/gist_id}","starred_url":"https://api.github.com/users/polina-popova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polina-popova/subscriptions","organizations_url":"https://api.github.com/users/polina-popova/orgs","repos_url":"https://api.github.com/users/polina-popova/repos","events_url":"https://api.github.com/users/polina-popova/events{/privacy}","received_events_url":"https://api.github.com/users/polina-popova/received_events","type":"User","site_admin":false},"body":"`Send reminders of the upcoming vacation to HR channel.`","created_at":"2018-10-23T09:37:40Z","updated_at":"2018-10-23T09:53:29Z","html_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas/pull/45#discussion_r227308570","pull_request_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/45","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/comments/227308570"},"html":{"href":"https://github.com/tolstoyevsky/hubot-viva-las-vegas/pull/45#discussion_r227308570"},"pull_request":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/45","id":222451966,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNDUxOTY2","html_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas/pull/45","diff_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas/pull/45.diff","patch_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas/pull/45.patch","issue_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues/45","number":45,"state":"open","locked":false,"title":"Send reminder 1/14/30 days before vacation","user":{"login":"BehindLoader","id":7967826,"node_id":"MDQ6VXNlcjc5Njc4MjY=","avatar_url":"https://avatars1.githubusercontent.com/u/7967826?v=4","gravatar_id":"","url":"https://api.github.com/users/BehindLoader","html_url":"https://github.com/BehindLoader","followers_url":"https://api.github.com/users/BehindLoader/followers","following_url":"https://api.github.com/users/BehindLoader/following{/other_user}","gists_url":"https://api.github.com/users/BehindLoader/gists{/gist_id}","starred_url":"https://api.github.com/users/BehindLoader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BehindLoader/subscriptions","organizations_url":"https://api.github.com/users/BehindLoader/orgs","repos_url":"https://api.github.com/users/BehindLoader/repos","events_url":"https://api.github.com/users/BehindLoader/events{/privacy}","received_events_url":"https://api.github.com/users/BehindLoader/received_events","type":"User","site_admin":false},"body":"close #48 ","created_at":"2018-10-12T12:35:57Z","updated_at":"2018-10-23T09:53:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbf7531d080a7dd720087ef062d2e1c2591a0af1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1095684603,"node_id":"MDU6TGFiZWwxMDk1Njg0NjAz","url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/labels/to%20develop","name":"to develop","color":"2902ed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/45/commits","review_comments_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/45/comments","review_comment_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues/45/comments","statuses_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/statuses/55ec754dd144ea4bbd1fa5c51db419a6b505a74a","head":{"label":"tolstoyevsky:notify-in-advance","ref":"notify-in-advance","sha":"55ec754dd144ea4bbd1fa5c51db419a6b505a74a","user":{"login":"tolstoyevsky","id":5354708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzNTQ3MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/5354708?v=4","gravatar_id":"","url":"https://api.github.com/users/tolstoyevsky","html_url":"https://github.com/tolstoyevsky","followers_url":"https://api.github.com/users/tolstoyevsky/followers","following_url":"https://api.github.com/users/tolstoyevsky/following{/other_user}","gists_url":"https://api.github.com/users/tolstoyevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tolstoyevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolstoyevsky/subscriptions","organizations_url":"https://api.github.com/users/tolstoyevsky/orgs","repos_url":"https://api.github.com/users/tolstoyevsky/repos","events_url":"https://api.github.com/users/tolstoyevsky/events{/privacy}","received_events_url":"https://api.github.com/users/tolstoyevsky/received_events","type":"Organization","site_admin":false},"repo":{"id":147546675,"node_id":"MDEwOlJlcG9zaXRvcnkxNDc1NDY2NzU=","name":"hubot-viva-las-vegas","full_name":"tolstoyevsky/hubot-viva-las-vegas","private":false,"owner":{"login":"tolstoyevsky","id":5354708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzNTQ3MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/5354708?v=4","gravatar_id":"","url":"https://api.github.com/users/tolstoyevsky","html_url":"https://github.com/tolstoyevsky","followers_url":"https://api.github.com/users/tolstoyevsky/followers","following_url":"https://api.github.com/users/tolstoyevsky/following{/other_user}","gists_url":"https://api.github.com/users/tolstoyevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tolstoyevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolstoyevsky/subscriptions","organizations_url":"https://api.github.com/users/tolstoyevsky/orgs","repos_url":"https://api.github.com/users/tolstoyevsky/repos","events_url":"https://api.github.com/users/tolstoyevsky/events{/privacy}","received_events_url":"https://api.github.com/users/tolstoyevsky/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas","description":"Hubot script which helps users to create leave requests","fork":false,"url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas","forks_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/forks","keys_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/teams","hooks_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/hooks","issue_events_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues/events{/number}","events_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/events","assignees_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/assignees{/user}","branches_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/branches{/branch}","tags_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/tags","blobs_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/refs{/sha}","trees_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/statuses/{sha}","languages_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/languages","stargazers_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/stargazers","contributors_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/contributors","subscribers_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/subscribers","subscription_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/subscription","commits_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/commits{/sha}","git_commits_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/commits{/sha}","comments_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/comments{/number}","issue_comment_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues/comments{/number}","contents_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/contents/{+path}","compare_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/merges","archive_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/downloads","issues_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues{/number}","pulls_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls{/number}","milestones_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/milestones{/number}","notifications_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/labels{/name}","releases_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/releases{/id}","deployments_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/deployments","created_at":"2018-09-05T16:17:50Z","updated_at":"2018-10-23T09:31:42Z","pushed_at":"2018-10-23T09:31:44Z","git_url":"git://github.com/tolstoyevsky/hubot-viva-las-vegas.git","ssh_url":"git@github.com:tolstoyevsky/hubot-viva-las-vegas.git","clone_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas.git","svn_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas","homepage":"","size":28,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"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":1,"open_issues":10,"watchers":1,"default_branch":"master"}},"base":{"label":"tolstoyevsky:master","ref":"master","sha":"4237d8bea1180e68862e7f39700e101e9cd6e59f","user":{"login":"tolstoyevsky","id":5354708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzNTQ3MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/5354708?v=4","gravatar_id":"","url":"https://api.github.com/users/tolstoyevsky","html_url":"https://github.com/tolstoyevsky","followers_url":"https://api.github.com/users/tolstoyevsky/followers","following_url":"https://api.github.com/users/tolstoyevsky/following{/other_user}","gists_url":"https://api.github.com/users/tolstoyevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tolstoyevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolstoyevsky/subscriptions","organizations_url":"https://api.github.com/users/tolstoyevsky/orgs","repos_url":"https://api.github.com/users/tolstoyevsky/repos","events_url":"https://api.github.com/users/tolstoyevsky/events{/privacy}","received_events_url":"https://api.github.com/users/tolstoyevsky/received_events","type":"Organization","site_admin":false},"repo":{"id":147546675,"node_id":"MDEwOlJlcG9zaXRvcnkxNDc1NDY2NzU=","name":"hubot-viva-las-vegas","full_name":"tolstoyevsky/hubot-viva-las-vegas","private":false,"owner":{"login":"tolstoyevsky","id":5354708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzNTQ3MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/5354708?v=4","gravatar_id":"","url":"https://api.github.com/users/tolstoyevsky","html_url":"https://github.com/tolstoyevsky","followers_url":"https://api.github.com/users/tolstoyevsky/followers","following_url":"https://api.github.com/users/tolstoyevsky/following{/other_user}","gists_url":"https://api.github.com/users/tolstoyevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tolstoyevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolstoyevsky/subscriptions","organizations_url":"https://api.github.com/users/tolstoyevsky/orgs","repos_url":"https://api.github.com/users/tolstoyevsky/repos","events_url":"https://api.github.com/users/tolstoyevsky/events{/privacy}","received_events_url":"https://api.github.com/users/tolstoyevsky/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas","description":"Hubot script which helps users to create leave requests","fork":false,"url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas","forks_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/forks","keys_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/teams","hooks_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/hooks","issue_events_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues/events{/number}","events_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/events","assignees_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/assignees{/user}","branches_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/branches{/branch}","tags_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/tags","blobs_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/refs{/sha}","trees_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/statuses/{sha}","languages_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/languages","stargazers_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/stargazers","contributors_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/contributors","subscribers_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/subscribers","subscription_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/subscription","commits_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/commits{/sha}","git_commits_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/git/commits{/sha}","comments_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/comments{/number}","issue_comment_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues/comments{/number}","contents_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/contents/{+path}","compare_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/merges","archive_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/downloads","issues_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues{/number}","pulls_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls{/number}","milestones_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/milestones{/number}","notifications_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/labels{/name}","releases_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/releases{/id}","deployments_url":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/deployments","created_at":"2018-09-05T16:17:50Z","updated_at":"2018-10-23T09:31:42Z","pushed_at":"2018-10-23T09:31:44Z","git_url":"git://github.com/tolstoyevsky/hubot-viva-las-vegas.git","ssh_url":"git@github.com:tolstoyevsky/hubot-viva-las-vegas.git","clone_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas.git","svn_url":"https://github.com/tolstoyevsky/hubot-viva-las-vegas","homepage":"","size":28,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"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":1,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/45"},"html":{"href":"https://github.com/tolstoyevsky/hubot-viva-las-vegas/pull/45"},"issue":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues/45"},"comments":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/tolstoyevsky/hubot-viva-las-vegas/statuses/55ec754dd144ea4bbd1fa5c51db419a6b505a74a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"polina-popova"}}