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
[ ] In Lighthouse::SubmitBenefitsIntakeClaim, check if each attachment is valid when adding it to the claim. Raise an error for invalid attachments.
Acceptance Criteria
[ ] The Lighthouse::SubmitBenefitsIntakeClaim job should fail if an attachment is invalid
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
[ ] The Lighthouse::SubmitBenefitsIntakeClaim job should fail if an attachment is invalid