feat: update sms units to kilogram transactions notes price source label and trading closed message
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user