feat: add properties to models
This commit is contained in:
parent
74ad6e65e8
commit
797de0c543
33 changed files with 367 additions and 186 deletions
|
|
@ -1,7 +1,31 @@
|
|||
import AbstractModel from './abstractModel'
|
||||
import UserModel from './user'
|
||||
import type TaskModel from './task'
|
||||
|
||||
export const RELATION_KINDS = [
|
||||
'subtask',
|
||||
'parenttask',
|
||||
'related',
|
||||
'duplicates',
|
||||
'blocking',
|
||||
'blocked',
|
||||
'precedes',
|
||||
'follows',
|
||||
'copiedfrom',
|
||||
'copiedto',
|
||||
] as const
|
||||
|
||||
export type RelationKind = typeof RELATION_KINDS[number]
|
||||
|
||||
export default class TaskRelationModel extends AbstractModel {
|
||||
id: number
|
||||
otherTaskId: TaskModel['id']
|
||||
taskId: TaskModel['id']
|
||||
relationKind: RelationKind
|
||||
|
||||
createdBy: UserModel
|
||||
created: Date
|
||||
|
||||
constructor(data) {
|
||||
super(data)
|
||||
this.createdBy = new UserModel(this.createdBy)
|
||||
|
|
|
|||
Reference in a new issue