* init * typefix * -- * fix test * update index * cleanup * rm unnecessary comments * improvements * add tests * test fixes * fixes * fixes * fixes * add try catch to make booking fail-open * Update packages/features/watchlist/operations/check-user-blocking.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix type --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
27 lines
728 B
TypeScript
27 lines
728 B
TypeScript
import type { WatchlistType } from "../types";
|
|
|
|
export interface BlockingResult {
|
|
isBlocked: boolean;
|
|
reason?: WatchlistType;
|
|
watchlistEntry?: Record<string, unknown> | null;
|
|
}
|
|
|
|
/**
|
|
* Result of bulk blocking check.
|
|
* Maps email (lowercase) -> BlockingResult
|
|
*/
|
|
export type BulkBlockingResult = Map<string, BlockingResult>;
|
|
|
|
export interface IBlockingService {
|
|
/**
|
|
* Check if a single email is blocked.
|
|
*/
|
|
isBlocked(email: string, organizationId?: number | null): Promise<BlockingResult>;
|
|
|
|
/**
|
|
* Bulk check multiple emails in a single query.
|
|
* Returns Map<email, BlockingResult> for efficient lookup.
|
|
*/
|
|
areBlocked(emails: string[], organizationId?: number | null): Promise<BulkBlockingResult>;
|
|
}
|