feat: update sms units to kilogram transactions notes price source label and trading closed message

This commit is contained in:
2026-11-18 18:25:34 +03:30
parent 0004192cbc
commit 3ce2c48438
19 changed files with 382 additions and 49 deletions
@@ -28,12 +28,25 @@ class SmsGatewayService
];
}
/**
* اصلاح عبارت «گرم» به «کیلوگرم» در متن تمامی پیامک‌های بورس مس
*/
public static function normalizeSmsWeightUnit(string $message): string
{
return preg_replace(
'/(?<![\p{L}\p{N}]|کیلو|کیلو\x{200c})گرم(?=[ی\s\n\r:،.,!؟\(\)\[\]\/\-–—]|$)/u',
'کیلو$0',
$message
) ?? $message;
}
public function send(
string $to,
string $message,
?string $source = null,
bool $isAlert = false
): SmsSendResult {
$message = self::normalizeSmsWeightUnit($message);
$config = $this->buildProviderConfig();
$useSuperAdmin = $this->superAdminSms->enabled();
$billingOperational = SmsWalletService::isBillingOperational() || $useSuperAdmin;