Files
ERitors-Scribe-Desktop/lib/models/Book.ts
natreex 3bc30d42ad Remove Story model handling verbal styles and linguistic properties
- Delete `Story` model implementation including `getVerbesStyle` method and related properties.
- Cleanup unused interfaces and redundant logic from the codebase.
2025-11-17 21:32:42 -05:00

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';
}
}
}