/**
 * Domain Types: Eligibility
 * 
 * DSL-based eligibility filter and evaluation results.
 */

export interface EligibilityFilterDto {
  /**
   * DSL expression for eligibility rules
   */
  dsl: string;
  
  /**
   * Optional context for evaluation
   */
  context?: {
    userId?: string;
    leagueId?: string;
    [key: string]: unknown;
  };
}

export interface EligibilityCondition {
  target: 'platform' | 'external';
  dimension?: string;
  game?: string;
  operator: string;
  expected: number | [number, number];
}

export interface ParsedEligibilityFilter {
  conditions: EligibilityCondition[];
  logicalOperator: 'AND' | 'OR';
}

export interface EvaluationReason {
  target: string;
  operator: string;
  expected: number | [number, number];
  actual: number;
  failed: boolean;
  message?: string;
}

export interface EvaluationResultDto {
  eligible: boolean;
  reasons: EvaluationReason[];
  summary: string;
  evaluatedAt: string;
  metadata?: {
    userId?: string;
    filter?: string;
    [key: string]: unknown;
  };
}
