import { z } from "zod";
import { Types } from "mongoose";

const objectIdSchema = z
  .string()
  .min(1, "ID is required")
  .refine((id) => Types.ObjectId.isValid(id), "Invalid ObjectId");

export const createBlockSchema = z.object({
  userId: objectIdSchema,
});

export const blockUserIdParamSchema = z.object({
  userId: objectIdSchema,
});

export const blockListSchema = z.object({
  page: z.coerce.number().int().positive().default(1),
  limit: z.coerce.number().int().positive().max(100).default(20),
});
