mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 21:59:40 +00:00
feat: working on saving goals jounrey for juniors
This commit is contained in:
15
src/saving-goals/dtos/response/goals-stats.response.dto.ts
Normal file
15
src/saving-goals/dtos/response/goals-stats.response.dto.ts
Normal file
@ -0,0 +1,15 @@
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user