fix: format prices in notifications, change partial payment label, and add session holding notify API

This commit is contained in:
2026-08-21 20:17:30 +03:30
parent 6839685a21
commit 4c07ca2ae1
9 changed files with 145 additions and 14 deletions
+5 -4
View File
@@ -28,7 +28,8 @@ const {
isPaidTransaction,
isCancelledTransaction,
isActiveTransaction,
sumPaidTransactions
sumPaidTransactions,
formatPrice
} = require('../../utils/paymentAmount');
const logger = require('../../utils/logger');
@@ -36,7 +37,7 @@ const PAYMENT_METHODS = new Set(['online', 'card', 'cash']);
const PAYMENT_STATUS_LABELS = {
pending: 'در انتظار پرداخت',
partial: 'پرداخت جزئی',
partial: یش پرداخت',
paid: 'پرداخت‌شده',
overdue: 'معوق'
};
@@ -112,7 +113,7 @@ const notifyTransactionRecorded = async (payment, transaction, source = {}) => {
phoneNumber: user.phoneNumber,
email: user.email,
subject: 'ثبت تراکنش',
body: `تراکنش ${transaction.uniqueCode || ''} به مبلغ ${transaction.amount} تومان ثبت شد.`,
body: `تراکنش ${transaction.uniqueCode || ''} به مبلغ ${formatPrice(transaction.amount)} تومان ثبت شد.`,
smsHandler: () => sendTransactionRecordedSms(user.phoneNumber, {
fullName: user.name || '',
amount: transaction.amount,
@@ -333,7 +334,7 @@ const createPayment = async (body, actorId = null) => {
phoneNumber: user.phoneNumber,
email: user.email,
subject: 'ایجاد صورتحساب',
body: `صورتحساب ${invoiceCode} به مبلغ ${getPayableAmount(payment)} تومان بابت «${courseName}» ایجاد شد.`,
body: `صورتحساب ${invoiceCode} به مبلغ ${formatPrice(getPayableAmount(payment))} تومان بابت «${courseName}» ایجاد شد.`,
smsHandler: () => sendInvoiceCreatedSms(user.phoneNumber, {
fullName: user.name || '',
amount: getPayableAmount(payment),