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:
hamed
2026-07-01 11:53:16 +03:30
parent 9d8d1014f1
commit b366baa64c
11 changed files with 352 additions and 92 deletions
+3 -1
View File
@@ -29,6 +29,8 @@ use OpenApi\Attributes as OA;
#[IsGranted('IS_AUTHENTICATED_FULLY')]
class SmsWalletController extends BaseController
{
private const SMS_PRICE_RIALS = 500;
public function __construct(
private readonly SmsWalletService $walletService,
private readonly SmsWalletRepository $walletRepo,
@@ -53,7 +55,7 @@ class SmsWalletController extends BaseController
}
$balanceRials = $this->walletService->getBalance($entityType, $entityId);
$smsPriceRials = (int) ($this->configRepo->get('sms_price_rials') ?? 500);
$smsPriceRials = self::SMS_PRICE_RIALS;
$estimatedSms = $smsPriceRials > 0 ? (int) floor($balanceRials / $smsPriceRials) : 0;
return $this->success([