feat(sms): bring-your-own-provider — cafés use their own SMS account
CI/CD / CI · API (dotnet build + test) (push) Successful in 40s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 30s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m8s
CI/CD / CI · Admin Web (tsc) (push) Successful in 37s
CI/CD / CI · Website (tsc) (push) Successful in 45s
CI/CD / CI · Koja (tsc) (push) Successful in 50s
CI/CD / Deploy · all services (push) Successful in 5m16s

The platform no longer sells SMS. Each café saves its OWN Kavenegar API
key + sender line (new Cafes columns + migration) and campaigns are sent
and billed through that account.

Backend:
- GET/PUT /sms/settings (Manager/Owner; key echoed masked, verified
  against the provider before saving)
- campaign + balance use the café's credentials; SMS_NOT_CONFIGURED
  error when missing; plan-tier SMS gating removed everywhere
  (PlanLimitChecker, SmsMarketingService, billing status)
- platform Kavenegar config stays ONLY for login OTPs (env/DB)
- design-time DbContext factory so `dotnet ef migrations add` works
  without booting the host

Dashboard:
- SMS screen: provider-settings card, not-configured callout, campaign
  form disabled until configured; quota bar removed (usage stays as info)
- subscription screen + plan comparison no longer show SMS limits

Admin panel:
- Kavenegar/SMS section removed from integrations (request field now
  optional; stored OTP config untouched)
- SMS limit field removed from the plan editor
- nav label "درگاه و پیامک" → "درگاه پرداخت و AI"

