import {z} from "zod";

export const titlesOptions = [
    {label: "Dr", value: "Dr"},
    {label: "Mr", value: "Mr"},
    {label: "Mrs", value: "Mrs"},
    {label: "Miss", value: "Miss"},
]

export const skillsOptions = [
    {label: "Cognitive-behavioral", value: "Cognitive-behavioral"},
    {label: "Crisis Management", value: "Crisis Management"},
    {label: "Case management", value: "Case management"},
];

export const languageOptions = [
    {label: "SiSwati", value: "SiSwati"},
    {label: "English", value: "English"},
    {label: "French", value: "French"},
    {label: "Spanish", value: "Spanish"},
    {label: "Other", value: "Other"},
];

export const AddClientFormSchema = z.object({
    // personal information
    title: z.string({
        required_error: "Client's title is required."
    }).min(1, {
        message: "Client's title is required."
    }),

    first_name: z.string({
        required_error: "Client first name required.",
    }).min(3, {
        message: "First name should be at least 3 characters long."
    }),

    last_name: z.string({
        required_error: "Client last name required.",
    }).min(3, {
        message: "Last name should be at least 3 characters long."
    }),

    email: z.string({
        required_error: "Client email required.",
    }).min(3, {
        message: "Email should be at least 3 characters long."
    }).email("Enter a valid email address."),

    phone_number: z.string({
        required_error: "Phone number required.",
    }).min(3, {
        message: "Enter a valid phone number."
    }),

    emergency_contact: z.string({
        required_error: "Client's emergency contact required.",
    }).min(3, {
        message: "Enter a valid emergency contact number."
    }).optional(),

    physical_address: z.string({
        required_error: "Physical address required.",
    }).min(3, {
        message: "Physical address should be at least 3 characters long."
    }).optional(),

    dob: z.date({
        required_error: "A date of birth is required.",
    }),

    // specialization
    specialized_skills: z.string().array().min(1, {
        message: "Select at least one specialized skill."
    }).optional(),
    languages: z.string().array().min(1, {
        message: "Select at least one language"
    }),

    // professional information
    nursing_licence_number: z.string({
        required_error: "Nursing licence number is required."
    }).min(1, {
        message: "Nursing licence number required."
    }),
    qualification_earned: z.string({
        required_error: "Field is required"
    }).min(1, {
        message: "Enter the most recent, highest qualification client holds."
    }),
    nursing_school: z.string({
        required_error: "Nursing school attended required."
    }).min(1, {
        message: "Nursing school attended required."
    }),
    graduation_date: z.date({
        required_error: "Graduation date required."
    })

})


export type AddNewClientProps = {
    title: string;
    first_name: string;
    last_name: string;
    email: string;
    phone_number: string;
    emergency_contact?: string | null;
    physical_address?: string;
    dob: Date;
    specialized_skills?: string[],
    languages?: string[],
    nursing_licence_number: string;
    qualification_earned: string;
    nursing_school: string;
    graduation_date: Date;
}