fix: clinicId on all appointment paths + startedAt on call records

- AI chat book_appointment tool: accepts optional clinicId
- Widget booking: passes clinicId from request
- LiveKit agent: passes clinicId from doctor context if available
- Dispose endpoint: sets startedAt/endedAt on outbound call records
  (computed from durationSec). Fixes null timestamps in call history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 14:52:30 +05:30
parent a4ff052fef
commit b6b597fdda
5 changed files with 16 additions and 4 deletions

View File

@@ -128,6 +128,7 @@ const bookAppointment = llm.tool({
doctorName: doctor?.name ?? doctorName ?? 'To be assigned',
department,
reasonForVisit: reason,
...((doctor as any)?.clinicId ? { clinicId: (doctor as any).clinicId } : {}),
},
},
);