import * as Yup from "yup";

export const getInitialValues = (objectToEdit: any): any => {
  // console.log(objectToEdit,"objectToEdit");

  return {
    id: objectToEdit?.id ?? null,
    registration_record_id: objectToEdit?.registration_record_id ?? null,
    // exam_id: objectToEdit?.exam_id ?? null,
    value: objectToEdit?.value ?? null,
  };
};

export const getValidationSchema = () => {
  // validate input
  return Yup.object().shape({
    registration_record_id: Yup.string().required("validation.required"),
    // exam_id: Yup.string().required("النوع مطلوب"),
    value: Yup.number()
      .required("validation.required")
      .typeError("validation.Must_be_a_number"),
  });
};
