import { ProjectViewModel } from '@app/ui/projects/project.presenter.model';
import { Project } from '@app/domain/projects/project.model';

export class ProjectPresenter {
  constructor() {}

  toViewModel(project: Project): ProjectViewModel {
    return {
      id: project.id,
      created: project.created,
      updated: project.updated,
      nom: project.nom,
      lien: project.lien,
      description: project.description,
      fichier: project.fichier,
      utilisateur: project.utilisateur,
    };
  }

  toViewModels(projects: Project[]): ProjectViewModel[] {
    return projects.map(this.toViewModel);
  }
}
