legal person loan request part 1

This commit is contained in:
2024-04-13 16:30:33 +03:30
parent a3b409a01a
commit 1f82fc7cf8
3 changed files with 55 additions and 9 deletions

View File

@@ -48,6 +48,7 @@ const AddFormComponent = () => {
const initialValues = {
person_type: "real",
telephone_number: "",
company_tel_number: "",
vehicle_type: "",
province_id: "",
father_name: "",
@@ -72,6 +73,7 @@ const AddFormComponent = () => {
plate_part4: "",
address: "",
birthday: "",
company_date: "",
education_id: "",
occupation_id: "",
checkedBox: false,
@@ -85,6 +87,12 @@ const AddFormComponent = () => {
return stringValue.length === 11
})
.required(t("LoanRequest.error_message_tel_number")),
company_tel_number: Yup.mixed()
.test("max", `${t("LoanRequest.company_tel_number_max")}`, (value) => {
const stringValue = String(value);
return stringValue.length === 11
})
.required(t("LoanRequest.error_message_company_tel_number")),
vehicle_type: Yup.string().required(t("LoanRequest.error_message_vehicle_type")),
register_number: Yup.string().required(t("LoanRequest.error_message_register_number")),
father_name: Yup.string().required(t("LoanRequest.error_message_father_name")),
@@ -95,6 +103,7 @@ const AddFormComponent = () => {
education_id: Yup.string().required(t("LoanRequest.error_message_education_id")),
address: Yup.string().required(t("LoanRequest.error_message_address")),
birthday: Yup.string().required(t("LoanRequest.error_message_date_of_birth")),
company_date: Yup.string().required(t("LoanRequest.error_message_date_of_birth")),
postal_code: Yup.mixed()
.test("max", `${t("LoanRequest.postal_code_max")}`, (value) => value.toString().length === 10)
.required(t("LoanRequest.error_message_postal_code")),