department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
280 stars 195 forks source link

Shift MHV/Health data access logic to vets-api, present access details to user on the frontend #86766

Open dcloud opened 3 weeks ago

dcloud commented 3 weeks ago

Description

Currently, MHV/health tools take a variety of approaches to determining which services a logged-in user should be able to access.

If we look at the vets-api User::Services, it appears we could use vets-api to generate a granular list of mhv/health tools a user should be able to access, and vets-website could examine the backendServices list to tell users which tools they should be able to use.

User story

As a Veteran, I want to know which tools might be available to me

Notes

Possible tasks:

Acceptance criteria

dcloud commented 3 weeks ago

Spawned by https://github.com/department-of-veterans-affairs/va.gov-team/issues/84911

dcloud commented 3 weeks ago

Could do an MVP or proof-of-concept of User::Services like va-patient (if that is a useful alias) or mhv-id

There are about 22 (non-test, non-mock) files in vets-website that appear to use vaPatient, including an isVaPatient selector. It's not apparent that engineers would know that vaPatient is merely vets-api checking that the user's va treatment facility ids has a positive length: va_treatment_facility_ids.length.positive?