Show SMS money labels in tomans; keep remote APIs in rials.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-08 13:27:31 +03:30
co-authored by Cursor
parent db66a44527
commit f9b77ceaac
2 changed files with 7 additions and 4 deletions
+5 -3
View File
@@ -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) {