apiVersion: v1
kind: ConfigMap
metadata:
  name: distribution-service-config
data:
  # Service settings
  SERVICE_NAME: "distribution-service"
  APP_NAME: "Bakery Distribution Service"
  DESCRIPTION: "Distribution service for enterprise tier bakery management"
  VERSION: "1.0.0"
  
  # Database settings
  DB_POOL_SIZE: "10"
  DB_MAX_OVERFLOW: "20"
  DB_POOL_TIMEOUT: "30"
  DB_POOL_RECYCLE: "3600"
  DB_POOL_PRE_PING: "true"
  DB_ECHO: "false"
  
  # Redis settings
  REDIS_DB: "7"  # Use separate database for distribution service
  REDIS_MAX_CONNECTIONS: "50"
  REDIS_RETRY_ON_TIMEOUT: "true"
  REDIS_SOCKET_KEEPALIVE: "true"
  
  # RabbitMQ settings
  RABBITMQ_EXCHANGE: "bakery_events"
  RABBITMQ_QUEUE_PREFIX: "distribution"
  RABBITMQ_RETRY_ATTEMPTS: "3"
  RABBITMQ_RETRY_DELAY: "5"
  
  # Authentication settings
  JWT_ALGORITHM: "HS256"
  JWT_ACCESS_TOKEN_EXPIRE_MINUTES: "30"
  JWT_REFRESH_TOKEN_EXPIRE_DAYS: "7"
  ENABLE_SERVICE_AUTH: "true"
  
  # HTTP client settings
  HTTP_TIMEOUT: "30"
  HTTP_RETRIES: "3"
  HTTP_RETRY_DELAY: "1.0"
  
  # CORS settings
  CORS_ORIGINS: "http://localhost:3000,http://localhost:3001"
  CORS_ALLOW_CREDENTIALS: "true"
  CORS_ALLOW_METHODS: "GET,POST,PUT,DELETE,PATCH,OPTIONS"
  CORS_ALLOW_HEADERS: "*"
  
  # Rate limiting
  RATE_LIMIT_ENABLED: "true"
  RATE_LIMIT_REQUESTS: "100"
  RATE_LIMIT_WINDOW: "60"
  RATE_LIMIT_BURST: "10"
  
  # Monitoring and observability
  LOG_LEVEL: "INFO"
  PROMETHEUS_ENABLED: "true"
  PROMETHEUS_PORT: "9090"
  JAEGER_ENABLED: "false"
  JAEGER_AGENT_HOST: "jaeger-agent"
  JAEGER_AGENT_PORT: "6831"
  
  # Health check settings
  HEALTH_CHECK_TIMEOUT: "30"
  HEALTH_CHECK_INTERVAL: "30"
  
  # Business rules
  MAX_FORECAST_DAYS: "30"
  MIN_HISTORICAL_DAYS: "60"
  CONFIDENCE_THRESHOLD: "0.8"
  
  # Routing optimization settings
  VRP_TIME_LIMIT_SECONDS: "30"
  VRP_DEFAULT_VEHICLE_CAPACITY_KG: "1000"
  VRP_AVERAGE_SPEED_KMH: "30"
  
  # Service-specific settings
  DISTRIBUTION_SERVICE_URL: "http://distribution-service:8000"