fix: add swagger

This commit is contained in:
Abdalhameed Ahmad
2025-09-23 09:00:41 +03:00
parent 1830d92cbd
commit 918b15c315
2 changed files with 6 additions and 4 deletions

View File

@ -32,6 +32,7 @@ import {
ThemeResponseDto, ThemeResponseDto,
TransferToJuniorResponseDto, TransferToJuniorResponseDto,
} from '../dtos/response'; } from '../dtos/response';
import { WeeklySummaryResponseDto } from '../dtos/response/weekly-summary.response.dto';
import { JuniorService } from '../services'; import { JuniorService } from '../services';
@Controller('juniors') @Controller('juniors')
@ -148,7 +149,7 @@ export class JuniorController {
@Get(':juniorId/weekly-summary') @Get(':juniorId/weekly-summary')
@UseGuards(RolesGuard) @UseGuards(RolesGuard)
@AllowedRoles(Roles.GUARDIAN) @AllowedRoles(Roles.GUARDIAN)
@ApiDataResponse('string') @ApiDataResponse(WeeklySummaryResponseDto)
async getWeeklySummary( async getWeeklySummary(
@Param('juniorId', CustomParseUUIDPipe) juniorId: string, @Param('juniorId', CustomParseUUIDPipe) juniorId: string,
@AuthenticatedUser() user: IJwtPayload, @AuthenticatedUser() user: IJwtPayload,

View File

@ -1,12 +1,13 @@
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
export class WeeklySummaryResponseDto { export class WeeklySummaryResponseDto {
@ApiProperty({ description: 'Start date of the week', example: '2023-10-01' })
startOfWeek!: Date;
@ApiProperty({ description: 'End date of the week', example: '2023-10-07' })
endOfWeek!: Date;
@ApiProperty({ description: 'Total amount spent in the week', example: 350 }) @ApiProperty({ description: 'Total amount spent in the week', example: 350 })
total!: number; total!: number;
@ApiProperty({ description: 'range', example: '2023-10-01 - 2023-10-07' })
range!: string;
@ApiProperty({ description: 'Amount spent on Sunday', example: 50 }) @ApiProperty({ description: 'Amount spent on Sunday', example: 50 })
sunday!: number; sunday!: number;