project refactoring en clean archi
This commit is contained in:
23
src/app/ui/projects/project.presenter.ts
Normal file
23
src/app/ui/projects/project.presenter.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user