feat: checkbox to count managed events for team-wide limits (#16923)

Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
Carina WollendorferandCarinaWolli authored and GitHub committed 2024-10-07 11:36:50 -04:00
1 parent 0d757039f7
commit b5fa43f086
17 files changed
+266 -61

No files matched your search

@@ -153,6 +153,7 @@ export type InputEventType = {
users?: { id: number }[];
hosts?: InputHost[];
schedulingType?: SchedulingType;
parent?: { id: number };
beforeEventBuffer?: number;
afterEventBuffer?: number;
teamId?: number | null;
@@ -160,6 +161,7 @@ export type InputEventType = {
id?: number | null;
parentId?: number | null;
bookingLimits?: IntervalLimit;
includeManagedEventsInLimits?: boolean;
};
requiresConfirmation?: boolean;
destinationCalendar?: Prisma.DestinationCalendarCreateInput;
@@ -246,7 +248,7 @@ export async function addEventTypesToDb(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
schedule?: any;
metadata?: any;
team?: { id?: number | null; bookingLimits?: IntervalLimit };
team?: { id?: number | null; bookingLimits?: IntervalLimit; includeManagedEventsInLimits?: boolean };
})[]
) {
log.silly("TestData: Add EventTypes to DB", JSON.stringify(eventTypes));
@@ -292,6 +294,7 @@ export async function addEventTypesToDb(
data: {
id: eventType.team?.id,
bookingLimits: eventType.team?.bookingLimits,
includeManagedEventsInLimits: eventType.team?.includeManagedEventsInLimits,
name: "",
},
});
@@ -323,6 +326,7 @@ export async function addEventTypes(eventTypes: InputEventType[], usersStore: In
beforeEventBuffer: 0,
afterEventBuffer: 0,
bookingLimits: {},
includeManagedEventsInLimits: false,
schedulingType: null,
length: 15,
//TODO: What is the purpose of periodStartDate and periodEndDate? Test these?
@@ -378,6 +382,7 @@ export async function addEventTypes(eventTypes: InputEventType[], usersStore: In
: eventType.schedule,
owner: eventType.owner ? { connect: { id: eventType.owner } } : undefined,
schedulingType: eventType.schedulingType,
parent: eventType.parent ? { connect: { id: eventType.parent.id } } : undefined,
rescheduleWithSameRoundRobinHost: eventType.rescheduleWithSameRoundRobinHost,
};
});
@@ -1285,6 +1290,7 @@ export function getScenarioData(
id: eventType.teamId ?? eventType.team?.id,
parentId: org ? org.id : null,
bookingLimits: eventType?.team?.bookingLimits,
includeManagedEventsInLimits: eventType?.team?.includeManagedEventsInLimits,
},
title: `Test Event Type - ${index + 1}`,
description: `It's a test event type - ${index + 1}`,