feat: debut d'un front vue.js + ajout de cursorrules
This commit is contained in:
parent
ca9a74fe69
commit
bee8572dc5
42
assets/vue/app/domain/manga/domain/entities/manga.js
Normal file
42
assets/vue/app/domain/manga/domain/entities/manga.js
Normal file
@@ -0,0 +1,42 @@
|
||||
export class Manga {
|
||||
constructor({
|
||||
id,
|
||||
slug,
|
||||
title,
|
||||
description = null,
|
||||
authors = [],
|
||||
imageUrl = null,
|
||||
publicationYear = null,
|
||||
status = null,
|
||||
rating = null,
|
||||
genres = [],
|
||||
createdAt = new Date().toISOString()
|
||||
}) {
|
||||
this.id = id;
|
||||
this.slug = slug;
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.authors = authors;
|
||||
this.imageUrl = imageUrl;
|
||||
this.publicationYear = publicationYear;
|
||||
this.status = status;
|
||||
this.rating = rating;
|
||||
this.genres = genres;
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
static create(data) {
|
||||
return new Manga(data);
|
||||
}
|
||||
}
|
||||
|
||||
export class MangaCollection {
|
||||
constructor(items, total, page, limit, hasNextPage, hasPreviousPage) {
|
||||
this.items = items.map(item => Manga.create(item));
|
||||
this.total = total;
|
||||
this.page = page;
|
||||
this.limit = limit;
|
||||
this.hasNextPage = hasNextPage;
|
||||
this.hasPreviousPage = hasPreviousPage;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user