change some files
This commit is contained in:
26
ui/forms/jobInfo/validation/index.ts
Normal file
26
ui/forms/jobInfo/validation/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import * as Yup from "yup";
|
||||
|
||||
export const JobInfoValidationSchema = Yup.object().shape({
|
||||
readyToWorkDate: Yup.string().required("تاریخ آمادگی برای شروع کار الزامی است"),
|
||||
retirementStatus: Yup.string().required("وضعیت بازنشستگی الزامی است"),
|
||||
isCurrentEmployee: Yup.boolean(),
|
||||
hasPastCooperation: Yup.boolean(),
|
||||
isCurrentlyEmployed: Yup.boolean(),
|
||||
dualJobInterest: Yup.boolean(),
|
||||
isMilitary: Yup.boolean(),
|
||||
hasInsurance: Yup.boolean(),
|
||||
insuranceType: Yup.string().when("hasInsurance", {
|
||||
is: true,
|
||||
then: (schema) => schema.required("نوع بیمه الزامی است"),
|
||||
otherwise: (schema) => schema.optional(),
|
||||
}),
|
||||
totalInsuranceYears: Yup.number().when("hasInsurance", {
|
||||
is: true,
|
||||
then: (schema) =>
|
||||
schema
|
||||
.typeError("باید عدد باشد")
|
||||
.required("تعداد سال بیمه الزامی است")
|
||||
.min(0, "نمیتواند منفی باشد"),
|
||||
otherwise: (schema) => schema.optional(),
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user