import type { DatabaseService } from '../database/database.service'; import type { Prisma } from '../generated/prisma/client'; type Db = DatabaseService | Prisma.TransactionClient; export async function isVerifiedBusinessAccount( db: Db, organizationId: string, accountId: string, ) { const latest = await db.businessVerificationEvent.findFirst({ where: { organizationId, accountId }, orderBy: { sequence: 'desc' }, }); return latest?.kind === 'APPROVED'; }