Start of new data model

This commit is contained in:
advplyr 2022-03-08 19:31:44 -06:00
parent 2b7f53b0a7
commit 65793f7109
18 changed files with 672 additions and 8 deletions

View file

@ -0,0 +1,45 @@
class Author {
constructor(author) {
this.id = null
this.asin = null
this.name = null
this.imagePath = null
this.imageFullPath = null
this.addedAt = null
this.updatedAt = null
if (author) {
this.construct(author)
}
}
construct(author) {
this.id = author.id
this.asin = author.asin
this.name = author.name
this.imagePath = author.imagePath
this.imageFullPath = author.imageFullPath
this.addedAt = author.addedAt
this.updatedAt = author.updatedAt
}
toJSON() {
return {
id: this.id,
asin: this.asin,
name: this.name,
imagePath: this.imagePath,
imageFullPath: this.imageFullPath,
addedAt: this.addedAt,
updatedAt: this.updatedAt
}
}
toJSONMinimal() {
return {
id: this.id,
name: this.name
}
}
}
module.exports = Author