user/src/modules/users/domain/usecases/delete-user.usecase.ts

13 lines
449 B
TypeScript
Raw Normal View History

2022-12-14 11:49:43 +00:00
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);
}
}