refactor: move eventTypeSlug and eventTypeLocations to @calcom/lib/zod (#26115)

* refactor: move eventTypeSlug and eventTypeLocations to @calcom/lib/zod

Move shared Zod schemas from @calcom/prisma/zod-utils to @calcom/lib/zod
to avoid prisma imports in non-repository code.

Changes:
- Create packages/lib/zod/eventType.ts with eventTypeSlug, eventTypeLocations,
  and EventTypeLocation type
- Re-export from @calcom/prisma/zod-utils for backwards compatibility
- Update packages/features/eventtypes/lib/schemas.ts to import from @calcom/lib/zod
- Remove unused slugify function from zod-utils.ts

This allows files like schemas.ts to avoid importing from @calcom/prisma,
which helps maintain the architectural boundary that prisma should only
be imported in repository code.

Co-Authored-By: [email protected] <[email protected]>

* refactor: remove barrel file and use explicit imports

Address PR feedback:
- Delete packages/lib/zod/index.ts barrel file
- Update imports to use explicit path @calcom/lib/zod/eventType
- Simplify EventTypeLocation type to use z.infer

Co-Authored-By: [email protected] <[email protected]>

* refactor: use explicit type definition with z.ZodType for eventTypeLocations

Co-Authored-By: [email protected] <[email protected]>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Keith WilliamsandDevin AI authored and GitHub committed 2025-12-30 13:03:10 -03:00
1 parent 319d9858d4
commit bc6ff386a4
3 files changed
+55 -62

No files matched your search

+2 -1
View File
@@ -1,7 +1,8 @@
import { z } from "zod";
import { eventTypeLocations, eventTypeSlug } from "@calcom/lib/zod/eventType";
import { SchedulingType } from "@calcom/prisma/enums";
import { eventTypeLocations, EventTypeMetaDataSchema, eventTypeSlug } from "@calcom/prisma/zod-utils";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
type CalVideoSettings =
| {