payload: {"action":"created","comment":{"url":"https://api.github.com/repos/andela/magma-backend/pulls/comments/323537091","pull_request_review_id":287169727,"id":323537091,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyMzUzNzA5MQ==","diff_hunk":"@@ -22,4 +22,79 @@ export default class UserService {\n     userCredentials.password = await Helper.hashPassword(password);\n     return User.create(userCredentials);\n   }\n+\n+  \n+  /**\n+   * @method signin\n+   * @description Signs in user with valid credentials\n+   * @static\n+   * @param {object} loginCredentials - data object\n+   * @returns {object} JSON response\n+   * @memberof UserService\n+   */\n+  static async signin(loginCredentials) {\n+    const { email } = loginCredentials;\n+    const foundUser = await User.findOne({ where: { email } });\n+    const user = {\n+      id: foundUser.id,\n+      email: foundUser.email,\n+      firstName: foundUser.firstName,\n+      lastName: foundUser.lastName,\n+    };\n+    return user;\n+  }\n+\n+  /**\n+   * @method retrieveUser\n+   * @description Medium between the database and UserController\n+   * @static\n+   * @param {object} userCredentials - data object\n+   * @returns {object} JSON response\n+   * @memberof UserService\n+   */\n+  static async retrieveUser(id,email) {\n+    let user = await User.findOne({returning: true, where: {id, email}});\n+    return user;\n+  }\n+\n+  /**\n+   * @method updateUser\n+   * @description Medium between the database and UserController\n+   * @static\n+   * @param {object} userCredentials - data object\n+   * @returns {object} JSON response\n+   * @memberof UserService\n+   */\n+  static async updateUser(userCredentials,id,email) {\n+    const data = userCredentials;\n+    let user = await User.update( data, {returning: true, where: {id, email}});\n+    return user[1];\n+  }\n+\n+  /**\n+   * @method assignRole\n+   * @description Medium between the database and UserController\n+   * @static\n+   * @param {object} userCredentials - data object","path":"src/services/UserService.js","position":57,"original_position":57,"commit_id":"190bf5fbe11b16083c9351c90651bbad69be95a8","original_commit_id":"190bf5fbe11b16083c9351c90651bbad69be95a8","user":{"login":"hound[bot]","id":30008653,"node_id":"MDM6Qm90MzAwMDg2NTM=","avatar_url":"https://avatars1.githubusercontent.com/in/3598?v=4","gravatar_id":"","url":"https://api.github.com/users/hound%5Bbot%5D","html_url":"https://github.com/apps/hound","followers_url":"https://api.github.com/users/hound%5Bbot%5D/followers","following_url":"https://api.github.com/users/hound%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/hound%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/hound%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hound%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/hound%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/hound%5Bbot%5D/repos","events_url":"https://api.github.com/users/hound%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/hound%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Expected JSDoc for 'body' but found 'userCredentials'  valid-jsdoc","created_at":"2019-09-12T02:53:04Z","updated_at":"2019-09-12T02:53:06Z","html_url":"https://github.com/andela/magma-backend/pull/25#discussion_r323537091","pull_request_url":"https://api.github.com/repos/andela/magma-backend/pulls/25","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/magma-backend/pulls/comments/323537091"},"html":{"href":"https://github.com/andela/magma-backend/pull/25#discussion_r323537091"},"pull_request":{"href":"https://api.github.com/repos/andela/magma-backend/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/andela/magma-backend/pulls/25","id":314907384,"node_id":"MDExOlB1bGxSZXF1ZXN0MzE0OTA3Mzg0","html_url":"https://github.com/andela/magma-backend/pull/25","diff_url":"https://github.com/andela/magma-backend/pull/25.diff","patch_url":"https://github.com/andela/magma-backend/pull/25.patch","issue_url":"https://api.github.com/repos/andela/magma-backend/issues/25","number":25,"state":"open","locked":false,"title":"#167749963 Implement user role settings ","user":{"login":"Naimaoye","id":48380183,"node_id":"MDQ6VXNlcjQ4MzgwMTgz","avatar_url":"https://avatars0.githubusercontent.com/u/48380183?v=4","gravatar_id":"","url":"https://api.github.com/users/Naimaoye","html_url":"https://github.com/Naimaoye","followers_url":"https://api.github.com/users/Naimaoye/followers","following_url":"https://api.github.com/users/Naimaoye/following{/other_user}","gists_url":"https://api.github.com/users/Naimaoye/gists{/gist_id}","starred_url":"https://api.github.com/users/Naimaoye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Naimaoye/subscriptions","organizations_url":"https://api.github.com/users/Naimaoye/orgs","repos_url":"https://api.github.com/users/Naimaoye/repos","events_url":"https://api.github.com/users/Naimaoye/events{/privacy}","received_events_url":"https://api.github.com/users/Naimaoye/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nImplement user role settings. This creates an endpoint where a super admin can assign roles to users\r\n#### Description of Task to be completed?\r\n- `write validations`\r\n- `write endpoint test`\r\n#### How should this be manually tested?\r\n- run `npm start`\r\n- use postman to test endpoint\r\n#### What are the relevant pivotal tracker stories?\r\n[167749963](https://www.pivotaltracker.com/n/projects/2381955)\r\n#### Screenshots (if appropriate)","created_at":"2019-09-06T11:09:54Z","updated_at":"2019-09-12T02:53:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1536691211,"node_id":"MDU6TGFiZWwxNTM2NjkxMjEx","url":"https://api.github.com/repos/andela/magma-backend/labels/work%20in%20progress","name":"work in progress","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/andela/magma-backend/pulls/25/commits","review_comments_url":"https://api.github.com/repos/andela/magma-backend/pulls/25/comments","review_comment_url":"https://api.github.com/repos/andela/magma-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/magma-backend/issues/25/comments","statuses_url":"https://api.github.com/repos/andela/magma-backend/statuses/190bf5fbe11b16083c9351c90651bbad69be95a8","head":{"label":"andela:ft-user-role-settings-167749963","ref":"ft-user-role-settings-167749963","sha":"190bf5fbe11b16083c9351c90651bbad69be95a8","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":200806416,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA4MDY0MTY=","name":"magma-backend","full_name":"andela/magma-backend","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/magma-backend","description":null,"fork":false,"url":"https://api.github.com/repos/andela/magma-backend","forks_url":"https://api.github.com/repos/andela/magma-backend/forks","keys_url":"https://api.github.com/repos/andela/magma-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/magma-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/magma-backend/teams","hooks_url":"https://api.github.com/repos/andela/magma-backend/hooks","issue_events_url":"https://api.github.com/repos/andela/magma-backend/issues/events{/number}","events_url":"https://api.github.com/repos/andela/magma-backend/events","assignees_url":"https://api.github.com/repos/andela/magma-backend/assignees{/user}","branches_url":"https://api.github.com/repos/andela/magma-backend/branches{/branch}","tags_url":"https://api.github.com/repos/andela/magma-backend/tags","blobs_url":"https://api.github.com/repos/andela/magma-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/magma-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/magma-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/magma-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/magma-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/magma-backend/languages","stargazers_url":"https://api.github.com/repos/andela/magma-backend/stargazers","contributors_url":"https://api.github.com/repos/andela/magma-backend/contributors","subscribers_url":"https://api.github.com/repos/andela/magma-backend/subscribers","subscription_url":"https://api.github.com/repos/andela/magma-backend/subscription","commits_url":"https://api.github.com/repos/andela/magma-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/magma-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/magma-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/magma-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/magma-backend/contents/{+path}","compare_url":"https://api.github.com/repos/andela/magma-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/magma-backend/merges","archive_url":"https://api.github.com/repos/andela/magma-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/magma-backend/downloads","issues_url":"https://api.github.com/repos/andela/magma-backend/issues{/number}","pulls_url":"https://api.github.com/repos/andela/magma-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/magma-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/magma-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/magma-backend/labels{/name}","releases_url":"https://api.github.com/repos/andela/magma-backend/releases{/id}","deployments_url":"https://api.github.com/repos/andela/magma-backend/deployments","created_at":"2019-08-06T08:09:59Z","updated_at":"2019-09-11T18:04:20Z","pushed_at":"2019-09-12T02:52:55Z","git_url":"git://github.com/andela/magma-backend.git","ssh_url":"git@github.com:andela/magma-backend.git","clone_url":"https://github.com/andela/magma-backend.git","svn_url":"https://github.com/andela/magma-backend","homepage":null,"size":267,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":8,"license":null,"forks":3,"open_issues":8,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"c453540315ee3e206761f232d1725d4f35b4e154","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":200806416,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA4MDY0MTY=","name":"magma-backend","full_name":"andela/magma-backend","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/magma-backend","description":null,"fork":false,"url":"https://api.github.com/repos/andela/magma-backend","forks_url":"https://api.github.com/repos/andela/magma-backend/forks","keys_url":"https://api.github.com/repos/andela/magma-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/magma-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/magma-backend/teams","hooks_url":"https://api.github.com/repos/andela/magma-backend/hooks","issue_events_url":"https://api.github.com/repos/andela/magma-backend/issues/events{/number}","events_url":"https://api.github.com/repos/andela/magma-backend/events","assignees_url":"https://api.github.com/repos/andela/magma-backend/assignees{/user}","branches_url":"https://api.github.com/repos/andela/magma-backend/branches{/branch}","tags_url":"https://api.github.com/repos/andela/magma-backend/tags","blobs_url":"https://api.github.com/repos/andela/magma-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/magma-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/magma-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/magma-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/magma-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/magma-backend/languages","stargazers_url":"https://api.github.com/repos/andela/magma-backend/stargazers","contributors_url":"https://api.github.com/repos/andela/magma-backend/contributors","subscribers_url":"https://api.github.com/repos/andela/magma-backend/subscribers","subscription_url":"https://api.github.com/repos/andela/magma-backend/subscription","commits_url":"https://api.github.com/repos/andela/magma-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/magma-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/magma-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/magma-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/magma-backend/contents/{+path}","compare_url":"https://api.github.com/repos/andela/magma-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/magma-backend/merges","archive_url":"https://api.github.com/repos/andela/magma-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/magma-backend/downloads","issues_url":"https://api.github.com/repos/andela/magma-backend/issues{/number}","pulls_url":"https://api.github.com/repos/andela/magma-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/magma-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/magma-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/magma-backend/labels{/name}","releases_url":"https://api.github.com/repos/andela/magma-backend/releases{/id}","deployments_url":"https://api.github.com/repos/andela/magma-backend/deployments","created_at":"2019-08-06T08:09:59Z","updated_at":"2019-09-11T18:04:20Z","pushed_at":"2019-09-12T02:52:55Z","git_url":"git://github.com/andela/magma-backend.git","ssh_url":"git@github.com:andela/magma-backend.git","clone_url":"https://github.com/andela/magma-backend.git","svn_url":"https://github.com/andela/magma-backend","homepage":null,"size":267,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":8,"license":null,"forks":3,"open_issues":8,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/magma-backend/pulls/25"},"html":{"href":"https://github.com/andela/magma-backend/pull/25"},"issue":{"href":"https://api.github.com/repos/andela/magma-backend/issues/25"},"comments":{"href":"https://api.github.com/repos/andela/magma-backend/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/magma-backend/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/magma-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/magma-backend/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/andela/magma-backend/statuses/190bf5fbe11b16083c9351c90651bbad69be95a8"}},"author_association":"COLLABORATOR"}}
other: {"actor":{"display_login":"hound"}}