fa/en/ar translations. 86 tests pass; all tsc clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-12 09:23:50 +03:30
parent 615d5348de
commit 00649d0248
24 changed files with 3953 additions and 188 deletions
+28 -2
View File
@@ -481,10 +481,36 @@
"targetGroup": "المجموعة المستهدفة",
"allCustomers": "كل العملاء",
"send": "إرسال",
"usage": "الاستخدام هذا الشهر",
"usage": "المُرسَل هذا الشهر",
"unlimited": "غير محدود",
"sent": "تم الإرسال",
"failed": "فشل"
"failed": "فشل",
"charCount": "{count} حرفاً",
"smsPartsHint": "{parts} رسالة",
"balance": "رصيد حسابك",
"balanceAmount": "{amount} ريال",
"balanceNotConfigured": "خدمة SMS غير مفعّلة",
"sender": "خط الإرسال",
"recipientsCount": "{count} مستلماً",
"sendConfirm": "إرسال إلى {count} شخصاً؟",
"sending": "جارٍ الإرسال...",
"byoHint": "تُرسل الرسائل عبر حسابك وخطك الخاص — تُحتسب تكلفة الإرسال مباشرة لدى مزوّد SMS الخاص بك.",
"notConfiguredOwner": "لإرسال الرسائل، احفظ أولاً مفتاح API ورقم خط كاوه‌نگار في الإعدادات أعلاه.",
"notConfiguredStaff": "لم يقم مدير المقهى بإعداد خدمة SMS بعد.",
"settings": {
"title": "إعدادات مزوّد SMS",
"hint": "أنشئ مفتاح API من لوحة كاوه‌نگار (kavenegar.com) وأدخله مع رقم خط الإرسال.",
"apiKey": "مفتاح API",
"apiKeyPlaceholder": "API Key",
"senderNumber": "رقم خط الإرسال",
"senderPlaceholder": "10004346...",
"configured": "خدمة SMS مفعّلة.",
"notConfigured": "لم يتم الإعداد بعد.",
"save": "حفظ",
"saving": "جارٍ التحقق…",
"saved": "تم حفظ إعدادات SMS.",
"saveFailed": "مفتاح API غير صالح أو فشل الحفظ."
}
},
"reports": {
"title": "التقارير والتحليلات",
+21 -4
View File
@@ -500,19 +500,36 @@
"targetGroup": "Target group",
"allCustomers": "All customers",
"send": "Send",
"usage": "Usage this month",
"usage": "Sent this month",
"unlimited": "Unlimited",
"sent": "Sent",
"failed": "Failed",
"charCount": "{count} chars",
"smsPartsHint": "{parts} SMS",
"balance": "Account credit",
"balance": "Your account credit",
"balanceAmount": "{amount} Rials",
"balanceNotConfigured": "Kavenegar not configured",
"balanceNotConfigured": "SMS service not set up",
"sender": "Sender line",
"recipientsCount": "{count} recipients",
"sendConfirm": "Send to {count} people?",
"sending": "Sending..."
"sending": "Sending...",
"byoHint": "SMS is sent through your OWN provider account and line — sending costs are billed directly by your SMS provider.",
"notConfiguredOwner": "To send SMS, first save your Kavenegar API key and sender line in the settings above.",
"notConfiguredStaff": "The SMS service has not been set up by the café manager yet.",
"settings": {
"title": "SMS provider settings",
"hint": "Create an API key in your Kavenegar panel (kavenegar.com) and enter it with your sender line number.",
"apiKey": "Kavenegar API key",
"apiKeyPlaceholder": "API Key",
"senderNumber": "Sender line number",
"senderPlaceholder": "10004346...",
"configured": "SMS service is active.",
"notConfigured": "Not set up yet.",
"save": "Save",
"saving": "Verifying…",
"saved": "SMS settings saved.",
"saveFailed": "The API key is invalid or saving failed."
}
},
"reports": {
"title": "Reports & analytics",
+22 -5
View File
@@ -500,19 +500,36 @@
"targetGroup": "گروه هدف",
"allCustomers": "همه مشتریان",
"send": "ارسال",
"usage": "مصرف این ماه",
"usage": "ارسال‌شده این ماه",
"unlimited": "نامحدود",
"sent": "ارسال شد",
"failed": "ناموفق",
"charCount": "{count} حرف",
"smsPartsHint": "{parts} پیامک",
"balance": "اعتبار حساب",
"balance": "اعتبار حساب شما",
"balanceAmount": "{amount} ریال",
"balanceNotConfigured": "Kavenegar پیکربندی نشده",
"balanceNotConfigured": "سرویس پیامک راه‌اندازی نشده",
"sender": "خط فرستنده",
"recipientsCount": "{count} مخاطب",
"sendConfirm": "ارسال به {count} نفر؟",
"sending": "در حال ارسال..."
"sending": "در حال ارسال...",
"byoHint": "پیامک با حساب و خط اختصاصی خود شما ارسال می‌شود — هزینه ارسال مستقیماً با اپراتور پیامک شماست.",
"notConfiguredOwner": "برای ارسال پیامک ابتدا کلید API و شماره خط کاوه‌نگار خود را در تنظیمات بالا ثبت کنید.",
"notConfiguredStaff": "سرویس پیامک هنوز توسط مدیر کافه راه‌اندازی نشده است.",
"settings": {
"title": "تنظیمات سرویس پیامک",
"hint": "از پنل کاوه‌نگار (kavenegar.com) کلید API بسازید و همراه شماره خط خود وارد کنید.",
"apiKey": "کلید API کاوه‌نگار",
"apiKeyPlaceholder": "API Key",
"senderNumber": "شماره خط ارسال",
"senderPlaceholder": "10004346...",
"configured": "سرویس پیامک فعال است.",
"notConfigured": "هنوز راه‌اندازی نشده.",
"save": "ذخیره",
"saving": "در حال بررسی…",
"saved": "تنظیمات پیامک ذخیره شد.",
"saveFailed": "کلید API نامعتبر است یا ذخیره ناموفق بود."
}
},
"reports": {
"title": "گزارش‌ها و تحلیل",
@@ -1481,7 +1498,7 @@
"title": "مدیریت سامانه",
"dashboard": "داشبورد",
"plans": "اشتراک و قیمت",
"integrations": "درگاه و پیامک",
"integrations": "درگاه پرداخت و AI",
"notifications": "اعلان‌ها",
"settings": "تنظیمات اپ",
"features": "قابلیت‌ها",