-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGetFileDataTables.ts
More file actions
21 lines (18 loc) · 881 Bytes
/
GetFileDataTables.ts
File metadata and controls
21 lines (18 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { IFilesRepository } from '../repositories/IFilesRepository'
import { FileDataTable } from '../models/FileDataTable'
export class GetFileDataTables implements UseCase<FileDataTable[]> {
private filesRepository: IFilesRepository
constructor(filesRepository: IFilesRepository) {
this.filesRepository = filesRepository
}
/**
* This use case is oriented toward tabular files and provides an array of FileDataTable objects for an existing tabular file.
*
* @param {number | string} [fileId] - The file identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers).
* @returns {Promise<FileDataTable[]>}
*/
async execute(fileId: number | string): Promise<FileDataTable[]> {
return await this.filesRepository.getFileDataTables(fileId)
}
}