Deposit
This commit is contained in:
@@ -271,6 +271,34 @@ export const NOTIFICATION_SCENARIOS: NotificationScenarioDefinition[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: NotificationScenarioKey.DEPOSIT_RECEIPT_SUBMITTED,
|
||||
label: 'ثبت رسید بیعانه',
|
||||
description: 'اعلان برای سالن پس از بارگذاری رسید بیعانه توسط مشتری',
|
||||
defaultTitle: 'رسید بیعانه ثبت شد',
|
||||
defaultBody:
|
||||
'مشتری {customerName} رسید پرداخت بیعانه {depositAmount} تومان را ثبت کرد. برای بررسی وارد شوید.',
|
||||
variables: [
|
||||
{
|
||||
key: 'customerName',
|
||||
label: 'نام مشتری',
|
||||
description: 'نام و نام خانوادگی مشتری',
|
||||
sampleValue: 'مریم احمدی',
|
||||
},
|
||||
{
|
||||
key: 'salonName',
|
||||
label: 'نام سالن',
|
||||
description: 'نام سالن زیبایی',
|
||||
sampleValue: 'سالن زیبایی رز',
|
||||
},
|
||||
{
|
||||
key: 'depositAmount',
|
||||
label: 'مبلغ بیعانه',
|
||||
description: 'مبلغ بیعانه به تومان',
|
||||
sampleValue: '۵۰۰,۰۰۰',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const NOTIFICATION_SCENARIO_MAP = new Map(
|
||||
|
||||
@@ -5,4 +5,5 @@ export enum NotificationScenarioKey {
|
||||
RESERVE_REMINDER_SENT = 'reserve_reminder_sent',
|
||||
CAMPAIGN_SENT = 'campaign_sent',
|
||||
CAMPAIGN_FAILED = 'campaign_failed',
|
||||
DEPOSIT_RECEIPT_SUBMITTED = 'deposit_receipt_submitted',
|
||||
}
|
||||
|
||||
@@ -78,6 +78,29 @@ export class SalonNotificationsService {
|
||||
});
|
||||
}
|
||||
|
||||
async notifyDepositReceiptSubmitted(params: {
|
||||
salonId: string;
|
||||
salonOwnerId: string;
|
||||
salonName: string;
|
||||
customerName: string;
|
||||
depositAmount: number;
|
||||
paymentId: string;
|
||||
}): Promise<void> {
|
||||
await this.safeCreate({
|
||||
salonId: params.salonId,
|
||||
userId: params.salonOwnerId,
|
||||
key: NotificationScenarioKey.DEPOSIT_RECEIPT_SUBMITTED,
|
||||
variables: {
|
||||
customerName: params.customerName,
|
||||
salonName: params.salonName,
|
||||
depositAmount: params.depositAmount.toLocaleString('fa-IR'),
|
||||
},
|
||||
link: `/deposits/${params.paymentId}/review`,
|
||||
relatedEntityType: 'payment',
|
||||
relatedEntityId: params.paymentId,
|
||||
});
|
||||
}
|
||||
|
||||
async notifyCampaignSent(params: {
|
||||
salon: Salon;
|
||||
type: CampaignType;
|
||||
|
||||
Reference in New Issue
Block a user