chore: track caller resolution module

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-01 17:13:35 +05:30
parent 5e3ccbd040
commit d0df6618b5
3 changed files with 255 additions and 0 deletions

View 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;
}
}