// Global AML & Sanctions Engine (GASE) - Main Service

import { sanctionsSyncService } from './sanctions-sync.service';
import { pepGraphService } from './pep-graph.service';
import { sasCalculatorService } from './sas-calculator.service';
import { riskTieringService } from './risk-tiering.service';
import { SuspiciousActivityScore, RiskTier } from './types';

export class GASEService {
  /**
   * Synchronize sanctions lists
   */
  async syncSanctionsLists(sovereignBankId?: string): Promise<void> {
    return sanctionsSyncService.syncSanctionsLists(sovereignBankId);
  }

  /**
   * Search sanctions
   */
  async searchSanctions(entityName: string, threshold?: number) {
    return sanctionsSyncService.searchSanctions(entityName, threshold);
  }

  /**
   * Add PEP to graph
   */
  async addPEP(pepData: any) {
    return pepGraphService.addPEPNode(pepData);
  }

  /**
   * Find PEP connections
   */
  async findPEPConnections(entityId: string, maxDepth?: number) {
    return pepGraphService.findPEPConnections(entityId, maxDepth);
  }

  /**
   * Calculate SAS
   */
  async calculateSAS(transactionId: string, entityId: string): Promise<SuspiciousActivityScore> {
    return sasCalculatorService.calculateSAS(transactionId, entityId);
  }

  /**
   * Assign risk tier
   */
  async assignRiskTier(entityId: string): Promise<RiskTier> {
    return riskTieringService.assignRiskTier(entityId);
  }

  /**
   * Get risk tier
   */
  async getRiskTier(entityId: string): Promise<RiskTier | null> {
    return riskTieringService.getRiskTier(entityId);
  }
}

export const gaseService = new GASEService();

