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

29 lines
674 B
TypeScript
Raw Normal View History

import AbstractModel, { type IAbstract } from './abstractModel'
2022-07-20 22:42:36 +00:00
import UserModel, {type IUser} from './user'
import FileModel, {type IFile} from './file'
2019-11-24 13:16:24 +00:00
export interface IAttachment extends IAbstract {
2022-06-23 01:22:21 +00:00
id: number
taskId: number
2022-07-20 22:42:36 +00:00
createdBy: IUser
file: IFile
created: Date
}
export default class AttachmentModel extends AbstractModel implements IAttachment {
id = 0
taskId = 0
createdBy: IUser = UserModel
file: IFile = FileModel
created: Date = null
constructor(data: Partial<IAttachment>) {
super()
this.assignData(data)
2022-06-23 01:22:21 +00:00
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
}
}