2020-01-30 16:14:25 +02:00
|
|
|
import { Paragraph } from "./paragraph";
|
2020-12-21 10:30:42 +02:00
|
|
|
import { Table } from "./table";
|
2020-01-30 16:14:25 +02:00
|
|
|
|
|
|
|
export class Comment {
|
|
|
|
id: number;
|
|
|
|
_author: string;
|
|
|
|
_date: string;
|
2020-12-21 10:30:42 +02:00
|
|
|
children: (Paragraph | Table)[] = [];
|
2020-08-13 19:57:59 +03:00
|
|
|
_parentCommentId: number;
|
2020-01-30 16:14:25 +02:00
|
|
|
|
|
|
|
constructor(id: number) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
author(author: string) {
|
|
|
|
this._author = author;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
date(date: string) {
|
|
|
|
this._date = date;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2020-12-21 10:30:42 +02:00
|
|
|
addParagraph(p: Paragraph) {
|
|
|
|
this.children.push(p);
|
2020-01-30 16:14:25 +02:00
|
|
|
return this;
|
|
|
|
}
|
2020-08-13 19:57:59 +03:00
|
|
|
|
|
|
|
parentCommentId(id: number) {
|
|
|
|
this._parentCommentId = id;
|
|
|
|
return this;
|
|
|
|
}
|
2020-01-30 16:14:25 +02:00
|
|
|
}
|