/**
 * Domain Events for the Compliance bounded context.
 *
 * These events represent significant domain occurrences that other
 * parts of the system (or external services via Kafka) may react to.
 */

export interface AmlAlertCreatedEvent {
  alertId: string;
  userId: string;
  pattern: string;
  riskScore: number;
  description: string;
  timestamp: string;
}

export interface OfacScreeningCompletedEvent {
  screeningId: string;
  userId: string;
  screenedName: string;
  isMatch: boolean;
  matchScore: string;
  result: string;
  timestamp: string;
}

export interface SarReportFiledEvent {
  reportId: string;
  alertId: string;
  userId: string;
  reportType: string;
  fincenReference: string | null;
  timestamp: string;
}

export interface DisputeOpenedEvent {
  disputeId: string;
  orderId: string;
  plaintiffId: string;
  defendantId: string | null;
  type: string;
  amount: string;
  timestamp: string;
}

export interface DisputeResolvedEvent {
  disputeId: string;
  orderId: string;
  plaintiffId: string;
  status: string;
  resolution: string;
  resolvedAt: string;
  timestamp: string;
}

/**
 * Compliance event topic constants for Kafka publishing.
 */
export const COMPLIANCE_EVENT_TOPICS = {
  AML_ALERT_CREATED: 'compliance.aml-alert.created',
  OFAC_SCREENING_COMPLETED: 'compliance.ofac-screening.completed',
  SAR_REPORT_FILED: 'compliance.sar-report.filed',
  DISPUTE_OPENED: 'compliance.dispute.opened',
  DISPUTE_RESOLVED: 'compliance.dispute.resolved',
} as const;
