feat: block pending meetings for requires confirmation (#16335)

* feat: block pending meetings for requires confirmation

* add i18n

* fix:typecheck

* fix(requires-confirmation-block): Fixes type error

* fix(requires-confirmation-block): Fixes type error

* Tweak to set BookingWhereInput as the explicit type instead of as

* fix: type error

---------

Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
sean-brydonandAlex van Andel authored and GitHub committed 2024-08-26 09:54:58 -04:00
1 parent 2fb4289798
commit c8e20b0c57
14 files changed
+213 -62

No files matched your search

+14 -1
View File
@@ -94,13 +94,14 @@ export async function getBusyTimes(params: {
const endTimeAdjustedWithMaxBuffer = dayjs(endTimeDate).add(maxBuffer, "minute").toDate();
// startTime is less than endTimeDate and endTime grater than startTimeDate
const sharedQuery = {
const sharedQuery: Prisma.BookingWhereInput = {
startTime: { lte: endTimeAdjustedWithMaxBuffer },
endTime: { gte: startTimeAdjustedWithMaxBuffer },
status: {
in: [BookingStatus.ACCEPTED],
},
};
// INFO: Refactored to allow this method to take in a list of current bookings for the user.
// Will keep support for retrieving a user's bookings if the caller does not already supply them.
// This function is called from multiple places but we aren't refactoring all of them at this moment
@@ -124,6 +125,18 @@ export async function getBusyTimes(params: {
},
},
},
{
startTime: { lte: endTimeDate },
endTime: { gte: startTimeDate },
eventType: {
id: eventTypeId,
requiresConfirmation: true,
requiresConfirmationWillBlockSlot: true,
},
status: {
in: [BookingStatus.PENDING],
},
},
],
},
select: {