# chunks_content

c0: npx jest src/__tests__/unit
c3: command
c5: 2026-08-06T03:18:26.936038237+00:00
c1:
  2026-08-06 06:18:25 [[31merror[39m]: Failed to get current balance {
    "service": "translate-api",
    "userId": "user_789",
    "error": {}
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send welcome email {
    "service": "translate-api",
    "error": {},
    "email": "user@example.com"
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send verification email {
    "service": "translate-api",
    "error": {},
    "email": "user@example.com"
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to deduct credits {
    "service": "translate-api",
    "userId": "user_123",
    "amount": 1000,
    "description": "Translation job",
    "error": {}
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send password reset email {
    "service": "translate-api",
    "error": {},
    "email": "user@example.com"
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send low credit warning {
    "service": "translate-api",
    "error": {},
    "email": "user@example.com"
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send subscription receipt {
    "service": "translate-api",
    "error": {},
    "email": "user@example.com"
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send job completion email {
    "service": "translate-api",
    "email": "user@example.com",
    "jobId": "job_123",
    "error": {}
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send low credit warning {
    "service": "translate-api",
    "error": {},
    "email": "user@example.com"
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send welcome email {
    "service": "translate-api",
    "error": {},
    "email": "invalid-email"
  }
  2026-08-06 06:18:25 [[31merror[39m]: Failed to send subscription receipt {
    "service": "translate-api",
    "error": {},
    "email": "user@example.com"
  }
  2026-08-06 06:18:26 [[31merror[39m]: Immediate bulk queue dispatch failed {
    "service": "translate-api",
    "error": {},
    "jobId": "job-1"
  }
  PASS src/__tests__/unit/services/settingsService.test.ts
    Settings Service
      getSystemSettings
        ✓ should fetch settings from database on cache miss (21 ms)
        ✓ should use cached settings on subsequent calls (cache hit) (3 ms)
        ✓ should auto-refresh cache after TTL expires (3 ms)
        ✓ should return empty map when no settings exist (1 ms)
        ✓ should handle database errors (18 ms)
      getSetting
        ✓ should return setting value when found (2 ms)
        ✓ should return undefined when setting not found (2 ms)
        ✓ should support type casting (2 ms)
        ✓ should work with string keys (1 ms)
      getSettingWithDefault
        ✓ should return setting value when found (1 ms)
        ✓ should return default value when setting not found (1 ms)
        ✓ should return default value when setting is undefined (2 ms)
        ✓ should work with numeric defaults (2 ms)
        ✓ should work with boolean defaults (2 ms)
      updateSetting
        ✓ should update setting in database and cache (3 ms)
        ✓ should create new setting if not exists (2 ms)
        ✓ should update cache immediately (2 ms)
        ✓ should handle database errors (2 ms)
        ✓ should handle null/undefined values (2 ms)
      deleteSetting
        ✓ should delete setting from database and cache (3 ms)
        ✓ should handle database errors (4 ms)
        ✓ should work with string keys (3 ms)
      forceRefresh
        ✓ should force cache refresh from database (4 ms)
        ✓ should refresh even when cache is not expired (4 ms)
      getGeminiConfig
        ✓ should return Gemini config when API key exists (4 ms)
        ✓ should return undefined when API key missing (4 ms)
      getPayPalConfig
        ✓ returns complete PayPal credentials without requiring legacy plan settings (3 ms)
        ✓ should return undefined when any required setting is missing (3 ms)
        ✓ returns undefined when PayPal mode is invalid (3 ms)
      getPricingConfig
        ✓ should return pricing from settings (4 ms)
        ✓ should return default pricing when not configured (4 ms)
      getCreditAllocations
        ✓ should return credit allocations from settings (3 ms)
        ✓ should return default allocations w
  [truncated]


