2020-04-26 01:11:34 +02:00
|
|
|
import AbstractModel from './abstractModel'
|
|
|
|
import UserModel from './user'
|
2020-09-04 22:01:02 +02:00
|
|
|
import TaskModel from './task'
|
2020-04-26 01:11:34 +02:00
|
|
|
|
|
|
|
export default class BucketModel extends AbstractModel {
|
|
|
|
constructor(bucket) {
|
|
|
|
super(bucket)
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
|
|
|
defaults() {
|
|
|
|
return {
|
|
|
|
id: 0,
|
|
|
|
title: '',
|
|
|
|
listId: 0,
|
2020-09-04 22:01:02 +02:00
|
|
|
limit: 0,
|
2020-04-26 01:11:34 +02:00
|
|
|
tasks: [],
|
2021-03-24 21:16:56 +01:00
|
|
|
isDoneBucket: false,
|
2021-07-28 22:46:33 +02:00
|
|
|
position: 0,
|
2020-04-26 01:11:34 +02:00
|
|
|
|
|
|
|
createdBy: null,
|
|
|
|
created: null,
|
|
|
|
updated: null,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|