feat: label AI-rescheduled appointments and add manual confirm option

- Add movedByAi boolean column to Appointment table (default false)
- reschedule-graph: set movedByAi=true when AI moves an appointment
- PATCH /api/appointments/:id/confirm endpoint clears the movedByAi flag
- Schedule grid: show teal AI badge on appointment cards where movedByAi=true
- Right-click context menu: 'Manually Confirmed' removes the AI badge via the confirm endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gitead
2026-05-11 19:23:36 -04:00
parent 1ff843bc79
commit 5e3cfef52b
76 changed files with 212 additions and 12 deletions

View File

@@ -439,6 +439,7 @@ async function moveAppointment(
startTime: newStartTime,
endTime: newEndTime,
status: "scheduled",
movedByAi: true,
} as any);
return "ok";

View File

@@ -417,6 +417,19 @@ router.put(
}
);
// Manually confirm an AI-moved appointment (clears the movedByAi flag)
router.patch("/:id/confirm", async (req: Request, res: Response): Promise<any> => {
try {
const id = parseInt(req.params.id);
if (isNaN(id)) return res.status(400).json({ message: "Invalid appointment ID" });
const updated = await storage.updateAppointment(id, { movedByAi: false } as any);
return res.json(updated);
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);
return res.status(500).json({ message: msg });
}
});
// Delete an appointment
router.delete("/:id", async (req: Request, res: Response): Promise<any> => {
try {