Skip to content

Commit 584f558

Browse files
refactor: move handleNotificationWhenNoSlots from trpc to features/slots (calcom#25538)
Move handleNotificationWhenNoSlots.ts and its test file from packages/trpc/server/routers/viewer/slots/ to packages/features/slots/ to resolve circular dependency issue where packages/features imports from packages/trpc. This file is not TRPC-specific and belongs in the features package. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent e10c4c1 commit 584f558

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/features/di/containers/NoSlotsNotification.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DI_TOKENS } from "@calcom/features/di/tokens";
22
import { redisModule } from "@calcom/features/redis/di/redisModule";
33
import { membershipRepositoryModule } from "@calcom/features/users/di/MembershipRepository.module";
44
import { prismaModule } from "@calcom/features/di/modules/Prisma";
5-
import type { NoSlotsNotificationService } from "@calcom/trpc/server/routers/viewer/slots/handleNotificationWhenNoSlots";
5+
import type { NoSlotsNotificationService } from "@calcom/features/slots/handleNotificationWhenNoSlots";
66

77
import { createContainer } from "../di";
88
import { noSlotsNotificationModule } from "../modules/NoSlotsNotification";

packages/features/di/modules/NoSlotsNotification.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { INoSlotsNotificationService } from "@calcom/trpc/server/routers/viewer/slots/handleNotificationWhenNoSlots";
2-
import { NoSlotsNotificationService } from "@calcom/trpc/server/routers/viewer/slots/handleNotificationWhenNoSlots";
1+
import type { INoSlotsNotificationService } from "@calcom/features/slots/handleNotificationWhenNoSlots";
2+
import { NoSlotsNotificationService } from "@calcom/features/slots/handleNotificationWhenNoSlots";
33

44
import { createModule } from "../di";
55
import { DI_TOKENS } from "../tokens";

packages/trpc/server/routers/viewer/slots/handleNotificationWhenNoSlots.test.ts renamed to packages/features/slots/handleNotificationWhenNoSlots.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import i18nMock from "../../../../../../tests/libs/__mocks__/libServerI18n";
2-
import prismaMock from "../../../../../../tests/libs/__mocks__/prismaMock";
1+
import i18nMock from "../../../tests/libs/__mocks__/libServerI18n";
2+
import prismaMock from "../../../tests/libs/__mocks__/prismaMock";
33

44
import { vi, describe, it, beforeAll, afterAll, expect, beforeEach, afterEach } from "vitest";
55

packages/trpc/server/routers/viewer/slots/handleNotificationWhenNoSlots.ts renamed to packages/features/slots/handleNotificationWhenNoSlots.ts

File renamed without changes.

packages/platform/libraries/slots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FilterHostsService } from "@calcom/features/bookings/lib/host-filtering
22
import { QualifiedHostsService } from "@calcom/features/bookings/lib/host-filtering/findQualifiedHostsWithDelegationCredentials";
33
import { BusyTimesService } from "@calcom/features/busyTimes/services/getBusyTimes";
44
import { validateRoundRobinSlotAvailability } from "@calcom/features/ee/round-robin/utils/validateRoundRobinSlotAvailability";
5-
import { NoSlotsNotificationService } from "@calcom/trpc/server/routers/viewer/slots/handleNotificationWhenNoSlots";
5+
import { NoSlotsNotificationService } from "@calcom/features/slots/handleNotificationWhenNoSlots";
66
import { AvailableSlotsService } from "@calcom/trpc/server/routers/viewer/slots/util";
77

88
export { AvailableSlotsService };

packages/trpc/server/routers/viewer/slots/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import type { CredentialForCalendarService } from "@calcom/types/Credential";
5858
import { TRPCError } from "@trpc/server";
5959

6060
import type { TGetScheduleInputSchema } from "./getSchedule.schema";
61-
import type { NoSlotsNotificationService } from "./handleNotificationWhenNoSlots";
61+
import type { NoSlotsNotificationService } from "@calcom/features/slots/handleNotificationWhenNoSlots";
6262
import type { GetScheduleOptions } from "./types";
6363

6464
const log = logger.getSubLogger({ prefix: ["[slots/util]"] });

0 commit comments

Comments
 (0)