/**
 * 私密消息解锁请求
 */
import { z } from "zod";

import { ChatLockTypeSchema } from "../chat_lock_type";

export const UnlockPrivateRequestSchema = z
  .object({
    characterId: z.string().min(1),
    messageId: z.string().min(1).optional(),
    lockType: ChatLockTypeSchema.optional(),
    clientLockId: z.string().min(1).optional(),
  })
  .refine((value) => value.messageId || value.lockType, {
    message: "messageId or lockType is required",
  })
  .readonly();

export type UnlockPrivateRequestInput = z.input<
  typeof UnlockPrivateRequestSchema
>;
export type UnlockPrivateRequestData = z.output<
  typeof UnlockPrivateRequestSchema
>;

export type UnlockPrivateRequest = UnlockPrivateRequestData;
