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/taskRelation.ts

25 lines
759 B
TypeScript
Raw Permalink Normal View History

2022-08-04 18:57:43 +00:00
import AbstractModel from './abstractModel'
import UserModel from './user'
2022-06-23 01:22:21 +00:00
2022-08-04 18:57:43 +00:00
import type {ITaskRelation} from '@/modelTypes/ITaskRelation'
import type {ITask} from '@/modelTypes/ITask'
import type {IUser} from '@/modelTypes/IUser'
2022-07-20 22:42:36 +00:00
2022-09-15 10:52:38 +00:00
import {RELATION_KIND, type IRelationKind} from '@/types/IRelationKind'
2022-09-06 09:36:01 +00:00
export default class TaskRelationModel extends AbstractModel<ITaskRelation> implements ITaskRelation {
id = 0
otherTaskId: ITask['id'] = 0
taskId: ITask['id'] = 0
2022-09-15 10:52:38 +00:00
relationKind: IRelationKind = RELATION_KIND.RELATED
2022-07-20 22:42:36 +00:00
2022-09-15 10:52:38 +00:00
createdBy: IUser = new UserModel()
created: Date = new Date
constructor(data: Partial<ITaskRelation>) {
super()
this.assignData(data)
2022-06-23 01:22:21 +00:00
this.createdBy = new UserModel(this.createdBy)
this.created = new Date(this.created)
}
}