apiVersion: v1
kind: ConfigMap
metadata:
  name: cm-ai-service
  namespace: kt-event-marketing
data:
  # Server Configuration
  SERVER_PORT: "8083"

  # Redis Configuration (service-specific)
  REDIS_DATABASE: "3"
  REDIS_TIMEOUT: "3000"
  REDIS_POOL_MIN: "2"

  # Kafka Configuration (service-specific)
  KAFKA_CONSUMER_GROUP: "ai-service-consumers"

  # Kafka Topics Configuration
  KAFKA_TOPICS_AI_JOB: "ai-event-generation-job"
  KAFKA_TOPICS_AI_JOB_DLQ: "ai-event-generation-job-dlq"

  # AI Provider Configuration
  AI_PROVIDER: "CLAUDE"
  AI_CLAUDE_API_URL: "https://api.anthropic.com/v1/messages"
  AI_CLAUDE_ANTHROPIC_VERSION: "2023-06-01"
  AI_CLAUDE_MODEL: "claude-sonnet-4-5-20250929"
  AI_CLAUDE_MAX_TOKENS: "4096"
  AI_CLAUDE_TEMPERATURE: "0.7"
  AI_CLAUDE_TIMEOUT: "300000"

  # Circuit Breaker Configuration
  RESILIENCE4J_CIRCUITBREAKER_FAILURE_RATE_THRESHOLD: "50"
  RESILIENCE4J_CIRCUITBREAKER_SLOW_CALL_RATE_THRESHOLD: "50"
  RESILIENCE4J_CIRCUITBREAKER_SLOW_CALL_DURATION_THRESHOLD: "60s"
  RESILIENCE4J_CIRCUITBREAKER_PERMITTED_CALLS_HALF_OPEN: "3"
  RESILIENCE4J_CIRCUITBREAKER_SLIDING_WINDOW_SIZE: "10"
  RESILIENCE4J_CIRCUITBREAKER_MINIMUM_CALLS: "5"
  RESILIENCE4J_CIRCUITBREAKER_WAIT_DURATION_OPEN: "60s"
  RESILIENCE4J_TIMELIMITER_TIMEOUT_DURATION: "300s"

  # Redis Cache TTL Configuration (seconds)
  CACHE_TTL_RECOMMENDATION: "86400"
  CACHE_TTL_JOB_STATUS: "86400"
  CACHE_TTL_TREND: "3600"
  CACHE_TTL_FALLBACK: "604800"

  # Logging Configuration
  LOG_LEVEL_ROOT: "INFO"
  LOG_LEVEL_AI: "DEBUG"
  LOG_LEVEL_KAFKA: "INFO"
  LOG_LEVEL_REDIS: "INFO"
  LOG_LEVEL_RESILIENCE4J: "DEBUG"
  LOG_FILE_NAME: "logs/ai-service.log"
  LOG_FILE_MAX_SIZE: "10MB"
  LOG_FILE_MAX_HISTORY: "7"
  LOG_FILE_TOTAL_CAP: "100MB"
