diff --git a/instruction.md b/instruction.md index fd03323..1da0b0c 100644 --- a/instruction.md +++ b/instruction.md @@ -47,7 +47,17 @@ Linux : i-0c850dcf8b85b1447 (Test) Prod : i-088e64c3435cb5078 (For IB & MB) ``` -## 2. Port Forwarding +## 2. list of Port : + - 8686 (fetch the customer details) + - 5432 (postgres) + - 8080 (IB- backend port) + - 8688 (fetch the account statement) + - 8687 (for customer name fetch in CBS -- when add beneficiary) + - 8689 (payment port) + - 6379( redis port) + + +## 3. Port Forwarding ### API (localhost → EC2:8080) ```bash @@ -100,21 +110,21 @@ SELECT * FROM users; # Grant permissions grant select, insert, update, delete on table admin to kmobile_app_rw; ``` -## 4. Linux Machine Access +## 5. Linux Machine Access ```bash # Run the .bat file first ssh username@localhost # Enter your password ``` -## Copy File from Local → Linux +## 6.Copy File from Local → Linux ```bash scp -P 9022 Smsservice/smsserviceapplication.jar @localhost:/home/ # ssh nabanita@localhost -p 9022 ``` -## About Backend +## 7.About Backend - If user "is_first_login" = true means Users did not login in IB. - **ib_access_level** or **mb_access_level** diff --git a/src/app/(main)/funds_transfer/outside_quick_pay.tsx b/src/app/(main)/funds_transfer/outside_quick_pay.tsx index b6c1daa..4d8128d 100644 --- a/src/app/(main)/funds_transfer/outside_quick_pay.tsx +++ b/src/app/(main)/funds_transfer/outside_quick_pay.tsx @@ -63,7 +63,7 @@ export default function OutsideQuickPay() { }); const data = await response.json(); if (response.ok && Array.isArray(data)) { - const filterSAaccount = data.filter((acc) => acc.stAccountType === 'SA'); + const filterSAaccount = data.filter((acc) => ['SA', 'SB'].includes(acc.stAccountType)); setAccountData(filterSAaccount); } } catch { diff --git a/src/app/(main)/funds_transfer/page.tsx b/src/app/(main)/funds_transfer/page.tsx index 78b6087..f56ece3 100644 --- a/src/app/(main)/funds_transfer/page.tsx +++ b/src/app/(main)/funds_transfer/page.tsx @@ -110,7 +110,7 @@ export default function QuickPay() { }); const data = await response.json(); if (response.ok && Array.isArray(data)) { - const filterSAaccount = data.filter((acc) => acc.stAccountType === 'SA'); + const filterSAaccount = data.filter((acc) => ['SA', 'SB'].includes(acc.stAccountType)); setAccountData(filterSAaccount); } } catch { diff --git a/src/app/(main)/funds_transfer/send_beneficiary/page.tsx b/src/app/(main)/funds_transfer/send_beneficiary/page.tsx index a7ac27b..673f525 100644 --- a/src/app/(main)/funds_transfer/send_beneficiary/page.tsx +++ b/src/app/(main)/funds_transfer/send_beneficiary/page.tsx @@ -120,7 +120,7 @@ export default function SendToBeneficiaryOwn() { }); const data = await response.json(); if (response.ok && Array.isArray(data)) { - const filterSAaccount = data.filter((acc) => acc.stAccountType === 'SA'); + const filterSAaccount = data.filter((acc) => ['SA', 'SB'].includes(acc.stAccountType)); setAccountData(filterSAaccount); } } catch { diff --git a/src/app/(main)/funds_transfer/send_beneficiary/sendBeneficiaryOthers.tsx b/src/app/(main)/funds_transfer/send_beneficiary/sendBeneficiaryOthers.tsx index 6ceb13c..dccfcfe 100644 --- a/src/app/(main)/funds_transfer/send_beneficiary/sendBeneficiaryOthers.tsx +++ b/src/app/(main)/funds_transfer/send_beneficiary/sendBeneficiaryOthers.tsx @@ -177,7 +177,7 @@ export default function SendToBeneficiaryOthers() { }); const data = await response.json(); if (response.ok && Array.isArray(data)) { - const filterSAaccount = data.filter((acc) => acc.stAccountType === 'SA'); + const filterSAaccount = data.filter((acc) => ['SA', 'SB'].includes(acc.stAccountType)); setAccountData(filterSAaccount); } } catch { diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index c373c53..2ccd540 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -49,6 +49,11 @@ export default function Login() { console.log(CIF); // await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: mobile }); await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: '7890544527' }); + notifications.show({ + color: "orange", + title: "OTP Required", + message: "OTP sent to your registered mobile number", + }); return true; } catch (err: any) { @@ -106,202 +111,10 @@ export default function Login() { setInputCaptcha(""); }; - // async function handleLogin(e: React.FormEvent) { - // e.preventDefault(); - // if (!otpRequired && !otpVerified) { - // const onlyDigit = /^\d{11}$/; - // if (!onlyDigit.test(CIF)) { - // // setError('Input value must be 11 digit'); - // notifications.show({ - // withBorder: true, - // color: "red", - // title: "Invalid UserId", - // message: "UserID must be 11 digit", - // autoClose: 5000, - // }); - // return; - // } - // if (!inputCaptcha) { - // notifications.show({ - // withBorder: true, - // color: "red", - // title: "Invalid Captcha", - // message: "Please fill the Captcha filed", - // autoClose: 5000, - // }); - // return; - // } - // if (inputCaptcha !== captcha) { - // notifications.show({ - // withBorder: true, - // color: "red", - // title: "Captcha Error", - // message: "Please enter the correct captcha", - // autoClose: 5000, - // }); - // regenerateCaptcha(); - // return; - // } - // if (!CIF || !psw) { - // notifications.show({ - // withBorder: true, - // color: "red", - // title: "Invalid Input", - // message: "Please fill UserId and Password", - // autoClose: 5000, - // }); - // return; - // } - // } - // try { - // if (!otpRequired || otpVerified) { - // const response = await fetch('api/auth/login', { - // method: 'POST', - // headers: { - // 'Content-Type': 'application/json', - // 'X-Login-Type': 'IB', - // }, - // body: JSON.stringify({ - // customerNo: CIF, - // password: psw, - // otp: otp - // }), - // }); - // const data = await response.json(); - // console.log(data); - // setIsLogging(true); - - // if (data.status === "OTP_REQUIRED" && response.status === 202) { - // console.log(data.mobile); - // setMobile(data.mobile); - // setOtpRequired(true); - // setButtonLabel("Verify OTP"); - - // const otpSent = await handleSendOtp(data.mobile); // auto-send - // if (otpSent) { - // notifications.show({ - // color: "orange", - // title: "OTP Required", - // message: "OTP sent to your registered mobile number", - // }); - // } - // return; - // } - // if (data.error === "MIGRATED_USER_HAS_NO_PASSWORD") { - // //console.log("Migration issue detected → opening modal"); - // setOpened(true); - // return; - // } - // if (!response.ok) { - // notifications.show({ - // withBorder: true, - // color: "red", - // title: "Error", - // message: data?.error || "Internal Server Error", - // autoClose: 5000, - // }); - // regenerateCaptcha(); - // localStorage.removeItem("access_token"); - // localStorage.clear(); - // sessionStorage.clear(); - // return; - - // } - // // setIsLogging(true); - // if (response.ok) { - // // console.log(data); - // setOtp(""); - // const token = data.token; - // localStorage.setItem("access_token", token); - // localStorage.setItem("pswExpiryDate", data.loginPswExpiry); - // // console.log("Expiry Date:",(dayjs(data.loginPswExpiry)).diff(dayjs(), "day")); - - // // Password Expiry Logic - // if (data.loginPswExpiry && (dayjs(data.loginPswExpiry)).diff(dayjs(), "day") < 0) { - // notifications.show({ - // withBorder: true, - // color: "orange", - // title: "Password Expired", - // message: "Your password has expired, please set a new one.", - // autoClose: 4000, - // }); - // router.push("/ChangePassword"); - // return; - // } - - // if (data.FirstTimeLogin === true) { - // router.push("/SetPassword") - // } - // else { - // router.push("/home"); - // } - - // } - // else { - // regenerateCaptcha(); - // setIsLogging(false); - // notifications.show({ - // withBorder: true, - // color: "red", - // title: "Wrong User Id or Password", - // message: "Wrong User Id or Password", - // autoClose: 5000, - // }); - // } - // } - // if (otpRequired && !otpVerified) { - // if (!otp) { - // notifications.show({ - // color: "red", - // title: "Invalid OTP", - // message: "Please enter OTP before verifying", - // }); - // setIsLogging(false); - // return; - // } - // console.log("hi verify mob", mobile); - // const verified = await handleVerifyOtp(mobile); - // if (!verified) { - // notifications.show({ - // title: "Invalid OTP", - // message: "The OTP entered does not match", - // color: "red", - // }); - // return; - // } - - // notifications.show({ - // color: "green", - // title: "OTP Verified", - // message: "Please click Login to continue", - // }); - // setOtpVerified(true); - // setButtonLabel("Login"); - // setIsLogging(false); - // return; - // } - // } - // catch (error: any) { - // notifications.show({ - // withBorder: true, - // color: "red", - // title: "Error", - // message: "Internal Server Error,Please try again Later", - // autoClose: 5000, - // }); - // return; - // } - // finally { - // setIsLogging(false); - // } - // } - - - - // For migration User async function handleLogin(e: React.FormEvent) { e.preventDefault(); + if (isLogging) return; setIsLogging(true); // show loading & disable inputs try { @@ -384,13 +197,13 @@ export default function Login() { setButtonLabel("Verify OTP"); const otpSent = await handleSendOtp(data.mobile); - if (otpSent) { - notifications.show({ - color: "orange", - title: "OTP Required", - message: "OTP sent to your registered mobile number", - }); - } + // if (otpSent) { + // notifications.show({ + // color: "orange", + // title: "OTP Required", + // message: "OTP sent to your registered mobile number", + // }); + // } setIsLogging(false); return; } @@ -775,7 +588,7 @@ export default function Login() { onChange={(e) => setOtp(e.currentTarget.value)} withAsterisk style={{ flex: 1 }} - readOnly={otpVerified} + disabled={otpVerified} />