2022-08-14 12:15:09 +02:00
|
|
|
import AbstractModel, { type IAbstract } from './abstractModel'
|
2022-07-21 00:42:36 +02:00
|
|
|
import UserModel, { type IUser } from './user'
|
|
|
|
import type { ITask } from './task'
|
2020-02-25 20:11:36 +00:00
|
|
|
|
2022-08-14 12:15:09 +02:00
|
|
|
export interface ITaskComment extends IAbstract {
|
2022-06-23 03:22:21 +02:00
|
|
|
id: number
|
2022-07-21 00:42:36 +02:00
|
|
|
taskId: ITask['id']
|
2022-06-23 03:22:21 +02:00
|
|
|
comment: string
|
2022-07-21 00:42:36 +02:00
|
|
|
author: IUser
|
|
|
|
|
|
|
|
created: Date
|
|
|
|
updated: Date
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class TaskCommentModel extends AbstractModel implements ITaskComment {
|
2022-08-14 12:15:45 +02:00
|
|
|
id = 0
|
|
|
|
taskId: ITask['id'] = 0
|
|
|
|
comment = ''
|
|
|
|
author: IUser = UserModel
|
2022-06-23 03:22:21 +02:00
|
|
|
|
2022-08-14 12:15:45 +02:00
|
|
|
created: Date = null
|
|
|
|
updated: Date = null
|
|
|
|
|
|
|
|
constructor(data: Partial<ITaskComment>) {
|
|
|
|
super()
|
|
|
|
this.assignData(data)
|
2022-06-23 03:22:21 +02:00
|
|
|
|
2020-02-25 20:11:36 +00:00
|
|
|
this.author = new UserModel(this.author)
|
|
|
|
this.created = new Date(this.created)
|
|
|
|
this.updated = new Date(this.updated)
|
|
|
|
}
|
|
|
|
}
|