const yup = require("yup");
const moment = require('moment');


export const updateUsersDataWithoutPasswordSchema = yup.object().shape({
    name:
        yup
            .string()
            .matches(/^[аa-яzАA-ЯZ0-9]{3,30}$/)
            .required(),

    surname:
        yup
            .string()
            .matches(/^[аa-яzАA-ЯZ0-9]{3,30}$/)
            .required(),

    email:
        yup
            .string()
            .email(),

    birthDay:
        yup
            .date()
            .min(new Date(1990, 0, 1)),
    // .max(moment().subtract(3, 'years').format('YYYY-MM-DD')),

    phone:
        yup
            .string()
            .min(19)
            .required(),

    street:
        yup
            .string()
            .max(25)
            .required(),

    home:
        yup
            .string()
            .max(8)
            .required(),

    city:
        yup
            .string()
            .min(6)
            .max(40)
            .required(),

    postIndex:
        yup
            .number()
            .min(10000)
            .max(99999)
            .required()

});