apps/recallassess/recallassess-api/src/api/client/dashboard/dashboard.controller.ts
api/client/dashboard
Methods |
|
| Async getAdminDashboardOverview | ||||||
getAdminDashboardOverview(auth: CLAuthData)
|
||||||
Decorators :
@Get('admin/overview')
|
||||||
|
Get admin dashboard overview (recent activities and pending assessments) GET /api/client/dashboard/admin/overview
Parameters :
Returns :
Promise<AdminDashboardOverviewDto>
|
| Async getAdminDashboardProgress | ||||||
getAdminDashboardProgress(auth: CLAuthData)
|
||||||
Decorators :
@Get('admin/progress')
|
||||||
|
Get admin dashboard progress statistics GET /api/client/dashboard/admin/progress
Parameters :
Returns :
Promise<AdminDashboardProgressDto>
|
| Async getParticipantDashboard | ||||||
getParticipantDashboard(auth: CLAuthData)
|
||||||
Decorators :
@Get()
|
||||||
|
Get participant dashboard data GET /api/client/dashboard
Parameters :
Returns :
Promise<ParticipantDashboardDto>
|
import { Controller, Get, HttpCode, HttpStatus } from '@nestjs/common';
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { CLAuthData, ClientAuth } from '../../shared/decorators/client-auth.decorator';
import {
AdminDashboardOverviewDto,
AdminDashboardProgressDto,
ParticipantDashboardDto,
} from './dto';
import { CLDashboardService } from './dashboard.service';
@ApiTags('Client - Dashboard')
@Controller('api/client/dashboard')
export class CLDashboardController {
constructor(private dashboardService: CLDashboardService) {}
/**
* Get participant dashboard data
* GET /api/client/dashboard
*/
@Get()
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'Get participant dashboard data' })
@ApiResponse({
status: 200,
description: 'Returns participant dashboard with stats, courses, and activities',
type: ParticipantDashboardDto,
})
async getParticipantDashboard(@ClientAuth() auth: CLAuthData): Promise<ParticipantDashboardDto> {
return this.dashboardService.getParticipantDashboard(auth.participantId);
}
/**
* Get admin dashboard overview (recent activities and pending assessments)
* GET /api/client/dashboard/admin/overview
*/
@Get('admin/overview')
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'Get admin dashboard overview' })
@ApiResponse({
status: 200,
description: 'Returns admin dashboard overview with recent activities and pending assessments',
type: AdminDashboardOverviewDto,
})
async getAdminDashboardOverview(
@ClientAuth() auth: CLAuthData,
): Promise<AdminDashboardOverviewDto> {
return this.dashboardService.getAdminDashboardOverview(auth.companyId);
}
/**
* Get admin dashboard progress statistics
* GET /api/client/dashboard/admin/progress
*/
@Get('admin/progress')
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'Get admin dashboard progress statistics' })
@ApiResponse({
status: 200,
description: 'Returns admin dashboard progress statistics',
type: AdminDashboardProgressDto,
})
async getAdminDashboardProgress(
@ClientAuth() auth: CLAuthData,
): Promise<AdminDashboardProgressDto> {
return this.dashboardService.getAdminDashboardProgress(auth.companyId);
}
}