Introduce series management functionality and repository updates

- Added `series-world.repo.ts` to handle database operations related to series worlds and their elements.
- Implemented `series-sync.repo.ts` for managing synchronization between books and series.
- Expanded `spell.ipc.ts` data models to include `seriesSpellId` for spell synchronization.
- Refactored `insertSpellTag` method in `spelltag.repo.ts` for improved error handling and logic clarity.
This commit is contained in:
natreex
2026-01-26 19:57:56 -05:00
parent 2359638cb0
commit cec5830360
35 changed files with 5483 additions and 203 deletions

View File

@@ -12,6 +12,7 @@ interface AddLocationSectionData {
locationName: string;
bookId: string;
id?: string;
seriesLocationId?: string | null;
}
interface AddLocationElementData {
@@ -44,7 +45,7 @@ ipcMain.handle('db:location:all', createHandler<GetAllLocationsData, LocationLis
// POST /location/section/add - Add location section
ipcMain.handle('db:location:section:add', createHandler<AddLocationSectionData, string>(
function(userId: string, data: AddLocationSectionData, lang: 'fr' | 'en'): string {
return Location.addLocationSection(userId, data.locationName, data.bookId, lang, data.id);
return Location.addLocationSection(userId, data.locationName, data.bookId, lang, data.id, data.seriesLocationId || null);
}
)
);
@@ -73,6 +74,19 @@ ipcMain.handle('db:location:update', createHandler<UpdateLocationData, UpdateLoc
)
);
// POST /location/section/update - Update location section with series link
interface UpdateSectionWithSeriesLinkData {
sectionId: string;
sectionName?: string;
seriesLocationId?: string | null;
}
ipcMain.handle('db:location:section:update', createHandler<UpdateSectionWithSeriesLinkData, boolean>(
function(userId: string, data: UpdateSectionWithSeriesLinkData, lang: 'fr' | 'en'): boolean {
return Location.updateSectionWithSeriesLink(userId, data.sectionId, data.sectionName, data.seriesLocationId, lang);
}
)
);
// DELETE /location/delete - Delete location section
interface DeleteLocationData {
locationId: string;