-
Notifications
You must be signed in to change notification settings - Fork 8
/
GetDatasetCitation.ts
31 lines (28 loc) · 1.38 KB
/
GetDatasetCitation.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { IDatasetsRepository } from '../repositories/IDatasetsRepository'
import { DatasetNotNumberedVersion } from '../models/DatasetNotNumberedVersion'
export class GetDatasetCitation implements UseCase<string> {
private datasetsRepository: IDatasetsRepository
constructor(datasetsRepository: IDatasetsRepository) {
this.datasetsRepository = datasetsRepository
}
/**
* Returns the Dataset citation text.
*
* @param {number} [datasetId] - The dataset identifier.
* @param {string | DatasetNotNumberedVersion} [datasetVersionId=DatasetNotNumberedVersion.LATEST] - The dataset version identifier, which can be a version-specific numeric string (for example, 1.0) or a DatasetNotNumberedVersion enum value. If this parameter is not set, the default value is: DatasetNotNumberedVersion.LATEST
* @param {boolean} [includeDeaccessioned=false] - Indicates whether to consider deaccessioned versions in the dataset search or not. The default value is false
* @returns {Promise<string>}
*/
async execute(
datasetId: number,
datasetVersionId: string | DatasetNotNumberedVersion = DatasetNotNumberedVersion.LATEST,
includeDeaccessioned = false
): Promise<string> {
return await this.datasetsRepository.getDatasetCitation(
datasetId,
datasetVersionId,
includeDeaccessioned
)
}
}