From fb23661080d55a874a098141cb7879ddae945588 Mon Sep 17 00:00:00 2001 From: Sharon Dcruz Date: Tue, 5 Aug 2025 13:20:00 +0000 Subject: [PATCH] expiry-using-payment (#81) Reviewed-on: https://git.cosqnet.com/cosqnet/fitlien-services/pulls/81 Reviewed-by: Dhansh A S Co-authored-by: Sharon Dcruz Co-committed-by: Sharon Dcruz --- .../src/notifications/membershipStatusNotifications.ts | 8 ++++---- functions/src/notifications/processNotification.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/src/notifications/membershipStatusNotifications.ts b/functions/src/notifications/membershipStatusNotifications.ts index bc908e2..bb0887b 100644 --- a/functions/src/notifications/membershipStatusNotifications.ts +++ b/functions/src/notifications/membershipStatusNotifications.ts @@ -274,6 +274,7 @@ async function processExpiredMembership( } } + async function sendPlanExpiredNotification( membershipId: string, membershipData: MembershipData @@ -311,6 +312,7 @@ async function sendPlanExpiredNotification( month: "long", day: "numeric", }); + } await app @@ -323,15 +325,13 @@ async function sendPlanExpiredNotification( notificationSent: false, timestamp: admin.firestore.FieldValue.serverTimestamp(), read: false, + readBy: [], data: { - title: "Plan Expired", - message: `The plan ${ - membershipData.subscription?.name || "Unknown Plan" - } for client ${clientName} has expired.`, planName: membershipData.subscription?.name || "Unknown Plan", clientName, membershipId, gymName, + ownerId: gymOwnerId, formattedExpiryDate: formattedDate, expiryDate: expiryDate ? admin.firestore.Timestamp.fromDate(expiryDate) diff --git a/functions/src/notifications/processNotification.ts b/functions/src/notifications/processNotification.ts index d232395..37b6865 100644 --- a/functions/src/notifications/processNotification.ts +++ b/functions/src/notifications/processNotification.ts @@ -240,7 +240,7 @@ function prepareNotificationMessage( title = notification.data?.title || "Plan Expired"; body = notification.data?.message || - `The plan ${notification.data?.planName} for client ${notification.data?.clientName} has expired.`; + `${notification.data?.clientName}/s subscription for plan ${notification.data?.planName} has expired.`; break; case "schedule_update":