mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +00:00
chore: track caller resolution module
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
26
src/caller/caller-resolution.controller.ts
Normal file
26
src/caller/caller-resolution.controller.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Controller, Post, Body, Headers, HttpException, HttpStatus, Logger } from '@nestjs/common';
|
||||
import { CallerResolutionService } from './caller-resolution.service';
|
||||
|
||||
@Controller('api/caller')
|
||||
export class CallerResolutionController {
|
||||
private readonly logger = new Logger(CallerResolutionController.name);
|
||||
|
||||
constructor(private readonly resolution: CallerResolutionService) {}
|
||||
|
||||
@Post('resolve')
|
||||
async resolve(
|
||||
@Body('phone') phone: string,
|
||||
@Headers('authorization') auth: string,
|
||||
) {
|
||||
if (!phone) {
|
||||
throw new HttpException('phone is required', HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
if (!auth) {
|
||||
throw new HttpException('Authorization header required', HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
this.logger.log(`[RESOLVE] Resolving caller: ${phone}`);
|
||||
const result = await this.resolution.resolve(phone, auth);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user