{"action":"created","comment":{"url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/comments/200488481","pull_request_review_id":134814263,"id":200488481,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDQ4ODQ4MQ==","diff_hunk":"@@ -0,0 +1,70 @@\n+// “Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live”\n+// \n+// THIS IS A JAVASCRIPT-LIKE CODE IMPLEMENTING THE SCHEDULING OF BATHS AND VETERINARIANS ON THE PET STORE CASE.\n+// \n+// PLEASE REVIEW THIS CODE TO GET IT AS CLEAN AS POSSIBLE. JUSTIFY YOUR CHANGES.\n+// \n+\n+\n+var c;\n+\n+public class Costumer {\n+\n+\tconstructor(name, address, petName1, petName2, petName3, petName4, phoneNumber) {\n+\t\tthis.name = height;\n+\t\tthis.address = address;\n+\t\tthis.petNames = [petName1, petName2, petName3, petName4];\n+\t\tthis.phoneNumber = phoneNumber;\n+\t}\n+\tpublic getCustomer(id) {\n+\t\treturn $http.get('myServer.com/getCustomer?id=' + id);\n+\t}\n+\tstatic all() {\n+\t\treturn $http.get('myServer.com/returnAllCustomers');\n+\t}\n+};\n+\n+public class Schedule {\n+\tconstructor(dia, hora, duracao, customerId, type, serviceDescription, otherInfo) {\n+\t\tthis.dia = dia;\n+\t\tthis.hora = hora;\n+\t\tthis.duracao = duracao;\n+\t\tthis.customerId = customerId;\n+\t\tthis.type = type;\n+\t\tthis.otherInfo = otherInfo;\n+\t}\n+\t/**\n+\t * WARNING: don't change this method because it's been used in another places\n+\t * @return {[type]} [description]\n+\t */\n+\tpublic saveSchedule() {\n+\t\treturn $http.post('myServer.com/saveSchedule', this);\n+\t}\n+};\n+\n+\n+//Scheduling baths\n+function scheduleBath(dia, hora, duracao, customerId) {\n+\tc = Customer.getCustomer(customerId);\n+\ttry {\n+\t\tSchedule s = new Schedule(dia, hora, duracao, customerId, \"BANHO\", \"Dono(a): \" + c.name + \". Nome do pet: \" + c.petNames[0]);\n+\t\ts.saveSchedule();\n+\t\treturn \"Agendamento realizado\";\n+\t} catch (Exception s) {\n+\t\treturn \"Agendamento deu erro. \" + s.printStackTrace();","path":"cleanCodeExercise.js","position":54,"original_position":54,"commit_id":"4fa937d764b5a835549bf8ef8bd33d92ff1135ba","original_commit_id":"4fa937d764b5a835549bf8ef8bd33d92ff1135ba","user":{"login":"celfons","id":7029523,"node_id":"MDQ6VXNlcjcwMjk1MjM=","avatar_url":"https://avatars1.githubusercontent.com/u/7029523?v=4","gravatar_id":"","url":"https://api.github.com/users/celfons","html_url":"https://github.com/celfons","followers_url":"https://api.github.com/users/celfons/followers","following_url":"https://api.github.com/users/celfons/following{/other_user}","gists_url":"https://api.github.com/users/celfons/gists{/gist_id}","starred_url":"https://api.github.com/users/celfons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/celfons/subscriptions","organizations_url":"https://api.github.com/users/celfons/orgs","repos_url":"https://api.github.com/users/celfons/repos","events_url":"https://api.github.com/users/celfons/events{/privacy}","received_events_url":"https://api.github.com/users/celfons/received_events","type":"User","site_admin":false},"body":"Tratativa de exceção deve ser realizada para trazer informações mais amigáveis que possam ajudar na correção e detecção do problema.","created_at":"2018-07-05T21:00:30Z","updated_at":"2018-07-05T21:01:57Z","html_url":"https://github.com/fmarques2/fsd-2-cleancode/pull/15#discussion_r200488481","pull_request_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/15","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/comments/200488481"},"html":{"href":"https://github.com/fmarques2/fsd-2-cleancode/pull/15#discussion_r200488481"},"pull_request":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/15","id":199583876,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NTgzODc2","html_url":"https://github.com/fmarques2/fsd-2-cleancode/pull/15","diff_url":"https://github.com/fmarques2/fsd-2-cleancode/pull/15.diff","patch_url":"https://github.com/fmarques2/fsd-2-cleancode/pull/15.patch","issue_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues/15","number":15,"state":"open","locked":false,"title":"Create cleanCodeExercise.js","user":{"login":"fmarques2","id":17281643,"node_id":"MDQ6VXNlcjE3MjgxNjQz","avatar_url":"https://avatars3.githubusercontent.com/u/17281643?v=4","gravatar_id":"","url":"https://api.github.com/users/fmarques2","html_url":"https://github.com/fmarques2","followers_url":"https://api.github.com/users/fmarques2/followers","following_url":"https://api.github.com/users/fmarques2/following{/other_user}","gists_url":"https://api.github.com/users/fmarques2/gists{/gist_id}","starred_url":"https://api.github.com/users/fmarques2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmarques2/subscriptions","organizations_url":"https://api.github.com/users/fmarques2/orgs","repos_url":"https://api.github.com/users/fmarques2/repos","events_url":"https://api.github.com/users/fmarques2/events{/privacy}","received_events_url":"https://api.github.com/users/fmarques2/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-05T20:50:08Z","updated_at":"2018-07-05T21:01:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"113b87930d8e7822f45004cb427556f992d8bd37","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/15/commits","review_comments_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/15/comments","review_comment_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues/15/comments","statuses_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/statuses/4fa937d764b5a835549bf8ef8bd33d92ff1135ba","head":{"label":"fmarques2:marcel","ref":"marcel","sha":"4fa937d764b5a835549bf8ef8bd33d92ff1135ba","user":{"login":"fmarques2","id":17281643,"node_id":"MDQ6VXNlcjE3MjgxNjQz","avatar_url":"https://avatars3.githubusercontent.com/u/17281643?v=4","gravatar_id":"","url":"https://api.github.com/users/fmarques2","html_url":"https://github.com/fmarques2","followers_url":"https://api.github.com/users/fmarques2/followers","following_url":"https://api.github.com/users/fmarques2/following{/other_user}","gists_url":"https://api.github.com/users/fmarques2/gists{/gist_id}","starred_url":"https://api.github.com/users/fmarques2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmarques2/subscriptions","organizations_url":"https://api.github.com/users/fmarques2/orgs","repos_url":"https://api.github.com/users/fmarques2/repos","events_url":"https://api.github.com/users/fmarques2/events{/privacy}","received_events_url":"https://api.github.com/users/fmarques2/received_events","type":"User","site_admin":false},"repo":{"id":118769168,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg3NjkxNjg=","name":"fsd-2-cleancode","full_name":"fmarques2/fsd-2-cleancode","owner":{"login":"fmarques2","id":17281643,"node_id":"MDQ6VXNlcjE3MjgxNjQz","avatar_url":"https://avatars3.githubusercontent.com/u/17281643?v=4","gravatar_id":"","url":"https://api.github.com/users/fmarques2","html_url":"https://github.com/fmarques2","followers_url":"https://api.github.com/users/fmarques2/followers","following_url":"https://api.github.com/users/fmarques2/following{/other_user}","gists_url":"https://api.github.com/users/fmarques2/gists{/gist_id}","starred_url":"https://api.github.com/users/fmarques2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmarques2/subscriptions","organizations_url":"https://api.github.com/users/fmarques2/orgs","repos_url":"https://api.github.com/users/fmarques2/repos","events_url":"https://api.github.com/users/fmarques2/events{/privacy}","received_events_url":"https://api.github.com/users/fmarques2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fmarques2/fsd-2-cleancode","description":null,"fork":false,"url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode","forks_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/forks","keys_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/teams","hooks_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/hooks","issue_events_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues/events{/number}","events_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/events","assignees_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/assignees{/user}","branches_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/branches{/branch}","tags_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/tags","blobs_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/refs{/sha}","trees_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/statuses/{sha}","languages_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/languages","stargazers_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/stargazers","contributors_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/contributors","subscribers_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/subscribers","subscription_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/subscription","commits_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/commits{/sha}","git_commits_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/commits{/sha}","comments_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/comments{/number}","issue_comment_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues/comments{/number}","contents_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/contents/{+path}","compare_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/merges","archive_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/downloads","issues_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues{/number}","pulls_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls{/number}","milestones_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/milestones{/number}","notifications_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/labels{/name}","releases_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/releases{/id}","deployments_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/deployments","created_at":"2018-01-24T13:29:53Z","updated_at":"2018-01-24T13:47:16Z","pushed_at":"2018-07-05T20:50:09Z","git_url":"git://github.com/fmarques2/fsd-2-cleancode.git","ssh_url":"git@github.com:fmarques2/fsd-2-cleancode.git","clone_url":"https://github.com/fmarques2/fsd-2-cleancode.git","svn_url":"https://github.com/fmarques2/fsd-2-cleancode","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":0,"open_issues":15,"watchers":0,"default_branch":"master"}},"base":{"label":"fmarques2:master","ref":"master","sha":"a35fa8a308ec0403dc1a3fd4d7a10e1a7e479d9f","user":{"login":"fmarques2","id":17281643,"node_id":"MDQ6VXNlcjE3MjgxNjQz","avatar_url":"https://avatars3.githubusercontent.com/u/17281643?v=4","gravatar_id":"","url":"https://api.github.com/users/fmarques2","html_url":"https://github.com/fmarques2","followers_url":"https://api.github.com/users/fmarques2/followers","following_url":"https://api.github.com/users/fmarques2/following{/other_user}","gists_url":"https://api.github.com/users/fmarques2/gists{/gist_id}","starred_url":"https://api.github.com/users/fmarques2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmarques2/subscriptions","organizations_url":"https://api.github.com/users/fmarques2/orgs","repos_url":"https://api.github.com/users/fmarques2/repos","events_url":"https://api.github.com/users/fmarques2/events{/privacy}","received_events_url":"https://api.github.com/users/fmarques2/received_events","type":"User","site_admin":false},"repo":{"id":118769168,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg3NjkxNjg=","name":"fsd-2-cleancode","full_name":"fmarques2/fsd-2-cleancode","owner":{"login":"fmarques2","id":17281643,"node_id":"MDQ6VXNlcjE3MjgxNjQz","avatar_url":"https://avatars3.githubusercontent.com/u/17281643?v=4","gravatar_id":"","url":"https://api.github.com/users/fmarques2","html_url":"https://github.com/fmarques2","followers_url":"https://api.github.com/users/fmarques2/followers","following_url":"https://api.github.com/users/fmarques2/following{/other_user}","gists_url":"https://api.github.com/users/fmarques2/gists{/gist_id}","starred_url":"https://api.github.com/users/fmarques2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmarques2/subscriptions","organizations_url":"https://api.github.com/users/fmarques2/orgs","repos_url":"https://api.github.com/users/fmarques2/repos","events_url":"https://api.github.com/users/fmarques2/events{/privacy}","received_events_url":"https://api.github.com/users/fmarques2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fmarques2/fsd-2-cleancode","description":null,"fork":false,"url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode","forks_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/forks","keys_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/teams","hooks_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/hooks","issue_events_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues/events{/number}","events_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/events","assignees_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/assignees{/user}","branches_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/branches{/branch}","tags_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/tags","blobs_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/refs{/sha}","trees_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/statuses/{sha}","languages_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/languages","stargazers_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/stargazers","contributors_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/contributors","subscribers_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/subscribers","subscription_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/subscription","commits_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/commits{/sha}","git_commits_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/git/commits{/sha}","comments_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/comments{/number}","issue_comment_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues/comments{/number}","contents_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/contents/{+path}","compare_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/merges","archive_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/downloads","issues_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues{/number}","pulls_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls{/number}","milestones_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/milestones{/number}","notifications_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/labels{/name}","releases_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/releases{/id}","deployments_url":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/deployments","created_at":"2018-01-24T13:29:53Z","updated_at":"2018-01-24T13:47:16Z","pushed_at":"2018-07-05T20:50:09Z","git_url":"git://github.com/fmarques2/fsd-2-cleancode.git","ssh_url":"git@github.com:fmarques2/fsd-2-cleancode.git","clone_url":"https://github.com/fmarques2/fsd-2-cleancode.git","svn_url":"https://github.com/fmarques2/fsd-2-cleancode","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":0,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/15"},"html":{"href":"https://github.com/fmarques2/fsd-2-cleancode/pull/15"},"issue":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues/15"},"comments":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/fmarques2/fsd-2-cleancode/statuses/4fa937d764b5a835549bf8ef8bd33d92ff1135ba"}},"author_association":"OWNER"}}
{"actor":{"display_login":"celfons"}}