Add recent outreach rejections stream

This commit is contained in:
jjbrunton committed 2026-08-14 15:45:57 +01:00
1 parent 0c21202253
commit 94049ed9c4
9 files changed
+170 -16

No files matched your search

+13
View File
@@ -35,6 +35,14 @@ describe('outreach route', () => {
rejectionReasons: [{ reason: 'Seller signals detected', count: 1 }],
})),
getOldestActiveAt: vi.fn(() => 1_000),
listRecentRejected: vi.fn(() => [{
postId: 'rejected-1', subreddit: 'example', author: 'bob', sourceType: 'chat',
post: {
id: 'rejected-1', subreddit: 'example', author: 'bob', title: 'A rejected post',
permalink: '/r/example/comments/rejected-1/', selftext: 'Scanned post content',
},
updatedAt: 3_000, lastError: 'Seller signals detected',
}]),
listActive: vi.fn(() => [{
postId: 'post-1', subreddit: 'example', author: 'alice', sourceType: 'image',
post: {
@@ -89,6 +97,11 @@ describe('outreach route', () => {
stages: { discovered: 2, screening: 1, ready: 1, sending: 1, retryable: 1 },
outcomes: { sent: 2, rejected: 1 },
rejectionReasons: [{ reason: 'Seller signals detected', count: 1 }],
recentRejections: [{
postId: 'rejected-1', subreddit: 'example', author: 'bob', title: 'A rejected post',
postUrl: 'https://www.reddit.com/r/example/comments/rejected-1/', sourceType: 'chat',
sourceContent: 'Scanned post content', rejectedAt: 3_000, reason: 'Seller signals detected',
}],
candidates: [{
postId: 'post-1', status: 'sending', hasPreparedMessage: true,
postUrl: 'https://www.reddit.com/r/example/comments/post-1/hello/',