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.
This commit is contained in:
natreex
2025-11-17 21:32:42 -05:00
parent baa45ac106
commit 3bc30d42ad
12 changed files with 259 additions and 1761 deletions

View File

@@ -54,11 +54,11 @@ export default class LocationRepo {
return result;
}
static insertLocation(userId: string, locationId: string, bookId: string, encryptedName: string, originalName: string, meta: string, lang: 'fr' | 'en' = 'fr'): string {
static insertLocation(userId: string, locationId: string, bookId: string, encryptedName: string, originalName: string, lang: 'fr' | 'en' = 'fr'): string {
let result: RunResult;
try {
const db: Database = System.getDb();
result = db.run('INSERT INTO book_location (loc_id, book_id, user_id, loc_name, loc_original_name, loc_meta) VALUES (?, ?, ?, ?, ?, ?)', [locationId, bookId, userId, encryptedName, originalName, meta]);
result = db.run('INSERT INTO book_location (loc_id, book_id, user_id, loc_name, loc_original_name) VALUES (?, ?, ?, ?, ?)', [locationId, bookId, userId, encryptedName, originalName]);
} catch (e: unknown) {
if (e instanceof Error) {
console.error(`DB Error: ${e.message}`);
@@ -75,11 +75,11 @@ export default class LocationRepo {
}
}
static insertLocationElement(userId: string, elementId: string, locationId: string, encryptedName: string, originalName: string, meta: string, lang: 'fr' | 'en' = 'fr'): string {
static insertLocationElement(userId: string, elementId: string, locationId: string, encryptedName: string, originalName: string, lang: 'fr' | 'en' = 'fr'): string {
let result: RunResult;
try {
const db: Database = System.getDb();
result = db.run('INSERT INTO location_element (element_id, location, user_id, element_name, original_name, element_description, element_meta) VALUES (?,?,?,?,?,?,?)', [elementId, locationId, userId, encryptedName, originalName, '', meta]);
result = db.run('INSERT INTO location_element (element_id, location, user_id, element_name, original_name, element_description) VALUES (?,?,?,?,?,?)', [elementId, locationId, userId, encryptedName, originalName, '']);
} catch (e: unknown) {
if (e instanceof Error) {
console.error(`DB Error: ${e.message}`);
@@ -96,11 +96,11 @@ export default class LocationRepo {
}
}
static insertLocationSubElement(userId: string, subElementId: string, elementId: string, encryptedName: string, originalName: string, meta: string, lang: 'fr' | 'en' = 'fr'): string {
static insertLocationSubElement(userId: string, subElementId: string, elementId: string, encryptedName: string, originalName: string, lang: 'fr' | 'en' = 'fr'): string {
let result: RunResult;
try {
const db: Database = System.getDb();
result = db.run('INSERT INTO location_sub_element (sub_element_id, element_id, user_id, sub_elem_name, original_name, sub_elem_description, sub_elem_meta) VALUES (?,?,?,?,?,?,?)', [subElementId, elementId, userId, encryptedName, originalName, '', meta]);
result = db.run('INSERT INTO location_sub_element (sub_element_id, element_id, user_id, sub_elem_name, original_name, sub_elem_description) VALUES (?,?,?,?,?,?)', [subElementId, elementId, userId, encryptedName, originalName, '']);
} catch (e: unknown) {
if (e instanceof Error) {
console.error(`DB Error: ${e.message}`);
@@ -117,10 +117,10 @@ export default class LocationRepo {
}
}
static updateLocationSubElement(userId: string, id: string, encryptedName: string, originalName: string, encryptDescription: string, meta: string, lang: 'fr' | 'en' = 'fr'): boolean {
static updateLocationSubElement(userId: string, id: string, encryptedName: string, originalName: string, encryptDescription: string, lang: 'fr' | 'en' = 'fr'): boolean {
try {
const db: Database = System.getDb();
const result: RunResult = db.run('UPDATE location_sub_element SET sub_elem_name=?, original_name=?, sub_elem_description=?, sub_elem_meta=? WHERE sub_element_id=? AND user_id=?', [encryptedName, originalName, encryptDescription, meta, id, userId]);
const result: RunResult = db.run('UPDATE location_sub_element SET sub_elem_name=?, original_name=?, sub_elem_description=? WHERE sub_element_id=? AND user_id=?', [encryptedName, originalName, encryptDescription, id, userId]);
return result.changes > 0;
} catch (e: unknown) {
if (e instanceof Error) {
@@ -133,10 +133,10 @@ export default class LocationRepo {
}
}
static updateLocationElement(userId: string, id: string, encryptedName: string, originalName: string, encryptedDescription: string, meta: string, lang: 'fr' | 'en' = 'fr'): boolean {
static updateLocationElement(userId: string, id: string, encryptedName: string, originalName: string, encryptedDescription: string, lang: 'fr' | 'en' = 'fr'): boolean {
try {
const db: Database = System.getDb();
const result: RunResult = db.run('UPDATE location_element SET element_name=?, original_name=?, element_description=?, element_meta=? WHERE element_id=? AND user_id=?', [encryptedName, originalName, encryptedDescription, meta, id, userId]);
const result: RunResult = db.run('UPDATE location_element SET element_name=?, original_name=?, element_description=? WHERE element_id=? AND user_id=?', [encryptedName, originalName, encryptedDescription, id, userId]);
return result.changes > 0;
} catch (e: unknown) {
if (e instanceof Error) {
@@ -149,10 +149,10 @@ export default class LocationRepo {
}
}
static updateLocationSection(userId: string, id: string, encryptedName: string, originalName: string, meta: string, lang: 'fr' | 'en' = 'fr'): boolean {
static updateLocationSection(userId: string, id: string, encryptedName: string, originalName: string, lang: 'fr' | 'en' = 'fr'): boolean {
try {
const db: Database = System.getDb();
const result: RunResult = db.run('UPDATE book_location SET loc_name=?, loc_original_name=?, loc_meta=? WHERE loc_id=? AND user_id=?', [encryptedName, originalName, meta, id, userId]);
const result: RunResult = db.run('UPDATE book_location SET loc_name=?, loc_original_name=? WHERE loc_id=? AND user_id=?', [encryptedName, originalName, id, userId]);
return result.changes > 0;
} catch (e: unknown) {
if (e instanceof Error) {