This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/models/taskComment.ts

35 lines
730 B
TypeScript
Raw Normal View History

import AbstractModel from './abstractModel'
2022-08-04 18:57:43 +00:00
import UserModel from './user'
2022-08-04 18:57:43 +00:00
import type {ITaskComment} from '@/modelTypes/ITaskComment'
import type {ITask} from '@/modelTypes/ITask'
import type {IUser} from '@/modelTypes/IUser'
2022-07-20 22:42:36 +00:00
export default class TaskCommentModel extends AbstractModel implements ITaskComment {
declare id: number
declare taskId: ITask['id']
declare comment: string
author: IUser
2022-06-23 01:22:21 +00:00
created: Date
updated: Date
constructor(data) {
super(data)
this.author = new UserModel(this.author)
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}
defaults() {
return {
id: 0,
taskId: 0,
comment: '',
author: UserModel,
created: null,
2022-06-23 01:22:21 +00:00
updated: null,
}
}
}