const {query} = require("../client") class Comment { /** * @param {string} id * @param {string} subject * @param {string} author * @param {string} characterName * @param {CommentCharacter} character * @param {string | number | Date} fictionalDate * @param {string | number | Date} createdDate * @param {string | number | Date} editedDate * @param {string} source */ constructor(id, subject, author, characterName, character, fictionalDate, createdDate, editedDate, source) { this.id = id this.subject = subject this.author = author this.characterName = characterName this.character = character != null ? CommentCharacter.fromData(character) : null this.fictionalDate = fictionalDate != null ? new Date(fictionalDate) : null this.createdDate = new Date(createdDate) this.editedDate = new Date(editedDate) this.source = source } static fromData(data) { return new Comment(data.id, data.subject, data.author, data.characterName, data.character, data.fictionalDate, data.createdDate, data.editedDate, data.source) } } class CommentCharacter { /** * @param {string} id * @param {string} name * @param {string} author * @param {string} description */ constructor(id, name, author, description) { this.id = id this.name = name this.author = author this.description = description } static fromData(data) { return new CommentCharacter(data.id, data.name, data.author, data.description) } } module.exports = {Comment, CommentCharacter}