import { ApiProperty } from '@nestjs/swagger'; import { IGoalStats } from '~/saving-goals/interfaces'; const ZERO = 0; export class GoalsStatsResponseDto { @ApiProperty() totalTarget: number; @ApiProperty() totalSaved: number; constructor(stats: IGoalStats) { this.totalTarget = stats.totalTarget || ZERO; this.totalSaved = stats.totalSaved || ZERO; } }