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

35 lines
662 B
TypeScript
Raw Normal View History

import AbstractModel, { type IAbstract } from './abstractModel'
2022-08-13 13:26:57 +00:00
import {RIGHTS, type Right} from '@/constants/rights'
2022-07-20 22:42:36 +00:00
import type { IUser } from './user'
export interface IUserShareBase extends IAbstract {
2022-07-20 22:42:36 +00:00
userId: IUser['id']
2022-06-23 01:22:21 +00:00
right: Right
created: Date
updated: Date
2022-07-20 22:42:36 +00:00
}
export default class UserShareBaseModel extends AbstractModel implements IUserShareBase {
userId!: IUser['id']
right!: Right
2022-07-20 22:42:36 +00:00
created: Date
updated: Date
2022-06-23 01:22:21 +00:00
constructor(data) {
super(data)
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}
defaults() {
return {
userId: '',
2022-06-23 01:14:58 +00:00
right: RIGHTS.READ,
created: null,
updated: null,
}
}
}