File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -19,4 +19,6 @@ export interface IDashboardService {
1919 month,
2020 year,
2121 } : IDashboardStartAndEnd ) : Promise < IDashboardStartAndEndDate > ;
22+
23+ getPercentage ( value : number , total : number ) : Promise < number > ;
2224}
Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ import {
66} from 'src/common/dashboard/interfaces/dashboard.interface' ;
77import { IDashboardService } from 'src/common/dashboard/interfaces/dashboard.service.interface' ;
88import { HelperDateService } from 'src/common/helper/services/helper.date.service' ;
9+ import { HelperNumberService } from 'src/common/helper/services/helper.number.service' ;
910
1011export class DashboardService implements IDashboardService {
11- constructor ( private readonly helperDateService : HelperDateService ) { }
12+ constructor (
13+ private readonly helperDateService : HelperDateService ,
14+ private readonly helperNumberService : HelperNumberService
15+ ) { }
1216
1317 async getStartAndEndDate (
1418 date : DashboardDto
@@ -70,4 +74,8 @@ export class DashboardService implements IDashboardService {
7074 endDate,
7175 } ;
7276 }
77+
78+ async getPercentage ( value : number , total : number ) : Promise < number > {
79+ return this . helperNumberService . percent ( value , total ) ;
80+ }
7381}
You can’t perform that action at this time.
0 commit comments