Add reported-issues, Goodreads sync & notifs

Introduce user-reported-issues and Goodreads shelf sync features and wire them into notifications. Adds Prisma migrations and schema changes (ReportedIssue, GoodreadsShelf, GoodreadsBookMapping), API endpoints for reporting (POST /audiobooks/[asin]/report-issue) and admin management (list, resolve/dismiss, replace), and an admin UI section to view/dismiss/replace reported issues. Adds a new notification event (issue_reported) with updates to notification schemas, docs and provider handling, plus a notification-events constants file. Refactors request creation to use createRequestForUser service, adds a Goodreads sync processor/service/hooks/UI modals, a scrape-resilience util, and related tests and minor integration updates.
This commit is contained in:
kikootwo
2026-02-11 16:49:55 -05:00
parent b013538b63
commit 20c8fb0898
69 changed files with 4167 additions and 766 deletions
+8 -8
View File
@@ -134,14 +134,14 @@ describe('AudibleService', () => {
it('paginates new releases and respects delays between pages', async () => {
configServiceMock.getAudibleRegion.mockResolvedValue('us');
clientMock.get
.mockResolvedValueOnce({ data: buildListHtml(10, 0) })
.mockResolvedValueOnce({ data: buildListHtml(5, 10) });
.mockResolvedValueOnce({ data: buildListHtml(50, 0) })
.mockResolvedValueOnce({ data: buildListHtml(25, 50) });
const service = new AudibleService();
const delaySpy = vi.spyOn(service as any, 'delay').mockResolvedValue(undefined);
const results = await service.getNewReleases(25);
const results = await service.getNewReleases(75);
expect(results).toHaveLength(15);
expect(results).toHaveLength(75);
expect(delaySpy).toHaveBeenCalledTimes(1);
});
@@ -345,14 +345,14 @@ describe('AudibleService', () => {
it('paginates popular audiobooks across pages', async () => {
configServiceMock.getAudibleRegion.mockResolvedValue('us');
clientMock.get
.mockResolvedValueOnce({ data: buildListHtml(10, 0) })
.mockResolvedValueOnce({ data: buildListHtml(10, 10) });
.mockResolvedValueOnce({ data: buildListHtml(50, 0) })
.mockResolvedValueOnce({ data: buildListHtml(25, 50) });
const service = new AudibleService();
const delaySpy = vi.spyOn(service as any, 'delay').mockResolvedValue(undefined);
const results = await service.getPopularAudiobooks(25);
const results = await service.getPopularAudiobooks(75);
expect(results).toHaveLength(20);
expect(results).toHaveLength(75);
expect(delaySpy).toHaveBeenCalledTimes(1);
});