2022-08-04 20:57:43 +02:00
|
|
|
import AbstractModel from './abstractModel'
|
|
|
|
import UserModel from './user'
|
2019-09-09 19:55:43 +02:00
|
|
|
|
2022-08-04 20:57:43 +02:00
|
|
|
import {RIGHTS, type Right} from '@/constants/rights'
|
|
|
|
import type {ILinkShare} from '@/modelTypes/ILinkShare'
|
|
|
|
import type {IUser} from '@/modelTypes/IUser'
|
2022-07-21 00:42:36 +02:00
|
|
|
|
|
|
|
export default class LinkShareModel extends AbstractModel implements ILinkShare {
|
2022-08-14 12:15:45 +02:00
|
|
|
id = 0
|
|
|
|
hash = ''
|
|
|
|
right: Right = RIGHTS.READ
|
|
|
|
sharedBy: IUser = UserModel
|
|
|
|
sharingType = 0 // FIXME: use correct numbers
|
|
|
|
listId = 0
|
|
|
|
name: ''
|
|
|
|
password: ''
|
|
|
|
created: Date = null
|
|
|
|
updated: Date = null
|
2019-09-09 19:55:43 +02:00
|
|
|
|
2022-08-14 12:15:45 +02:00
|
|
|
constructor(data: Partial<ILinkShare>) {
|
|
|
|
super()
|
|
|
|
this.assignData(data)
|
2019-09-09 19:55:43 +02:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
this.sharedBy = new UserModel(this.sharedBy)
|
2020-02-08 14:16:06 +01:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
this.created = new Date(this.created)
|
|
|
|
this.updated = new Date(this.updated)
|
|
|
|
}
|
2019-09-09 19:55:43 +02:00
|
|
|
}
|