-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathRegisterUser.ts
More file actions
22 lines (19 loc) · 878 Bytes
/
RegisterUser.ts
File metadata and controls
22 lines (19 loc) · 878 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 { UserDTO } from '../dtos/UserDTO'
import { IUsersRepository } from '../repositories/IUsersRepository'
export class RegisterUser implements UseCase<void> {
private usersRepository: IUsersRepository
constructor(usersRepository: IUsersRepository) {
this.usersRepository = usersRepository
}
/**
* Registers a new user, given a UserDTO object. Only available through DataverseApiAuthMechanism.BEARER_TOKEN auth mechanism.
*
* @param {UserDTO} [userDTO] - UserDTO object including the new user data.
* @returns {Promise<void>} - This method does not return anything upon successful completion.
* @throws {WriteError} - If there are errors while writing data.
*/
async execute(userDTO: UserDTO): Promise<void> {
return await this.usersRepository.registerUser(userDTO)
}
}