diff --git a/src/junior/controllers/junior.controller.ts b/src/junior/controllers/junior.controller.ts index b54d397..d3a472a 100644 --- a/src/junior/controllers/junior.controller.ts +++ b/src/junior/controllers/junior.controller.ts @@ -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, diff --git a/src/junior/dtos/response/weekly-summary.response.dto.ts b/src/junior/dtos/response/weekly-summary.response.dto.ts index 310e0f6..5c1e7e5 100644 --- a/src/junior/dtos/response/weekly-summary.response.dto.ts +++ b/src/junior/dtos/response/weekly-summary.response.dto.ts @@ -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;