import {z} from "zod";

export const PrefixSchema = z.object({
    name: z.string().startsWith("PREFIX_"),
    colorCode: z.string().length(2).startsWith("§"),
    chatPrefix: z.string()
})

export type Prefix = z.infer<typeof PrefixSchema>;

export const PermsSchema = z.object({
    perms: z.array(z.string()),
    prefixes: z.record(PrefixSchema),
})

export type Perms = z.infer<typeof PermsSchema>;

export const UserPermsSchema = z.object({
    prefix: PrefixSchema,
    perms: z.array(z.string()),
})

export type UserPerms = z.infer<typeof UserPermsSchema>;
