diff options
Diffstat (limited to 'src/lib/types')
-rw-r--r-- | src/lib/types/BaseModel.ts | 6 | ||||
-rw-r--r-- | src/lib/types/Models.ts | 102 |
2 files changed, 0 insertions, 108 deletions
diff --git a/src/lib/types/BaseModel.ts b/src/lib/types/BaseModel.ts deleted file mode 100644 index fdbd706..0000000 --- a/src/lib/types/BaseModel.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Model } from 'sequelize'; - -export abstract class BaseModel<A, B> extends Model<A, B> { - public readonly createdAt: Date; - public readonly updatedAt: Date; -} diff --git a/src/lib/types/Models.ts b/src/lib/types/Models.ts deleted file mode 100644 index 6ea890e..0000000 --- a/src/lib/types/Models.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { Optional } from 'sequelize'; -import { BaseModel } from './BaseModel'; - -export interface GuildModel { - id: string; - prefix: string; -} -export type GuildModelCreationAttributes = Optional<GuildModel, 'prefix'>; - -export class Guild - extends BaseModel<GuildModel, GuildModelCreationAttributes> - implements GuildModel { - id: string; - prefix: string; -} - -export interface BanModel { - id: string; - user: string; - guild: string; - reason: string; - expires: Date; - modlog: string; -} -export interface BanModelCreationAttributes { - id?: string; - user: string; - guild: string; - reason?: string; - expires?: Date; - modlog: string; -} - -export class Ban - extends BaseModel<BanModel, BanModelCreationAttributes> - implements BanModel { - /** - * The ID of this ban (no real use just for a primary key) - */ - id: string; - /** - * The user who is banned - */ - user: string; - /** - * The guild they are banned from - */ - guild: string; - /** - * The reason they are banned (optional) - */ - reason: string | null; - /** - * The date at which this ban expires and should be unbanned (optional) - */ - expires: Date | null; - /** - * The ref to the modlog entry - */ - modlog: string; -} - -export enum ModlogType { - BAN = 'BAN', - TEMPBAN = 'TEMPBAN', - KICK = 'KICK', - MUTE = 'MUTE', - TEMPMUTE = 'TEMPMUTE', - WARN = 'WARN' -} - -export interface ModlogModel { - id: string; - type: ModlogType; - user: string; - moderator: string; - reason: string; - duration: number; - guild: string; -} - -export interface ModlogModelCreationAttributes { - id?: string; - type: ModlogType; - user: string; - moderator: string; - reason?: string; - duration?: number; - guild: string; -} - -export class Modlog - extends BaseModel<ModlogModel, ModlogModelCreationAttributes> - implements ModlogModel { - id: string; - type: ModlogType; - user: string; - moderator: string; - guild: string; - reason: string | null; - duration: number | null; -} |