mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-21 14:23:48 +00:00
refactor: invert application↔routes boundary (Track B — points 3, 6a)
- Point 3: move the feed/email storage-cleanup helpers (purgeFeedKeysStep, collectUnsubscribeUrls, purgeExpiredFeeds, deleteKeysWithConcurrency, deleteAttachmentsForEmails) out of routes/admin/helpers.ts into src/application/feed-cleanup.ts, so the application layer no longer imports from routes/. deleteFeedRecord no longer takes a Hono Context: it accepts a BackgroundScheduler ((task) => void) and the HTTP edge passes (p) => waitUntilSafe(c, p). Application/domain are now Hono-Context-free. - Point 6a: rename the misleadingly-named Feed.rename → Feed.editDetails (it edits title + description), and feed-service.renameFeed → editFeedDetails. CLAUDE.md source layout updated. 351 tests pass; tsc --noEmit clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,8 @@ import {
|
||||
editFeed,
|
||||
deleteFeedRecord,
|
||||
} from "../../application/feed-service";
|
||||
import { deleteAttachmentsForEmails } from "../admin/helpers";
|
||||
import { deleteAttachmentsForEmails } from "../../application/feed-cleanup";
|
||||
import { waitUntilSafe } from "../../infrastructure/worker";
|
||||
import { FeedRepository } from "../../infrastructure/feed-repository";
|
||||
import { FeedId } from "../../domain/value-objects/feed-id";
|
||||
import { getStats } from "../../application/stats";
|
||||
@@ -248,7 +249,9 @@ apiApp.openapi(
|
||||
async (c) => {
|
||||
const env = c.env;
|
||||
const { feedId } = c.req.valid("param");
|
||||
const removed = await deleteFeedRecord(c, env, feedId);
|
||||
const removed = await deleteFeedRecord(env, feedId, (p) =>
|
||||
waitUntilSafe(c, p),
|
||||
);
|
||||
if (!removed) return c.json({ error: "Feed not found" }, 404);
|
||||
return c.json({ ok: true }, 200);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user