export class GetUserByIdQueryHandler {
  constructor(userRepository) {
    this.userRepository = userRepository;
  }

  async handle(query) {
    const user = await this.userRepository.getById(query.id);
    if (!user) {
      throw new Error('User not found');
    }
    return user;
  }
}
