From d9f0a2ddcacd3038e8b503f89341391dff7865f0 Mon Sep 17 00:00:00 2001 From: yashmantri Date: Mon, 30 Sep 2024 16:41:02 +0530 Subject: [PATCH 1/4] TP-65692 | Payment Link fix --- .../registerPayements/OnlinePayment.tsx | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/screens/registerPayements/OnlinePayment.tsx b/src/screens/registerPayements/OnlinePayment.tsx index e5696b9b..2310b893 100644 --- a/src/screens/registerPayements/OnlinePayment.tsx +++ b/src/screens/registerPayements/OnlinePayment.tsx @@ -7,7 +7,11 @@ import TextInput, { TextInputMaskType } from '../../../RN-UI-LIB/src/components/ import { GenericStyles } from '../../../RN-UI-LIB/src/styles'; import { COLORS } from '../../../RN-UI-LIB/src/styles/colors'; import { formatAmount } from '../../../RN-UI-LIB/src/utlis/amount'; -import { PaymentType, generatePaymentLinkAction } from '../../action/paymentActions'; +import { + PaymentType, + generatePaymentLinkAction, + getForeclosureAmount, +} from '../../action/paymentActions'; import { CLICKSTREAM_EVENT_NAMES } from '../../common/Constants'; import { copyToClipboard, @@ -28,6 +32,9 @@ import { ITelephoneNumbers } from '@reducers/telephoneNumbersSlice'; import PressableChip from '@rn-ui-lib/components/PressableChip'; import { PAYMENT_LINK_CHANNELS } from './Constants'; import { getCommunicationChannelType } from './utils'; +import { dateFormat } from '@rn-ui-lib/utils/dates'; +import { IForeclosureBreakup } from './ForeclosureBreakupAccordion'; +import { DEFAULT_FORECLOSURE_BREAKUP } from './Foreclosure'; interface IOnlinePayment { caseId: string; @@ -63,6 +70,20 @@ const OnlinePayment: React.FC = ({ const [showQrCodeModal, setShowQrCodeModal] = React.useState(false); const [paymentLink, setPaymentLink] = useState(''); const [isLoading, setIsLoading] = useState(false); + const [foreClosureDetails, setForeClosureDetails] = useState( + DEFAULT_FORECLOSURE_BREAKUP + ); + + useEffect(() => { + const getForeCLosureDetails = async () => { + const foreclosureAmount = await getForeclosureAmount( + caseDetail?.loanAccountNumber, + dateFormat(new Date(), 'YYYY-MM-DD') + ); + setForeClosureDetails(foreclosureAmount); + }; + getForeCLosureDetails(); + }, []); useEffect(() => { if (paymentLink && generateClicked) { @@ -115,6 +136,8 @@ const OnlinePayment: React.FC = ({ errorMessage = `The entered amount should be between ${formatAmount(1)} and ${formatAmount( maxAmount )}`; + case 'validate': + errorMessage = 'Please enter a valid number'; break; } const isPaymentButtonDisabled = !isValid || !isOnline; @@ -237,7 +260,12 @@ const OnlinePayment: React.FC = ({ required: true, min: 1, max: maxAmount, - validate: (value) => isValidAmountEntered(Number(value)), + validate: (value) => { + const amountVal = Number(value); + if (amountVal !== foreClosureDetails?.totalAmount) + return isValidAmountEntered(amountVal) && Number.isInteger(amountVal); + return isValidAmountEntered(amountVal); + }, }} /> From f1c7b5e47b625d1dd78076c070059b258d6115d4 Mon Sep 17 00:00:00 2001 From: yashmantri Date: Mon, 30 Sep 2024 16:42:29 +0530 Subject: [PATCH 2/4] TP-65692 | Payment Link fix --- android/app/build.gradle | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index c3a7a4bf..b238b213 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -134,8 +134,8 @@ def reactNativeArchitectures() { return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } -def VERSION_CODE = 198 -def VERSION_NAME = "2.13.10" +def VERSION_CODE = 199 +def VERSION_NAME = "2.13.11" android { ndkVersion rootProject.ext.ndkVersion diff --git a/package.json b/package.json index ec8e868e..725c083a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "AV_APP", - "version": "2.13.10", - "buildNumber": "198", + "version": "2.13.11", + "buildNumber": "199", "private": true, "scripts": { "android:dev": "yarn move:dev && react-native run-android", From 8bc80d5e80db7d7545b0dbea88eb87775e4cd24a Mon Sep 17 00:00:00 2001 From: yashmantri Date: Mon, 30 Sep 2024 17:02:28 +0530 Subject: [PATCH 3/4] TP-65692 | Payment Link fix --- src/screens/registerPayements/OnlinePayment.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screens/registerPayements/OnlinePayment.tsx b/src/screens/registerPayements/OnlinePayment.tsx index 2310b893..31647436 100644 --- a/src/screens/registerPayements/OnlinePayment.tsx +++ b/src/screens/registerPayements/OnlinePayment.tsx @@ -137,7 +137,7 @@ const OnlinePayment: React.FC = ({ maxAmount )}`; case 'validate': - errorMessage = 'Please enter a valid number'; + errorMessage = 'Please enter a valid amount'; break; } const isPaymentButtonDisabled = !isValid || !isOnline; From 4c80aa1237e826bfa83908830e198c1cf6bbad9e Mon Sep 17 00:00:00 2001 From: yashmantri Date: Mon, 30 Sep 2024 18:05:27 +0530 Subject: [PATCH 4/4] TP-65692 | Payment Link fix --- src/screens/registerPayements/OnlinePayment.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/screens/registerPayements/OnlinePayment.tsx b/src/screens/registerPayements/OnlinePayment.tsx index 31647436..5d242af0 100644 --- a/src/screens/registerPayements/OnlinePayment.tsx +++ b/src/screens/registerPayements/OnlinePayment.tsx @@ -136,6 +136,7 @@ const OnlinePayment: React.FC = ({ errorMessage = `The entered amount should be between ${formatAmount(1)} and ${formatAmount( maxAmount )}`; + break; case 'validate': errorMessage = 'Please enter a valid amount'; break;