department-of-veterans-affairs/vets-website

View on GitHub
src/applications/disability-benefits/686c-674/documentation/674.md

Summary

Maintainability
Test Coverage
# Async and Error Handling for 674

This is a brief overview of BGS::SubmitForm674Job in terms of async calls and error handling:

- Raises Invalid674Claim error if claim data is not valid. Validity is defined as follows:
  - SSN can’t be blank
  - Dependent application can’t be blank
  - Veteran address can’t be blank
- Submit 674 (BGS::Form674#submit)
  - BGS::Service methods called: #create_proc, #create_proc_form, #create_note, #update_proc
  - #create_note has a rescue block that raises a 'BGS_686c_SERVICE_403’ backend exception and re-thrown for SubmitForm674Job to catch, but doesn’t look like any notification is sent to the user at this point.
- If 674 job succeeds:
  - Deletes in progress form
  - Async send VANotify::ConfirmationEmail to user
- If any exception is caught
  - revert in progress form data
  - DependentsApplicationFailureMailer#deliver_now to user