1
0

feat(views): crud in frontend

This commit is contained in:
kolaente
2024-03-18 13:56:44 +01:00
parent 433584813a
commit 434b1ea0e8
10 changed files with 476 additions and 12 deletions

View File

@ -7,6 +7,7 @@ import type {IProject} from '@/modelTypes/IProject'
import type {IUser} from '@/modelTypes/IUser'
import type {ITask} from '@/modelTypes/ITask'
import type {ISubscription} from '@/modelTypes/ISubscription'
import ProjectViewModel from '@/models/projectView'
export default class ProjectModel extends AbstractModel<IProject> implements IProject {
id = 0
@ -25,6 +26,7 @@ export default class ProjectModel extends AbstractModel<IProject> implements IPr
parentProjectId = 0
doneBucketId = 0
defaultBucketId = 0
views = []
created: Date = null
updated: Date = null
@ -48,6 +50,8 @@ export default class ProjectModel extends AbstractModel<IProject> implements IPr
this.subscription = new SubscriptionModel(this.subscription)
}
this.views = this.views.map(v => new ProjectViewModel(v))
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}

View File

@ -0,0 +1,30 @@
import type {IProjectView, ProjectViewBucketConfigurationMode, ProjectViewKind} from '@/modelTypes/IProjectView'
import AbstractModel from '@/models/abstractModel'
export default class ProjectViewModel extends AbstractModel<IProjectView> implements IProjectView {
id = 0
title = ''
projectId = 0
viewKind: ProjectViewKind = 'list'
filter = ''
position = 0
bucketConfiguration = []
bucketConfigurationMode: ProjectViewBucketConfigurationMode = 'manual'
defaultBucketId = 0
doneBucketId = 0
created: Date = new Date()
updated: Date = new Date()
constructor(data: Partial<IProjectView>) {
super()
this.assignData(data)
if (!this.bucketConfiguration) {
this.bucketConfiguration = []
}
}
}