- Delete `Story` model implementation including `getVerbesStyle` method and related properties. - Cleanup unused interfaces and redundant logic from the codebase.
137 lines
3.2 KiB
TypeScript
137 lines
3.2 KiB
TypeScript
import {Author} from './User';
|
|
import {ActChapter, ChapterProps} from "@/lib/models/Chapter";
|
|
import {SelectBoxProps} from "@/shared/interface";
|
|
|
|
export interface BookProps {
|
|
bookId: string;
|
|
type: string;
|
|
title: string;
|
|
author?: Author;
|
|
serie?: number;
|
|
subTitle?: string;
|
|
summary?: string;
|
|
publicationDate?: string;
|
|
desiredWordCount?: number;
|
|
totalWordCount?: number;
|
|
coverImage?: string;
|
|
chapters?: ChapterProps[];
|
|
}
|
|
|
|
export interface BookListProps {
|
|
id: string;
|
|
type: string;
|
|
authorId: string;
|
|
title: string;
|
|
subTitle?: string;
|
|
summary?: string;
|
|
serieId?: number;
|
|
desiredReleaseDate?: string;
|
|
desiredWordCount?: number;
|
|
wordCount?: number;
|
|
coverImage?: string;
|
|
bookMeta?: string;
|
|
}
|
|
|
|
export interface GuideLine {
|
|
tone: string;
|
|
atmosphere: string;
|
|
writingStyle: string;
|
|
themes: string;
|
|
symbolism: string;
|
|
motifs: string;
|
|
narrativeVoice: string;
|
|
pacing: string;
|
|
intendedAudience: string;
|
|
keyMessages: string;
|
|
}
|
|
|
|
export interface GuideLineAI {
|
|
narrativeType: number|null;
|
|
dialogueType: number|null;
|
|
globalResume: string|null;
|
|
atmosphere: string|null;
|
|
verbeTense: number|null;
|
|
langue: number|null;
|
|
currentResume: string|null;
|
|
themes: string|null;
|
|
}
|
|
|
|
export interface PlotPoint {
|
|
plotPointId: string;
|
|
title: string;
|
|
summary: string;
|
|
linkedIncidentId: string;
|
|
chapters?: ActChapter[];
|
|
}
|
|
|
|
export interface Incident {
|
|
incidentId: string;
|
|
title: string;
|
|
summary: string;
|
|
chapters?: ActChapter[];
|
|
}
|
|
|
|
export interface Issue {
|
|
name: string;
|
|
id: string;
|
|
}
|
|
|
|
export interface Act {
|
|
id: number;
|
|
summary: string | null;
|
|
incidents?: Incident[];
|
|
plotPoints?: PlotPoint[];
|
|
chapters?: ActChapter[];
|
|
}
|
|
|
|
export interface Tag {
|
|
label: string,
|
|
value: string,
|
|
}
|
|
|
|
export interface BookTags {
|
|
characters: Tag[];
|
|
locations: Tag[];
|
|
objects: Tag[];
|
|
worldElements: Tag[];
|
|
}
|
|
|
|
export const bookTypes: SelectBoxProps[] = [
|
|
{label: 'bookTypes.short', value: 'short'},
|
|
{label: 'bookTypes.novelette', value: 'novelette'},
|
|
{label: 'bookTypes.novella', value: 'long'},
|
|
{label: 'bookTypes.chapbook', value: 'chapbook'},
|
|
{label: 'bookTypes.novel', value: 'novel'},
|
|
]
|
|
|
|
export default class Book {
|
|
constructor() {
|
|
}
|
|
|
|
static booksToSelectBox(books: BookProps[]): SelectBoxProps[] {
|
|
return books.map((book: BookProps) => {
|
|
return {
|
|
label: book.title,
|
|
value: book.bookId,
|
|
}
|
|
});
|
|
}
|
|
|
|
static getBookTypeLabel(value: string): string {
|
|
switch (value) {
|
|
case 'short':
|
|
return 'bookTypes.short';
|
|
case 'novelette':
|
|
return 'bookTypes.novelette';
|
|
case 'long':
|
|
return 'bookTypes.novella';
|
|
case 'chapbook':
|
|
return 'bookTypes.chapbook';
|
|
case 'novel':
|
|
return 'bookTypes.novel';
|
|
default:
|
|
return 'bookTypes.novel';
|
|
}
|
|
}
|
|
}
|