trial
This commit is contained in:
@@ -299,6 +299,35 @@ export const NOTIFICATION_SCENARIOS: NotificationScenarioDefinition[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: NotificationScenarioKey.SUBSCRIPTION_EXPIRED,
|
||||
label: 'پایان دوره اشتراک یا آزمایشی',
|
||||
description:
|
||||
'اعلان برای سالن هنگامی که دوره آزمایشی رایگان یا اشتراک خریداریشده به پایان میرسد',
|
||||
defaultTitle: 'دوره {planLabel} شما به پایان رسید',
|
||||
defaultBody:
|
||||
'{planLabel} سالن {salonName} در تاریخ {endDate} به پایان رسید. برای ادامه استفاده از امکانات و ارسال پیامک، اشتراک خود را تهیه کنید.',
|
||||
variables: [
|
||||
{
|
||||
key: 'salonName',
|
||||
label: 'نام سالن',
|
||||
description: 'نام سالن زیبایی',
|
||||
sampleValue: 'سالن زیبایی رز',
|
||||
},
|
||||
{
|
||||
key: 'planLabel',
|
||||
label: 'نوع دوره',
|
||||
description: 'دوره آزمایشی رایگان یا نام پلن خریداریشده',
|
||||
sampleValue: 'دوره آزمایشی رایگان',
|
||||
},
|
||||
{
|
||||
key: 'endDate',
|
||||
label: 'تاریخ پایان',
|
||||
description: 'تاریخ پایان دوره',
|
||||
sampleValue: '۱۴۰۴/۰۴/۲۰',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const NOTIFICATION_SCENARIO_MAP = new Map(
|
||||
|
||||
@@ -6,4 +6,5 @@ export enum NotificationScenarioKey {
|
||||
CAMPAIGN_SENT = 'campaign_sent',
|
||||
CAMPAIGN_FAILED = 'campaign_failed',
|
||||
DEPOSIT_RECEIPT_SUBMITTED = 'deposit_receipt_submitted',
|
||||
SUBSCRIPTION_EXPIRED = 'subscription_expired',
|
||||
}
|
||||
|
||||
@@ -158,6 +158,28 @@ export class SalonNotificationsService {
|
||||
});
|
||||
}
|
||||
|
||||
async notifySubscriptionExpired(params: {
|
||||
salonId: string;
|
||||
salonOwnerId: string;
|
||||
salonName: string;
|
||||
planLabel: string;
|
||||
endDate: Date;
|
||||
}): Promise<void> {
|
||||
await this.safeCreate({
|
||||
salonId: params.salonId,
|
||||
userId: params.salonOwnerId,
|
||||
key: NotificationScenarioKey.SUBSCRIPTION_EXPIRED,
|
||||
variables: {
|
||||
salonName: params.salonName,
|
||||
planLabel: params.planLabel,
|
||||
endDate: params.endDate.toLocaleDateString('fa-IR'),
|
||||
},
|
||||
link: '/subscription',
|
||||
relatedEntityType: 'subscription',
|
||||
relatedEntityId: null,
|
||||
});
|
||||
}
|
||||
|
||||
private async notifyForReserve(
|
||||
reserveId: string,
|
||||
key: NotificationScenarioKey,
|
||||
|
||||
Reference in New Issue
Block a user