From a3b409a01aa7bffaba724118f75f2aef21c563a0 Mon Sep 17 00:00:00 2001 From: AminGhasempoor Date: Sat, 13 Apr 2024 16:02:59 +0330 Subject: [PATCH] real person loan request --- package.json | 1 + public/locales/fa/app.json | 52 +- src/components/dashboard/first/index.jsx | 2 +- .../navgan/add-request-loan/forms/AddForm.jsx | 992 ++++++++++-------- .../forms/LegalPersonForm.jsx | 149 +++ .../add-request-loan/forms/RealPersonForm.jsx | 320 ++++++ .../navgan/add-request-loan/index.jsx | 20 +- .../past-add-request-loan/forms/AddForm.jsx | 616 +++++++++++ .../navgan/past-add-request-loan/index.jsx | 23 + src/core/data/sidebarMenu.js | 2 +- .../navgan/add-request-loan/index.jsx | 2 +- .../navgan/past-add-request-loan/index.jsx | 19 + 12 files changed, 1748 insertions(+), 450 deletions(-) create mode 100644 src/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm.jsx create mode 100644 src/components/dashboard/navgan/add-request-loan/forms/RealPersonForm.jsx create mode 100644 src/components/dashboard/navgan/past-add-request-loan/forms/AddForm.jsx create mode 100644 src/components/dashboard/navgan/past-add-request-loan/index.jsx create mode 100644 src/pages/dashboard/navgan/past-add-request-loan/index.jsx diff --git a/package.json b/package.json index ff64d0f..c2321ca 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-toastify": "^9.1.3", + "react-transition-group": "^4.4.5", "sass": "^1.62.0", "stylis": "^4.1.3", "stylis-plugin-rtl": "^2.1.1", diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index 0d2b5a5..d983010 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -156,26 +156,32 @@ "real_person": "شخص حقیقی", "legal_person": "شخص حقوقی", "national_code_number": "کد ملی می بایست شامل اعداد باشد", - "national_number_number": "شناسه ملی می بایست شامل اعداد باشد", + "national_number_number": "شناسه ملی شرکت می بایست شامل اعداد باشد", "national_code_max": "کد ملی می بایست 10 رقم باشد", - "national_number_max": "شناسه ملی می بایست 11 رقم باشد", + "national_number_max": "شناسه ملی شرکت می بایست 11 رقم باشد", "shenasname_serial_max": "سریال پشت کارت ملی می بایست شامل 10 بخش باشد", "postal_code_max": "کد پستی می بایست 10 رقم باشد", "tel_number_max": "شماره ثابت می بایست 11 رقم باشد", "national_code_positive": "کد ملی می بایست مثبت باشد", - "national_number_positive": "شناسه ملی می بایست مثبت باشد", + "national_number_positive": "شناسه ملی شرکت می بایست مثبت باشد", "uploading_documents": "اسناد", "error_message_person_type": "نوع شخص خود را وارد کنید!", "error_message_name": "لطفا نام خود را وارد کنید!", + "error_message_company_name": "لطفا نام شرکت خود را وارد کنید!", + "error_message_first_name": "لطفا نام خود را وارد کنید!", + "error_message_last_name": "لطفا نام خانوادگی خود را وارد کنید!", + "error_message_gender": "لطفا جنسیت خود را وارد کنید!", + "error_message_father_name": "لطفا نام پدر خود را وارد کنید!", + "error_message_register_number": "لطفا شماره ثبت شرکت خود را وارد کنید!", "error_message_plate_number": "لطفا شماره پلاک را به درستی وارد کنید!", "error_message_occupation_id": "لطفا کد شغل را به درستی وارد کنید!", - "error_message_education_id": "لطفا تحصیلات را به درستی وارد کنید!", + "error_message_education_id": "لطفا مدرک تحصیلی را به درستی وارد کنید!", "error_message_tel_number": "لطفا شماره ثابت (با پیش شماره استان) خود را وارد کنید!", "error_message_vehicle_type": "لطفا نوع وسیله نقلیه خود را وارد کنید!", "error_message_navgan_id": "لطفا کد هوشمند ناوگان خود را وارد کنید!", "error_message_province_id": "لطفا استان خود را وارد کنید!", "error_message_national_id": "لطفا کد ملی خود را وارد کنید!", - "error_message_national_number": "لطفا شناسه ملی خود را وارد کنید!", + "error_message_national_number": "لطفا شناسه ملی شرکت خود را وارد کنید!", "error_message_date_of_birth": "لطفا تاریخ تولد خود را وارد کنید!", "error_message_shenasname_serial": "لطفا سریال پشت کارت ملی خود را وارد کنید!", "error_message_tracking_code": "لطفا کد رهگیری کارت ملی خود را وارد کنید!", @@ -185,10 +191,16 @@ "error_message_navgan_type": "لطفا نوع ناوگان خود را وارد کنید!", "error_message_address": "لطفا آدرس خود را وارد کنید!", "text_field_tel_number": "شماره ثابت (با پیش شماره استان)", - "text_field_education_id": "تحصیلات", + "text_field_education_id": "مدرک تحصیلی", "text_field_occupation_id": "شغل", "text_field_enter_your_tel_number": "شماره ثابت (با پیش شماره استان) خود را وارد کنید", "text_field_name": "نام", + "text_field_company_name": "نام شرکت", + "text_field_first_name": "نام", + "text_field_last_name": "نام خانوادگی", + "text_field_gender": "جنسیت", + "text_field_register_number": "شماره ثبت شرکت", + "text_field_father_name": "نام پدر", "text_field_plate_part4": "بخش چهارم", "text_field_plate_part3": "بخش سوم", "text_field_plate_part2": "بخش دوم", @@ -200,8 +212,13 @@ "text_field_enter_your_plate_part2": "بخش دوم پلاک را وارد کنید", "text_field_enter_your_plate_part3": "بخش سوم پلاک را وارد کنید", "text_field_enter_your_plate_part4": "بخش چهارم پلاک راوارد کنید", + "text_field_enter_your_first_name": "نام خود راوارد کنید", + "text_field_enter_your_company_name": "نام شرکت خود راوارد کنید", + "text_field_enter_your_last_name": "نام خانوادگی خود راوارد کنید", "text_field_enter_your_address": "آدرس خود راوارد کنید", "text_field_enter_your_name": "نام خود را وارد کنید", + "text_field_enter_your_register_number": "شماره ثبت شرکت خود را وارد کنید", + "text_field_enter_your_father_name": "نام پدر خود را وارد کنید", "text_field_enter_your_postal_code": "کد پستی خود را وارد کنید", "text_field_vehicle_type": "نوع وسیله نقلیه", "text_field_enter_your_vehicle_type": "نوع وسیله نقلیه خود را وارد کنید", @@ -214,9 +231,9 @@ "text_field_navgan_id": "کد هوشمند ناوگان", "text_field_enter_your_navgan_id": "کد هوشمند ناوگان خود را وارد کنید", "text_field_national_code": "کد ملی", - "text_field_national_number": "شناسه ملی", + "text_field_national_number": "شناسه ملی شرکت", "text_field_enter_your_national_id": "کد ملی خود را وارد کنید", - "text_field_enter_your_national_number": "شناسه ملی خود را وارد کنید", + "text_field_enter_your_national_number": "شناسه ملی شرکت خود را وارد کنید", "text_field_shenasname_serial": "سریال پشت کارت ملی", "text_field_enter_your_shenasname_serial": "سریال پشت کارت ملی خود را وارد کنید", "text_field_national_trackin_code": "کد رهگیری کارت ملی", @@ -235,17 +252,18 @@ "national_code_number": "کد ملی می بایست شامل اعداد باشد", "national_code_positive": "کد ملی می بایست مثبت باشد", "national_code_max": "کد ملی می بایست 10 رقم باشد", - "national_number_positive": "شناسه ملی می بایست مثبت باشد", + "national_number_positive": "شناسه ملی شرکت می بایست مثبت باشد", "error_message_national_id": "لطفا کد ملی خود را وارد کنید!", - "national_number_number": "شناسه ملی می بایست شامل اعداد باشد", - "national_number_max": "شناسه ملی می بایست 11 رقم باشد", - "error_message_national_number": "لطفا شناسه ملی خود را وارد کنید!", + "national_number_number": "شناسه ملی شرکت می بایست شامل اعداد باشد", + "national_number_max": "شناسه ملی شرکت می بایست 11 رقم باشد", + "error_message_national_number": "لطفا شناسه ملی شرکت خود را وارد کنید!", "error_message_shenasname_serial": "لطفا سریال پشت کارت ملی خود را وارد کنید!", "error_message_tracking_code": "لطفا کد رهگیری کارت ملی خود را وارد کنید!", "text_field_shenasname_serial": "سریال پشت کارت ملی", "text_field_national_trackin_code": "کد رهگیری کارت ملی", "text_field_national_id": "کد ملی", "text_field_postal_code": "کد پستی", + "text_field_company_postal_code": "کد پستی شرکت", "text_field_national_serial_number": "سریال پشت کارت ملی", "text_field_address": "آدرس", "text_field_birthday": "تاریخ تولد", @@ -256,21 +274,23 @@ "text_field_occupation_id": "شغل", "text_field_name": "نام کامل مالک", "text_field_navgan_type": "نوع ناوگان", - "text_field_shenase_meli": "شناسه ملی", + "text_field_shenase_meli": "شناسه ملی شرکت", "text_field_vehicle_type": "نوع وسیله", "text_field_tel_number": "شماره ثابت (با پیش شماره استان)", "text_field_enter_your_national_id": "کد ملی را وارد کنید", "text_field_enter_your_postal_code": "کد پستی را وارد کنید", + "text_field_enter_your_company_postal_code": "کد پستی شرکت را وارد کنید", "text_field_enter_your_national_serial_number": "سریال پشت کارت ملی را وارد کنید", "text_field_enter_your_address": "آدرس را وارد کنید", "text_field_enter_your_tel_number": "شماره ثابت (با پیش شماره استان) خود را وارد کنید", "text_field_enter_your_birthday": "تاریخ تولد را وارد کنید", "text_field_enter_your_navgan_id": "کد ناوگان را وارد کنید", "text_field_enter_your_name": "نام کامل مالک را وارد کنید", - "text_field_enter_your_shenase_meli": "شناسه ملی را وارد کنید", + "text_field_enter_your_shenase_meli": "شناسه ملی شرکت را وارد کنید", "text_field_enter_your_national_tracking_code": "کد رهگیری کارت ملی را وارد کنید", "postal_code_max": "کد پستی می بایست 10 رقم باشد", - "error_message_postal_code": "لطفا کد پستی را وارد کنید!", + "company_postal_code_max": "کد پستی شرکت می بایست 10 رقم باشد", + "error_message_company_postal_code": "لطفا کد پستی شرکت را وارد کنید!", "error_message_national_serial_number": "لطفا سریال پشت کارت ملی را وارد کنید!", "error_message_address": "لطفا آدرس را وارد کنید!", "error_message_birthday": "لطفا تاریخ تولد را وارد کنید!", @@ -284,7 +304,7 @@ "error_message_fixed_number": "لطفا تلفن ثابت را وارد کنید!", "error_message_tel_number": "لطفا شماره ثابت (با پیش شماره استان) خود را وارد کنید!", "error_message_occupation_id": "لطفا کد شغل (با توجه به مستندات ارائه شده) را به درستی وارد کنید!", - "error_message_education_id": "لطفا تحصیلات (با توجه به مستندات ارائه شده) را به درستی وارد کنید!", + "error_message_education_id": "لطفا مدرک تحصیلی (با توجه به مستندات ارائه شده) را به درستی وارد کنید!", "cityList_empty": "شهر یافت نشد", "button_submit": "ویرایش", "error_message_not_show_state": "شما دسترسی لازم به دریافت اطلاعات را ندارید!" diff --git a/src/components/dashboard/first/index.jsx b/src/components/dashboard/first/index.jsx index 7b42ef9..826380e 100644 --- a/src/components/dashboard/first/index.jsx +++ b/src/components/dashboard/first/index.jsx @@ -18,7 +18,7 @@ const FirstComponent = () => { {t("Dashboard.go_to_add_request_loan")} - ) : (<> - - - { - if (value === null) return - formik.handleChange({ - target: { - name: "person_type", value: value, - }, - }) - }} - > - - {t("LoanRequest.real_person")} - - - {t("LoanRequest.legal_person")} - - - - - { - const inputValue = event.target.value; - if (isNaN(Number(inputValue))) { - return; - } - formik.handleChange({ - target: { - name: "national_id", value: inputValue, - }, - }); - }} - label={t("LoanRequest.text_field_national_code")} - placeholder={t("LoanRequest.text_field_enter_your_national_code")} - onBlur={formik.handleBlur("national_id")} - error={formik.touched.national_id && Boolean(formik.errors.national_id)} - helperText={formik.touched.national_id && formik.errors.national_id} - fullWidth - /> - - - - { - const inputValue = event.target.value; - if (isNaN(Number(inputValue))) { - return; - } + ) : ( + <> + + + { + if (value === null) return formik.handleChange({ target: { - name: "national_number", value: inputValue, + name: "person_type", value: value, }, - }); + }) }} - label={t("LoanRequest.text_field_national_number")} - placeholder={t("LoanRequest.text_field_enter_your_national_number")} - onBlur={formik.handleBlur("national_number")} - error={formik.touched.national_number && Boolean(formik.errors.national_number)} - helperText={formik.touched.national_number && formik.errors.national_number} - fullWidth - /> + > + + {t("LoanRequest.real_person")} + + + {t("LoanRequest.legal_person")} + + - - - - - { - if (value === null) return - formik.handleChange({ - target: { - name: "national_serial_number_or_tracking_code", value: value, - }, - }) - }} - > - - {t("LoanRequest.text_field_shenasname_serial")} - - - {t("LoanRequest.text_field_national_trackin_code")} - - - {formik.values.national_serial_number_or_tracking_code === 'national_serial_number' ? ( - + { + formik.values.person_type === "real" ? : + } + {/**/} + {/* */} + {/* {formik.values.person_type === "legal" ? (*/} + {/* {*/} + {/* const inputValue = event.target.value;*/} + {/* if (isNaN(Number(inputValue))) {*/} + {/* return;*/} + {/* }*/} + {/* formik.handleChange({*/} + {/* target: {*/} + {/* name: "national_number", value: inputValue,*/} + {/* },*/} + {/* });*/} + {/* }}*/} + {/* label={t("LoanRequest.text_field_national_number")}*/} + {/* placeholder={t("LoanRequest.text_field_enter_your_national_number")}*/} + {/* onBlur={formik.handleBlur("national_number")}*/} + {/* error={formik.touched.national_number && Boolean(formik.errors.national_number)}*/} + {/* helperText={formik.touched.national_number && formik.errors.national_number}*/} + {/* fullWidth*/} + {/* />*/} + {/* ) : (*/} + {/* {*/} + {/* const inputValue = event.target.value;*/} + {/* if (isNaN(Number(inputValue))) {*/} + {/* return;*/} + {/* }*/} + {/* formik.handleChange({*/} + {/* target: {*/} + {/* name: "national_code", value: inputValue,*/} + {/* },*/} + {/* });*/} + {/* }}*/} + {/* label={t("LoanRequest.text_field_national_code")}*/} + {/* placeholder={t("LoanRequest.text_field_enter_your_national_code")}*/} + {/* onBlur={formik.handleBlur("national_id")}*/} + {/* error={formik.touched.national_id && Boolean(formik.errors.national_id)}*/} + {/* helperText={formik.touched.national_id && formik.errors.national_id}*/} + {/* fullWidth*/} + {/* />*/} + {/* )}*/} + {/* */} + {/**/} + {/*{formik.values.person_type === 'legal' && (*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* {*/} + {/* const inputValue = event.target.value;*/} + {/* if (isNaN(Number(inputValue))) {*/} + {/* return;*/} + {/* }*/} + {/* formik.handleChange({*/} + {/* target: {*/} + {/* name: "register_number", value: inputValue,*/} + {/* },*/} + {/* });*/} + {/* }}*/} + {/* label={t("LoanRequest.text_field_register_number")}*/} + {/* placeholder={t("LoanRequest.text_field_enter_your_register_number")}*/} + {/* onBlur={formik.handleBlur("register_number")}*/} + {/* error={formik.touched.register_number && Boolean(formik.errors.register_number)}*/} + {/* helperText={formik.touched.register_number && formik.errors.register_number}*/} + {/* fullWidth*/} + {/* />*/} + {/* */} + {/* */} + {/* */} + {/*)}*/} + {/**/} + {/* */} + {/* {*/} + {/* if (value === null) return*/} + {/* formik.handleChange({*/} + {/* target: {*/} + {/* name: "national_serial_number_or_tracking_code", value: value,*/} + {/* },*/} + {/* })*/} + {/* }}*/} + {/* >*/} + {/* */} + {/* {t("LoanRequest.text_field_shenasname_serial")}*/} + {/* */} + {/* */} + {/* {t("LoanRequest.text_field_national_trackin_code")}*/} + {/* */} + {/* */} + {/* */} + {/* {formik.values.national_serial_number_or_tracking_code === 'national_serial_number' ? (*/} + {/* */} + {/* */} + {/* ) : (*/} + {/* */} + {/* */} + {/* */} + {/* )}*/} + {/**/} + {/**/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/**/} + {/**/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* {*/} + {/* formik.setFieldValue('gender', event.target.value)*/} + {/* }}*/} + {/* setFieldTouched={formik.setFieldTouched}*/} + {/* error={formik.touched.gender && Boolean(formik.errors.gender)}*/} + {/* helperText={formik.touched.gender && formik.errors.gender}*/} + {/* onBlur={formik.handleBlur("gender")}*/} + {/* />*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/**/} + {/**/} + {/* */} + {/* {*/} + {/* const inputValue = event.target.value;*/} + {/* if (isNaN(Number(inputValue))) {*/} + {/* return;*/} + {/* }*/} + {/* formik.handleChange({*/} + {/* target: {*/} + {/* name: "postal_code", value: inputValue,*/} + {/* },*/} + {/* });*/} + {/* }}*/} + {/* size="small"*/} + {/* label={t("LoanRequest.text_field_postal_code")}*/} + {/* placeholder={t("LoanRequest.text_field_enter_your_postal_code")}*/} + {/* fullWidth*/} + {/* onBlur={formik.handleBlur("postal_code")}*/} + {/* error={formik.touched.postal_code && Boolean(formik.errors.postal_code)}*/} + {/* helperText={formik.touched.postal_code && formik.errors.postal_code}*/} + {/* />*/} + {/* */} + {/* */} + {/* {*/} + {/* const inputValue = event.target.value;*/} + {/* if (isNaN(Number(inputValue))) {*/} + {/* return;*/} + {/* }*/} + {/* formik.handleChange({*/} + {/* target: {*/} + {/* name: "telephone_number", value: inputValue,*/} + {/* },*/} + {/* });*/} + {/* }}*/} + {/* label={t("LoanRequest.text_field_tel_number")}*/} + {/* placeholder={t("LoanRequest.text_field_enter_your_tel_number")}*/} + {/* fullWidth*/} + {/* onBlur={formik.handleBlur("telephone_number")}*/} + {/* error={formik.touched.telephone_number && Boolean(formik.errors.telephone_number)}*/} + {/* helperText={formik.touched.telephone_number && formik.errors.telephone_number}*/} + {/* />*/} + {/* */} + {/**/} + {/**/} + {/* */} + {/* {*/} + {/* formik.setFieldValue('navgan_type', event.target.value)*/} + {/* }}*/} + {/* setFieldTouched={formik.setFieldTouched}*/} + {/* error={formik.touched.navgan_type && Boolean(formik.errors.navgan_type)}*/} + {/* helperText={formik.touched.navgan_type && formik.errors.navgan_type}*/} + {/* onBlur={formik.handleBlur("navgan_type")}*/} + {/* />*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/**/} + {/**/} + {/* */} + {/* {*/} + {/* formik.setFieldValue('province_id', event.target.value);*/} + {/* setProvinceID(event.target.value)*/} + {/* formik.setFieldTouched("city_id", false, false);*/} + {/* formik.setFieldValue("city_id", "")*/} + {/* }}*/} + {/* setFieldTouched={formik.setFieldTouched}*/} + {/* error={formik.touched.province_id && Boolean(formik.errors.province_id)}*/} + {/* helperText={formik.touched.province_id && formik.errors.province_id}*/} + {/* onBlur={formik.handleBlur("province_id")}*/} + {/* />*/} + {/* */} + {/* */} + {/* formik.setFieldValue('city_id', event.target.value)}*/} + {/* setFieldTouched={formik.setFieldTouched}*/} + {/* error={formik.touched.city_id && Boolean(formik.errors.city_id)}*/} + {/* helperText={formik.touched.city_id && formik.errors.city_id}*/} + {/* onBlur={formik.handleBlur("city_id")}*/} + {/* />*/} + {/* */} + {/**/} + {/**/} + {/* */} + {/* formik.setFieldValue('vehicle_type', event.target.value)}*/} + {/* error={formik.touched.vehicle_type && Boolean(formik.errors.vehicle_type)}*/} + {/* helperText={formik.touched.vehicle_type && formik.errors.vehicle_type}*/} + {/* onBlur={formik.handleBlur("vehicle_type")}*/} + {/* />*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/**/} + {/**/} + {/* */} + {/* {*/} + {/* formik.setFieldValue('education_id', event.target.value)*/} + {/* }}*/} + {/* setFieldTouched={formik.setFieldTouched}*/} + {/* error={formik.touched.education_id && Boolean(formik.errors.education_id)}*/} + {/* helperText={formik.touched.education_id && formik.errors.education_id}*/} + {/* onBlur={formik.handleBlur("education_id")}*/} + {/* />*/} + {/* */} + {/* */} + {/* {*/} + {/* formik.setFieldValue('occupation_id', event.target.value)*/} + {/* }}*/} + {/* setFieldTouched={formik.setFieldTouched}*/} + {/* error={formik.touched.occupation_id && Boolean(formik.errors.occupation_id)}*/} + {/* helperText={formik.touched.occupation_id && formik.errors.occupation_id}*/} + {/* onBlur={formik.handleBlur("occupation_id")}*/} + {/* />*/} + {/* */} + {/**/} + + - ) : ( - - )} + + + + + { + formik.setFieldValue("checkedBox", event.target.checked) + }} + />} + label={`${t("LoanRequest.checkbox")}`}/> - - + - - - - { - const inputValue = event.target.value; - if (isNaN(Number(inputValue))) { - return; - } - formik.handleChange({ - target: { - name: "postal_code", value: inputValue, - }, - }); - }} - size="small" - label={t("LoanRequest.text_field_postal_code")} - placeholder={t("LoanRequest.text_field_enter_your_postal_code")} - fullWidth - onBlur={formik.handleBlur("postal_code")} - error={formik.touched.postal_code && Boolean(formik.errors.postal_code)} - helperText={formik.touched.postal_code && formik.errors.postal_code} - /> - - - { - const inputValue = event.target.value; - if (isNaN(Number(inputValue))) { - return; - } - formik.handleChange({ - target: { - name: "telephone_number", value: inputValue, - }, - }); - }} - label={t("LoanRequest.text_field_tel_number")} - placeholder={t("LoanRequest.text_field_enter_your_tel_number")} - fullWidth - onBlur={formik.handleBlur("telephone_number")} - error={formik.touched.telephone_number && Boolean(formik.errors.telephone_number)} - helperText={formik.touched.telephone_number && formik.errors.telephone_number} - /> - - - - - { - formik.setFieldValue('navgan_type', event.target.value) - }} - setFieldTouched={formik.setFieldTouched} - error={formik.touched.navgan_type && Boolean(formik.errors.navgan_type)} - helperText={formik.touched.navgan_type && formik.errors.navgan_type} - onBlur={formik.handleBlur("navgan_type")} - /> - - - - - - - - { - formik.setFieldValue('province_id', event.target.value); - setProvinceID(event.target.value) - formik.setFieldTouched("city_id", false, false); - formik.setFieldValue("city_id", "") - }} - setFieldTouched={formik.setFieldTouched} - error={formik.touched.province_id && Boolean(formik.errors.province_id)} - helperText={formik.touched.province_id && formik.errors.province_id} - onBlur={formik.handleBlur("province_id")} - /> - - - formik.setFieldValue('city_id', event.target.value)} - setFieldTouched={formik.setFieldTouched} - error={formik.touched.city_id && Boolean(formik.errors.city_id)} - helperText={formik.touched.city_id && formik.errors.city_id} - onBlur={formik.handleBlur("city_id")} - /> - - - - - formik.setFieldValue('vehicle_type', event.target.value)} - error={formik.touched.vehicle_type && Boolean(formik.errors.vehicle_type)} - helperText={formik.touched.vehicle_type && formik.errors.vehicle_type} - onBlur={formik.handleBlur("vehicle_type")} - /> - - - - - - - - { - formik.setFieldValue('education_id', event.target.value) - }} - setFieldTouched={formik.setFieldTouched} - error={formik.touched.education_id && Boolean(formik.errors.education_id)} - helperText={formik.touched.education_id && formik.errors.education_id} - onBlur={formik.handleBlur("education_id")} - /> - - - { - formik.setFieldValue('occupation_id', event.target.value) - }} - setFieldTouched={formik.setFieldTouched} - error={formik.touched.occupation_id && Boolean(formik.errors.occupation_id)} - helperText={formik.touched.occupation_id && formik.errors.occupation_id} - onBlur={formik.handleBlur("occupation_id")} - /> - - - - - - - - - - { - formik.setFieldValue("checkedBox", event.target.checked) - }} - />} - label={`${t("LoanRequest.checkbox")}`}/> - - - - - - - )} + + + + )} ); }; diff --git a/src/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm.jsx b/src/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm.jsx new file mode 100644 index 0000000..78a38aa --- /dev/null +++ b/src/components/dashboard/navgan/add-request-loan/forms/LegalPersonForm.jsx @@ -0,0 +1,149 @@ +import {Collapse, Grid, TextField} from "@mui/material"; +import {useTranslations} from "next-intl"; +import useCities from "@/lib/app/hooks/useCities"; +import UseEducations from "@/lib/app/hooks/useEducations"; +import useOccupations from "@/lib/app/hooks/useOccupations"; + +const LegalPersonForm = ({formik}) => { + const t = useTranslations(); + const {cityTextField, cityList, setProvinceID, isLoadingCityList} = useCities() + const {educationsList, isLoadingEducationsList, errorEducationsList} = UseEducations() + const {occupationsList, isLoadingOccupationsList, errorOccupationsList} = useOccupations() + return ( + <> + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "national_number", value: inputValue, + }, + }); + }} + label={t("LoanRequest.text_field_national_number")} + placeholder={t("LoanRequest.text_field_enter_your_national_number")} + onBlur={formik.handleBlur("national_number")} + error={formik.touched.national_number && Boolean(formik.errors.national_number)} + helperText={formik.touched.national_number && formik.errors.national_number} + fullWidth + /> + + + + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "register_number", value: inputValue, + }, + }); + }} + label={t("LoanRequest.text_field_register_number")} + placeholder={t("LoanRequest.text_field_enter_your_register_number")} + onBlur={formik.handleBlur("register_number")} + error={formik.touched.register_number && Boolean(formik.errors.register_number)} + helperText={formik.touched.register_number && formik.errors.register_number} + fullWidth + /> + + + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "postal_code", value: inputValue, + }, + }); + }} + size="small" + label={t("LoanRequest.text_field_company_postal_code")} + placeholder={t("LoanRequest.text_field_enter_your_company_postal_code")} + fullWidth + onBlur={formik.handleBlur("company_postal_code")} + error={formik.touched.company_postal_code && Boolean(formik.errors.company_postal_code)} + helperText={formik.touched.company_postal_code && formik.errors.company_postal_code} + /> + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "telephone_number", value: inputValue, + }, + }); + }} + label={t("LoanRequest.text_field_company_tel_number")} + placeholder={t("LoanRequest.text_field_enter_your_company_tel_number")} + fullWidth + onBlur={formik.handleBlur("company_tel_number")} + error={formik.touched.company_tel_number && Boolean(formik.errors.company_tel_number)} + helperText={formik.touched.company_tel_number && formik.errors.company_tel_number} + /> + + + + ) +} +export default LegalPersonForm \ No newline at end of file diff --git a/src/components/dashboard/navgan/add-request-loan/forms/RealPersonForm.jsx b/src/components/dashboard/navgan/add-request-loan/forms/RealPersonForm.jsx new file mode 100644 index 0000000..b1195d0 --- /dev/null +++ b/src/components/dashboard/navgan/add-request-loan/forms/RealPersonForm.jsx @@ -0,0 +1,320 @@ +import {Grid, TextField, ToggleButton, ToggleButtonGroup} from "@mui/material"; +import SelectBox from "@/core/components/SelectBox"; +import MuiDatePicker from "@/core/components/MuiDatePicker"; +import {useTranslations} from "next-intl"; +import useLimitedProvince from "@/lib/app/hooks/useLimitedProvince"; +import useCities from "@/lib/app/hooks/useCities"; +import UseEducations from "@/lib/app/hooks/useEducations"; +import useOccupations from "@/lib/app/hooks/useOccupations"; + +const RealPersonForm = ({formik}) => { + const t = useTranslations(); + const {provinceList, isLoadingProvinceList, errorProvinceList} = useLimitedProvince() + + return( + <> + + + { + if (value === null) return + formik.handleChange({ + target: { + name: "national_serial_number_or_tracking_code", value: value, + }, + }) + }} + > + + {t("LoanRequest.text_field_shenasname_serial")} + + + {t("LoanRequest.text_field_national_trackin_code")} + + + + {formik.values.national_serial_number_or_tracking_code === 'national_serial_number' ? ( + + + ) : ( + + + + )} + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "national_code", value: inputValue, + }, + }); + }} + label={t("LoanRequest.text_field_national_code")} + placeholder={t("LoanRequest.text_field_enter_your_national_code")} + onBlur={formik.handleBlur("national_id")} + error={formik.touched.national_id && Boolean(formik.errors.national_id)} + helperText={formik.touched.national_id && formik.errors.national_id} + fullWidth + /> + + + + + + + + + + + + + + + + { + formik.setFieldValue('gender', event.target.value) + }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.gender && Boolean(formik.errors.gender)} + helperText={formik.touched.gender && formik.errors.gender} + onBlur={formik.handleBlur("gender")} + /> + + + + + + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "postal_code", value: inputValue, + }, + }); + }} + size="small" + label={t("LoanRequest.text_field_postal_code")} + placeholder={t("LoanRequest.text_field_enter_your_postal_code")} + fullWidth + onBlur={formik.handleBlur("postal_code")} + error={formik.touched.postal_code && Boolean(formik.errors.postal_code)} + helperText={formik.touched.postal_code && formik.errors.postal_code} + /> + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "telephone_number", value: inputValue, + }, + }); + }} + label={t("LoanRequest.text_field_tel_number")} + placeholder={t("LoanRequest.text_field_enter_your_tel_number")} + fullWidth + onBlur={formik.handleBlur("telephone_number")} + error={formik.touched.telephone_number && Boolean(formik.errors.telephone_number)} + helperText={formik.touched.telephone_number && formik.errors.telephone_number} + /> + + + + + { + formik.setFieldValue('navgan_type', event.target.value) + }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.navgan_type && Boolean(formik.errors.navgan_type)} + helperText={formik.touched.navgan_type && formik.errors.navgan_type} + onBlur={formik.handleBlur("navgan_type")} + /> + + + + + + + + { + formik.setFieldValue('province_id', event.target.value); + setProvinceID(event.target.value) + formik.setFieldTouched("city_id", false, false); + formik.setFieldValue("city_id", "") + }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.province_id && Boolean(formik.errors.province_id)} + helperText={formik.touched.province_id && formik.errors.province_id} + onBlur={formik.handleBlur("province_id")} + /> + + + + ) +} +export default RealPersonForm \ No newline at end of file diff --git a/src/components/dashboard/navgan/add-request-loan/index.jsx b/src/components/dashboard/navgan/add-request-loan/index.jsx index 3e4cf0c..211862c 100644 --- a/src/components/dashboard/navgan/add-request-loan/index.jsx +++ b/src/components/dashboard/navgan/add-request-loan/index.jsx @@ -7,16 +7,16 @@ const LoanRequestComponent = () => { const t = useTranslations(); return ( - <> - - - - - - - + <> + + + + + + + ); }; diff --git a/src/components/dashboard/navgan/past-add-request-loan/forms/AddForm.jsx b/src/components/dashboard/navgan/past-add-request-loan/forms/AddForm.jsx new file mode 100644 index 0000000..c8cdcbb --- /dev/null +++ b/src/components/dashboard/navgan/past-add-request-loan/forms/AddForm.jsx @@ -0,0 +1,616 @@ +import SelectBox from "@/core/components/SelectBox"; +import DataSaverOnIcon from "@mui/icons-material/DataSaverOn"; +import { + Box, + Button, + Checkbox, + Fade, + FormControlLabel, + Grid, + Stack, + TextField, + ToggleButton, + ToggleButtonGroup, + Typography +} from "@mui/material"; +import {useFormik} from "formik"; +import {useTranslations} from "next-intl"; +import * as Yup from "yup"; +import {CenterLayout, useRequest, useUser} from "@witel/webapp-builder"; +import useCities from "@/lib/app/hooks/useCities"; +import PlateNumber from "@/core/components/PlateNumber"; +import MuiDatePicker from "@/core/components/MuiDatePicker"; +import UseEducations from "@/lib/app/hooks/useEducations"; +import useOccupations from "@/lib/app/hooks/useOccupations"; +import {useState} from "react"; +import DoneIcon from '@mui/icons-material/Done'; +import {NextLinkComposed} from "@witel/webapp-builder/dist/utils/linkRouting"; +import SvgDone from "@/core/components/svgs/SvgDone"; +import {SEND_LOAN_REQUEST_NAVGAN} from "@/core/data/apiRoutes"; +import {useRouter} from "next/router"; +import useLimitedProvince from "@/lib/app/hooks/useLimitedProvince"; + +const AddFormComponent = () => { + const router = useRouter() + const {getUser, changeUser} = useUser() + const t = useTranslations(); + const [finishLoanRequest, setFinishLoanRequest] = useState(false) + const [checked, setChecked] = useState(false); + const requestServer = useRequest() + const {provinceList, isLoadingProvinceList, errorProvinceList} = useLimitedProvince() + const {cityTextField, cityList, setProvinceID, isLoadingCityList} = useCities() + const {educationsList, isLoadingEducationsList, errorEducationsList} = UseEducations() + const {occupationsList, isLoadingOccupationsList, errorOccupationsList} = useOccupations() + + const initialValues = { + person_type: "real", + telephone_number: "", + vehicle_type: "", + province_id: "", + city_id: "", + navgan_id: "", + national_id: "", + national_number: "", + national_serial_number: "", + national_card_tracking_code: "", + national_serial_number_or_tracking_code: "national_serial_number", + postal_code: "", + navgan_type: "", + plate_part1: "", + plate_part2: "الف", + plate_part3: "", + plate_part4: "", + address: "", + birthday: "", + education_id: "", + occupation_id: "", + checkedBox: false, + }; + + const validationSchema = Yup.object().shape({ + person_type: Yup.string().required(t("LoanRequest.error_message_person_type")), + telephone_number: Yup.mixed() + .test("max", `${t("LoanRequest.tel_number_max")}`, (value) => { + const stringValue = String(value); + return stringValue.length === 11 + }) + .required(t("LoanRequest.error_message_tel_number")), + vehicle_type: Yup.string().required(t("LoanRequest.error_message_vehicle_type")), + navgan_type: Yup.string().required(t("LoanRequest.error_message_navgan_type")), + occupation_id: Yup.string().required(t("LoanRequest.error_message_occupation_id")), + 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")), + postal_code: Yup.mixed() + .test("max", `${t("LoanRequest.postal_code_max")}`, (value) => value.toString().length === 10) + .required(t("LoanRequest.error_message_postal_code")), + plate_part1: Yup.mixed().test("max", `${t("LoanRequest.error_message_plate_number")}`, (value) => value.toString().length === 2) + .required(t("LoanRequest.error_message_plate_number")), + plate_part2: Yup.mixed() + .required(t("LoanRequest.error_message_plate_number")), + plate_part3: Yup.mixed().test("max", `${t("LoanRequest.error_message_plate_number")}`, (value) => value.toString().length === 3) + .required(t("LoanRequest.error_message_plate_number")), + plate_part4: Yup.mixed().test("max", `${t("LoanRequest.error_message_plate_number")}`, (value) => value.toString().length === 2) + .required(t("LoanRequest.error_message_plate_number")), + navgan_id: Yup.mixed().required(t("LoanRequest.error_message_navgan_id")), + province_id: Yup.string().required(t("LoanRequest.error_message_province_id")), + city_id: Yup.string().required(t("LoanRequest.error_message_city_id")), + national_id: Yup.mixed() + .test("is-number", `${t("LoanRequest.national_code_number")}`, (value) => !isNaN(value)) + .test("positive", `${t("LoanRequest.national_code_positive")}`, (value) => value >= 0) + .test("max", `${t("LoanRequest.national_code_max")}`, (value) => value.toString().length === 10) + .required(t("LoanRequest.error_message_national_id")), + national_number: Yup.mixed().when('person_type', ([person_type], schema) => { + return person_type === 'legal' ? schema + .test("is-number", `${t("LoanRequest.national_number_number")}`, (value) => !isNaN(value)) + .test("positive", `${t("LoanRequest.national_number_positive")}`, (value) => value >= 0) + .test("max", `${t("LoanRequest.national_number_max")}`, (value) => value && value.toString().length === 11) + .required(t("LoanRequest.error_message_national_number")) : schema; + }), + national_serial_number: Yup.string().when('national_serial_number_or_tracking_code', ([national_serial_number_or_tracking_code], schema) => { + return national_serial_number_or_tracking_code === 'national_serial_number' ? schema.required(t("LoanRequest.error_message_shenasname_serial")) : schema + }), + national_card_tracking_code: Yup.string().when('national_serial_number_or_tracking_code', ([national_serial_number_or_tracking_code], schema) => { + return national_serial_number_or_tracking_code === 'national_card_tracking_code' ? schema.required(t("LoanRequest.error_message_tracking_code")) : schema + }) + }); + + + const handleSubmit = async (values, props) => { + props.setSubmitting(true) + let _national_number = values.person_type === "legal" ? { + shenase_meli: values.national_number + } : {} + + const _national_card = values.national_serial_number_or_tracking_code === "national_serial_number" ? { + national_serial_number: values.national_serial_number + } : { + national_tracking_code: values.national_card_tracking_code + } + + let _data = { + is_legal_person: values.person_type === 'legal' ? 1 : 0, + telephone_number: values.telephone_number, + national_id: values.national_id, + vehicle_type: values.vehicle_type, + province_id: values.province_id, + city_id: values.city_id, + navgan_id: values.navgan_id, + postal_code: values.postal_code, + navgan_type: values.navgan_type, + plate_part1: values.plate_part1, + plate_part2: values.plate_part2, + plate_part3: values.plate_part3, + plate_part4: values.plate_part4, + address: values.address, + birthday: values.birthday.locale('en').format("YYYY-MM-DD"), + education_id: values.education_id, + occupation_id: values.occupation_id, ..._national_card, ..._national_number + } + + await requestServer(SEND_LOAN_REQUEST_NAVGAN, "post", { + auth: true, notification: true, data: _data + }).then(() => { + router.replace('/dashboard/navgan/followUp-loan') + getUser((data) => { + changeUser(data); + }); + }).catch(() => { + }).finally(() => { + props.setSubmitting(false) + }) + }; + + const formik = useFormik({ + initialValues, validationSchema, onSubmit: handleSubmit + }) + + return (<> + {finishLoanRequest ? ( + + + {t("LoanRequest.finish_loan_request")} + + + + ) : (<> + + + { + if (value === null) return + formik.handleChange({ + target: { + name: "person_type", value: value, + }, + }) + }} + > + + {t("LoanRequest.real_person")} + + + {t("LoanRequest.legal_person")} + + + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "national_id", value: inputValue, + }, + }); + }} + label={t("LoanRequest.text_field_national_code")} + placeholder={t("LoanRequest.text_field_enter_your_national_code")} + onBlur={formik.handleBlur("national_id")} + error={formik.touched.national_id && Boolean(formik.errors.national_id)} + helperText={formik.touched.national_id && formik.errors.national_id} + fullWidth + /> + + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "national_number", value: inputValue, + }, + }); + }} + label={t("LoanRequest.text_field_national_number")} + placeholder={t("LoanRequest.text_field_enter_your_national_number")} + onBlur={formik.handleBlur("national_number")} + error={formik.touched.national_number && Boolean(formik.errors.national_number)} + helperText={formik.touched.national_number && formik.errors.national_number} + fullWidth + /> + + + + + + { + if (value === null) return + formik.handleChange({ + target: { + name: "national_serial_number_or_tracking_code", value: value, + }, + }) + }} + > + + {t("LoanRequest.text_field_shenasname_serial")} + + + {t("LoanRequest.text_field_national_trackin_code")} + + + + {formik.values.national_serial_number_or_tracking_code === 'national_serial_number' ? ( + + + ) : ( + + )} + + + + + + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "postal_code", value: inputValue, + }, + }); + }} + size="small" + label={t("LoanRequest.text_field_postal_code")} + placeholder={t("LoanRequest.text_field_enter_your_postal_code")} + fullWidth + onBlur={formik.handleBlur("postal_code")} + error={formik.touched.postal_code && Boolean(formik.errors.postal_code)} + helperText={formik.touched.postal_code && formik.errors.postal_code} + /> + + + { + const inputValue = event.target.value; + if (isNaN(Number(inputValue))) { + return; + } + formik.handleChange({ + target: { + name: "telephone_number", value: inputValue, + }, + }); + }} + label={t("LoanRequest.text_field_tel_number")} + placeholder={t("LoanRequest.text_field_enter_your_tel_number")} + fullWidth + onBlur={formik.handleBlur("telephone_number")} + error={formik.touched.telephone_number && Boolean(formik.errors.telephone_number)} + helperText={formik.touched.telephone_number && formik.errors.telephone_number} + /> + + + + + { + formik.setFieldValue('navgan_type', event.target.value) + }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.navgan_type && Boolean(formik.errors.navgan_type)} + helperText={formik.touched.navgan_type && formik.errors.navgan_type} + onBlur={formik.handleBlur("navgan_type")} + /> + + + + + + + + { + formik.setFieldValue('province_id', event.target.value); + setProvinceID(event.target.value) + formik.setFieldTouched("city_id", false, false); + formik.setFieldValue("city_id", "") + }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.province_id && Boolean(formik.errors.province_id)} + helperText={formik.touched.province_id && formik.errors.province_id} + onBlur={formik.handleBlur("province_id")} + /> + + + formik.setFieldValue('city_id', event.target.value)} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.city_id && Boolean(formik.errors.city_id)} + helperText={formik.touched.city_id && formik.errors.city_id} + onBlur={formik.handleBlur("city_id")} + /> + + + + + formik.setFieldValue('vehicle_type', event.target.value)} + error={formik.touched.vehicle_type && Boolean(formik.errors.vehicle_type)} + helperText={formik.touched.vehicle_type && formik.errors.vehicle_type} + onBlur={formik.handleBlur("vehicle_type")} + /> + + + + + + + + { + formik.setFieldValue('education_id', event.target.value) + }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.education_id && Boolean(formik.errors.education_id)} + helperText={formik.touched.education_id && formik.errors.education_id} + onBlur={formik.handleBlur("education_id")} + /> + + + { + formik.setFieldValue('occupation_id', event.target.value) + }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.occupation_id && Boolean(formik.errors.occupation_id)} + helperText={formik.touched.occupation_id && formik.errors.occupation_id} + onBlur={formik.handleBlur("occupation_id")} + /> + + + + + + + + + + { + formik.setFieldValue("checkedBox", event.target.checked) + }} + />} + label={`${t("LoanRequest.checkbox")}`}/> + + + + + + + )} + ); +}; + +export default AddFormComponent; diff --git a/src/components/dashboard/navgan/past-add-request-loan/index.jsx b/src/components/dashboard/navgan/past-add-request-loan/index.jsx new file mode 100644 index 0000000..06ad301 --- /dev/null +++ b/src/components/dashboard/navgan/past-add-request-loan/index.jsx @@ -0,0 +1,23 @@ +import {Box, Chip, Divider} from "@mui/material"; +import {useTranslations} from "next-intl"; +import AddFormComponent from "@/components/dashboard/navgan/past-add-request-loan/forms/AddForm"; +import {CenterLayout, useUser} from "@witel/webapp-builder"; + +const LoanRequestComponent = () => { + const t = useTranslations(); + + return ( + <> + + + + + + + + ); +}; + +export default LoanRequestComponent; diff --git a/src/core/data/sidebarMenu.js b/src/core/data/sidebarMenu.js index ef2c7d8..497c9bc 100644 --- a/src/core/data/sidebarMenu.js +++ b/src/core/data/sidebarMenu.js @@ -17,7 +17,7 @@ const sidebarMenu = [ key: "sidebar.add-request-loan", name: "sidebar.add-request-loan", type: "page", - route: "/dashboard/navgan/add-request-loan", + route: "/dashboard/navgan/past-past-add-request-loan", icon: , selected: false, permission: "can_request_navgan_loan" diff --git a/src/pages/dashboard/navgan/add-request-loan/index.jsx b/src/pages/dashboard/navgan/add-request-loan/index.jsx index 33076eb..d413ad0 100644 --- a/src/pages/dashboard/navgan/add-request-loan/index.jsx +++ b/src/pages/dashboard/navgan/add-request-loan/index.jsx @@ -1,6 +1,6 @@ -import LoanRequestComponent from "@/components/dashboard/navgan/add-request-loan"; import {globalServerProps} from "@/core/utils/globalServerProps"; import DeadlineMiddleware from "@/middlewares/Deadline"; +import LoanRequestComponent from "@/components/dashboard/navgan/add-request-loan"; export default function AddLoanRequest(props) { return ( diff --git a/src/pages/dashboard/navgan/past-add-request-loan/index.jsx b/src/pages/dashboard/navgan/past-add-request-loan/index.jsx new file mode 100644 index 0000000..904c461 --- /dev/null +++ b/src/pages/dashboard/navgan/past-add-request-loan/index.jsx @@ -0,0 +1,19 @@ +import LoanRequestComponent from "src/components/dashboard/navgan/past-add-request-loan"; +import {globalServerProps} from "@/core/utils/globalServerProps"; +import DeadlineMiddleware from "@/middlewares/Deadline"; + +export default function AddLoanRequest(props) { + return ( + + ); +} + +export async function getServerSideProps({req, locale}) { + return { + props: { + ...await globalServerProps({req, locale}), + title: "LoanRequest.loan_request_page", + layout: {name: 'DashboardLayout', props: {permissions: ["can_request_navgan_loan"]}} + }, + }; +}