Add active outreach funnel dashboard

This commit is contained in:
jjbrunton committed 2026-08-09 15:54:05 +01:00
1 parent deaf86c364
commit f55ae7ddf8
15 files changed
+519 -1

No files matched your search

+22
View File
@@ -126,6 +126,28 @@ describe('CandidateQueueRepository', () => {
prepared: expect.objectContaining({ generatedMessage: 'prepared message' }),
});
});
it('lists only active candidates in actionable stage order', () => {
queue.enqueue([
post('waiting', 'alice'),
post('screening', 'bob'),
post('ready', 'carol'),
post('sending', 'dana'),
post('rejected', 'erin'),
], 'image', 1, 1_000);
queue.claimForScreening('worker-1', 1_000, 1_010);
const ready = queue.claimForScreening('worker-2', 1_000, 1_020)!;
queue.markReady(ready.postId, 'worker-2', prepared(ready.post), 1_021);
const sending = queue.claimReady('account-a', 'worker-3', 1_000, 1_030)!;
const rejected = queue.claimForScreening('worker-4', 1_000, 1_040)!;
queue.reject(rejected.postId, 'worker-4', 'Seller signals detected', 1_041);
expect(queue.listActive().map((candidate) => candidate.status)).toEqual([
'sending', 'screening', 'discovered', 'discovered',
]);
expect(queue.listActive().map((candidate) => candidate.postId)).not.toContain(rejected.postId);
expect(queue.getOldestActiveAt()).toBe(1_000);
});
});
describe('RuntimeStateRepository', () => {