Add AST cache files for AltchaService, API documentation, and AltchaService tests

- Created JSON representation of AltchaService class and its methods, including imports and relationships.
- Added documentation for the Captcha API, detailing endpoints and responses.
- Introduced test cases for AltchaService, covering various functionalities and edge cases.
This commit is contained in:
hamed
2026-07-10 11:42:23 +03:30
parent c3c520801d
commit ec184dfcc8
17 changed files with 1069 additions and 1039 deletions
@@ -30,6 +30,8 @@ class SiteConfigController extends BaseController
'max_cancel_hours_before',
'appointment_reminder_hours',
'log_retention_days',
// captcha
'altcha_enabled',
// payment gateways
'payment_test_mode',
'payment_allowed_frontend_hosts',
@@ -47,6 +49,7 @@ class SiteConfigController extends BaseController
private readonly SiteConfigRepository $configRepo,
private readonly \App\Config\Repository\TaxRateHistoryRepository $taxHistoryRepo,
private readonly EntityManagerInterface $em,
private readonly \App\Shared\Captcha\AltchaService $altcha,
) {}
#[Route('/api/v1/admin/settings', methods: ['GET'])]
@@ -55,6 +58,8 @@ class SiteConfigController extends BaseController
$config = $this->configRepo->getAll();
// کلید API پیامک فقط از env؛ فقط وضعیت تنظیم‌بودن برگردانده می‌شود نه مقدار.
$config['sms_api_key_configured'] = ($_ENV['KAVENEGAR_API_KEY'] ?? '') !== '';
// مقدار مؤثر کپچا (override پنل اگر ست شده، وگرنه env) تا toggle درست نمایش دهد.
$config['altcha_enabled'] = $this->altcha->enabled() ? '1' : '0';
return $this->success($config);
}