generated from nhcarrigan/template
feat: add suggestion feature
This commit is contained in:
@@ -8,7 +8,7 @@ export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
username: string;
|
||||
avatarUrl?: string;
|
||||
avatar?: string;
|
||||
discordId: string;
|
||||
isAdmin: boolean;
|
||||
isBanned: boolean;
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
import type { CreateGameDto } from "./game.types";
|
||||
import type { CreateBookDto } from "./book.types";
|
||||
import type { CreateMusicDto } from "./music.types";
|
||||
import type { CreateArtDto } from "./art.types";
|
||||
import type { CreateShowDto } from "./show.types";
|
||||
import type { CreateMangaDto } from "./manga.types";
|
||||
|
||||
export enum SuggestionEntity {
|
||||
GAME = "GAME",
|
||||
BOOK = "BOOK",
|
||||
MUSIC = "MUSIC",
|
||||
ART = "ART",
|
||||
SHOW = "SHOW",
|
||||
MANGA = "MANGA",
|
||||
}
|
||||
|
||||
export enum SuggestionStatus {
|
||||
UNREVIEWED = "UNREVIEWED",
|
||||
ACCEPTED = "ACCEPTED",
|
||||
DECLINED = "DECLINED",
|
||||
}
|
||||
|
||||
export interface SuggestionUser {
|
||||
id: string;
|
||||
username: string;
|
||||
avatar?: string;
|
||||
inDiscord: boolean;
|
||||
isVip: boolean;
|
||||
isMod: boolean;
|
||||
isStaff: boolean;
|
||||
}
|
||||
|
||||
export interface Suggestion {
|
||||
id: string;
|
||||
userId: string;
|
||||
user: SuggestionUser;
|
||||
entityType: SuggestionEntity;
|
||||
status: SuggestionStatus;
|
||||
declineReason?: string;
|
||||
title: string;
|
||||
gameData?: Omit<CreateGameDto, "rating">;
|
||||
bookData?: Omit<CreateBookDto, "rating">;
|
||||
musicData?: Omit<CreateMusicDto, "rating">;
|
||||
artData?: CreateArtDto;
|
||||
showData?: Omit<CreateShowDto, "rating">;
|
||||
mangaData?: Omit<CreateMangaDto, "rating">;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface CreateGameSuggestionDto {
|
||||
entityType: SuggestionEntity.GAME;
|
||||
title: string;
|
||||
platform?: string;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
}
|
||||
|
||||
export interface CreateBookSuggestionDto {
|
||||
entityType: SuggestionEntity.BOOK;
|
||||
title: string;
|
||||
author: string;
|
||||
isbn?: string;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
}
|
||||
|
||||
export interface CreateMusicSuggestionDto {
|
||||
entityType: SuggestionEntity.MUSIC;
|
||||
title: string;
|
||||
artist: string;
|
||||
type: string;
|
||||
notes?: string;
|
||||
coverArt?: string;
|
||||
}
|
||||
|
||||
export interface CreateArtSuggestionDto {
|
||||
entityType: SuggestionEntity.ART;
|
||||
title: string;
|
||||
artist: string;
|
||||
description?: string;
|
||||
imageUrl: string;
|
||||
}
|
||||
|
||||
export interface CreateShowSuggestionDto {
|
||||
entityType: SuggestionEntity.SHOW;
|
||||
title: string;
|
||||
type: string;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
}
|
||||
|
||||
export interface CreateMangaSuggestionDto {
|
||||
entityType: SuggestionEntity.MANGA;
|
||||
title: string;
|
||||
author: string;
|
||||
notes?: string;
|
||||
coverImage?: string;
|
||||
}
|
||||
|
||||
export type CreateSuggestionDto =
|
||||
| CreateGameSuggestionDto
|
||||
| CreateBookSuggestionDto
|
||||
| CreateMusicSuggestionDto
|
||||
| CreateArtSuggestionDto
|
||||
| CreateShowSuggestionDto
|
||||
| CreateMangaSuggestionDto;
|
||||
|
||||
export interface DeclineSuggestionDto {
|
||||
reason?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user