{"action":"created","comment":{"url":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/comments/183284694","pull_request_review_id":114252802,"id":183284694,"diff_hunk":"@@ -241,6 +306,110 @@ export default class CenterController {\n         });\n         res.status(200).json(eventsWithActiveStatus);\n       })\n-      .catch(() => res.status(500).send('Internal Server Error'));\n+      .catch(() => {\n+        res.status(500).send('Internal Server Error');\n+      });\n+  }\n+  /**\n+   * Activate center\n+   *\n+   * @param {object} req - Server request\n+   * @param {object} res - Server response\n+   * @returns {*} - Server response\n+   * @memberof CenterController\n+   */\n+  static async approveCenter(req, res) {\n+    const centerId = req.params.id;\n+    const center = await models.centers.findById(centerId);\n+\n+    if (!center) {\n+      return res.status(404).json({ centerId: 'Can not find center' });\n+    }\n+\n+    return models.centers\n+      .update({ approve: APPROVED_CENTER }, { where: { id: centerId } })\n+      .then(() => res.status(201).json(center));\n+  }\n+\n+  /**\n+   * Cancel Center Creation Application\n+   *\n+   * @static\n+   * @param {object} req - Server request\n+   * @param {object} res - Server response\n+   * @returns {*} - Server response\n+   * @memberof CenterController\n+   */\n+  static async declineCenter(req, res) {\n+    const centerId = req.params.id;\n+    const center = await models.centers.findById(centerId);\n+\n+    if (!center) {\n+      return res.status(404).json({ centerId: 'Can not find center' });\n+    }\n+\n+    return models.centers\n+      .update({ approve: DECLINED_CENTER }, { where: { centerId } })\n+      .then(() => res.status(201).json(center));\n+  }\n+\n+  /**\n+   * Toggle the availability of a center\n+   *\n+   * @static\n+   * @param {object} req - Server request\n+   * @param {object} res - Server response\n+   * @returns {*} - Server response\n+   * @memberof CenterController\n+   */\n+  static async toggleCenterActiveness(req, res) {\n+    const centerId = req.params.id;\n+    const center = await models.centers.find({\n+      where: {\n+        $and: [{ id: centerId }, { ownerId: req.user.id }]\n+      }\n+    });\n+\n+    if (!center) {\n+      return res.status(404).json({ centerId: 'Can not find center' });\n+    }\n+\n+    const active =\n+      center.active === ACTIVE_CENTER ? LOCK_CENTER : ACTIVE_CENTER;\n+\n+    return models.centers\n+      .update({ active: DECLINED_CENTER }, { where: { active } })\n+      .then(() => res.status(201).json(active));\n+  }\n+\n+  /**\n+   * Cancel Event\n+   *\n+   * @static\n+   * @param {object} req - Server request\n+   * @param {object} res - Server response\n+   * @returns {*} - Server response\n+   * @memberof CenterController\n+   */\n+  static cancelEvent(req, res) {\n+    return models.sequelize\n+      .query(\n+        'SELECT * FROM events, centers WHERE events.\"centerId\" = centers.id AND centers.\"ownerId\" = :ownerId AND events.\"id\" = :eventId',","path":"server/v2/controllers/CenterController.js","position":277,"original_position":277,"commit_id":"107f70c0e5e6b553e0e221dccd54cdf04dd11178","original_commit_id":"107f70c0e5e6b553e0e221dccd54cdf04dd11178","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line 397 exceeds the maximum line length of 80          max-len","created_at":"2018-04-23T06:16:12Z","updated_at":"2018-04-23T06:16:14Z","html_url":"https://github.com/omokolataiwo/eventmanager/pull/33#discussion_r183284694","pull_request_url":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/33","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/comments/183284694"},"html":{"href":"https://github.com/omokolataiwo/eventmanager/pull/33#discussion_r183284694"},"pull_request":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/33","id":183334897,"html_url":"https://github.com/omokolataiwo/eventmanager/pull/33","diff_url":"https://github.com/omokolataiwo/eventmanager/pull/33.diff","patch_url":"https://github.com/omokolataiwo/eventmanager/pull/33.patch","issue_url":"https://api.github.com/repos/omokolataiwo/eventmanager/issues/33","number":33,"state":"open","locked":false,"title":"#156984764:  Test codebase","user":{"login":"omokolataiwo","id":30238960,"avatar_url":"https://avatars3.githubusercontent.com/u/30238960?v=4","gravatar_id":"","url":"https://api.github.com/users/omokolataiwo","html_url":"https://github.com/omokolataiwo","followers_url":"https://api.github.com/users/omokolataiwo/followers","following_url":"https://api.github.com/users/omokolataiwo/following{/other_user}","gists_url":"https://api.github.com/users/omokolataiwo/gists{/gist_id}","starred_url":"https://api.github.com/users/omokolataiwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omokolataiwo/subscriptions","organizations_url":"https://api.github.com/users/omokolataiwo/orgs","repos_url":"https://api.github.com/users/omokolataiwo/repos","events_url":"https://api.github.com/users/omokolataiwo/events{/privacy}","received_events_url":"https://api.github.com/users/omokolataiwo/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nTested all endpoints \r\n#### Description of Task to be completed?\r\n- [x] test event controller\r\n- [x] test center controller\r\n- [x] test user controller\r\n#### How should this be manually tested?\r\n- Clone the repository\r\n- `cd <repo_directory>`\r\n- `npm install`\r\n- `npm test`\r\n\r\n#### Any background context you want to provide?\r\nN/A\r\n\r\n#### Screen shot?\r\n![image](https://user-images.githubusercontent.com/30238960/39109743-1520ea3e-46c6-11e8-87d8-0b6aa41566b6.png)\r\n\r\n#### What are the relevant pivotal tracker stories?\r\n[Finishes #156984764]","created_at":"2018-04-23T06:15:49Z","updated_at":"2018-04-23T06:16:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"122bbd133cff63143b0af823a13f914d31ae8bdf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/33/commits","review_comments_url":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/33/comments","review_comment_url":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/omokolataiwo/eventmanager/issues/33/comments","statuses_url":"https://api.github.com/repos/omokolataiwo/eventmanager/statuses/107f70c0e5e6b553e0e221dccd54cdf04dd11178","head":{"label":"omokolataiwo:feat/156984764/write-test","ref":"feat/156984764/write-test","sha":"107f70c0e5e6b553e0e221dccd54cdf04dd11178","user":{"login":"omokolataiwo","id":30238960,"avatar_url":"https://avatars3.githubusercontent.com/u/30238960?v=4","gravatar_id":"","url":"https://api.github.com/users/omokolataiwo","html_url":"https://github.com/omokolataiwo","followers_url":"https://api.github.com/users/omokolataiwo/followers","following_url":"https://api.github.com/users/omokolataiwo/following{/other_user}","gists_url":"https://api.github.com/users/omokolataiwo/gists{/gist_id}","starred_url":"https://api.github.com/users/omokolataiwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omokolataiwo/subscriptions","organizations_url":"https://api.github.com/users/omokolataiwo/orgs","repos_url":"https://api.github.com/users/omokolataiwo/repos","events_url":"https://api.github.com/users/omokolataiwo/events{/privacy}","received_events_url":"https://api.github.com/users/omokolataiwo/received_events","type":"User","site_admin":false},"repo":{"id":110697270,"name":"eventmanager","full_name":"omokolataiwo/eventmanager","owner":{"login":"omokolataiwo","id":30238960,"avatar_url":"https://avatars3.githubusercontent.com/u/30238960?v=4","gravatar_id":"","url":"https://api.github.com/users/omokolataiwo","html_url":"https://github.com/omokolataiwo","followers_url":"https://api.github.com/users/omokolataiwo/followers","following_url":"https://api.github.com/users/omokolataiwo/following{/other_user}","gists_url":"https://api.github.com/users/omokolataiwo/gists{/gist_id}","starred_url":"https://api.github.com/users/omokolataiwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omokolataiwo/subscriptions","organizations_url":"https://api.github.com/users/omokolataiwo/orgs","repos_url":"https://api.github.com/users/omokolataiwo/repos","events_url":"https://api.github.com/users/omokolataiwo/events{/privacy}","received_events_url":"https://api.github.com/users/omokolataiwo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/omokolataiwo/eventmanager","description":"EventManager that manages your booking for your events. EventManager is very convenient way of booking your events. ","fork":false,"url":"https://api.github.com/repos/omokolataiwo/eventmanager","forks_url":"https://api.github.com/repos/omokolataiwo/eventmanager/forks","keys_url":"https://api.github.com/repos/omokolataiwo/eventmanager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omokolataiwo/eventmanager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omokolataiwo/eventmanager/teams","hooks_url":"https://api.github.com/repos/omokolataiwo/eventmanager/hooks","issue_events_url":"https://api.github.com/repos/omokolataiwo/eventmanager/issues/events{/number}","events_url":"https://api.github.com/repos/omokolataiwo/eventmanager/events","assignees_url":"https://api.github.com/repos/omokolataiwo/eventmanager/assignees{/user}","branches_url":"https://api.github.com/repos/omokolataiwo/eventmanager/branches{/branch}","tags_url":"https://api.github.com/repos/omokolataiwo/eventmanager/tags","blobs_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/refs{/sha}","trees_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omokolataiwo/eventmanager/statuses/{sha}","languages_url":"https://api.github.com/repos/omokolataiwo/eventmanager/languages","stargazers_url":"https://api.github.com/repos/omokolataiwo/eventmanager/stargazers","contributors_url":"https://api.github.com/repos/omokolataiwo/eventmanager/contributors","subscribers_url":"https://api.github.com/repos/omokolataiwo/eventmanager/subscribers","subscription_url":"https://api.github.com/repos/omokolataiwo/eventmanager/subscription","commits_url":"https://api.github.com/repos/omokolataiwo/eventmanager/commits{/sha}","git_commits_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/commits{/sha}","comments_url":"https://api.github.com/repos/omokolataiwo/eventmanager/comments{/number}","issue_comment_url":"https://api.github.com/repos/omokolataiwo/eventmanager/issues/comments{/number}","contents_url":"https://api.github.com/repos/omokolataiwo/eventmanager/contents/{+path}","compare_url":"https://api.github.com/repos/omokolataiwo/eventmanager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omokolataiwo/eventmanager/merges","archive_url":"https://api.github.com/repos/omokolataiwo/eventmanager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omokolataiwo/eventmanager/downloads","issues_url":"https://api.github.com/repos/omokolataiwo/eventmanager/issues{/number}","pulls_url":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls{/number}","milestones_url":"https://api.github.com/repos/omokolataiwo/eventmanager/milestones{/number}","notifications_url":"https://api.github.com/repos/omokolataiwo/eventmanager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omokolataiwo/eventmanager/labels{/name}","releases_url":"https://api.github.com/repos/omokolataiwo/eventmanager/releases{/id}","deployments_url":"https://api.github.com/repos/omokolataiwo/eventmanager/deployments","created_at":"2017-11-14T13:59:38Z","updated_at":"2018-04-20T20:53:52Z","pushed_at":"2018-04-23T06:15:49Z","git_url":"git://github.com/omokolataiwo/eventmanager.git","ssh_url":"git@github.com:omokolataiwo/eventmanager.git","clone_url":"https://github.com/omokolataiwo/eventmanager.git","svn_url":"https://github.com/omokolataiwo/eventmanager","homepage":"","size":8350,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"base":{"label":"omokolataiwo:develop","ref":"develop","sha":"bb3dbde9bd8cd88edc31f9f5bb564e7a228f26f6","user":{"login":"omokolataiwo","id":30238960,"avatar_url":"https://avatars3.githubusercontent.com/u/30238960?v=4","gravatar_id":"","url":"https://api.github.com/users/omokolataiwo","html_url":"https://github.com/omokolataiwo","followers_url":"https://api.github.com/users/omokolataiwo/followers","following_url":"https://api.github.com/users/omokolataiwo/following{/other_user}","gists_url":"https://api.github.com/users/omokolataiwo/gists{/gist_id}","starred_url":"https://api.github.com/users/omokolataiwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omokolataiwo/subscriptions","organizations_url":"https://api.github.com/users/omokolataiwo/orgs","repos_url":"https://api.github.com/users/omokolataiwo/repos","events_url":"https://api.github.com/users/omokolataiwo/events{/privacy}","received_events_url":"https://api.github.com/users/omokolataiwo/received_events","type":"User","site_admin":false},"repo":{"id":110697270,"name":"eventmanager","full_name":"omokolataiwo/eventmanager","owner":{"login":"omokolataiwo","id":30238960,"avatar_url":"https://avatars3.githubusercontent.com/u/30238960?v=4","gravatar_id":"","url":"https://api.github.com/users/omokolataiwo","html_url":"https://github.com/omokolataiwo","followers_url":"https://api.github.com/users/omokolataiwo/followers","following_url":"https://api.github.com/users/omokolataiwo/following{/other_user}","gists_url":"https://api.github.com/users/omokolataiwo/gists{/gist_id}","starred_url":"https://api.github.com/users/omokolataiwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omokolataiwo/subscriptions","organizations_url":"https://api.github.com/users/omokolataiwo/orgs","repos_url":"https://api.github.com/users/omokolataiwo/repos","events_url":"https://api.github.com/users/omokolataiwo/events{/privacy}","received_events_url":"https://api.github.com/users/omokolataiwo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/omokolataiwo/eventmanager","description":"EventManager that manages your booking for your events. EventManager is very convenient way of booking your events. ","fork":false,"url":"https://api.github.com/repos/omokolataiwo/eventmanager","forks_url":"https://api.github.com/repos/omokolataiwo/eventmanager/forks","keys_url":"https://api.github.com/repos/omokolataiwo/eventmanager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omokolataiwo/eventmanager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omokolataiwo/eventmanager/teams","hooks_url":"https://api.github.com/repos/omokolataiwo/eventmanager/hooks","issue_events_url":"https://api.github.com/repos/omokolataiwo/eventmanager/issues/events{/number}","events_url":"https://api.github.com/repos/omokolataiwo/eventmanager/events","assignees_url":"https://api.github.com/repos/omokolataiwo/eventmanager/assignees{/user}","branches_url":"https://api.github.com/repos/omokolataiwo/eventmanager/branches{/branch}","tags_url":"https://api.github.com/repos/omokolataiwo/eventmanager/tags","blobs_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/refs{/sha}","trees_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omokolataiwo/eventmanager/statuses/{sha}","languages_url":"https://api.github.com/repos/omokolataiwo/eventmanager/languages","stargazers_url":"https://api.github.com/repos/omokolataiwo/eventmanager/stargazers","contributors_url":"https://api.github.com/repos/omokolataiwo/eventmanager/contributors","subscribers_url":"https://api.github.com/repos/omokolataiwo/eventmanager/subscribers","subscription_url":"https://api.github.com/repos/omokolataiwo/eventmanager/subscription","commits_url":"https://api.github.com/repos/omokolataiwo/eventmanager/commits{/sha}","git_commits_url":"https://api.github.com/repos/omokolataiwo/eventmanager/git/commits{/sha}","comments_url":"https://api.github.com/repos/omokolataiwo/eventmanager/comments{/number}","issue_comment_url":"https://api.github.com/repos/omokolataiwo/eventmanager/issues/comments{/number}","contents_url":"https://api.github.com/repos/omokolataiwo/eventmanager/contents/{+path}","compare_url":"https://api.github.com/repos/omokolataiwo/eventmanager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omokolataiwo/eventmanager/merges","archive_url":"https://api.github.com/repos/omokolataiwo/eventmanager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omokolataiwo/eventmanager/downloads","issues_url":"https://api.github.com/repos/omokolataiwo/eventmanager/issues{/number}","pulls_url":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls{/number}","milestones_url":"https://api.github.com/repos/omokolataiwo/eventmanager/milestones{/number}","notifications_url":"https://api.github.com/repos/omokolataiwo/eventmanager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omokolataiwo/eventmanager/labels{/name}","releases_url":"https://api.github.com/repos/omokolataiwo/eventmanager/releases{/id}","deployments_url":"https://api.github.com/repos/omokolataiwo/eventmanager/deployments","created_at":"2017-11-14T13:59:38Z","updated_at":"2018-04-20T20:53:52Z","pushed_at":"2018-04-23T06:15:49Z","git_url":"git://github.com/omokolataiwo/eventmanager.git","ssh_url":"git@github.com:omokolataiwo/eventmanager.git","clone_url":"https://github.com/omokolataiwo/eventmanager.git","svn_url":"https://github.com/omokolataiwo/eventmanager","homepage":"","size":8350,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/33"},"html":{"href":"https://github.com/omokolataiwo/eventmanager/pull/33"},"issue":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/issues/33"},"comments":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/omokolataiwo/eventmanager/statuses/107f70c0e5e6b553e0e221dccd54cdf04dd11178"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}