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

32 lines
748 B
TypeScript
Raw Normal View History

2019-11-24 13:16:24 +00:00
import AbstractModel from './abstractModel'
2022-08-04 18:57:43 +00:00
import UserModel from './user'
import FileModel from './file'
import type { IUser } from '@/modelTypes/IUser'
import type { IFile } from '@/modelTypes/IFile'
import type { IAttachment } from '@/modelTypes/IAttachment'
2022-07-20 22:42:36 +00:00
export default class AttachmentModel extends AbstractModel implements IAttachment {
declare id: number
declare taskId: number
createdBy: IUser
file: IFile
2022-06-23 01:22:21 +00:00
created: Date
2022-08-04 18:57:43 +00:00
constructor(data: Partial<IAttachment>) {
2019-11-24 13:16:24 +00:00
super(data)
this.createdBy = new UserModel(this.createdBy)
2019-11-24 13:16:24 +00:00
this.file = new FileModel(this.file)
this.created = new Date(this.created)
2019-11-24 13:16:24 +00:00
}
defaults() {
return {
id: 0,
taskId: 0,
createdBy: UserModel,
2022-06-23 01:22:21 +00:00
file: FileModel,
created: null,
2019-11-24 13:16:24 +00:00
}
}
}