# ============================================================
# Genex Backend - Environment Variables
# Copy this to .env and adjust values for your environment
# ============================================================

# --- Database (PostgreSQL 15) ---
DB_HOST=postgres
DB_PORT=5432
DB_USERNAME=genex
DB_PASSWORD=genex_dev_password
DB_NAME=genex

# --- Redis 7 ---
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=

# --- Kafka ---
KAFKA_BROKERS=kafka:9092

# --- JWT ---
JWT_ACCESS_SECRET=dev-access-secret-change-in-production
JWT_ACCESS_EXPIRY=15m
JWT_REFRESH_SECRET=dev-refresh-secret-change-in-production
JWT_REFRESH_EXPIRY=7d

# --- Kong ---
KONG_ADMIN_URL=http://kong:8001
KONG_PROXY_PORT=8080

# --- Service Ports ---
USER_SERVICE_PORT=3001
ISSUER_SERVICE_PORT=3002
TRADING_SERVICE_PORT=3003
CLEARING_SERVICE_PORT=3004
COMPLIANCE_SERVICE_PORT=3005
TRANSLATE_SERVICE_PORT=3007
NOTIFICATION_SERVICE_PORT=3008
CHAIN_INDEXER_PORT=3009

# --- External AI Agent Service ---
AI_SERVICE_URL=http://ai-agent-cluster:3006
AI_SERVICE_API_KEY=your-ai-service-api-key
AI_SERVICE_TIMEOUT=30000

# --- MinIO Object Storage ---
MINIO_ENDPOINT=minio
MINIO_PORT=9000
MINIO_ACCESS_KEY=genex-admin
MINIO_SECRET_KEY=genex-minio-secret
MINIO_USE_SSL=false

# --- SMS Service ---
SMS_ENABLED=false
SMS_CODE_EXPIRE_SECONDS=300
SMS_CODE_LENGTH=6
SMS_DAILY_LIMIT=10
SMS_MAX_VERIFY_ATTEMPTS=5

# --- Aliyun SMS (when SMS_ENABLED=true) ---
ALIYUN_ACCESS_KEY_ID=
ALIYUN_ACCESS_KEY_SECRET=
ALIYUN_SMS_SIGN_NAME=券金融
ALIYUN_SMS_TEMPLATE_CODE=
ALIYUN_SMS_TPL_REGISTER=SMS_501745796
ALIYUN_SMS_TPL_LOGIN=SMS_501720822
ALIYUN_SMS_TPL_RESET_PASSWORD=SMS_501735781
ALIYUN_SMS_TPL_CHANGE_PHONE=SMS_501925825
ALIYUN_SMS_TPL_IDENTITY_VERIFY=SMS_501925825
ALIYUN_SMS_TPL_TRANSACTION=SMS_501820752
ALIYUN_SMS_TPL_PAYMENT=SMS_501855782
ALIYUN_SMS_ENDPOINT=dysmsapi.aliyuncs.com

# --- Account Lockout ---
LOGIN_MAX_FAIL_ATTEMPTS=6
LOGIN_MAX_LOCK_MINUTES=1440

# --- External Services (all mocked in MVP) ---
CHAIN_RPC_URL=http://localhost:26657
SENDGRID_API_KEY=mock-key
TWILIO_SID=mock-sid
TWILIO_AUTH_TOKEN=mock-token
CHAINALYSIS_API_KEY=mock-key
