# =============================================================================
# Customer Portal - Development Environment
# =============================================================================
# Copy to .env in project root OR to apps/portal/.env.development and
# apps/bff/.env.development for per-app configuration.
#
# Most settings have sensible defaults - only required values and
# dev-specific overrides are listed here.
# =============================================================================

# -----------------------------------------------------------------------------
# REQUIRED - No defaults, must be set
# -----------------------------------------------------------------------------

DATABASE_URL=postgresql://dev:dev@localhost:5432/portal_dev?schema=public

# Generate with: openssl rand -base64 32
JWT_SECRET=HjHsUyTE3WhPn5N07iSvurdV4hk2VEkIuN+lIflHhVQ=

# -----------------------------------------------------------------------------
# Frontend (Next.js) - Browser-exposed variables
# -----------------------------------------------------------------------------

NEXT_PUBLIC_APP_NAME="Customer Portal (Dev)"
NEXT_PUBLIC_APP_VERSION=1.0.0-dev
NEXT_PUBLIC_API_BASE=http://localhost:4000
NEXT_PUBLIC_ENABLE_DEVTOOLS=true

# -----------------------------------------------------------------------------
# CORS - Required for direct browser calls to BFF
# -----------------------------------------------------------------------------

CORS_ORIGIN=http://localhost:3000

# -----------------------------------------------------------------------------
# Dev Overrides (relaxed limits, verbose logging)
# -----------------------------------------------------------------------------

LOG_LEVEL=debug
RATE_LIMIT_LIMIT=1000
AUTH_RATE_LIMIT_LIMIT=10

# -----------------------------------------------------------------------------
# External Services - Fill in when testing integrations
# -----------------------------------------------------------------------------

# WHMCS (Development/Sandbox)
WHMCS_DEV_BASE_URL=
WHMCS_DEV_API_IDENTIFIER=
WHMCS_DEV_API_SECRET=

# Salesforce
SF_LOGIN_URL=
SF_CLIENT_ID=
SF_USERNAME=
SF_PRIVATE_KEY_PATH=./secrets/sf-private.key

# Freebit SIM Management
FREEBIT_BASE_URL=
FREEBIT_OEM_KEY=

# SendGrid Email
SENDGRID_API_KEY=

# -----------------------------------------------------------------------------
# DEFAULTS - Uncomment only if you need to override
# -----------------------------------------------------------------------------

# Core (defaults shown)
# NODE_ENV=development
# APP_NAME=customer-portal-bff
# APP_BASE_URL=http://localhost:3000
# BFF_PORT=4000
# REDIS_URL=redis://localhost:6379

# Security (defaults shown)
# JWT_EXPIRES_IN=7d
# BCRYPT_ROUNDS=14
# TRUST_PROXY=false

# Rate Limiting (production defaults - dev overrides above)
# RATE_LIMIT_TTL=60
# AUTH_RATE_LIMIT_TTL=900

# Freebit (defaults shown)
# FREEBIT_OEM_ID=PASI
# FREEBIT_TIMEOUT=30000
# FREEBIT_RETRY_ATTEMPTS=3

# Email (defaults shown)
# EMAIL_ENABLED=true
# EMAIL_USE_QUEUE=true
# EMAIL_FROM=no-reply@example.com
# EMAIL_FROM_NAME=Assist Solutions

# Portal (defaults shown)
# PORTAL_PRICEBOOK_ID=01sTL000008eLVlYAM
# PORTAL_PRICEBOOK_NAME=Portal

# Salesforce Events (defaults shown)
# SF_EVENTS_ENABLED=false
# SF_EVENTS_REPLAY=LATEST
# SF_PUBSUB_ENDPOINT=api.pubsub.salesforce.com:7443

# Dev Bypasses - NEVER enable in production!
# DISABLE_CSRF=false
# DISABLE_RATE_LIMIT=false
# DISABLE_ACCOUNT_LOCKING=false
# SKIP_OTP=false  # Skip OTP verification during login (dev only)
