Remove CharacterComponent and CharacterDetail components

- Deleted `CharacterComponent` and `CharacterDetail` files from the project.
- Refactored related logic to improve code maintainability and reduce redundancy.
This commit is contained in:
natreex
2026-02-05 14:12:08 -05:00
parent cec5830360
commit 209dc6f85a
133 changed files with 17673 additions and 3110 deletions

View File

@@ -0,0 +1,41 @@
import System from '../System.js';
import RemovedItemsRepository from '../repositories/removed-items.repository.js';
/**
* Model class for tracking deleted items for sync purposes.
* Provides the main entry point for recording deletions.
*/
export default class RemovedItem {
/**
* Records a deleted item for sync tracking.
* Must be called BEFORE the actual deletion from the source table.
*
* @param userId - The unique identifier of the user.
* @param bookId - The book ID (null for series items).
* @param tableName - The name of the table from which the item is deleted.
* @param entityId - The UUID of the deleted entity.
* @param deletedAt - The timestamp of deletion (from UI via System.timeStampInSeconds()).
* @param lang - The language for error messages ('fr' or 'en'). Defaults to 'fr'.
* @returns True if the record was inserted successfully.
*/
public static deleteTracker(
userId: string,
bookId: string | null,
tableName: string,
entityId: string,
deletedAt: number,
lang: 'fr' | 'en' = 'fr'
): boolean {
const removalId: string = System.createUniqueId();
return RemovedItemsRepository.insert(
removalId,
tableName,
entityId,
bookId,
userId,
deletedAt,
lang
);
}
}