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

Validate Burial submission attachments #92981

Closed TaiWilkin closed 1 month ago

TaiWilkin commented 1 month ago

Issue Description

When submitting Benefits claims, the Lighthouse::SubmitBenefitsIntakeClaim job doesn't validate attachments before submitting the claim. When the attachments reach Lighthouse, they're rejected by VBADocuments::UploadValidations. The error from VBADocuments is logged to DataDog, but since it occurs after submission, it doesn't trigger an error in Lighthouse::SubmitBenefitsIntakeClaim.

We shouldn't submit claims to Lighthouse with invalid attachments. As an initial step, update Lighthouse::SubmitBenefitsIntakeClaim to validate attachments when adding them (see PensionBenefitIntakeJob#perform and PensionBenefitIntakeJob#process_document). This will cause an error to be raised in the Sidekiq job, triggering retries and logging.


Tasks

Acceptance Criteria