import { UserViewModel } from '@app/ui/users/user.presenter.model';
import { User } from '@app/domain/users/user.model';

export class UserPresenter {
  constructor() {}

  toViewModel(user: User): UserViewModel {
    return {
      id: user.id,
      username: user.username,
      verified: user.verified,
      emailVisibility: user.emailVisibility,
      email: user.email,
      name: user.name,
      avatar: user.avatar,
    };
  }

  toViewModels(users: User[]): UserViewModel[] {
    return users.map(this.toViewModel);
  }
}
