Can Comment a Comment

This commit is contained in:
2019-10-15 15:46:19 +02:00
parent 499fbd6dcf
commit 8cb5c35296
4 changed files with 77 additions and 13 deletions

View File

@@ -7,12 +7,26 @@ open class Comment <T : UuidEntity> (
id: UUID = UUID.randomUUID(),
createdBy: Citizen,
target: T,
override var targetReference: String = target::class.simpleName!!.toLowerCase(),
var content: String,
var responses: List<Comment<T>>? = null,
val responses: List<Comment<T>>? = null,
var parent: Comment<T>? = null,
var parentsIds: List<UUID>? = null,
val parentsIds: List<UUID>? = null,
val childrenCount: Int? = null
) : Extra<T>(id, createdBy, target),
EntityUpdatedAt by EntityUpdatedAtImp(),
EntityDeletedAt by EntityDeletedAtImp(),
Votable by VotableImp()
{
constructor(
createdBy: Citizen,
parent: Comment<T>,
content: String
) : this(
createdBy = createdBy,
parent = parent,
target = parent.target,
targetReference = parent.targetReference,
content = content
)
}