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
282 stars 199 forks source link

As a 10-10d applicant I need to include more than a total of 3 applicants on the form #80989

Closed baltes closed 3 months ago

baltes commented 5 months ago

Implementation Plan

  1. Fixture JSON to be > 3 applicants
  2. Update model test (See vba_40_0247_spec.rb)
  3. Port over https://github.com/department-of-veterans-affairs/vets-api/blob/6512caf3f5b3ee1d7e822f1037971406bb7e9437/modules/simple_forms_api/app/models/simple_forms_api/vba_40_0247.rb#L101-L118 and add logic on a per model basis as the key (applicant v. clamant) that needs looping will differ.

    • This new PDF will be treated as a new attachment(s).

      def get_attachments
      attachments = []
      
      additional_address = @data['additional_address']
      if additional_address
      file_path = fill_pdf_with_additional_address.   <--------------- But fill_pdf_with_additional_applicants
      attachments << file_path
      end
    • Get # of applicants/claimants and loop over them so additional attachments are generated
    • Confirm multiple PDFs exist in the repo and tests pass
cloudmagic80 commented 3 months ago

The initial estimate is 3-4 Sprints. There are a few ways to tackle this: Option 1: update the fixture JSON to have more than 3 applicants, loop through the submit function based on how many applicants there are and update the test to expect the extra form/forms. Probably test with 10-10d since 7959a isn’t up yet.

Then maybe create a GeneratePDF service module.

balexandr commented 3 months ago

@cloudmagic80 You worked on the attachment_ids portion. Can you update the plan above with anything that may need to be considered with the metadata?

cloudmagic80 commented 3 months ago

You can change the metadata. yes. As long as the front end gives the right data

balexandr commented 3 months ago

bd2ea1ef-0110-48bc-b513-28532e80ceec_vha_10_10d-tmp.pdf bd2ea1ef-0110-48bc-b513-28532e80ceec_vha_10_10d_additional_applicants-tmp1.pdf bd2ea1ef-0110-48bc-b513-28532e80ceec_vha_10_10d-tmp2.pdf

These files are from a 10-10D test with 6 applicants and an optional uploaded item.

balexandr commented 3 months ago

@baltes We need a corresponding FE ticket for this work for 10-10D CC: @cloudmagic80

baltes commented 3 months ago

Front end ticket is here: https://app.zenhub.com/workspaces/ivc-forms-652da2d3f0ae4c0016bfb109/issues/gh/department-of-veterans-affairs/va.gov-team/85713

cloudmagic80 commented 3 months ago

I'm putting this ticket back into In Progress. The metadata isn't correctly labeled.

cloudmagic80 commented 3 months ago

Completed: https://github.com/department-of-veterans-affairs/vets-api/pull/17135

cloudmagic80 commented 3 months ago

QA results were all completed successfully. Run all Unit test. Run e2e test for these scenarios: A: 1010D with 1 applicant. B: 1010D with 4 applicants. C: 1010D with 1 applicant with 1 social security attachment D: 1010D with 4 applicants with 4 social security attachments and 4 birth certificates E: 7959C with 1 applicant F: 7959C with 1 applicant and 1 attachment G: 7959F1 with 1 applicant H: Check all PDF output locally. I: Check all PDF output in S3 J: Check all metadata in S3

baltes commented 3 months ago

Awesome, thanks for all the detail on QA @cloudmagic80