import { AmlAlert, AlertStatus, AmlPattern } from '../entities/aml-alert.entity'; export const AML_ALERT_REPOSITORY = Symbol('IAmlAlertRepository'); export interface IAmlAlertRepository { create(data: Partial): AmlAlert; save(alert: AmlAlert): Promise; findById(id: string): Promise; findAndCount(options: { where?: Record; skip?: number; take?: number; order?: Record; }): Promise<[AmlAlert[], number]>; find(options: { where?: Record | Record[]; order?: Record; take?: number; }): Promise; count(options?: { where?: Record | Record[] }): Promise; update(id: string, data: Partial): Promise; /** Count alerts with risk_score >= threshold and not in resolved/dismissed status */ countHighRiskActive(threshold: number): Promise; /** Paginated query with optional status and pattern filters */ findPaginated( page: number, limit: number, filters?: { status?: string; pattern?: string }, ): Promise<[AmlAlert[], number]>; /** Find alerts with risk_score >= threshold, ordered by score desc */ findSuspicious(page: number, limit: number, threshold: number): Promise<[AmlAlert[], number]>; /** Count high-risk alerts (risk_score >= threshold) */ countHighRisk(threshold: number): Promise; }