feat(review): approved/rejected queue views — approve now produces a working list

serverListPendingReviewMatches gains a status param; queue gains
Pending/Approved/Rejected tabs composed with the source filter. Approve
was already durable (review fields survive nightly re-scoring) but
approved matches vanished from the UI — now they're the working list
for manual contact pulls and sends.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Croissant Le Doux
2026-07-17 00:56:58 -04:00
parent 4f35dcdb8d
commit 7cefbbbfa1
2 changed files with 40 additions and 7 deletions

View File

@@ -23,7 +23,10 @@ export interface PendingReviewMatch {
export async function serverListPendingReviewMatches(
db: NpOutreachDatabase | NpOutreachTransaction,
{ source }: { source?: string } = {},
{
source,
status = 'pending',
}: { source?: string; status?: 'pending' | 'approved' | 'rejected' } = {},
): Promise<PendingReviewMatch[]> {
return db
.select({
@@ -42,9 +45,9 @@ export async function serverListPendingReviewMatches(
.innerJoin(schema.grants, eq(schema.matches.grantId, schema.grants.id))
.where(
source == null
? eq(schema.matches.reviewStatus, 'pending')
? eq(schema.matches.reviewStatus, status)
: and(
eq(schema.matches.reviewStatus, 'pending'),
eq(schema.matches.reviewStatus, status),
eq(schema.grants.source, source as never),
),
)