import { z } from "zod"

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

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

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

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

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

    collectionTokens: collectionTokensSchema,
})

export type UserAdd = z.infer<typeof userAddSchema>
