hunk.code_window:   .object({
       title: z.string().optional(),
       slug: z.string().optional(),
       length: z.number().int().optional(),
     })
     .strict();
   export const schemaEventTypeEditBodyParams = schemaEventTypeBaseBodyParams.merge(schemaEventTypeEditParams);
   export const schemaEventTypeReadPublic = EventType.pick({
  
hunk.labels: keep keep keep add keep keep keep keep keep
hunk.after_edit:     seatsPerTimeSlot: z.number().optional(),
       seatsShowAttendees: z.boolean().optional(),
  
hunk.file_path: lib/validations/event-type.ts
hunk.type: add
file: import type { Prisma } from "@prisma/client";
  import type { NextApiRequest } from "next";
  
  import { HttpError } from "@calcom/lib/http-error";
  import { defaultResponder } from "@calcom/lib/server";
  
  import { schemaEventTypeCreateBodyParams, schemaEventTypeReadPublic } from "~/lib/validations/event-type";
  
  /**
   * @swagger
   * /event-types:
   *   post:
   *     summary: Creates a new event type
   *     operationId: addEventType
   *     requestBody:
   *       description: Create a new event-type related to your user or team
   *       required: true
   *       content:
   *         application/json:
   *           schema:
   *             type: object
   *             required:
   *               - title
   *               - slug
   *               - length
   *               - metadata
   *             properties:
   *               length:
   *                 type: number
   *                 example: 30
   *               metadata:
   *                 type: object
   *                 example: {"smartContractAddress": "0x1234567890123456789012345678901234567890"}
   *               title:
   *                 type: string
   *                 example: My Event
   *               slug:
   *                 type: string
   *                 example: my-event
   *     tags:
   *     - event-types
   *     externalDocs:
   *        url: https://docs.cal.com/event-types
   *     responses:
   *       201:
   *         description: OK, event type created
   *       400:
   *        description: Bad request. EventType body is invalid.
   *       401:
   *        description: Authorization information is missing or invalid.
   */
  async function postHandler(req: NextApiRequest) {
    const { userId, isAdmin, prisma } = req;
    const body = schemaEventTypeCreateBodyParams.parse(req.body);
    let args: Prisma.EventTypeCreateArgs = { data: { ...body, userId, users: { connect: { id: userId } } } };
  
    await checkPermissions(req);
  
    if (isAdmin && body.userId) args = { data: { ...body, users: { connect: { id: body.userId } } } };
  
    const data = await prisma.eventType.create(args);
  
    return {
      event_type: schemaEventTypeReadPublic.parse(data),
      message: "Event type created successfully",
    };
  }
  
  async function checkPermissions(req: NextApiRequest) {
    const { isAdmin } = req;
    const body = schemaEventTypeCreateBodyParams.parse(req.body);
    /* Non-admin users can only create event types for themselves */
    if (!isAdmin && body.userId)
      throw new HttpError({ statusCode: 401, message: "ADMIN required for `userId`" });
    /* Admin users are required to pass in a userId */
    if (isAdmin && !body.userId) throw new HttpError({ statusCode: 400, message: "`userId` required" });
  }
  
  export default defaultResponder(postHandler);
  