feat: extend mode interface from class instead from interface

This commit is contained in:
Dominik Pschenitschni 2022-07-21 18:35:37 +02:00
parent 80eaf38090
commit a6b96f857d
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
33 changed files with 40 additions and 41 deletions

View file

@ -1,9 +1,8 @@
import AbstractModel from './abstractModel'
import UserModel, {type IUser} from './user'
import FileModel, {type IFile} from './file'
import type {IAbstract} from './abstractModel'
export interface IAttachment extends IAbstract {
export interface IAttachment extends AbstractModel {
id: number
taskId: number
createdBy: IUser

View file

@ -1,8 +1,8 @@
import AbstractModel, { type IAbstract } from './abstractModel'
import AbstractModel from './abstractModel'
export type AvatarProvider = 'default' | 'initials' | 'gravatar' | 'marble' | 'upload'
export interface IAvatar extends IAbstract {
export interface IAvatar extends AbstractModel {
avatarProvider: AvatarProvider
}

View file

@ -1,6 +1,6 @@
import AbstractModel, { type IAbstract } from './abstractModel'
import AbstractModel from './abstractModel'
export interface IBackgroundImage extends IAbstract {
export interface IBackgroundImage extends AbstractModel {
id: number
url: string
thumb: string

View file

@ -1,8 +1,8 @@
import AbstractModel, { type IAbstract } from './abstractModel'
import AbstractModel from './abstractModel'
import UserModel, { type IUser } from './user'
import TaskModel, { type ITask } from './task'
export interface IBucket extends IAbstract {
export interface IBucket extends AbstractModel {
id: number
title: string
listId: number

View file

@ -1,6 +1,6 @@
import AbstractModel, { type IAbstract } from './abstractModel'
import AbstractModel from './abstractModel'
export interface ICaldavToken extends IAbstract {
export interface ICaldavToken extends AbstractModel {
id: number;
created: Date;
}

View file

@ -1,6 +1,6 @@
import AbstractModel from './abstractModel'
interface IEmailUpdate {
interface IEmailUpdate extends AbstractModel {
newEmail: string
password: string
}

View file

@ -1,6 +1,6 @@
import AbstractModel from './abstractModel'
export interface IFile {
export interface IFile extends AbstractModel {
id: number
mime: string
name: string

View file

@ -4,7 +4,7 @@ import {colorIsDark} from '@/helpers/color/colorIsDark'
const DEFAULT_LABEL_BACKGROUND_COLOR = 'e8e8e8'
export interface ILabel {
export interface ILabel extends AbstractModel {
id: number
title: string
hexColor: string

View file

@ -1,6 +1,6 @@
import AbstractModel from './abstractModel'
interface ILabel {
interface ILabel extends AbstractModel {
id: number
taskId: number
labelId: number

View file

@ -1,8 +1,8 @@
import AbstractModel, { type IAbstract } from './abstractModel'
import AbstractModel from './abstractModel'
import UserModel, { type IUser } from './user'
import {RIGHTS, type Right} from '@/models/constants/rights'
export interface ILinkShare extends IAbstract {
export interface ILinkShare extends AbstractModel {
id: number
hash: string
right: Right

View file

@ -1,4 +1,4 @@
import AbstractModel, { type IAbstract } from '@/models/abstractModel'
import AbstractModel from '@/models/abstractModel'
import TaskModel, { type ITask } from '@/models/task'
import UserModel, { type IUser } from '@/models/user'
import SubscriptionModel, { type ISubscription } from '@/models/subscription'
@ -6,7 +6,7 @@ import type { INamespace } from '@/models/namespace'
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
export interface IList extends IAbstract {
export interface IList extends AbstractModel {
id: number
title: string
description: string

View file

@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
import ListModel, { type IList } from './list'
import type { INamespace } from './namespace'
export interface ListDuplicate {
export interface ListDuplicate extends AbstractModel {
listId: number
namespaceId: INamespace['id']
list: IList

View file

@ -1,9 +1,9 @@
import AbstractModel, { type IAbstract } from './abstractModel'
import AbstractModel from './abstractModel'
import ListModel, { type IList } from './list'
import UserModel, { type IUser } from './user'
import SubscriptionModel, { type ISubscription } from '@/models/subscription'
export interface INamespace extends IAbstract {
export interface INamespace extends AbstractModel {
id: number
title: string
description: string

View file

@ -40,7 +40,7 @@ interface NotificationMemberAdded extends Notification {
team: ITeam
}
export interface INotification {
export interface INotification extends AbstractModel {
id: number
name: string
notification: NotificationTask | NotificationAssigned | NotificationDeleted | NotificationCreated | NotificationMemberAdded

View file

@ -1,6 +1,6 @@
import AbstractModel from './abstractModel'
export interface IPasswordReset {
export interface IPasswordReset extends AbstractModel {
token: string
newPassword: string
email: string

View file

@ -1,6 +1,6 @@
import AbstractModel from '@/models/abstractModel'
export interface IPasswordUpdate {
export interface IPasswordUpdate extends AbstractModel {
newPassword: string
oldPassword: string
}

View file

@ -1,7 +1,7 @@
import AbstractModel from '@/models/abstractModel'
import UserModel, { type IUser } from '@/models/user'
export interface ISavedFilter {
export interface ISavedFilter extends AbstractModel {
id: 0
title: string
description: string

View file

@ -1,7 +1,7 @@
import AbstractModel from '@/models/abstractModel'
import UserModel, { type IUser } from '@/models/user'
export interface ISubscription {
export interface ISubscription extends AbstractModel {
id: number
entity: string // FIXME: correct type?
entityId: number // FIXME: correct type?

View file

@ -26,7 +26,7 @@ export interface RepeatAfter {
amount: number
}
export interface ITask {
export interface ITask extends AbstractModel {
id: number
title: string
description: string

View file

@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
import type { ITask } from './task'
import type { IUser } from './user'
export interface ITaskAssignee {
export interface ITaskAssignee extends AbstractModel {
created: Date
userId: IUser['id']
taskId: ITask['id']

View file

@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
import UserModel, { type IUser } from './user'
import type { ITask } from './task'
export interface ITaskComment {
export interface ITaskComment extends AbstractModel {
id: number
taskId: ITask['id']
comment: string

View file

@ -19,7 +19,7 @@ export const RELATION_KINDS = [...Object.values(RELATION_KIND)] as const
export type RelationKind = typeof RELATION_KINDS[number]
export interface ITaskRelationModel {
export interface ITaskRelationModel extends AbstractModel {
id: number
otherTaskId: ITask['id']
taskId: ITask['id']

View file

@ -3,7 +3,7 @@ import UserModel, { type IUser } from './user'
import TeamMemberModel, { type ITeamMember } from './teamMember'
import {RIGHTS, type Right} from '@/models/constants/rights'
export interface ITeam {
export interface ITeam extends AbstractModel {
id: number
name: string
description: string

View file

@ -1,7 +1,7 @@
import TeamShareBaseModel from './teamShareBase'
import type { IList } from './list'
export interface ITeamList {
export interface ITeamList extends TeamShareBaseModel {
listId: IList['id']
}

View file

@ -1,7 +1,7 @@
import UserModel from './user'
import type { IList } from './list'
export interface ITeamMember {
export interface ITeamMember extends UserModel {
admin: boolean
teamId: IList['id']
}

View file

@ -1,7 +1,7 @@
import TeamShareBaseModel from './teamShareBase'
import type { INamespace } from './namespace'
export interface ITeamNamespace {
export interface ITeamNamespace extends TeamShareBaseModel {
namespaceId: INamespace['id']
}

View file

@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
import {RIGHTS, type Right} from '@/models/constants/rights'
import type { ITeam } from './team'
export interface ITeamShareBase {
export interface ITeamShareBase extends AbstractModel {
teamId: ITeam['id']
right: Right

View file

@ -1,6 +1,6 @@
import AbstractModel from './abstractModel'
export interface ITotp {
export interface ITotp extends AbstractModel {
secret: string
enabled: boolean
url: string

View file

@ -1,7 +1,7 @@
import AbstractModel from './abstractModel'
import UserSettingsModel, { type IUserSettings } from '@/models/userSettings'
export interface IUser {
export interface IUser extends AbstractModel {
id: number
email: string
username: string

View file

@ -1,7 +1,7 @@
import UserShareBaseModel from './userShareBase'
import type { IList } from './list'
export interface IUserList {
export interface IUserList extends UserShareBaseModel {
listId: IList['id']
}

View file

@ -1,7 +1,7 @@
import UserShareBaseModel from './userShareBase'
import type { INamespace } from './namespace'
export interface IUserNamespace {
export interface IUserNamespace extends UserShareBaseModel {
namespaceId: INamespace['id']
}

View file

@ -2,7 +2,7 @@
import AbstractModel from './abstractModel'
import type { IList } from './list'
export interface IUserSettings {
export interface IUserSettings extends AbstractModel {
name: string
emailRemindersEnabled: boolean
discoverableByName: boolean

View file

@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
import {RIGHTS, type Right} from '@/models/constants/rights'
import type { IUser } from './user'
export interface IUserShareBase {
export interface IUserShareBase extends AbstractModel {
userId: IUser['id']
right: Right