19 lines
1.5 KiB
TypeScript
19 lines
1.5 KiB
TypeScript
import { Controller, Get, Inject, Module, Query } from '@nestjs/common';
|
|
import { CurrentUserParam, RequirePermissions, type CurrentUser } from '../security/security.metadata.js';
|
|
import { CallerAnalyticsService } from './caller-analytics.service.js';
|
|
|
|
@Controller('caller-analytics')
|
|
@RequirePermissions('caller_analytics.view')
|
|
class CallerAnalyticsController {
|
|
constructor(@Inject(CallerAnalyticsService) private readonly service: CallerAnalyticsService) {}
|
|
@Get('overview') overview(@Query() q: Record<string, unknown>, @CurrentUserParam() user: CurrentUser) { return this.service.overview(q, user); }
|
|
@Get('summary') summary(@Query() q: Record<string, unknown>, @CurrentUserParam() user: CurrentUser) { return this.service.overview(q, user); }
|
|
@Get('numbers') numbers(@Query() q: Record<string, unknown>, @CurrentUserParam() user: CurrentUser) { return this.service.overview(q, user); }
|
|
@Get('trends') trends(@Query() q: Record<string, unknown>, @CurrentUserParam() user: CurrentUser) { return this.service.overview(q, user); }
|
|
@Get('calls') calls(@Query() q: Record<string, unknown>, @CurrentUserParam() user: CurrentUser) { return this.service.detail(q, user); }
|
|
@Get('breakdown') breakdown(@Query() q: Record<string, unknown>, @CurrentUserParam() user: CurrentUser) { return this.service.detail(q, user); }
|
|
@Get('options') options(@CurrentUserParam() user: CurrentUser) { return this.service.options(user); }
|
|
}
|
|
@Module({ controllers: [CallerAnalyticsController], providers: [CallerAnalyticsService] })
|
|
export class CallerAnalyticsModule {}
|