import AbstractModel from './abstractModel' import UserModel from '@/models/user' import type {ISubscription} from '@/modelTypes/ISubscription' import type {IUser} from '@/modelTypes/IUser' export default class SubscriptionModel extends AbstractModel implements ISubscription { declare id: number declare entity: string // FIXME: correct type? declare entityId: number // FIXME: correct type? user: IUser created: Date constructor(data) { super(data) this.created = new Date(this.created) this.user = new UserModel(this.user) } defaults() { return { id: 0, entity: '', entityId: 0, created: null, user: {}, } } }