import { z } from "zod"

export const tokenSchema = z.object({
    prefix: z.string().min(1, "Prefix is required").optional(),
    token: z.string().min(1, "Token is required").optional(),
})

export const collectionTokensSchema = z.object({
    default: z.string().optional(),
    tokens: z.array(tokenSchema).optional()
})

export const userUpdateSchema = z.object({
    expiryStarts: z.string().optional(),
    expiryEnds: z.string().optional(),

    isConfirmed: z.boolean().optional(),
    isNotificationSend: z.boolean().optional(),

    tag: z.string().optional(),
    email: z.string().email().optional(),
    phone: z.string().min(5).optional(),
    person: z.string().optional(),

    collectionTokens: collectionTokensSchema,
})

export type UserUpdate = z.infer<typeof userUpdateSchema>
