You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
846 B

import { Statistics } from '@/models/statistics'
import { StatisticsRepository } from '@/repositories/statistics/interface'
export class StatisticsDTO {
label: object
user: object
progress: object
constructor(item: Statistics, labelText: string, userText: string, progressLabels: string[]) {
this.label = item.labelStats(labelText)
this.user = item.userStats(userText)
this.progress = item.progress(progressLabels)
}
}
export class StatisticsApplicationService {
constructor(
private readonly repository: StatisticsRepository
) {}
public async fetchStatistics(
projectId: string, labelText: string, userText: string, progressLabels: string[]
): Promise<StatisticsDTO> {
const item = await this.repository.fetch(projectId)
return new StatisticsDTO(item, labelText, userText, progressLabels)
}
}