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,
|
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,
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user