Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arf.78633/arp mock data #16218

Merged
merged 4 commits into from
Apr 10, 2024
Merged

Arf.78633/arp mock data #16218

merged 4 commits into from
Apr 10, 2024

Conversation

gabezurita
Copy link
Contributor

@gabezurita gabezurita commented Apr 5, 2024

See frontend PR: department-of-veterans-affairs/vets-website#29034

Summary

  • This work is behind a feature toggle (flipper): YES

Description

While we do not yet have a GET /veteran-service-organizations/power-of-attorney-requests LH Claims API endpoint, we should consider building some mock data that we can use to support further development and staging demos.

Prerequisites/Dependencies

  • The LH Team has to confirm the return value of GET /veteran-service-organizations/power-of-attorney-requests. See this issue for more details.
  • Take a best guess at the structure of the above endpoint, and mock that data in the ARP engine.
    • Note: this Canvas has a hypothetical response that should serve as a fairly solid guide on what data will be returned by the LH Claims API

Related issue(s)

https://app.zenhub.com/workspaces/accredited-representative-facing-team-65453a97a9cc36069a2ad1d6/issues/gh/department-of-veterans-affairs/va.gov-team/78633

Loosely based on @nihil2501's Dash PR and ongoing LH work

Testing done

  • New code is covered by unit tests

What areas of the site does it impact?

The ARP Engine

Acceptance criteria

  • The power_of_attorney_requests ARP Engine PowerOfAttorneyRequestsController#index returns mock POA requests.

@gabezurita gabezurita self-assigned this Apr 5, 2024
@va-vfs-bot va-vfs-bot temporarily deployed to arf.78633/ARP-mock-data/main/main April 5, 2024 03:16 Inactive
@gabezurita gabezurita force-pushed the arf.78633/ARP-mock-data branch from 9ad0abe to d63e1dc Compare April 5, 2024 03:17
@gabezurita gabezurita force-pushed the arf.78633/ARP-mock-data branch from d63e1dc to 1ab5c9f Compare April 5, 2024 03:29
@va-vfs-bot va-vfs-bot temporarily deployed to arf.78633/ARP-mock-data/main/main April 5, 2024 03:29 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to arf.78633/ARP-mock-data/main/main April 5, 2024 03:35 Inactive
@gabezurita gabezurita mentioned this pull request Apr 5, 2024
1 task
@va-vfs-bot va-vfs-bot temporarily deployed to arf.78633/ARP-mock-data/main/main April 5, 2024 23:51 Inactive
@gabezurita gabezurita force-pushed the arf.78633/ARP-mock-data branch from 772df06 to c99da5d Compare April 5, 2024 23:55
Copy link

github-actions bot commented Apr 5, 2024

1 Warning
⚠️ This PR changes 271 LoC (not counting whitespace/newlines).

In order to ensure each PR receives the proper attention it deserves, we recommend not exceeding
200. Expect some delays getting reviews.

File Summary

Files

  • modules/accredited_representative_portal/app/controllers/accredited_representative_portal/services/fetch_poa_requests.rb (+50/-0)

  • modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/power_of_attorney_requests_controller.rb (+66/-6)

  • modules/accredited_representative_portal/config/routes.rb (+1/-1)

  • modules/accredited_representative_portal/spec/requests/accredited_representative_portal/v0/power_of_attorney_requests_controller_spec.rb (+47/-5)

  • modules/accredited_representative_portal/spec/support/poa_record_generator.rb (+95/-0)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/, *.bru
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

@va-vfs-bot va-vfs-bot temporarily deployed to arf.78633/ARP-mock-data/main/main April 5, 2024 23:57 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to arf.78633/ARP-mock-data/main/main April 6, 2024 00:12 Inactive
@gabezurita gabezurita force-pushed the arf.78633/ARP-mock-data branch from 5f63692 to 4f46ecc Compare April 6, 2024 00:17
@va-vfs-bot va-vfs-bot temporarily deployed to arf.78633/ARP-mock-data/main/main April 6, 2024 00:18 Inactive
@gabezurita gabezurita force-pushed the arf.78633/ARP-mock-data branch from 4f46ecc to fef5373 Compare April 6, 2024 00:20
@va-vfs-bot va-vfs-bot temporarily deployed to arf.78633/ARP-mock-data/main/main April 6, 2024 00:24 Inactive
Copy link
Contributor

@cohnjesse cohnjesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Small question and some praise, loaded this up locally and looks good there too! Great work👌

# Currently reads from a static JSON file as a data source.
# @return [Hash] A hash containing the filtered records and metadata.
def call
file_path = Rails.root.join('modules', 'accredited_representative_portal', 'spec', 'fixtures',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise - Nice!

# is available. For more information on the transition plan, refer to:
# https://app.zenhub.com/workspaces/accredited-representative-facing-team-65453a97a9cc36069a2ad1d6/issues/gh/department-of-veterans-affairs/va.gov-team/80195
def update_poa_request(proc_id, action)
# TODO: Update the below to use the RepresentativeUser's profile data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise - Love these comments, makes figuring out future work much easier!

# id = params[:id]
# NOTE: the below is a placeholder for the acceptance logic
render json: { message: 'Accepted' }, status: :ok
id = params[:proc_id]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add this to permitted_params?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refresher on strong params: https://guides.rubyonrails.org/action_controller_overview.html#strong-parameters
I think the framework protects the developer to notice a bunch of cases that there are multiple parameters that haven't explicitly been permitted, but explicitly using a single key is not such a case which makes sense.

Here's one of the cases where it automatically helps you. Getting a slice returns a new Parameter object that is still permitted: false:

irb(main):001* params = ActionController::Parameters.new({
irb(main):002*   person: {
irb(main):003*     name: "Francesco",
irb(main):004*     age:  22,
irb(main):005*     role: "admin"
irb(main):006*   }
irb(main):007> })
=> #<ActionController::Parameters {"person"=>{"name"=>"Francesco", "age"=>22, "role"=>"admin"}} permitted: false>
irb(main):008> params[:person]
=> #<ActionController::Parameters {"name"=>"Francesco", "age"=>22, "role"=>"admin"} permitted: false>
irb(main):009> params[:person].slice(:name)
=> #<ActionController::Parameters {"name"=>"Francesco"} permitted: false>

Copy link
Contributor

@nihil2501 nihil2501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gabezurita gabezurita merged commit 2efa918 into master Apr 10, 2024
20 checks passed
@gabezurita gabezurita deleted the arf.78633/ARP-mock-data branch April 10, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants