Show SMS money labels in tomans; keep remote APIs in rials.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -228,9 +228,9 @@ export class SmsService {
|
||||
});
|
||||
|
||||
const tenant = await this.requireTenant(tenantId);
|
||||
const amountLabel = dto.amountRials.toLocaleString('fa-IR');
|
||||
const amountLabel = this.formatMoney(dto.amountRials);
|
||||
this.notify.notifyAdmins(
|
||||
`سوپرادمین: کیف پول SMS «${tenant.nameFa}» ${dto.amountRials > 0 ? 'شارژ' : 'اصلاح'} شد (${amountLabel} ریال). موجودی: ${updated.balanceRials.toLocaleString('fa-IR')}`,
|
||||
`سوپرادمین: کیف پول SMS «${tenant.nameFa}» ${dto.amountRials > 0 ? 'شارژ' : 'اصلاح'} شد (${amountLabel}). موجودی: ${this.formatMoney(updated.balanceRials)}`,
|
||||
);
|
||||
|
||||
return this.getAccount(tenantId);
|
||||
@@ -863,8 +863,10 @@ export class SmsService {
|
||||
return 'healthy';
|
||||
}
|
||||
|
||||
/** Human-facing SuperAdmin label: storage is rial, display is toman. */
|
||||
private formatMoney(value: number) {
|
||||
return `${new Intl.NumberFormat('fa-IR').format(value)} ریال`;
|
||||
const toman = Math.trunc(value / 10);
|
||||
return `${new Intl.NumberFormat('fa-IR').format(toman)} تومان`;
|
||||
}
|
||||
|
||||
private chargeInfoOf(account: SmsAccount) {
|
||||
|
||||
Reference in New Issue
Block a user