feat(sms): simplify SMS settings to use only KAVENEGAR_API_KEY from env, remove other SMS-related fields from config
This commit is contained in:
+10
-2
@@ -1,9 +1,17 @@
|
||||
# SMS API
|
||||
|
||||
> **Prefix:** `/api/v1/sms`
|
||||
> **Providers:** `kavenegar` (default) | `rangineh`
|
||||
> **Provider:** همیشه `kavenegar` (پیشفرض و تنها گزینه فعال).
|
||||
> All send operations are dispatched **asynchronously** via Symfony Messenger → Redis queue.
|
||||
|
||||
## Configuration
|
||||
|
||||
- **کلید API کاوهنگار فقط از متغیر محیطی `KAVENEGAR_API_KEY` خوانده میشود** — نه از دیتابیس و نه از پنل. در پنل ادمین فقط وضعیت read-only «تنظیمشده/نشده» نمایش داده میشود.
|
||||
- شماره فرستنده تنظیم نمیشود؛ کاوهنگار از خط پیشفرض حساب استفاده میکند.
|
||||
- endpoint `GET /api/v1/admin/settings` یک فیلد read-only به نام `sms_api_key_configured` (boolean) برمیگرداند.
|
||||
- `PATCH /api/v1/admin/settings` دیگر کلیدهای `sms_provider`، `kavenegar_api_key`، `kavenegar_sender`، `rangineh_api_key`، `rangineh_sender`، `sms_price_rials` را نمیپذیرد (از `ALLOWED_KEYS` حذف شدهاند).
|
||||
- قیمت هر پیامک ثابت است: `SmsWalletController::SMS_PRICE_RIALS = 500` ریال.
|
||||
|
||||
---
|
||||
|
||||
## POST `/api/v1/sms/send`
|
||||
@@ -25,7 +33,7 @@ Send a direct SMS message (free text).
|
||||
|-------|------|----------|-------------|
|
||||
| `mobile` | string | ✅ | Recipient mobile (`09XXXXXXXXX`) |
|
||||
| `message` | string | ✅ | Message text |
|
||||
| `provider` | string | ❌ | `"kavenegar"` or `"rangineh"` (default from env) |
|
||||
| `provider` | string | ❌ | نادیده گرفته میشود؛ همیشه `kavenegar` استفاده میشود |
|
||||
|
||||
### Response `200`
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user