mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 00:24:54 +00:00
fix: add swagger
This commit is contained in:
@ -32,6 +32,7 @@ import {
|
||||
ThemeResponseDto,
|
||||
TransferToJuniorResponseDto,
|
||||
} from '../dtos/response';
|
||||
import { WeeklySummaryResponseDto } from '../dtos/response/weekly-summary.response.dto';
|
||||
import { JuniorService } from '../services';
|
||||
|
||||
@Controller('juniors')
|
||||
@ -148,7 +149,7 @@ export class JuniorController {
|
||||
@Get(':juniorId/weekly-summary')
|
||||
@UseGuards(RolesGuard)
|
||||
@AllowedRoles(Roles.GUARDIAN)
|
||||
@ApiDataResponse('string')
|
||||
@ApiDataResponse(WeeklySummaryResponseDto)
|
||||
async getWeeklySummary(
|
||||
@Param('juniorId', CustomParseUUIDPipe) juniorId: string,
|
||||
@AuthenticatedUser() user: IJwtPayload,
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
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 })
|
||||
total!: number;
|
||||
|
||||
@ApiProperty({ description: 'range', example: '2023-10-01 - 2023-10-07' })
|
||||
range!: string;
|
||||
|
||||
@ApiProperty({ description: 'Amount spent on Sunday', example: 50 })
|
||||
sunday!: number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user