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 203 forks source link

EVSS Migration - 526 Submit - Military Service Address (Discovery) #67032

Closed sethdarragile6 closed 1 year ago

sethdarragile6 commented 1 year ago

Issue Description

Lighthouse recently started conversations around the use of submit requests elements pertaining to the military address of the veteran that EVSS had used, but they omitted. From LH:

It turns out they [EVSS] were internally mapping militaryStateCode to state, and militaryPostOfficeTypeCode to city. That is how the values would be displayed in VBMS. So, we were wondering if you could keep collecting the information as you do today from the Veteran, but map those to state and city on our Claims v2 526 request? That should still mimic the existing functionality without adding additional attributes to our request.

Long story short: LH would like us map the veteran's military address to LH's single address fields

slack thread 1 - ? OG thread from Kayla, I couldn't find it Kayla - My team is looking to confirm if the 526 submission flow on VA.gov needs to support Military address types. Is your team the correct team to direct that question to? We are specifically wanting to know if you are currently using militaryStateCode or militaryPostOfficeTypeCode in the EVSS Form526 request. I discussed this further with Michael Harlow to confirm how EVSS was treating these attributes. It turns out they were internally mapping militaryStateCode to state, and militaryPostOfficeTypeCode to city. That is how the values would be displayed in VBMS. So, we were wondering if you could keep collecting the information as you do today from the Veteran, but map those to state and city on our Claims v2 526 request? That should still mimic the existing functionality without adding additional attributes to our request.

slack thread 2


Tasks

Acceptance Criteria

Screenshots

Private Zenhub Image (from EVSS/LH Mapping doc)


How to configure this issue

sethdarragile6 commented 1 year ago

Here's how we process military and (international) addresses in vets-api currently (in data_translation_all_claim.rb, --> def translate_mailing_address)

  1. Determine what type of address: a. if the state is AA, AE, or AP, then the type is MILITARY b. otherwise, if country is USA, then the type is DOMESTIC c. otherwise, the type is INTERNATIONAL
  2. If type is a. DOMESTIC, then populate city, state, zipFirstFive and zipLastFour per usual b. MILITARY, then populate militaryPostOfficeTypeCode with the city, stripped of whitespace and uppercased, and militaryStateCode with the state zipFirstFive and zipLastFour per usual c. INTERNATIONAL, populate internationalPostalCode from a lookup from international_postal_codes.json based on the country field city per usual

I'm assuming that, if it's a military address, we're expecting city to come in as "APO", "DPO", "FPO"- albeit possibly with whitespace and mixed case. We should confirm whether or not there is front end validation for this, because it seems that the backend code is trying to sanitize a freeform text field here

Other than that little nagging doubt, it would seem that our logic mirrors Lighthouse's expectations. I will post out to the migration channel to be sure, of course.

sethdarragile6 commented 1 year ago

Resolved all my questions with Michael Harlow on this thread. Updated implementation story with relevant deets.

sethdarragile6 commented 1 year ago

Dug a little more into militaryPostOfficeTypeCode, and inferred that these are coming in as expected, i.e. 'APO'. I was unable to trace it from the front-end directly, complicated by the fact that this information apparently gets pulled in from an external source. But investigating some "black hole submissions" detailed by Sam (and with his help) I was able to clearly delineate that

  1. There used to be a problem with unscrubbed values in this field, like 'Apo' or 'APO ', when hitting EVSS
  2. A fix was made 2021-08-05 to remove whitespace and uppercase the result
  3. From 2021-08-07 on, the problem went away