import * as Yup from "yup";
import { StudentPackage, StudentPackageInitialValues } from "../../../types/studentPackage";
import { formateDateInitialValue } from "../../../utils/formateDateInitialValue";

export const getInitialValues = (
  objectToEdit: Partial<StudentPackage>,
): StudentPackageInitialValues => {
  return {
    id: objectToEdit?.id ?? null,
    package_id: objectToEdit?.package?.id ?? null,
    student_id: objectToEdit?.student?.user_id ?? null,
    activation_date: formateDateInitialValue(objectToEdit?.activation_date) ,
    expiration_date: formateDateInitialValue(objectToEdit?.expiration_date) ,

  };
};

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