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

38 lines
726 B
TypeScript

import AbstractModel from '@/models/abstractModel'
import UserModel, { type IUser } from '@/models/user'
export interface ISubscription {
id: number
entity: string // FIXME: correct type?
entityId: number // FIXME: correct type?
user: IUser
created: Date
}
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: {},
}
}
}