Files
zod-backend/src/saving-goals/dtos/response/goals-stats.response.dto.ts
2024-12-15 12:44:59 +03:00

16 lines
376 B
TypeScript

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;
}
}