feat(infra): project pendingConfirmation into feeds:list

saveMetadata now also upserts the list entry so the pendingConfirmation
flag is reflected in the dashboard without an extra per-feed KV read.
toListItemDTO gains an optional third parameter for the flag.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
Julien HerrandClaude Sonnet 4.6 committed 2026-05-25 09:02:16 +02:00
1 parent 79bb4902b9
commit 36d58ade48
4 files changed
+87 -6

No files matched your search

+6 -1
View File
@@ -43,12 +43,17 @@ export function toConfigDTO(state: FeedState): FeedConfig {
}
/** Domain state → the projection cached in the global `feeds:list` registry. */
export function toListItemDTO(id: FeedId, state: FeedState): FeedListItem {
export function toListItemDTO(
id: FeedId,
state: FeedState,
pendingConfirmation = false,
): FeedListItem {
return {
id: id.value,
title: state.title,
description: state.description,
mailbox_id: state.mailboxId,
expires_at: state.expiresAt,
...(pendingConfirmation !== undefined ? { pendingConfirmation } : {}),
};
}