fix: only skip appointment-attachment merge when automated claim already has files

skipAppointmentAttachmentMerge was blanket-set for any autoSubmit path
(chatbot, Claim with AI batch automation, insurance-status auto-check),
so screenshots/files attached directly on the appointment were silently
dropped from the MassHealth Selenium upload whenever a claim was
auto-submitted. Now the merge is only skipped if the automated flow
actually supplied its own files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 00:29:26 -04:00
parent 870bda5950
commit d5cecb0b54

View File

@@ -1023,10 +1023,11 @@ export function ClaimForm({
insuranceSiteKey: "MH",
claimId: createdClaim.id,
uploadedFiles,
// Chatbot-driven submissions already include every file the user intends to send —
// skip the backend's appointment-attachment fallback merge so old files saved on the
// appointment (e.g. via the Schedule editor) aren't silently added as extra uploads.
skipAppointmentAttachmentMerge: !!autoSubmit,
// Only skip the backend's appointment-attachment fallback merge when this automated
// submission already supplied its own files — otherwise files saved directly on the
// appointment (e.g. a screenshot attached via the Schedule editor) would never reach
// the insurance upload at all.
skipAppointmentAttachmentMerge: !!autoSubmit && !!uploadedFiles?.length,
});
// 5. Close form