import * as Yup from "yup";
import { Student, StudentInitialValues } from "../../../types/Student";

export const getInitialValues = (
  objectToEdit: Partial<Student>,
): StudentInitialValues => {
  return {
    id: objectToEdit?.id,
    first_name: objectToEdit?.first_name ?? "",
    last_name: objectToEdit?.last_name ?? "",
    username: objectToEdit?.user?.username  ?? null ,
    password:  null ,
  };
};

export const getValidationSchema = () => {
  // validate input
  return Yup.object().shape({
    name: Yup.string().required("validation.required"),
  });
};
