feat: Attribute filter/Segment for Round Robin hosts (#17361)

Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
Hariom BalharaandCarinaWolli authored and GitHub committed 2024-11-20 10:22:53 +05:30
1 parent e3abd35ba7
commit 82e52a1948
78 files changed
+2454 -1122

No files matched your search

@@ -142,6 +142,8 @@ describe("handleChildrenEventTypes", () => {
recurringEvent: undefined,
eventTypeColor: undefined,
userId: 4,
rrSegmentQueryValue: undefined,
assignRRMembersUsingSegment: false,
},
});
expect(result.newUserIds).toEqual([4]);
@@ -187,6 +189,8 @@ describe("handleChildrenEventTypes", () => {
expect(prismaMock.eventType.update).toHaveBeenCalledWith({
data: {
...rest,
assignRRMembersUsingSegment: undefined,
rrSegmentQueryValue: undefined,
locations: [],
scheduleId: null,
lockTimeZoneToggleOnBookingPage: false,
@@ -299,6 +303,8 @@ describe("handleChildrenEventTypes", () => {
userId: 4,
workflows: undefined,
hashedLink: undefined,
rrSegmentQueryValue: undefined,
assignRRMembersUsingSegment: false,
},
});
expect(result.newUserIds).toEqual([4]);
@@ -343,6 +349,8 @@ describe("handleChildrenEventTypes", () => {
expect(prismaMock.eventType.update).toHaveBeenCalledWith({
data: {
...rest,
assignRRMembersUsingSegment: undefined,
rrSegmentQueryValue: undefined,
locations: [],
hashedLink: {
deleteMany: {},
@@ -405,6 +413,7 @@ describe("handleChildrenEventTypes", () => {
profileId: null,
updatedValues: {},
});
expect(prismaMock.eventType.create).toHaveBeenCalledWith({
data: {
...evType,
@@ -429,6 +438,8 @@ describe("handleChildrenEventTypes", () => {
create: [{ workflowId: 11 }],
},
hashedLink: undefined,
rrSegmentQueryValue: undefined,
assignRRMembersUsingSegment: false,
},
});
const { profileId, ...rest } = evType;
@@ -437,6 +448,8 @@ describe("handleChildrenEventTypes", () => {
data: {
...rest,
locations: [],
assignRRMembersUsingSegment: undefined,
rrSegmentQueryValue: undefined,
lockTimeZoneToggleOnBookingPage: false,
requiresBookerEmailVerification: false,
hashedLink: {
@@ -7,6 +7,7 @@ import type { Prisma } from "@prisma/client";
import type { WebhookTriggerEvents } from "@prisma/client";
import type Stripe from "stripe";
import { v4 as uuidv4 } from "uuid";
import { vi } from "vitest";
import "vitest-fetch-mock";
import type { z } from "zod";
@@ -35,6 +36,11 @@ import type { EventBusyDate, IntervalLimit } from "@calcom/types/Calendar";
import { getMockPaymentService } from "./MockPaymentService";
import type { getMockRequestDataForBooking } from "./getMockRequestDataForBooking";
// We don't need to test it. Also, it causes Formbricks error when imported
vi.mock("@calcom/lib/raqb/findTeamMembersMatchingAttributeLogic", () => ({
default: {},
}));
type Fields = z.infer<typeof eventTypeBookingFields>;
logger.settings.minLevel = 1;