fix: use IAbstract to extend model interface

This commit is contained in:
Dominik Pschenitschni 2022-08-14 12:15:09 +02:00
parent d36577c04e
commit 8be1f81848
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
28 changed files with 56 additions and 56 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,10 +1,10 @@
import AbstractModel from './abstractModel'
import AbstractModel, { type IAbstract } from './abstractModel'
import UserModel, { type IUser } from './user'
import {colorIsDark} from '@/helpers/color/colorIsDark'
const DEFAULT_LABEL_BACKGROUND_COLOR = 'e8e8e8'
export interface ILabel extends AbstractModel {
export interface ILabel extends IAbstract {
id: number
title: string
hexColor: string

View file

@ -1,6 +1,6 @@
import AbstractModel from './abstractModel'
import AbstractModel, { type IAbstract } from './abstractModel'
export interface ILabelTask extends AbstractModel {
export interface ILabelTask extends IAbstract {
id: number
taskId: number
labelId: number

View file

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

View file

@ -1,4 +1,4 @@
import AbstractModel from '@/models/abstractModel'
import AbstractModel, { type IAbstract } 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 AbstractModel {
export interface IList extends IAbstract {
id: number
title: string
description: string

View file

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

View file

@ -1,9 +1,9 @@
import AbstractModel from './abstractModel'
import AbstractModel, { type IAbstract } 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 AbstractModel {
export interface INamespace extends IAbstract {
id: number
title: string
description: string

View file

@ -1,4 +1,4 @@
import AbstractModel from '@/models/abstractModel'
import AbstractModel, { type IAbstract } from '@/models/abstractModel'
import {parseDateOrNull} from '@/helpers/parseDateOrNull'
import UserModel, { type IUser } from '@/models/user'
import TaskModel, { type ITask } from '@/models/task'
@ -40,7 +40,7 @@ interface NotificationMemberAdded extends Notification {
team: ITeam
}
export interface INotification extends AbstractModel {
export interface INotification extends IAbstract {
id: number
name: string
notification: NotificationTask | NotificationAssigned | NotificationDeleted | NotificationCreated | NotificationMemberAdded

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
import type { Priority } from '@/constants/priorities'
import AbstractModel from '@/models/abstractModel'
import AbstractModel, { type IAbstract } from '@/models/abstractModel'
import UserModel, { type IUser } from '@/models/user'
import LabelModel, { type ILabel } from '@/models/label'
import AttachmentModel, {type IAttachment} from '@/models/attachment'
@ -22,7 +22,7 @@ export const TASK_REPEAT_MODES = {
export type TaskRepeatMode = typeof TASK_REPEAT_MODES[keyof typeof TASK_REPEAT_MODES]
export interface ITask extends AbstractModel {
export interface ITask extends IAbstract {
id: number
title: string
description: string

View file

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

View file

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

View file

@ -1,4 +1,4 @@
import AbstractModel from './abstractModel'
import AbstractModel, { type IAbstract } from './abstractModel'
import UserModel, { type IUser } from './user'
import type { ITask } from './task'
@ -19,7 +19,7 @@ export const RELATION_KINDS = [...Object.values(RELATION_KIND)] as const
export type RelationKind = typeof RELATION_KINDS[number]
export interface ITaskRelation extends AbstractModel {
export interface ITaskRelation extends IAbstract {
id: number
otherTaskId: ITask['id']
taskId: ITask['id']

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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