17 lines
480 B
TypeScript
17 lines
480 B
TypeScript
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';
|
|
}
|