Files
hounam-submit-form-frontend/ui/forms/skillsForm/validation/index.ts
2026-06-02 17:08:52 +03:30

31 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import * as Yup from "yup";
export const SkillsValidationSchema = Yup.object().shape({
computerSkill: Yup.object().shape({
pcUsage: Yup.string().optional(),
word: Yup.string().optional(),
excel: Yup.string().optional(),
powerPoint: Yup.string().optional(),
rahkaran: Yup.string().optional(),
kasra: Yup.string().optional(),
didgah: Yup.string().optional(),
his: Yup.string().optional(),
otherSoftware: Yup.string().max(1000, "توضیحات نمی‌تواند بیش از ۱۰۰۰ کاراکتر باشد").optional(),
}),
languageSkill: Yup.object().shape({
englishLevel: Yup.string().required("سطح زبان انگلیسی الزامی است"),
englishDescription: Yup.string().optional(),
hasEnglishCertificate: Yup.boolean(),
englishCertificateType: Yup.string().when("hasEnglishCertificate", {
is: true,
then: (schema) => schema.required("انتخاب نوع مدرک زبان الزامی است"),
otherwise: (schema) => schema.optional(),
}),
arabicLevel: Yup.string().required("سطح زبان عربی الزامی است"),
arabicDescription: Yup.string().optional(),
otherLanguagesDescription: Yup.string().optional(),
dialectsDescription: Yup.string().optional(),
otherSkills: Yup.string().optional(),
}),
});