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
281 stars 201 forks source link

Implement Service History API #80645

Open steele-lm opened 5 months ago

steele-lm commented 5 months ago

Issue Description

To prepare to autofill a Veteran's Service History in the Burial, COE, and Chapter 36 forms, we need to integrate with the existing Service History API.

Chapter 36/PCPG: Prefill only if Veteran is logged in and filling out the form


Tasks

Acceptance Criteria

micahaspyr commented 5 months ago

For forms with a logged in user, grabbing their Service History via the Lighthouse API would require

Backend

  1. a Veteran's icn number
    • An icn can be searched for with another Veteran Identifier such as ssn
    • Might be available via the UserAccount model
  2. Implementing another method in the VeteranVerification akin to this 526 specific code image

    The 'endpoint' variable would be set to 'service_history' instead of 'disability_rating'

Frontend

The frontend will be querying the service history. Functions will need to be added to receive the data and prefill the form. There are examples in the vets-website codebase where form inputs are being prefilled so this may need a little bit of customization

micahaspyr commented 5 months ago

Need to update swagger docs as central mail no longer applies and service_history needs adding

Screenshot 2024-04-23 at 5 27 06 PM
micahaspyr commented 5 months ago

We should talk about putting this endpoint and the Veteran Service History and Eligibility API as a whole under v0/profile. Currently, there is a service_history endpoint under v0/profile, but it does not user the Lighthouse VSH&E API. Perhaps we can have a v0/profile/lighthouse/* path for the endpoints laid out in the documentation here. Right now the 526 team just plugs in the rated_disabilities endpoint to their routing pattern. I have it plugged into our claims_base_controller.rb base class for the claims controllers to inherent from, thus giving all of the inheriting classes the service_history across the endpoints.