ÿØÿà JFIF H H ÿÛ C GIF89;
| System: Linux srv913213 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 Current Path : /var/www/talentgenesis_admin_backend/src/admin/dashboard/ |
| Current File : /var/www/talentgenesis_admin_backend/src/admin/dashboard/dashboard.controller.ts |
import { Controller, Get, Query, UseGuards } from '@nestjs/common';
import { DashboardService } from './dashboard.service';
import { ApiBearerAuth, ApiQuery, ApiResponse, ApiTags } from '@nestjs/swagger';
import { AuthGuard } from 'src/guards/auth.guard';
@ApiTags('Dashboard')
@ApiBearerAuth()
@UseGuards(AuthGuard)
@Controller('dashboard')
export class DashboardController {
constructor(private readonly dashboardService: DashboardService) {}
@Get('candidate-sources')
@ApiQuery({
name: 'filter',
required: false,
enum: ['year', 'month', 'week', 'all'],
})
async getCandidateSources(
@Query('filter') filter: 'year' | 'month' | 'week' | 'all' = 'all',
) {
return this.dashboardService.getCandidateSources(filter);
}
@Get('applications-stats')
@ApiQuery({
name: 'filter',
required: false,
enum: ['year', 'month', 'week', 'all'],
})
async getApplicationsStats(@Query('filter') filter: 'year' | 'month' | 'week' | 'all' = 'month') {
return this.dashboardService.getApplicationsStats(filter);
}
@Get('job-stats')
@ApiQuery({
name: 'filter',
required: false,
enum: ['year', 'month', 'week', 'all'],
description: 'Filter jobs by period: year, month, week, or all (default: month)',
})
async getJobStats(@Query('filter') filter: 'year' | 'month' | 'week' | 'all' = 'month') {
return this.dashboardService.getJobStats(filter);
}
@Get('overview')
@ApiQuery({
name: 'filter',
required: false,
enum: ['year', 'month', 'week', 'all', 'customRange'],
description:
'Filter overview stats: year, month, week, all, or customRange (default: month)',
})
@ApiQuery({
name: 'fromDate',
required: false,
description: 'Start date (YYYY-MM-DD) - required if filter=customRange',
})
@ApiQuery({
name: 'toDate',
required: false,
description: 'End date (YYYY-MM-DD) - required if filter=customRange',
})
async getOverview(
@Query('filter') filter: 'year' | 'month' | 'week' | 'all' | 'customRange' = 'month',
@Query('fromDate') fromDate?: string,
@Query('toDate') toDate?: string,
) {
return this.dashboardService.getOverviewStats(filter, fromDate, toDate);
}
}