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
283 stars 204 forks source link

[BE] My VA Forms Status: Get benefits-intake-id from correct table #92355

Closed tpharrison closed 1 month ago

tpharrison commented 2 months ago

Background

The backend query that retrieves form submission statuses on My VA currently uses the benefits_intake_uuid from the form_submissions table to get the status of each form via the Lighthouse Benefits Intake API.

For forms with multiple submission attempts, a record is created for each attempt in the form_submission_attempts table. In these cases, the query should retrieve the benefits_intake_uuid from the latest record in the form_submission_attempts table. If there is only one form submission record, the benefits_intake_uuid should be taken from the form_submissions table.

flowchart TD;
    A[Start] --> B{Multiple form submissions?}
    B -- Yes --> C[Retrieve latest record from form_submission_attempts]
    B -- No --> D[Retrieve record from form_submissions]
    C --> E[Get benefits_intake_uuid from latest attempt]
    D --> E[Get benefits_intake_uuid from record]
    E --> F[Use benefits_intake_uuid to retrieve status from Lighthouse API]
    F --> G[End]

Tasks

Acceptance Criteria

ACParker89 commented 1 month ago

@mtcA6 FYA Tom will be working on this in 45

tpharrison commented 1 month ago

Some questions have arisen regarding this ticket. I'll be discussing the form submission table design with Eric Tillberg on 9/23.