{"action":"created","comment":{"url":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/comments/229326858","pull_request_review_id":169799461,"id":229326858,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTMyNjg1OA==","diff_hunk":"@@ -46,27 +76,72 @@ public String listaSolicitacoesDaCasa(Model model) {\n     public String listaSolicitacoesDoHospital(Model model) {\n \n         model.addAttribute(\"solicitacoesHospital\", solicitacaoRepository.findAll());\n-\n+        model.addAttribute(\"formata\", DateTimeFormatter.ofPattern(\"dd/MM/yyyy HH:mm:ss\"));\n         return \"solicitacao/listagens/listaSolicitacaoHospital\";\n     }\n \n-    @PostMapping(\"/cadastro\")\n-    @ResponseBody\n-    public String salvaSolicitacao(Model model, @ModelAttribute(\"solicitacao\") Solicitacao solicitacao) {\n-        solicitacao.getAcompanhantes().forEach(acompanhante -> acompanhante.setSolicitacao(solicitacao));\n+    @GetMapping(\"/casa/lista/aceitos\")\n+    public String gerenciarHospedesAceitos(Model model) {\n+        model.addAttribute(\"solicitacoesAceitas\", solicitacaoRepository.findAll());\n+        return \"solicitacao/GerenciarHospedeAceitos\";\n+    }\n \n-        solicitacaoRepository.save(solicitacao);\n \n-        model.addAttribute(\"solicitacoes\", solicitacaoRepository.findAll());\n+    @PostMapping(\"/aceitar\")\n+    public String aceitaSolicitacao(Long id) {\n+        Optional<Solicitacao> solicitacaoOptional = solicitacaoRepository.findById(id);\n \n-        return \"solicitacao/cadastro\";\n+        if(solicitacaoOptional.isPresent()) {\n+            Solicitacao solicitacao = solicitacaoOptional.get();\n+            solicitacao.setStatus(\"Aceito: \" + solicitacao.getNome());\n+            solicitacaoRepository.save(solicitacao);\n+\n+            return \"redirect:/solicitacao/casa/lista\";\n+        }\n+\n+        return \"404\";\n     }\n \n+    @PostMapping(\"/negar\")\n+    public String negaSolicitacao(Long id) {\n+        Optional<Solicitacao> solicitacaoOptional = solicitacaoRepository.findById(id);\n+\n+        if(solicitacaoOptional.isPresent()) {\n+            Solicitacao solicitacao = solicitacaoOptional.get();\n+            solicitacao.setStatus(\"Negado: \" + solicitacao.getNome());\n+            solicitacaoRepository.save(solicitacao);\n+\n+            return \"redirect:/solicitacao/casa/lista\";\n+\n+        }\n+\n+        return \"404\";","path":"app/src/main/java/com/thoughtworks/aceleradora/solicitacao/controller/SolicitacaoController.java","position":103,"original_position":103,"commit_id":"5c0a93da04781a8be353c3beba207c2774e6d820","original_commit_id":"5c0a93da04781a8be353c3beba207c2774e6d820","user":{"login":"othman853","id":4705127,"node_id":"MDQ6VXNlcjQ3MDUxMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/4705127?v=4","gravatar_id":"","url":"https://api.github.com/users/othman853","html_url":"https://github.com/othman853","followers_url":"https://api.github.com/users/othman853/followers","following_url":"https://api.github.com/users/othman853/following{/other_user}","gists_url":"https://api.github.com/users/othman853/gists{/gist_id}","starred_url":"https://api.github.com/users/othman853/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othman853/subscriptions","organizations_url":"https://api.github.com/users/othman853/orgs","repos_url":"https://api.github.com/users/othman853/repos","events_url":"https://api.github.com/users/othman853/events{/privacy}","received_events_url":"https://api.github.com/users/othman853/received_events","type":"User","site_admin":false},"body":"\r\n\r\nDeveríamos mostrar um template que exista. 404 Provavelmente não é um template válido.\r\n","created_at":"2018-10-30T14:23:49Z","updated_at":"2018-10-30T14:29:38Z","html_url":"https://github.com/aceleradora-TW/hospebem/pull/36#discussion_r229326858","pull_request_url":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/36","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/comments/229326858"},"html":{"href":"https://github.com/aceleradora-TW/hospebem/pull/36#discussion_r229326858"},"pull_request":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/36","id":226939708,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2OTM5NzA4","html_url":"https://github.com/aceleradora-TW/hospebem/pull/36","diff_url":"https://github.com/aceleradora-TW/hospebem/pull/36.diff","patch_url":"https://github.com/aceleradora-TW/hospebem/pull/36.patch","issue_url":"https://api.github.com/repos/aceleradora-TW/hospebem/issues/36","number":36,"state":"open","locked":false,"title":"Gerenciar informacoes do hospede","user":{"login":"cassia11","id":43010445,"node_id":"MDQ6VXNlcjQzMDEwNDQ1","avatar_url":"https://avatars0.githubusercontent.com/u/43010445?v=4","gravatar_id":"","url":"https://api.github.com/users/cassia11","html_url":"https://github.com/cassia11","followers_url":"https://api.github.com/users/cassia11/followers","following_url":"https://api.github.com/users/cassia11/following{/other_user}","gists_url":"https://api.github.com/users/cassia11/gists{/gist_id}","starred_url":"https://api.github.com/users/cassia11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cassia11/subscriptions","organizations_url":"https://api.github.com/users/cassia11/orgs","repos_url":"https://api.github.com/users/cassia11/repos","events_url":"https://api.github.com/users/cassia11/events{/privacy}","received_events_url":"https://api.github.com/users/cassia11/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-30T14:15:39Z","updated_at":"2018-10-30T14:29:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d7c7c4d99a638970ca9d363587cc3f2e2ee4892","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/36/commits","review_comments_url":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/36/comments","review_comment_url":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aceleradora-TW/hospebem/issues/36/comments","statuses_url":"https://api.github.com/repos/aceleradora-TW/hospebem/statuses/5c0a93da04781a8be353c3beba207c2774e6d820","head":{"label":"aceleradora-TW:gerenciar-informacoes-do-hospede","ref":"gerenciar-informacoes-do-hospede","sha":"5c0a93da04781a8be353c3beba207c2774e6d820","user":{"login":"aceleradora-TW","id":18720656,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzIwNjU2","avatar_url":"https://avatars0.githubusercontent.com/u/18720656?v=4","gravatar_id":"","url":"https://api.github.com/users/aceleradora-TW","html_url":"https://github.com/aceleradora-TW","followers_url":"https://api.github.com/users/aceleradora-TW/followers","following_url":"https://api.github.com/users/aceleradora-TW/following{/other_user}","gists_url":"https://api.github.com/users/aceleradora-TW/gists{/gist_id}","starred_url":"https://api.github.com/users/aceleradora-TW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aceleradora-TW/subscriptions","organizations_url":"https://api.github.com/users/aceleradora-TW/orgs","repos_url":"https://api.github.com/users/aceleradora-TW/repos","events_url":"https://api.github.com/users/aceleradora-TW/events{/privacy}","received_events_url":"https://api.github.com/users/aceleradora-TW/received_events","type":"Organization","site_admin":false},"repo":{"id":151568054,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE1NjgwNTQ=","name":"hospebem","full_name":"aceleradora-TW/hospebem","private":false,"owner":{"login":"aceleradora-TW","id":18720656,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzIwNjU2","avatar_url":"https://avatars0.githubusercontent.com/u/18720656?v=4","gravatar_id":"","url":"https://api.github.com/users/aceleradora-TW","html_url":"https://github.com/aceleradora-TW","followers_url":"https://api.github.com/users/aceleradora-TW/followers","following_url":"https://api.github.com/users/aceleradora-TW/following{/other_user}","gists_url":"https://api.github.com/users/aceleradora-TW/gists{/gist_id}","starred_url":"https://api.github.com/users/aceleradora-TW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aceleradora-TW/subscriptions","organizations_url":"https://api.github.com/users/aceleradora-TW/orgs","repos_url":"https://api.github.com/users/aceleradora-TW/repos","events_url":"https://api.github.com/users/aceleradora-TW/events{/privacy}","received_events_url":"https://api.github.com/users/aceleradora-TW/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aceleradora-TW/hospebem","description":null,"fork":false,"url":"https://api.github.com/repos/aceleradora-TW/hospebem","forks_url":"https://api.github.com/repos/aceleradora-TW/hospebem/forks","keys_url":"https://api.github.com/repos/aceleradora-TW/hospebem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aceleradora-TW/hospebem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aceleradora-TW/hospebem/teams","hooks_url":"https://api.github.com/repos/aceleradora-TW/hospebem/hooks","issue_events_url":"https://api.github.com/repos/aceleradora-TW/hospebem/issues/events{/number}","events_url":"https://api.github.com/repos/aceleradora-TW/hospebem/events","assignees_url":"https://api.github.com/repos/aceleradora-TW/hospebem/assignees{/user}","branches_url":"https://api.github.com/repos/aceleradora-TW/hospebem/branches{/branch}","tags_url":"https://api.github.com/repos/aceleradora-TW/hospebem/tags","blobs_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/refs{/sha}","trees_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aceleradora-TW/hospebem/statuses/{sha}","languages_url":"https://api.github.com/repos/aceleradora-TW/hospebem/languages","stargazers_url":"https://api.github.com/repos/aceleradora-TW/hospebem/stargazers","contributors_url":"https://api.github.com/repos/aceleradora-TW/hospebem/contributors","subscribers_url":"https://api.github.com/repos/aceleradora-TW/hospebem/subscribers","subscription_url":"https://api.github.com/repos/aceleradora-TW/hospebem/subscription","commits_url":"https://api.github.com/repos/aceleradora-TW/hospebem/commits{/sha}","git_commits_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/commits{/sha}","comments_url":"https://api.github.com/repos/aceleradora-TW/hospebem/comments{/number}","issue_comment_url":"https://api.github.com/repos/aceleradora-TW/hospebem/issues/comments{/number}","contents_url":"https://api.github.com/repos/aceleradora-TW/hospebem/contents/{+path}","compare_url":"https://api.github.com/repos/aceleradora-TW/hospebem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aceleradora-TW/hospebem/merges","archive_url":"https://api.github.com/repos/aceleradora-TW/hospebem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aceleradora-TW/hospebem/downloads","issues_url":"https://api.github.com/repos/aceleradora-TW/hospebem/issues{/number}","pulls_url":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls{/number}","milestones_url":"https://api.github.com/repos/aceleradora-TW/hospebem/milestones{/number}","notifications_url":"https://api.github.com/repos/aceleradora-TW/hospebem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aceleradora-TW/hospebem/labels{/name}","releases_url":"https://api.github.com/repos/aceleradora-TW/hospebem/releases{/id}","deployments_url":"https://api.github.com/repos/aceleradora-TW/hospebem/deployments","created_at":"2018-10-04T12:28:26Z","updated_at":"2018-10-29T18:41:37Z","pushed_at":"2018-10-30T14:15:40Z","git_url":"git://github.com/aceleradora-TW/hospebem.git","ssh_url":"git@github.com:aceleradora-TW/hospebem.git","clone_url":"https://github.com/aceleradora-TW/hospebem.git","svn_url":"https://github.com/aceleradora-TW/hospebem","homepage":null,"size":460,"stargazers_count":5,"watchers_count":5,"language":"Java","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":8,"license":null,"forks":0,"open_issues":8,"watchers":5,"default_branch":"master"}},"base":{"label":"aceleradora-TW:master","ref":"master","sha":"42833672b012e0e22693bfe7730861b36cc43719","user":{"login":"aceleradora-TW","id":18720656,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzIwNjU2","avatar_url":"https://avatars0.githubusercontent.com/u/18720656?v=4","gravatar_id":"","url":"https://api.github.com/users/aceleradora-TW","html_url":"https://github.com/aceleradora-TW","followers_url":"https://api.github.com/users/aceleradora-TW/followers","following_url":"https://api.github.com/users/aceleradora-TW/following{/other_user}","gists_url":"https://api.github.com/users/aceleradora-TW/gists{/gist_id}","starred_url":"https://api.github.com/users/aceleradora-TW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aceleradora-TW/subscriptions","organizations_url":"https://api.github.com/users/aceleradora-TW/orgs","repos_url":"https://api.github.com/users/aceleradora-TW/repos","events_url":"https://api.github.com/users/aceleradora-TW/events{/privacy}","received_events_url":"https://api.github.com/users/aceleradora-TW/received_events","type":"Organization","site_admin":false},"repo":{"id":151568054,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE1NjgwNTQ=","name":"hospebem","full_name":"aceleradora-TW/hospebem","private":false,"owner":{"login":"aceleradora-TW","id":18720656,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzIwNjU2","avatar_url":"https://avatars0.githubusercontent.com/u/18720656?v=4","gravatar_id":"","url":"https://api.github.com/users/aceleradora-TW","html_url":"https://github.com/aceleradora-TW","followers_url":"https://api.github.com/users/aceleradora-TW/followers","following_url":"https://api.github.com/users/aceleradora-TW/following{/other_user}","gists_url":"https://api.github.com/users/aceleradora-TW/gists{/gist_id}","starred_url":"https://api.github.com/users/aceleradora-TW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aceleradora-TW/subscriptions","organizations_url":"https://api.github.com/users/aceleradora-TW/orgs","repos_url":"https://api.github.com/users/aceleradora-TW/repos","events_url":"https://api.github.com/users/aceleradora-TW/events{/privacy}","received_events_url":"https://api.github.com/users/aceleradora-TW/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aceleradora-TW/hospebem","description":null,"fork":false,"url":"https://api.github.com/repos/aceleradora-TW/hospebem","forks_url":"https://api.github.com/repos/aceleradora-TW/hospebem/forks","keys_url":"https://api.github.com/repos/aceleradora-TW/hospebem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aceleradora-TW/hospebem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aceleradora-TW/hospebem/teams","hooks_url":"https://api.github.com/repos/aceleradora-TW/hospebem/hooks","issue_events_url":"https://api.github.com/repos/aceleradora-TW/hospebem/issues/events{/number}","events_url":"https://api.github.com/repos/aceleradora-TW/hospebem/events","assignees_url":"https://api.github.com/repos/aceleradora-TW/hospebem/assignees{/user}","branches_url":"https://api.github.com/repos/aceleradora-TW/hospebem/branches{/branch}","tags_url":"https://api.github.com/repos/aceleradora-TW/hospebem/tags","blobs_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/refs{/sha}","trees_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aceleradora-TW/hospebem/statuses/{sha}","languages_url":"https://api.github.com/repos/aceleradora-TW/hospebem/languages","stargazers_url":"https://api.github.com/repos/aceleradora-TW/hospebem/stargazers","contributors_url":"https://api.github.com/repos/aceleradora-TW/hospebem/contributors","subscribers_url":"https://api.github.com/repos/aceleradora-TW/hospebem/subscribers","subscription_url":"https://api.github.com/repos/aceleradora-TW/hospebem/subscription","commits_url":"https://api.github.com/repos/aceleradora-TW/hospebem/commits{/sha}","git_commits_url":"https://api.github.com/repos/aceleradora-TW/hospebem/git/commits{/sha}","comments_url":"https://api.github.com/repos/aceleradora-TW/hospebem/comments{/number}","issue_comment_url":"https://api.github.com/repos/aceleradora-TW/hospebem/issues/comments{/number}","contents_url":"https://api.github.com/repos/aceleradora-TW/hospebem/contents/{+path}","compare_url":"https://api.github.com/repos/aceleradora-TW/hospebem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aceleradora-TW/hospebem/merges","archive_url":"https://api.github.com/repos/aceleradora-TW/hospebem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aceleradora-TW/hospebem/downloads","issues_url":"https://api.github.com/repos/aceleradora-TW/hospebem/issues{/number}","pulls_url":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls{/number}","milestones_url":"https://api.github.com/repos/aceleradora-TW/hospebem/milestones{/number}","notifications_url":"https://api.github.com/repos/aceleradora-TW/hospebem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aceleradora-TW/hospebem/labels{/name}","releases_url":"https://api.github.com/repos/aceleradora-TW/hospebem/releases{/id}","deployments_url":"https://api.github.com/repos/aceleradora-TW/hospebem/deployments","created_at":"2018-10-04T12:28:26Z","updated_at":"2018-10-29T18:41:37Z","pushed_at":"2018-10-30T14:15:40Z","git_url":"git://github.com/aceleradora-TW/hospebem.git","ssh_url":"git@github.com:aceleradora-TW/hospebem.git","clone_url":"https://github.com/aceleradora-TW/hospebem.git","svn_url":"https://github.com/aceleradora-TW/hospebem","homepage":null,"size":460,"stargazers_count":5,"watchers_count":5,"language":"Java","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":8,"license":null,"forks":0,"open_issues":8,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/36"},"html":{"href":"https://github.com/aceleradora-TW/hospebem/pull/36"},"issue":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/issues/36"},"comments":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/aceleradora-TW/hospebem/statuses/5c0a93da04781a8be353c3beba207c2774e6d820"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"othman853"}}