feat: caller context cache invalidation endpoint

- CallerContextService: added invalidateCache(leadId) method
- CallerResolutionController: POST /api/caller/invalidate-context
  endpoint — frontend calls after appointment mutations to bust
  stale AI context cache

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-18 05:29:56 +05:30
parent 77b3e917db
commit 8c8b1e78b0
2 changed files with 16 additions and 0 deletions

View File

@@ -33,4 +33,13 @@ export class CallerResolutionController {
return result;
}
@Post('invalidate-context')
async invalidateContext(@Body('leadId') leadId: string) {
if (!leadId) {
throw new HttpException('leadId is required', HttpStatus.BAD_REQUEST);
}
await this.callerContext.invalidateCache(leadId);
return { status: 'ok' };
}
}