mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
feat(infra): project hasNativeFeed into feeds:list
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,18 @@ describe("feed-mapper", () => {
|
||||
mailbox_id: "a.b.42",
|
||||
expires_at: 3000,
|
||||
pendingConfirmation: false,
|
||||
hasNativeFeed: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("projects hasNativeFeed when passed", () => {
|
||||
const item = toListItemDTO(
|
||||
FeedId.unchecked("a.b.42"),
|
||||
fromConfigDTO(fullConfig),
|
||||
true,
|
||||
true,
|
||||
);
|
||||
expect(item.pendingConfirmation).toBe(true);
|
||||
expect(item.hasNativeFeed).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -49,6 +49,7 @@ export function toListItemDTO(
|
||||
id: FeedId,
|
||||
state: FeedState,
|
||||
pendingConfirmation = false,
|
||||
hasNativeFeed = false,
|
||||
): FeedListItem {
|
||||
return {
|
||||
id: id.value,
|
||||
@@ -57,5 +58,6 @@ export function toListItemDTO(
|
||||
mailbox_id: state.mailboxId,
|
||||
expires_at: state.expiresAt,
|
||||
pendingConfirmation,
|
||||
hasNativeFeed,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -88,7 +88,12 @@ export class FeedRepository {
|
||||
this.putConfig(feed.id, toConfigDTO(feed.state())),
|
||||
this.putMetadata(feed.id, feed.toMetadataSnapshot()),
|
||||
this.upsertListEntry(
|
||||
toListItemDTO(feed.id, feed.state(), feed.pendingConfirmation),
|
||||
toListItemDTO(
|
||||
feed.id,
|
||||
feed.state(),
|
||||
feed.pendingConfirmation,
|
||||
feed.hasNativeFeed(),
|
||||
),
|
||||
),
|
||||
this.putInboundIndex(feed.mailboxId, feed.id),
|
||||
]);
|
||||
@@ -104,7 +109,12 @@ export class FeedRepository {
|
||||
await Promise.all([
|
||||
this.putMetadata(feed.id, feed.toMetadataSnapshot()),
|
||||
this.upsertListEntry(
|
||||
toListItemDTO(feed.id, feed.state(), feed.pendingConfirmation),
|
||||
toListItemDTO(
|
||||
feed.id,
|
||||
feed.state(),
|
||||
feed.pendingConfirmation,
|
||||
feed.hasNativeFeed(),
|
||||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
@@ -118,7 +128,12 @@ export class FeedRepository {
|
||||
await Promise.all([
|
||||
this.putConfig(feed.id, toConfigDTO(feed.state())),
|
||||
this.upsertListEntry(
|
||||
toListItemDTO(feed.id, feed.state(), feed.pendingConfirmation),
|
||||
toListItemDTO(
|
||||
feed.id,
|
||||
feed.state(),
|
||||
feed.pendingConfirmation,
|
||||
feed.hasNativeFeed(),
|
||||
),
|
||||
),
|
||||
this.putInboundIndex(feed.mailboxId, feed.id),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user