expiry-using-payment (#81)
All checks were successful
Deploy FitLien services to Dev / Deploy to Dev (push) Successful in 3m54s
All checks were successful
Deploy FitLien services to Dev / Deploy to Dev (push) Successful in 3m54s
Reviewed-on: #81 Reviewed-by: Dhansh A S <dhanshas@cosq.net> Co-authored-by: Sharon Dcruz <sharondcruz@cosq.net> Co-committed-by: Sharon Dcruz <sharondcruz@cosq.net>
This commit is contained in:
parent
cba945c282
commit
fb23661080
@ -274,6 +274,7 @@ async function processExpiredMembership(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function sendPlanExpiredNotification(
|
async function sendPlanExpiredNotification(
|
||||||
membershipId: string,
|
membershipId: string,
|
||||||
membershipData: MembershipData
|
membershipData: MembershipData
|
||||||
@ -311,6 +312,7 @@ async function sendPlanExpiredNotification(
|
|||||||
month: "long",
|
month: "long",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await app
|
await app
|
||||||
@ -323,15 +325,13 @@ async function sendPlanExpiredNotification(
|
|||||||
notificationSent: false,
|
notificationSent: false,
|
||||||
timestamp: admin.firestore.FieldValue.serverTimestamp(),
|
timestamp: admin.firestore.FieldValue.serverTimestamp(),
|
||||||
read: false,
|
read: false,
|
||||||
|
readBy: [],
|
||||||
data: {
|
data: {
|
||||||
title: "Plan Expired",
|
|
||||||
message: `The plan ${
|
|
||||||
membershipData.subscription?.name || "Unknown Plan"
|
|
||||||
} for client ${clientName} has expired.`,
|
|
||||||
planName: membershipData.subscription?.name || "Unknown Plan",
|
planName: membershipData.subscription?.name || "Unknown Plan",
|
||||||
clientName,
|
clientName,
|
||||||
membershipId,
|
membershipId,
|
||||||
gymName,
|
gymName,
|
||||||
|
ownerId: gymOwnerId,
|
||||||
formattedExpiryDate: formattedDate,
|
formattedExpiryDate: formattedDate,
|
||||||
expiryDate: expiryDate
|
expiryDate: expiryDate
|
||||||
? admin.firestore.Timestamp.fromDate(expiryDate)
|
? admin.firestore.Timestamp.fromDate(expiryDate)
|
||||||
|
|||||||
@ -240,7 +240,7 @@ function prepareNotificationMessage(
|
|||||||
title = notification.data?.title || "Plan Expired";
|
title = notification.data?.title || "Plan Expired";
|
||||||
body =
|
body =
|
||||||
notification.data?.message ||
|
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;
|
break;
|
||||||
|
|
||||||
case "schedule_update":
|
case "schedule_update":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user