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
Signed by: dpschen
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 UserModel, {type IUser} from './user'
import FileModel, {type IFile} from './file' import FileModel, {type IFile} from './file'
export interface IAttachment extends AbstractModel { export interface IAttachment extends IAbstract {
id: number id: number
taskId: number taskId: number
createdBy: IUser 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 type AvatarProvider = 'default' | 'initials' | 'gravatar' | 'marble' | 'upload'
export interface IAvatar extends AbstractModel { export interface IAvatar extends IAbstract {
avatarProvider: AvatarProvider 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 id: number
url: string url: string
thumb: 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 UserModel, { type IUser } from './user'
import TaskModel, { type ITask } from './task' import TaskModel, { type ITask } from './task'
export interface IBucket extends AbstractModel { export interface IBucket extends IAbstract {
id: number id: number
title: string title: string
listId: number 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; id: number;
created: Date; 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 newEmail: string
password: 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 id: number
mime: string mime: string
name: 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 UserModel, { type IUser } from './user'
import {colorIsDark} from '@/helpers/color/colorIsDark' import {colorIsDark} from '@/helpers/color/colorIsDark'
const DEFAULT_LABEL_BACKGROUND_COLOR = 'e8e8e8' const DEFAULT_LABEL_BACKGROUND_COLOR = 'e8e8e8'
export interface ILabel extends AbstractModel { export interface ILabel extends IAbstract {
id: number id: number
title: string title: string
hexColor: 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 id: number
taskId: number taskId: number
labelId: 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 UserModel, { type IUser } from './user'
import {RIGHTS, type Right} from '@/constants/rights' import {RIGHTS, type Right} from '@/constants/rights'
export interface ILinkShare extends AbstractModel { export interface ILinkShare extends IAbstract {
id: number id: number
hash: string hash: string
right: Right 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 TaskModel, { type ITask } from '@/models/task'
import UserModel, { type IUser } from '@/models/user' import UserModel, { type IUser } from '@/models/user'
import SubscriptionModel, { type ISubscription } from '@/models/subscription' import SubscriptionModel, { type ISubscription } from '@/models/subscription'
@ -6,7 +6,7 @@ import type { INamespace } from '@/models/namespace'
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter' import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
export interface IList extends AbstractModel { export interface IList extends IAbstract {
id: number id: number
title: string title: string
description: 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 ListModel, { type IList } from './list'
import type { INamespace } from './namespace' import type { INamespace } from './namespace'
export interface IListDuplicate extends AbstractModel { export interface IListDuplicate extends IAbstract {
listId: number listId: number
namespaceId: INamespace['id'] namespaceId: INamespace['id']
list: IList 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 ListModel, { type IList } from './list'
import UserModel, { type IUser } from './user' import UserModel, { type IUser } from './user'
import SubscriptionModel, { type ISubscription } from '@/models/subscription' import SubscriptionModel, { type ISubscription } from '@/models/subscription'
export interface INamespace extends AbstractModel { export interface INamespace extends IAbstract {
id: number id: number
title: string title: string
description: 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 {parseDateOrNull} from '@/helpers/parseDateOrNull'
import UserModel, { type IUser } from '@/models/user' import UserModel, { type IUser } from '@/models/user'
import TaskModel, { type ITask } from '@/models/task' import TaskModel, { type ITask } from '@/models/task'
@ -40,7 +40,7 @@ interface NotificationMemberAdded extends Notification {
team: ITeam team: ITeam
} }
export interface INotification extends AbstractModel { export interface INotification extends IAbstract {
id: number id: number
name: string name: string
notification: NotificationTask | NotificationAssigned | NotificationDeleted | NotificationCreated | NotificationMemberAdded 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 token: string
newPassword: string newPassword: string
email: 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 newPassword: string
oldPassword: 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' import UserModel, { type IUser } from '@/models/user'
export interface ISavedFilter extends AbstractModel { export interface ISavedFilter extends IAbstract {
id: 0 id: 0
title: string title: string
description: 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' import UserModel, { type IUser } from '@/models/user'
export interface ISubscription extends AbstractModel { export interface ISubscription extends IAbstract {
id: number id: number
entity: string // FIXME: correct type? entity: string // FIXME: correct type?
entityId: number // FIXME: correct type? entityId: number // FIXME: correct type?

View File

@ -1,6 +1,6 @@
import type { Priority } from '@/constants/priorities' 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 UserModel, { type IUser } from '@/models/user'
import LabelModel, { type ILabel } from '@/models/label' import LabelModel, { type ILabel } from '@/models/label'
import AttachmentModel, {type IAttachment} from '@/models/attachment' 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 type TaskRepeatMode = typeof TASK_REPEAT_MODES[keyof typeof TASK_REPEAT_MODES]
export interface ITask extends AbstractModel { export interface ITask extends IAbstract {
id: number id: number
title: string title: string
description: 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 { ITask } from './task'
import type { IUser } from './user' import type { IUser } from './user'
export interface ITaskAssignee extends AbstractModel { export interface ITaskAssignee extends IAbstract {
created: Date created: Date
userId: IUser['id'] userId: IUser['id']
taskId: ITask['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 UserModel, { type IUser } from './user'
import type { ITask } from './task' import type { ITask } from './task'
export interface ITaskComment extends AbstractModel { export interface ITaskComment extends IAbstract {
id: number id: number
taskId: ITask['id'] taskId: ITask['id']
comment: string 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 UserModel, { type IUser } from './user'
import type { ITask } from './task' 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 type RelationKind = typeof RELATION_KINDS[number]
export interface ITaskRelation extends AbstractModel { export interface ITaskRelation extends IAbstract {
id: number id: number
otherTaskId: ITask['id'] otherTaskId: ITask['id']
taskId: 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 UserModel, { type IUser } from './user'
import TeamMemberModel, { type ITeamMember } from './teamMember' import TeamMemberModel, { type ITeamMember } from './teamMember'
import {RIGHTS, type Right} from '@/constants/rights' import {RIGHTS, type Right} from '@/constants/rights'
export interface ITeam extends AbstractModel { export interface ITeam extends IAbstract {
id: number id: number
name: string name: string
description: 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 {RIGHTS, type Right} from '@/constants/rights'
import type { ITeam } from './team' import type { ITeam } from './team'
export interface ITeamShareBase extends AbstractModel { export interface ITeamShareBase extends IAbstract {
teamId: ITeam['id'] teamId: ITeam['id']
right: Right 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 secret: string
enabled: boolean enabled: boolean
url: string 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' import UserSettingsModel, { type IUserSettings } from '@/models/userSettings'
export interface IUser extends AbstractModel { export interface IUser extends IAbstract {
id: number id: number
email: string email: string
username: string username: string

View File

@ -1,8 +1,8 @@
import AbstractModel from './abstractModel' import AbstractModel, { type IAbstract } from './abstractModel'
import type { IList } from './list' import type { IList } from './list'
export interface IUserSettings extends AbstractModel { export interface IUserSettings extends IAbstract {
name: string name: string
emailRemindersEnabled: boolean emailRemindersEnabled: boolean
discoverableByName: 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 {RIGHTS, type Right} from '@/constants/rights'
import type { IUser } from './user' import type { IUser } from './user'
export interface IUserShareBase extends AbstractModel { export interface IUserShareBase extends IAbstract {
userId: IUser['id'] userId: IUser['id']
right: Right right: Right