fix: format prices in notifications, change partial payment label, and add session holding notify API
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user