{"action":"created","comment":{"url":"https://api.github.com/repos/ca-cwds/case-management/pulls/comments/179955410","pull_request_review_id":110294613,"id":179955410,"diff_hunk":"@@ -13,19 +21,36 @@ def safety_alerts\n       render json: client_safety_alerts\n     end\n \n-    # rubocop:disable Metrics/AbcSize\n     def update_relationship\n-      r_params = {  id: params[:relationship_id], client_id: params[:id],\n-                    related_client_id: params[:related_client_id],\n-                    absent_parent_indicator: params[:absent_parent_indicator],\n-                    start_date: params[:start_date], end_date: params[:end_date],\n-                    same_home_status: params[:same_home_status], type_code: params[:type_code] }\n       relationship_service = Relationships::RelationshipService.new\n-      updated_relationship = relationship_service.update_relationship(params[:id],\n-                                                                      params[:relationship_id],\n-                                                                      r_params, session[:token])\n+      updated_relationship = relationship_service\n+                             .update_relationship(params[:id],\n+                                                  params[:relationship_id],\n+                                                  relationship_params(params).to_h,\n+                                                  session[:token])\n       render json: updated_relationship\n     end\n-    # rubocop:enable Metrics/AbcSize\n+\n+    def relationship_params(params)\n+      RelationshipParameters.new(id: params[:relationship_id],\n+                                 client_id: params[:id],\n+                                 related_client_id: params[:related_client_id],\n+                                 absent_parent_indicator: params[:absent_parent_indicator],\n+                                 start_date: params[:start_date], end_date: params[:end_date],\n+                                 same_home_status: params[:same_home_status],\n+                                 type_code: params[:type_code])\n+    end\n+  end\n+\n+  class RelationshipParameters < Dry::Struct","path":"app/controllers/api/clients_controller.rb","position":49,"original_position":49,"commit_id":"8543655de0090f504eb1c701fd25af50975423ce","original_commit_id":"8543655de0090f504eb1c701fd25af50975423ce","user":{"login":"edgibbs","id":100718,"avatar_url":"https://avatars3.githubusercontent.com/u/100718?v=4","gravatar_id":"","url":"https://api.github.com/users/edgibbs","html_url":"https://github.com/edgibbs","followers_url":"https://api.github.com/users/edgibbs/followers","following_url":"https://api.github.com/users/edgibbs/following{/other_user}","gists_url":"https://api.github.com/users/edgibbs/gists{/gist_id}","starred_url":"https://api.github.com/users/edgibbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgibbs/subscriptions","organizations_url":"https://api.github.com/users/edgibbs/orgs","repos_url":"https://api.github.com/users/edgibbs/repos","events_url":"https://api.github.com/users/edgibbs/events{/privacy}","received_events_url":"https://api.github.com/users/edgibbs/received_events","type":"User","site_admin":false},"body":"I like the idea here, and we might want to decide how we handle form-like objects using some of the other dry-rb features like validation.  The counterweight is mostly we want to keep this layer thin to hand off to the microservice.","created_at":"2018-04-08T17:46:02Z","updated_at":"2018-04-08T17:48:50Z","html_url":"https://github.com/ca-cwds/case-management/pull/303#discussion_r179955410","pull_request_url":"https://api.github.com/repos/ca-cwds/case-management/pulls/303","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ca-cwds/case-management/pulls/comments/179955410"},"html":{"href":"https://github.com/ca-cwds/case-management/pull/303#discussion_r179955410"},"pull_request":{"href":"https://api.github.com/repos/ca-cwds/case-management/pulls/303"}}},"pull_request":{"url":"https://api.github.com/repos/ca-cwds/case-management/pulls/303","id":180068241,"html_url":"https://github.com/ca-cwds/case-management/pull/303","diff_url":"https://github.com/ca-cwds/case-management/pull/303.diff","patch_url":"https://github.com/ca-cwds/case-management/pull/303.patch","issue_url":"https://api.github.com/repos/ca-cwds/case-management/issues/303","number":303,"state":"open","locked":false,"title":"relationship_handle_params_value_obj_RL_55","user":{"login":"amanbop","id":6539112,"avatar_url":"https://avatars3.githubusercontent.com/u/6539112?v=4","gravatar_id":"","url":"https://api.github.com/users/amanbop","html_url":"https://github.com/amanbop","followers_url":"https://api.github.com/users/amanbop/followers","following_url":"https://api.github.com/users/amanbop/following{/other_user}","gists_url":"https://api.github.com/users/amanbop/gists{/gist_id}","starred_url":"https://api.github.com/users/amanbop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amanbop/subscriptions","organizations_url":"https://api.github.com/users/amanbop/orgs","repos_url":"https://api.github.com/users/amanbop/repos","events_url":"https://api.github.com/users/amanbop/events{/privacy}","received_events_url":"https://api.github.com/users/amanbop/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-06T22:32:34Z","updated_at":"2018-04-08T17:48:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf3cd3cea74f5af6c29e710e3ae16cf7a1673699","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ca-cwds/case-management/pulls/303/commits","review_comments_url":"https://api.github.com/repos/ca-cwds/case-management/pulls/303/comments","review_comment_url":"https://api.github.com/repos/ca-cwds/case-management/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ca-cwds/case-management/issues/303/comments","statuses_url":"https://api.github.com/repos/ca-cwds/case-management/statuses/8543655de0090f504eb1c701fd25af50975423ce","head":{"label":"ca-cwds:relationship_handle_params_value_obj_RL_55","ref":"relationship_handle_params_value_obj_RL_55","sha":"8543655de0090f504eb1c701fd25af50975423ce","user":{"login":"ca-cwds","id":16274270,"avatar_url":"https://avatars3.githubusercontent.com/u/16274270?v=4","gravatar_id":"","url":"https://api.github.com/users/ca-cwds","html_url":"https://github.com/ca-cwds","followers_url":"https://api.github.com/users/ca-cwds/followers","following_url":"https://api.github.com/users/ca-cwds/following{/other_user}","gists_url":"https://api.github.com/users/ca-cwds/gists{/gist_id}","starred_url":"https://api.github.com/users/ca-cwds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ca-cwds/subscriptions","organizations_url":"https://api.github.com/users/ca-cwds/orgs","repos_url":"https://api.github.com/users/ca-cwds/repos","events_url":"https://api.github.com/users/ca-cwds/events{/privacy}","received_events_url":"https://api.github.com/users/ca-cwds/received_events","type":"Organization","site_admin":false},"repo":{"id":98466373,"name":"case-management","full_name":"ca-cwds/case-management","owner":{"login":"ca-cwds","id":16274270,"avatar_url":"https://avatars3.githubusercontent.com/u/16274270?v=4","gravatar_id":"","url":"https://api.github.com/users/ca-cwds","html_url":"https://github.com/ca-cwds","followers_url":"https://api.github.com/users/ca-cwds/followers","following_url":"https://api.github.com/users/ca-cwds/following{/other_user}","gists_url":"https://api.github.com/users/ca-cwds/gists{/gist_id}","starred_url":"https://api.github.com/users/ca-cwds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ca-cwds/subscriptions","organizations_url":"https://api.github.com/users/ca-cwds/orgs","repos_url":"https://api.github.com/users/ca-cwds/repos","events_url":"https://api.github.com/users/ca-cwds/events{/privacy}","received_events_url":"https://api.github.com/users/ca-cwds/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ca-cwds/case-management","description":null,"fork":false,"url":"https://api.github.com/repos/ca-cwds/case-management","forks_url":"https://api.github.com/repos/ca-cwds/case-management/forks","keys_url":"https://api.github.com/repos/ca-cwds/case-management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ca-cwds/case-management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ca-cwds/case-management/teams","hooks_url":"https://api.github.com/repos/ca-cwds/case-management/hooks","issue_events_url":"https://api.github.com/repos/ca-cwds/case-management/issues/events{/number}","events_url":"https://api.github.com/repos/ca-cwds/case-management/events","assignees_url":"https://api.github.com/repos/ca-cwds/case-management/assignees{/user}","branches_url":"https://api.github.com/repos/ca-cwds/case-management/branches{/branch}","tags_url":"https://api.github.com/repos/ca-cwds/case-management/tags","blobs_url":"https://api.github.com/repos/ca-cwds/case-management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ca-cwds/case-management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ca-cwds/case-management/git/refs{/sha}","trees_url":"https://api.github.com/repos/ca-cwds/case-management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ca-cwds/case-management/statuses/{sha}","languages_url":"https://api.github.com/repos/ca-cwds/case-management/languages","stargazers_url":"https://api.github.com/repos/ca-cwds/case-management/stargazers","contributors_url":"https://api.github.com/repos/ca-cwds/case-management/contributors","subscribers_url":"https://api.github.com/repos/ca-cwds/case-management/subscribers","subscription_url":"https://api.github.com/repos/ca-cwds/case-management/subscription","commits_url":"https://api.github.com/repos/ca-cwds/case-management/commits{/sha}","git_commits_url":"https://api.github.com/repos/ca-cwds/case-management/git/commits{/sha}","comments_url":"https://api.github.com/repos/ca-cwds/case-management/comments{/number}","issue_comment_url":"https://api.github.com/repos/ca-cwds/case-management/issues/comments{/number}","contents_url":"https://api.github.com/repos/ca-cwds/case-management/contents/{+path}","compare_url":"https://api.github.com/repos/ca-cwds/case-management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ca-cwds/case-management/merges","archive_url":"https://api.github.com/repos/ca-cwds/case-management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ca-cwds/case-management/downloads","issues_url":"https://api.github.com/repos/ca-cwds/case-management/issues{/number}","pulls_url":"https://api.github.com/repos/ca-cwds/case-management/pulls{/number}","milestones_url":"https://api.github.com/repos/ca-cwds/case-management/milestones{/number}","notifications_url":"https://api.github.com/repos/ca-cwds/case-management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ca-cwds/case-management/labels{/name}","releases_url":"https://api.github.com/repos/ca-cwds/case-management/releases{/id}","deployments_url":"https://api.github.com/repos/ca-cwds/case-management/deployments","created_at":"2017-07-26T21:14:03Z","updated_at":"2018-04-06T23:11:09Z","pushed_at":"2018-04-08T04:59:05Z","git_url":"git://github.com/ca-cwds/case-management.git","ssh_url":"git@github.com:ca-cwds/case-management.git","clone_url":"https://github.com/ca-cwds/case-management.git","svn_url":"https://github.com/ca-cwds/case-management","homepage":null,"size":1279,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":9,"open_issues":33,"watchers":3,"default_branch":"master"}},"base":{"label":"ca-cwds:master","ref":"master","sha":"49cc5d690c712f80b68bb727a8dc7151426a868a","user":{"login":"ca-cwds","id":16274270,"avatar_url":"https://avatars3.githubusercontent.com/u/16274270?v=4","gravatar_id":"","url":"https://api.github.com/users/ca-cwds","html_url":"https://github.com/ca-cwds","followers_url":"https://api.github.com/users/ca-cwds/followers","following_url":"https://api.github.com/users/ca-cwds/following{/other_user}","gists_url":"https://api.github.com/users/ca-cwds/gists{/gist_id}","starred_url":"https://api.github.com/users/ca-cwds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ca-cwds/subscriptions","organizations_url":"https://api.github.com/users/ca-cwds/orgs","repos_url":"https://api.github.com/users/ca-cwds/repos","events_url":"https://api.github.com/users/ca-cwds/events{/privacy}","received_events_url":"https://api.github.com/users/ca-cwds/received_events","type":"Organization","site_admin":false},"repo":{"id":98466373,"name":"case-management","full_name":"ca-cwds/case-management","owner":{"login":"ca-cwds","id":16274270,"avatar_url":"https://avatars3.githubusercontent.com/u/16274270?v=4","gravatar_id":"","url":"https://api.github.com/users/ca-cwds","html_url":"https://github.com/ca-cwds","followers_url":"https://api.github.com/users/ca-cwds/followers","following_url":"https://api.github.com/users/ca-cwds/following{/other_user}","gists_url":"https://api.github.com/users/ca-cwds/gists{/gist_id}","starred_url":"https://api.github.com/users/ca-cwds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ca-cwds/subscriptions","organizations_url":"https://api.github.com/users/ca-cwds/orgs","repos_url":"https://api.github.com/users/ca-cwds/repos","events_url":"https://api.github.com/users/ca-cwds/events{/privacy}","received_events_url":"https://api.github.com/users/ca-cwds/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ca-cwds/case-management","description":null,"fork":false,"url":"https://api.github.com/repos/ca-cwds/case-management","forks_url":"https://api.github.com/repos/ca-cwds/case-management/forks","keys_url":"https://api.github.com/repos/ca-cwds/case-management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ca-cwds/case-management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ca-cwds/case-management/teams","hooks_url":"https://api.github.com/repos/ca-cwds/case-management/hooks","issue_events_url":"https://api.github.com/repos/ca-cwds/case-management/issues/events{/number}","events_url":"https://api.github.com/repos/ca-cwds/case-management/events","assignees_url":"https://api.github.com/repos/ca-cwds/case-management/assignees{/user}","branches_url":"https://api.github.com/repos/ca-cwds/case-management/branches{/branch}","tags_url":"https://api.github.com/repos/ca-cwds/case-management/tags","blobs_url":"https://api.github.com/repos/ca-cwds/case-management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ca-cwds/case-management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ca-cwds/case-management/git/refs{/sha}","trees_url":"https://api.github.com/repos/ca-cwds/case-management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ca-cwds/case-management/statuses/{sha}","languages_url":"https://api.github.com/repos/ca-cwds/case-management/languages","stargazers_url":"https://api.github.com/repos/ca-cwds/case-management/stargazers","contributors_url":"https://api.github.com/repos/ca-cwds/case-management/contributors","subscribers_url":"https://api.github.com/repos/ca-cwds/case-management/subscribers","subscription_url":"https://api.github.com/repos/ca-cwds/case-management/subscription","commits_url":"https://api.github.com/repos/ca-cwds/case-management/commits{/sha}","git_commits_url":"https://api.github.com/repos/ca-cwds/case-management/git/commits{/sha}","comments_url":"https://api.github.com/repos/ca-cwds/case-management/comments{/number}","issue_comment_url":"https://api.github.com/repos/ca-cwds/case-management/issues/comments{/number}","contents_url":"https://api.github.com/repos/ca-cwds/case-management/contents/{+path}","compare_url":"https://api.github.com/repos/ca-cwds/case-management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ca-cwds/case-management/merges","archive_url":"https://api.github.com/repos/ca-cwds/case-management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ca-cwds/case-management/downloads","issues_url":"https://api.github.com/repos/ca-cwds/case-management/issues{/number}","pulls_url":"https://api.github.com/repos/ca-cwds/case-management/pulls{/number}","milestones_url":"https://api.github.com/repos/ca-cwds/case-management/milestones{/number}","notifications_url":"https://api.github.com/repos/ca-cwds/case-management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ca-cwds/case-management/labels{/name}","releases_url":"https://api.github.com/repos/ca-cwds/case-management/releases{/id}","deployments_url":"https://api.github.com/repos/ca-cwds/case-management/deployments","created_at":"2017-07-26T21:14:03Z","updated_at":"2018-04-06T23:11:09Z","pushed_at":"2018-04-08T04:59:05Z","git_url":"git://github.com/ca-cwds/case-management.git","ssh_url":"git@github.com:ca-cwds/case-management.git","clone_url":"https://github.com/ca-cwds/case-management.git","svn_url":"https://github.com/ca-cwds/case-management","homepage":null,"size":1279,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":9,"open_issues":33,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ca-cwds/case-management/pulls/303"},"html":{"href":"https://github.com/ca-cwds/case-management/pull/303"},"issue":{"href":"https://api.github.com/repos/ca-cwds/case-management/issues/303"},"comments":{"href":"https://api.github.com/repos/ca-cwds/case-management/issues/303/comments"},"review_comments":{"href":"https://api.github.com/repos/ca-cwds/case-management/pulls/303/comments"},"review_comment":{"href":"https://api.github.com/repos/ca-cwds/case-management/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ca-cwds/case-management/pulls/303/commits"},"statuses":{"href":"https://api.github.com/repos/ca-cwds/case-management/statuses/8543655de0090f504eb1c701fd25af50975423ce"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"edgibbs"}}