From 8be1f81848303d590adb890743dd688fbf5cdf1c Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sun, 14 Aug 2022 12:15:09 +0200 Subject: [PATCH] fix: use IAbstract to extend model interface --- src/models/attachment.ts | 4 ++-- src/models/avatar.ts | 4 ++-- src/models/backgroundImage.ts | 4 ++-- src/models/bucket.ts | 4 ++-- src/models/caldavToken.ts | 4 ++-- src/models/emailUpdate.ts | 4 ++-- src/models/file.ts | 4 ++-- src/models/label.ts | 4 ++-- src/models/labelTask.ts | 4 ++-- src/models/linkShare.ts | 4 ++-- src/models/list.ts | 4 ++-- src/models/listDuplicateModel.ts | 4 ++-- src/models/namespace.ts | 4 ++-- src/models/notification.ts | 4 ++-- src/models/passwordReset.ts | 4 ++-- src/models/passwordUpdate.ts | 4 ++-- src/models/savedFilter.ts | 4 ++-- src/models/subscription.ts | 4 ++-- src/models/task.ts | 4 ++-- src/models/taskAssignee.ts | 4 ++-- src/models/taskComment.ts | 4 ++-- src/models/taskRelation.ts | 4 ++-- src/models/team.ts | 4 ++-- src/models/teamShareBase.ts | 4 ++-- src/models/totp.ts | 4 ++-- src/models/user.ts | 4 ++-- src/models/userSettings.ts | 4 ++-- src/models/userShareBase.ts | 4 ++-- 28 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/models/attachment.ts b/src/models/attachment.ts index 10f935f14..8c48a17d2 100644 --- a/src/models/attachment.ts +++ b/src/models/attachment.ts @@ -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 diff --git a/src/models/avatar.ts b/src/models/avatar.ts index f87c60db2..43d491518 100644 --- a/src/models/avatar.ts +++ b/src/models/avatar.ts @@ -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 } diff --git a/src/models/backgroundImage.ts b/src/models/backgroundImage.ts index 71f732468..f56e750cf 100644 --- a/src/models/backgroundImage.ts +++ b/src/models/backgroundImage.ts @@ -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 diff --git a/src/models/bucket.ts b/src/models/bucket.ts index 46afd96af..1d89c86fa 100644 --- a/src/models/bucket.ts +++ b/src/models/bucket.ts @@ -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 diff --git a/src/models/caldavToken.ts b/src/models/caldavToken.ts index 2518e123d..a2e53c985 100644 --- a/src/models/caldavToken.ts +++ b/src/models/caldavToken.ts @@ -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; } diff --git a/src/models/emailUpdate.ts b/src/models/emailUpdate.ts index d01dd959a..aef40a12f 100644 --- a/src/models/emailUpdate.ts +++ b/src/models/emailUpdate.ts @@ -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 } diff --git a/src/models/file.ts b/src/models/file.ts index 74b66ce71..0a768743c 100644 --- a/src/models/file.ts +++ b/src/models/file.ts @@ -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 diff --git a/src/models/label.ts b/src/models/label.ts index 5c5be2481..48642e391 100644 --- a/src/models/label.ts +++ b/src/models/label.ts @@ -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 diff --git a/src/models/labelTask.ts b/src/models/labelTask.ts index 5550e5cd0..46a5b1371 100644 --- a/src/models/labelTask.ts +++ b/src/models/labelTask.ts @@ -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 diff --git a/src/models/linkShare.ts b/src/models/linkShare.ts index 67f1dd2a6..08f67a3e9 100644 --- a/src/models/linkShare.ts +++ b/src/models/linkShare.ts @@ -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 diff --git a/src/models/list.ts b/src/models/list.ts index c4b28273f..496737a13 100644 --- a/src/models/list.ts +++ b/src/models/list.ts @@ -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 diff --git a/src/models/listDuplicateModel.ts b/src/models/listDuplicateModel.ts index 8dd0db9fb..d3b199d49 100644 --- a/src/models/listDuplicateModel.ts +++ b/src/models/listDuplicateModel.ts @@ -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 diff --git a/src/models/namespace.ts b/src/models/namespace.ts index 00f42a85b..802e85171 100644 --- a/src/models/namespace.ts +++ b/src/models/namespace.ts @@ -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 diff --git a/src/models/notification.ts b/src/models/notification.ts index 21a392dae..94b65bc98 100644 --- a/src/models/notification.ts +++ b/src/models/notification.ts @@ -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 diff --git a/src/models/passwordReset.ts b/src/models/passwordReset.ts index 3d5099aae..696fae260 100644 --- a/src/models/passwordReset.ts +++ b/src/models/passwordReset.ts @@ -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 diff --git a/src/models/passwordUpdate.ts b/src/models/passwordUpdate.ts index d78e7801c..f4f04553c 100644 --- a/src/models/passwordUpdate.ts +++ b/src/models/passwordUpdate.ts @@ -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 } diff --git a/src/models/savedFilter.ts b/src/models/savedFilter.ts index 6bb7be4a2..7c6ac36bd 100644 --- a/src/models/savedFilter.ts +++ b/src/models/savedFilter.ts @@ -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 diff --git a/src/models/subscription.ts b/src/models/subscription.ts index d17a692fd..459c78d30 100644 --- a/src/models/subscription.ts +++ b/src/models/subscription.ts @@ -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? diff --git a/src/models/task.ts b/src/models/task.ts index e54d80eb3..8d450cc49 100644 --- a/src/models/task.ts +++ b/src/models/task.ts @@ -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 diff --git a/src/models/taskAssignee.ts b/src/models/taskAssignee.ts index 84c9ba220..93b9434f8 100644 --- a/src/models/taskAssignee.ts +++ b/src/models/taskAssignee.ts @@ -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'] diff --git a/src/models/taskComment.ts b/src/models/taskComment.ts index 5c4a0f9b0..d774d7a0b 100644 --- a/src/models/taskComment.ts +++ b/src/models/taskComment.ts @@ -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 diff --git a/src/models/taskRelation.ts b/src/models/taskRelation.ts index b576bb55f..931c5f155 100644 --- a/src/models/taskRelation.ts +++ b/src/models/taskRelation.ts @@ -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'] diff --git a/src/models/team.ts b/src/models/team.ts index fa9c536ea..c24c1352d 100644 --- a/src/models/team.ts +++ b/src/models/team.ts @@ -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 diff --git a/src/models/teamShareBase.ts b/src/models/teamShareBase.ts index 5d24ae8dd..7ce563648 100644 --- a/src/models/teamShareBase.ts +++ b/src/models/teamShareBase.ts @@ -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 diff --git a/src/models/totp.ts b/src/models/totp.ts index 619af601a..7d33ebd34 100644 --- a/src/models/totp.ts +++ b/src/models/totp.ts @@ -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 diff --git a/src/models/user.ts b/src/models/user.ts index 181910cc1..642acff8f 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -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 diff --git a/src/models/userSettings.ts b/src/models/userSettings.ts index e7e7acadc..c5bc638a4 100644 --- a/src/models/userSettings.ts +++ b/src/models/userSettings.ts @@ -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 diff --git a/src/models/userShareBase.ts b/src/models/userShareBase.ts index 703ce6309..274700007 100644 --- a/src/models/userShareBase.ts +++ b/src/models/userShareBase.ts @@ -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