vikunja-frontend/src/models/teamShareBase.ts
Dominik Pschenitschni 7d4ba6249e
feat: add modelTypes
2022-09-05 17:57:21 +02:00

25 lines
No EOL
712 B
TypeScript

import AbstractModel from './abstractModel'
import {RIGHTS, type Right} from '@/constants/rights'
import type {ITeamShareBase} from '@/modelTypes/ITeamShareBase'
import type {ITeam} from '@/modelTypes/ITeam'
/**
* This class is a base class for common team sharing model.
* It is extended in a way so it can be used for namespaces as well for lists.
*/
export default class TeamShareBaseModel extends AbstractModel implements ITeamShareBase {
teamId: ITeam['id'] = 0
right: Right = RIGHTS.READ
created: Date = null
updated: Date = null
constructor(data: Partial<ITeamShareBase>) {
super()
this.assignData(data)
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}
}