13 lines
449 B
TypeScript
13 lines
449 B
TypeScript
|
import { CommandHandler } from '@nestjs/cqrs';
|
||
|
import { UsersRepository } from '../../adapters/secondaries/users.repository';
|
||
|
import { DeleteUserCommand } from '../../commands/delete-user.command';
|
||
|
|
||
|
@CommandHandler(DeleteUserCommand)
|
||
|
export class DeleteUserUseCase {
|
||
|
constructor(private readonly _repository: UsersRepository) {}
|
||
|
|
||
|
async execute(command: DeleteUserCommand): Promise<void> {
|
||
|
return this._repository.delete(command.uuid);
|
||
|
}
|
||
|
}
|