2022-08-04 20:57:43 +02:00
|
|
|
import AbstractModel from './abstractModel'
|
|
|
|
import UserModel from './user'
|
|
|
|
import TaskModel from './task'
|
2020-04-26 01:11:34 +02:00
|
|
|
|
2022-08-04 20:57:43 +02:00
|
|
|
import type {IBucket} from '@/modelTypes/IBucket'
|
|
|
|
import type {ITask} from '@/modelTypes/ITask'
|
|
|
|
import type {IUser} from '@/modelTypes/IUser'
|
2022-07-21 00:42:36 +02:00
|
|
|
|
2022-09-06 11:36:01 +02:00
|
|
|
export default class BucketModel extends AbstractModel<IBucket> implements IBucket {
|
2022-08-14 12:15:45 +02:00
|
|
|
id = 0
|
|
|
|
title = ''
|
|
|
|
listId = ''
|
|
|
|
limit = 0
|
|
|
|
tasks: ITask[] = []
|
2022-09-06 11:36:01 +02:00
|
|
|
isDoneBucket = false
|
|
|
|
position = 0
|
2022-07-21 00:42:36 +02:00
|
|
|
|
2022-08-14 12:15:45 +02:00
|
|
|
createdBy: IUser = null
|
|
|
|
created: Date = null
|
|
|
|
updated: Date = null
|
2022-06-23 03:22:21 +02:00
|
|
|
|
2022-08-14 12:15:45 +02:00
|
|
|
constructor(data: Partial<IBucket>) {
|
|
|
|
super()
|
|
|
|
this.assignData(data)
|
2020-04-26 01:11:34 +02:00
|
|
|
|
|
|
|
this.tasks = this.tasks.map(t => new TaskModel(t))
|
|
|
|
|
|
|
|
this.createdBy = new UserModel(this.createdBy)
|
|
|
|
this.created = new Date(this.created)
|
|
|
|
this.updated = new Date(this.updated)
|
|
|
|
}
|
|
|
|
}
|