-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGetDatasetDownloadCount.ts
More file actions
22 lines (19 loc) · 1019 Bytes
/
GetDatasetDownloadCount.ts
File metadata and controls
22 lines (19 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { DatasetDownloadCount } from '../models/DatasetDownloadCount'
import { IDatasetsRepository } from '../repositories/IDatasetsRepository'
export class GetDatasetDownloadCount implements UseCase<DatasetDownloadCount> {
private datasetsRepository: IDatasetsRepository
constructor(datasetsRepository: IDatasetsRepository) {
this.datasetsRepository = datasetsRepository
}
/**
* Returns a DatasetDownloadCount instance, with dataset id, count and MDCStartDate(optional).
*
* @param {number | string} [datasetId] - The dataset identifier.
* @param {boolean} [includeMDC(optional)] - Indicates whether to consider include counts from MDC start date or not. The default value is false
* @returns {Promise<DatasetDownloadCount>}
*/
async execute(datasetId: number | string, includeMDC?: boolean): Promise<DatasetDownloadCount> {
return await this.datasetsRepository.getDatasetDownloadCount(datasetId, includeMDC)
}
}