feat: save claim attachments to cloud storage and documents page

- Claim file uploads (chatbot or manual) now save to both the Cloud
  Storage patient folder and the Documents page via new
  POST /api/claims/upload-to-cloud endpoint
- MH submit flow now calls uploadAttachmentsToLocalFolder (same as
  DDMA/United/Tufts) so chatbot-attached X-rays are persisted
- Removed old /upload-attachments disk route and attachmentDiskStorage
  multer config; deleted uploads/patients/ folder
- uploadAttachmentsToLocalFolder now points to /upload-to-cloud and
  sends patientId so the backend can create the patient folder

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-06-11 00:30:32 -04:00
co-authored by Claude Sonnet 4.6
parent 46daeb1c1f
commit d4b9c1b889
10 changed files with 280 additions and 68 deletions
+2 -2
View File
@@ -313,9 +313,9 @@ router.post("/create-appointment-today", async (req: Request, res: Response): Pr
try {
const userId = req.user?.id;
if (!userId) return res.status(401).json({ message: "Unauthorized" });
const { patientId } = req.body;
const { patientId, date } = req.body;
if (!patientId) return res.status(400).json({ message: "patientId is required" });
const result = await createAppointmentToday(Number(patientId), userId, storage);
const result = await createAppointmentToday(Number(patientId), userId, storage, date ?? undefined);
if ("error" in result) return res.status(409).json({ message: result.error });
return res.status(200).json(result);
} catch (err) {