Skip to content

Scheduling infrastructure for absolutely everyone.

fix: don't send request reminder for unpaid bookings (#10325)

nicktrn0d1ab6ade94f
diff --git a/apps/web/pages/api/cron/bookingReminder.ts b/apps/web/pages/api/cron/bookingReminder.ts
index 4c99aded044..ab511b5a427 100644
--- a/apps/web/pages/api/cron/bookingReminder.ts
+++ b/apps/web/pages/api/cron/bookingReminder.ts
@@ -31,6 +31,17 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
},
// Only send reminders if the event hasn't finished
endTime: { gte: new Date() },
+ OR: [
+ // no payment required
+ {
+ payment: { none: {} },
+ },
+ // paid but awaiting approval
+ {
+ payment: { some: {} },
+ paid: true,
+ },
+ ],
},
select: {
...bookingMinimalSelect,