@finspringinnovations/fixeddepositsdk 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/customerApi.js +1 -0
- package/lib/api/fdApi.d.ts +401 -1
- package/lib/api/fdApi.js +24 -2
- package/lib/config/workflowConstants.d.ts +40 -30
- package/lib/config/workflowConstants.js +35 -24
- package/lib/navigation/RootNavigator.js +62 -81
- package/lib/navigation/types.d.ts +4 -1
- package/lib/navigation/workflowNavigator.d.ts +1 -1
- package/lib/navigation/workflowNavigator.js +107 -26
- package/lib/screens/AadhaarVerification.js +1 -11
- package/lib/screens/AddBankAccount.js +1 -11
- package/lib/screens/BankDetail.js +1 -11
- package/lib/screens/Employee.js +1 -11
- package/lib/screens/FDCalculator.js +1 -11
- package/lib/screens/FDList.js +529 -416
- package/lib/screens/FindIFSC.js +1 -11
- package/lib/screens/NomineeDetail.js +12 -22
- package/lib/screens/PayNow.js +1 -11
- package/lib/screens/Payment.js +2 -11
- package/lib/screens/PaymentStatus.js +11 -21
- package/lib/screens/ReviewKYC.js +1 -11
- package/lib/types/workflowTypes.d.ts +1 -1
- package/package.json +1 -1
- package/src/api/customerApi.ts +1 -0
- package/src/api/fdApi.ts +28 -1
- package/src/config/workflowConstants.ts +51 -39
- package/src/constants/strings/bank.ts +80 -80
- package/src/navigation/RootNavigator.tsx +646 -663
- package/src/navigation/types.ts +4 -1
- package/src/navigation/workflowNavigator.ts +170 -107
- package/src/screens/AadhaarVerification.tsx +1 -15
- package/src/screens/AddBankAccount.tsx +2 -16
- package/src/screens/BankDetail.tsx +1 -15
- package/src/screens/Employee.tsx +1 -15
- package/src/screens/FDCalculator.tsx +1 -15
- package/src/screens/FDList.tsx +2311 -2171
- package/src/screens/FindIFSC.tsx +2 -16
- package/src/screens/NomineeDetail.tsx +762 -775
- package/src/screens/PayNow.tsx +2 -16
- package/src/screens/Payment.tsx +190 -203
- package/src/screens/PaymentStatus.tsx +574 -588
- package/src/screens/ReviewKYC.tsx +1 -15
- package/src/types/workflowTypes.ts +1 -10
package/lib/screens/FDList.js
CHANGED
|
@@ -36,31 +36,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const mahindrafdsdk_1 = require("@finspringinnovations/mahindrafdsdk");
|
|
40
|
+
const shriramfdsdk_1 = require("@finspringinnovations/shriramfdsdk");
|
|
41
|
+
const native_1 = require("@react-navigation/native");
|
|
39
42
|
const react_1 = __importStar(require("react"));
|
|
40
43
|
const react_native_1 = require("react-native");
|
|
41
|
-
const native_1 = require("@react-navigation/native");
|
|
42
|
-
const components_1 = require("../components");
|
|
43
|
-
const ThemeContext_1 = require("../theme/ThemeContext");
|
|
44
|
-
const interestRateApi_1 = require("../api/interestRateApi");
|
|
45
44
|
const customerApi_1 = require("../api/customerApi");
|
|
45
|
+
const fdApi_1 = require("../api/fdApi");
|
|
46
|
+
const interestRateApi_1 = require("../api/interestRateApi");
|
|
46
47
|
const masterDataApi_1 = require("../api/masterDataApi");
|
|
47
|
-
const MasterDataProvider_1 = require("../providers/MasterDataProvider");
|
|
48
48
|
const workflowApi_1 = require("../api/workflowApi");
|
|
49
|
-
const
|
|
49
|
+
const components_1 = require("../components");
|
|
50
50
|
const SafeAreaWrapper_1 = __importDefault(require("../components/SafeAreaWrapper"));
|
|
51
51
|
const appDataConfig_1 = require("../config/appDataConfig");
|
|
52
|
+
const workflowConstants_1 = require("../config/workflowConstants");
|
|
53
|
+
const strings_1 = require("../constants/strings");
|
|
54
|
+
const base64Images_1 = require("../constants/strings/base64Images");
|
|
52
55
|
const helpers_1 = require("../navigation/helpers");
|
|
56
|
+
const workflowNavigator_1 = require("../navigation/workflowNavigator");
|
|
57
|
+
const MasterDataProvider_1 = require("../providers/MasterDataProvider");
|
|
53
58
|
const store_1 = require("../store");
|
|
54
|
-
const onboardingSlice_1 = require("../store/onboardingSlice");
|
|
55
59
|
const fdListSelectedSlice_1 = require("../store/fdListSelectedSlice");
|
|
56
|
-
const
|
|
57
|
-
const
|
|
60
|
+
const onboardingSlice_1 = require("../store/onboardingSlice");
|
|
61
|
+
const ThemeContext_1 = require("../theme/ThemeContext");
|
|
58
62
|
const globalData_1 = require("../utils/globalData");
|
|
59
|
-
const mahindrafdsdk_1 = require("@finspringinnovations/mahindrafdsdk");
|
|
60
|
-
const strings_1 = require("../constants/strings");
|
|
61
|
-
const base64Images_1 = require("../constants/strings/base64Images");
|
|
62
|
-
const shriramfdsdk_1 = require("@finspringinnovations/shriramfdsdk");
|
|
63
|
-
const mahindrafdsdk_2 = require("@finspringinnovations/mahindrafdsdk");
|
|
64
63
|
var completeFDData = null;
|
|
65
64
|
/** Resolve company logo type for FD list card by name or provider. */
|
|
66
65
|
function getLogoTypeForFD(fd) {
|
|
@@ -108,6 +107,7 @@ function appToPendingFDData(app) {
|
|
|
108
107
|
const rate = Number((_e = (_d = app.interest_rate) !== null && _d !== void 0 ? _d : app.interestRate) !== null && _e !== void 0 ? _e : 0);
|
|
109
108
|
const value = Number((_j = (_h = (_g = (_f = app.current_value) !== null && _f !== void 0 ? _f : app.currentValue) !== null && _g !== void 0 ? _g : app.maturity_amount) !== null && _h !== void 0 ? _h : app.maturityAmount) !== null && _j !== void 0 ? _j : 0);
|
|
110
109
|
const maturityDateStr = app.maturity_date || app.maturityDate || '';
|
|
110
|
+
const tenure = Number(app.tenure_in_months) ? app.tenure_in_months + " Months" : '';
|
|
111
111
|
let maturityDate = '--';
|
|
112
112
|
if (maturityDateStr) {
|
|
113
113
|
const d = new Date(maturityDateStr);
|
|
@@ -126,6 +126,7 @@ function appToPendingFDData(app) {
|
|
|
126
126
|
maturityDate,
|
|
127
127
|
interestPayout: app.interest_payout_term || app.interestPayoutTerm || app.payout_term || 'Yearly',
|
|
128
128
|
logoType: logoType !== null && logoType !== void 0 ? logoType : undefined,
|
|
129
|
+
tenure: tenure
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
132
|
/** Resolve providerId from app payload robustly; infer from provider name when id key is missing. */
|
|
@@ -160,6 +161,8 @@ const FDList = ({ onGoBack, onSelectFD, onNavigateToFDCalculator, onNavigateToEx
|
|
|
160
161
|
const [isInitialized, setIsInitialized] = (0, react_1.useState)(false);
|
|
161
162
|
/** Loading state for Mahindra customer/application/details prefetch (used for pending FD continue). */
|
|
162
163
|
const [isLoadingMahindraCustomerDetails, setIsLoadingMahindraCustomerDetails] = (0, react_1.useState)(false);
|
|
164
|
+
/** True while handlePendingFDContinue is in-flight (tap → navigate). Blocks the UI with a loader. */
|
|
165
|
+
const [isPendingFDLoading, setIsPendingFDLoading] = (0, react_1.useState)(false);
|
|
163
166
|
const colors = (0, ThemeContext_1.useColors)();
|
|
164
167
|
const typography = (0, ThemeContext_1.useTypography)();
|
|
165
168
|
const spacing = (0, ThemeContext_1.useSpacing)();
|
|
@@ -176,6 +179,7 @@ const FDList = ({ onGoBack, onSelectFD, onNavigateToFDCalculator, onNavigateToEx
|
|
|
176
179
|
const [terminateWorkflow, { data: terminateWorkflowData, error: terminateWorkflowError, isLoading: isTerminatingWorkflow, }] = (0, workflowApi_1.useTerminateWorkflowMutation)();
|
|
177
180
|
// Payment Reverse Feed API
|
|
178
181
|
const [paymentReverseFeed, { data: paymentReverseFeedResponse, error: paymentReverseFeedError, isLoading: isLoadingPaymentReverseFeed, }] = (0, fdApi_1.usePaymentReverseFeedMutation)();
|
|
182
|
+
const [getPaymentUrl] = (0, fdApi_1.useLazyGetPaymentUrlQuery)();
|
|
179
183
|
const styles = createStyles(colors, typography, spacing, themeName);
|
|
180
184
|
const { masterData: masterDataContext, setMasterData } = (0, MasterDataProvider_1.useMasterData)();
|
|
181
185
|
// Redux selectors for workflow IDs
|
|
@@ -210,8 +214,8 @@ const FDList = ({ onGoBack, onSelectFD, onNavigateToFDCalculator, onNavigateToEx
|
|
|
210
214
|
(0, shriramfdsdk_1.initializeSDK)(currentAppData);
|
|
211
215
|
}
|
|
212
216
|
else {
|
|
213
|
-
(0,
|
|
214
|
-
(0,
|
|
217
|
+
(0, mahindrafdsdk_1.initializeEnvironment)(currentEnvData);
|
|
218
|
+
(0, mahindrafdsdk_1.initializeSDK)(currentAppData);
|
|
215
219
|
}
|
|
216
220
|
return true;
|
|
217
221
|
}
|
|
@@ -634,20 +638,7 @@ const FDList = ({ onGoBack, onSelectFD, onNavigateToFDCalculator, onNavigateToEx
|
|
|
634
638
|
};
|
|
635
639
|
initializeComponent();
|
|
636
640
|
}, [onGoBack]);
|
|
637
|
-
//
|
|
638
|
-
(0, react_1.useEffect)(() => {
|
|
639
|
-
if (react_native_1.Platform.OS !== 'android')
|
|
640
|
-
return;
|
|
641
|
-
const onHardwareBackPress = () => {
|
|
642
|
-
// Call onGoBack which triggers onExit in RootNavigator
|
|
643
|
-
if (onGoBack) {
|
|
644
|
-
onGoBack();
|
|
645
|
-
}
|
|
646
|
-
return true; // Prevent default behavior
|
|
647
|
-
};
|
|
648
|
-
const backHandler = react_native_1.BackHandler.addEventListener('hardwareBackPress', onHardwareBackPress);
|
|
649
|
-
return () => backHandler.remove();
|
|
650
|
-
}, [onGoBack]);
|
|
641
|
+
// Removed screen-level hardware back handler to allow only header back button navigation
|
|
651
642
|
// Removed init-time fetch to avoid duplicate calls; we'll fetch on first focus only
|
|
652
643
|
// Refresh data when screen comes into focus (only if initialized)
|
|
653
644
|
(0, native_1.useFocusEffect)((0, react_1.useCallback)(() => {
|
|
@@ -779,426 +770,548 @@ const FDList = ({ onGoBack, onSelectFD, onNavigateToFDCalculator, onNavigateToEx
|
|
|
779
770
|
// }, [customerApplications, dispatch]);
|
|
780
771
|
// Unified handler: behave like bottom sheet Continue flow
|
|
781
772
|
const handlePendingFDContinue = async (overrideApp, forcedSdkType) => {
|
|
782
|
-
var _a, _b, _c;
|
|
783
|
-
|
|
784
|
-
let currentState = null;
|
|
785
|
-
let transactionId = undefined;
|
|
786
|
-
let appData = overrideApp || pendingContextApp;
|
|
787
|
-
let fdDisplay = null;
|
|
788
|
-
let onboardingIdsFromApp = null;
|
|
773
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
774
|
+
setIsPendingFDLoading(true);
|
|
789
775
|
try {
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
776
|
+
// Get current state from customer applications for workflow navigation
|
|
777
|
+
let currentStateCaption = "";
|
|
778
|
+
let transactionId = undefined;
|
|
779
|
+
let appData = overrideApp || pendingContextApp;
|
|
780
|
+
let fdDisplay = null;
|
|
781
|
+
let onboardingIdsFromApp = null;
|
|
782
|
+
try {
|
|
783
|
+
if (!appData && customerApplications && !isCustomerApplicationsEmpty()) {
|
|
784
|
+
// Normalize list
|
|
785
|
+
let applicationsData = [];
|
|
786
|
+
if (Array.isArray(customerApplications)) {
|
|
787
|
+
applicationsData = customerApplications;
|
|
788
|
+
}
|
|
789
|
+
else if (customerApplications.data && Array.isArray(customerApplications.data)) {
|
|
790
|
+
applicationsData = customerApplications.data;
|
|
791
|
+
}
|
|
792
|
+
else if (customerApplications.applications && Array.isArray(customerApplications.applications)) {
|
|
793
|
+
applicationsData = customerApplications.applications;
|
|
794
|
+
}
|
|
795
|
+
if (applicationsData.length > 0) {
|
|
796
|
+
// Fallback: find first Active application when no override/pendingContext
|
|
797
|
+
appData = applicationsData.find((a) => {
|
|
798
|
+
const s = (a.wf_status || a.status || '').toString();
|
|
799
|
+
return s === 'Active';
|
|
800
|
+
}) || applicationsData.find((a) => {
|
|
801
|
+
const s = (a.wf_status || a.status || '').toString().toLowerCase();
|
|
802
|
+
return PENDING_ACTIVE_STATUSES.includes(s);
|
|
803
|
+
}) || applicationsData[0];
|
|
804
|
+
}
|
|
801
805
|
}
|
|
802
|
-
if (
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
806
|
+
if (appData) {
|
|
807
|
+
currentStateCaption = appData.current_state_caption;
|
|
808
|
+
transactionId = appData.transaction_id || appData.transactionId || appData.Transactionid || appData.TransactionId;
|
|
809
|
+
fdDisplay = appToPendingFDData(appData);
|
|
810
|
+
let providerIdFromApp = resolveProviderIdFromApp(appData, MahindraProviderId, ShriramProviderId);
|
|
811
|
+
if (forcedSdkType === 'mahindra') {
|
|
812
|
+
providerIdFromApp = MahindraProviderId;
|
|
813
|
+
}
|
|
814
|
+
else if (forcedSdkType === 'shriram') {
|
|
815
|
+
providerIdFromApp = ShriramProviderId;
|
|
816
|
+
}
|
|
817
|
+
const providerIdLower = (providerIdFromApp || '').toLowerCase();
|
|
818
|
+
const isMahindra = providerIdLower === MahindraProviderId.toLowerCase();
|
|
819
|
+
// For Mahindra flows, ensure customer/application/details are fully loaded
|
|
820
|
+
// before navigating into ExternalSDK so downstream screens see complete
|
|
821
|
+
// nominee/bank/KYC/guardian data. Show a loader while we wait.
|
|
822
|
+
if (isMahindra) {
|
|
823
|
+
await prefetchMahindraCustomerApplicationDetails(appData);
|
|
824
|
+
}
|
|
825
|
+
console.log("fdDisplay===>", fdDisplay);
|
|
826
|
+
try {
|
|
827
|
+
const fdListSelectedData = {
|
|
828
|
+
id: appData.fd_id || appData.fdId || 'active-fd',
|
|
829
|
+
providerId: providerIdFromApp,
|
|
830
|
+
name: fdDisplay.name,
|
|
831
|
+
accountNumber: appData.account_number || appData.accountNumber || '',
|
|
832
|
+
roi: `${fdDisplay.returns}% p.a.`,
|
|
833
|
+
tenure: fdDisplay.tenure || '-',
|
|
834
|
+
amount: Number(fdDisplay.invested) || 0,
|
|
835
|
+
maturityDate: fdDisplay.maturityDate || '-',
|
|
836
|
+
status: 'active',
|
|
837
|
+
creditRating: getStaticCreditRatingForFD({
|
|
838
|
+
name: fdDisplay.name,
|
|
839
|
+
providerId: providerIdFromApp,
|
|
840
|
+
}),
|
|
841
|
+
companyName: fdDisplay.name,
|
|
842
|
+
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
843
|
+
interestPayout: fdDisplay.interestPayout || '',
|
|
844
|
+
};
|
|
845
|
+
dispatch((0, fdListSelectedSlice_1.setFDListSelected)(fdListSelectedData));
|
|
846
|
+
}
|
|
847
|
+
catch (e) {
|
|
848
|
+
// Handle error silently
|
|
849
|
+
}
|
|
850
|
+
try {
|
|
851
|
+
const ids = {
|
|
852
|
+
workflowInstanceId: appData.workflow_instance_id || appData.workflowInstanceId,
|
|
853
|
+
applicationId: appData.application_id || appData.applicationId,
|
|
854
|
+
entityid: appData.entity_id || appData.entityId,
|
|
855
|
+
customerId: appData.customer_id || appData.customerId,
|
|
856
|
+
fdId: appData.fd_id || appData.fdId,
|
|
857
|
+
currentState: appData.current_state || appData.currentState,
|
|
858
|
+
currentTask: appData.current_task || appData.currentTask,
|
|
859
|
+
providerId: providerIdFromApp || undefined,
|
|
860
|
+
wfStatus: appData.wf_status || appData.wfStatus,
|
|
861
|
+
};
|
|
862
|
+
onboardingIdsFromApp = ids;
|
|
863
|
+
dispatch((0, onboardingSlice_1.setOnboardingIds)(ids));
|
|
864
|
+
}
|
|
865
|
+
catch (e) {
|
|
866
|
+
}
|
|
811
867
|
}
|
|
812
868
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
869
|
+
catch (error) {
|
|
870
|
+
// Handle error silently
|
|
871
|
+
}
|
|
872
|
+
if (!fdDisplay && appData)
|
|
816
873
|
fdDisplay = appToPendingFDData(appData);
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
providerIdFromApp = ShriramProviderId;
|
|
823
|
-
}
|
|
824
|
-
const providerIdLower = (providerIdFromApp || '').toLowerCase();
|
|
825
|
-
const isMahindra = providerIdLower === MahindraProviderId.toLowerCase();
|
|
826
|
-
// For Mahindra flows, ensure customer/application/details are fully loaded
|
|
827
|
-
// before navigating into ExternalSDK so downstream screens see complete
|
|
828
|
-
// nominee/bank/KYC/guardian data. Show a loader while we wait.
|
|
829
|
-
if (isMahindra) {
|
|
830
|
-
await prefetchMahindraCustomerApplicationDetails(appData);
|
|
831
|
-
}
|
|
874
|
+
// If current state is payment and transactionId is available, call payment reverse feed API
|
|
875
|
+
// Check for both Mahindra and Shriram payment states
|
|
876
|
+
const isPaymentState = currentStateCaption === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.PAYMENT ||
|
|
877
|
+
currentStateCaption === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.PAYMENT;
|
|
878
|
+
if (isPaymentState && transactionId) {
|
|
832
879
|
try {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
880
|
+
// Get user info and required IDs (prefer appData from continue context)
|
|
881
|
+
const userInfo = (0, appDataConfig_1.getUserInfoForAPI)();
|
|
882
|
+
let providerIdFromApp = resolveProviderIdFromApp(appData, MahindraProviderId, ShriramProviderId);
|
|
883
|
+
if (forcedSdkType === 'mahindra')
|
|
884
|
+
providerIdFromApp = MahindraProviderId;
|
|
885
|
+
if (forcedSdkType === 'shriram')
|
|
886
|
+
providerIdFromApp = ShriramProviderId;
|
|
887
|
+
const paymentReverseFeedRequest = {
|
|
888
|
+
providerId: providerIdFromApp || providerId,
|
|
889
|
+
workflowInstanceId: (appData === null || appData === void 0 ? void 0 : appData.workflow_instance_id) || (appData === null || appData === void 0 ? void 0 : appData.workflowInstanceId) || workflowInstanceId,
|
|
890
|
+
userreferenceid: userInfo.id,
|
|
891
|
+
applicationid: (appData === null || appData === void 0 ? void 0 : appData.application_id) || (appData === null || appData === void 0 ? void 0 : appData.applicationId) || applicationId,
|
|
892
|
+
entityid: (appData === null || appData === void 0 ? void 0 : appData.entity_id) || (appData === null || appData === void 0 ? void 0 : appData.entityId) || entityId,
|
|
893
|
+
transactionId: transactionId,
|
|
894
|
+
};
|
|
895
|
+
const response = await paymentReverseFeed(paymentReverseFeedRequest).unwrap();
|
|
896
|
+
// Handle the response based on payment status (normalize to uppercase)
|
|
897
|
+
const paymentStatus = (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.paymentStatus) || (response === null || response === void 0 ? void 0 : response.paymentStatus) || '').toUpperCase();
|
|
898
|
+
const statusParam = paymentStatus === 'SUCCESS' ? 'success' : paymentStatus === 'FAILED' ? 'failed' : 'pending';
|
|
899
|
+
const fdDataParam = fdDisplay ? {
|
|
900
|
+
companyName: fdDisplay.name,
|
|
840
901
|
amount: Number(fdDisplay.invested) || 0,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
902
|
+
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
903
|
+
tenure: fdDisplay.tenure ? `${fdDisplay.tenure}` : '-',
|
|
904
|
+
interestPayout: fdDisplay.interestPayout || 'Yearly',
|
|
905
|
+
} : activeFD ? {
|
|
906
|
+
companyName: activeFD.name,
|
|
907
|
+
amount: Number(activeFD.invested) || 0,
|
|
908
|
+
fdRate: `${activeFD.returns}% p.a.`,
|
|
909
|
+
tenure: activeFD.maturityDate ? `${activeFD.maturityDate}` : '-',
|
|
910
|
+
interestPayout: activeFD.interestPayout || 'Yearly',
|
|
911
|
+
} : undefined;
|
|
912
|
+
// Shriram: always navigate to Shriram SDK PaymentStatus, never FDSDK PaymentStatus
|
|
913
|
+
let paymentProviderId = resolveProviderIdFromApp(appData, MahindraProviderId, ShriramProviderId).toLowerCase();
|
|
914
|
+
if (forcedSdkType === 'mahindra')
|
|
915
|
+
paymentProviderId = MahindraProviderId.toLowerCase();
|
|
916
|
+
if (forcedSdkType === 'shriram')
|
|
917
|
+
paymentProviderId = ShriramProviderId.toLowerCase();
|
|
918
|
+
const isShriramPayment = paymentProviderId === ShriramProviderId.toLowerCase();
|
|
919
|
+
const isMahindraPayment = paymentProviderId === MahindraProviderId.toLowerCase();
|
|
920
|
+
if (isShriramPayment && appData) {
|
|
921
|
+
if (!initializeExternalSDKFromFDList('shriram'))
|
|
922
|
+
return;
|
|
923
|
+
let ShriramSDKGlobalDataPayment = null;
|
|
924
|
+
if (customerApplications && !isCustomerApplicationsEmpty()) {
|
|
925
|
+
let applicationsData = [];
|
|
926
|
+
if (Array.isArray(customerApplications))
|
|
927
|
+
applicationsData = customerApplications;
|
|
928
|
+
else if ((customerApplications === null || customerApplications === void 0 ? void 0 : customerApplications.data) && Array.isArray(customerApplications.data))
|
|
929
|
+
applicationsData = customerApplications.data;
|
|
930
|
+
else if ((customerApplications === null || customerApplications === void 0 ? void 0 : customerApplications.applications) && Array.isArray(customerApplications.applications))
|
|
931
|
+
applicationsData = customerApplications.applications;
|
|
932
|
+
const completeApplications = applicationsData.filter((app) => {
|
|
933
|
+
const s = (app.wf_status || app.status || '').toString().toLowerCase();
|
|
934
|
+
return s === 'completed' || s === 'complete';
|
|
935
|
+
});
|
|
936
|
+
const shriramComplete = completeApplications.find((app) => (app.fd_provider_id || app.fdProviderId || app.provider_id || app.providerId || '').toLowerCase() === ShriramProviderId.toLowerCase());
|
|
937
|
+
if (shriramComplete)
|
|
938
|
+
ShriramSDKGlobalDataPayment = shriramComplete;
|
|
939
|
+
}
|
|
940
|
+
const fdListSelectedDataPayment = fdDisplay ? {
|
|
941
|
+
id: appData.fd_id || appData.fdId || 'active-fd',
|
|
942
|
+
providerId: providerIdFromApp,
|
|
844
943
|
name: fdDisplay.name,
|
|
944
|
+
accountNumber: appData.account_number || appData.accountNumber || '',
|
|
945
|
+
roi: `${fdDisplay.returns}% p.a.`,
|
|
946
|
+
tenure: fdDisplay.tenure || '-',
|
|
947
|
+
amount: Number(fdDisplay.invested) || 0,
|
|
948
|
+
maturityDate: fdDisplay.maturityDate || '-',
|
|
949
|
+
status: 'active',
|
|
950
|
+
creditRating: getStaticCreditRatingForFD({
|
|
951
|
+
name: fdDisplay.name,
|
|
952
|
+
providerId: providerIdFromApp,
|
|
953
|
+
}),
|
|
954
|
+
companyName: fdDisplay.name,
|
|
955
|
+
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
956
|
+
interestPayout: fdDisplay.interestPayout || 'Yearly',
|
|
957
|
+
} : null;
|
|
958
|
+
const masterDataPayment = ShriramMasterData;
|
|
959
|
+
(0, helpers_1.navigate)('ExternalSDK', {
|
|
960
|
+
sdkType: 'shriram',
|
|
845
961
|
providerId: providerIdFromApp,
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
}
|
|
853
|
-
catch (e) {
|
|
854
|
-
// Handle error silently
|
|
855
|
-
}
|
|
856
|
-
try {
|
|
857
|
-
const ids = {
|
|
858
|
-
workflowInstanceId: appData.workflow_instance_id || appData.workflowInstanceId,
|
|
859
|
-
applicationId: appData.application_id || appData.applicationId,
|
|
860
|
-
entityid: appData.entity_id || appData.entityId,
|
|
861
|
-
customerId: appData.customer_id || appData.customerId,
|
|
862
|
-
fdId: appData.fd_id || appData.fdId,
|
|
863
|
-
currentState: appData.current_state || appData.currentState,
|
|
864
|
-
currentTask: appData.current_task || appData.currentTask,
|
|
865
|
-
providerId: providerIdFromApp || undefined,
|
|
866
|
-
wfStatus: appData.wf_status || appData.wfStatus,
|
|
867
|
-
};
|
|
868
|
-
onboardingIdsFromApp = ids;
|
|
869
|
-
dispatch((0, onboardingSlice_1.setOnboardingIds)(ids));
|
|
870
|
-
}
|
|
871
|
-
catch (e) {
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
catch (error) {
|
|
876
|
-
// Handle error silently
|
|
877
|
-
}
|
|
878
|
-
if (!fdDisplay && appData)
|
|
879
|
-
fdDisplay = appToPendingFDData(appData);
|
|
880
|
-
// If current state is payment and transactionId is available, call payment reverse feed API
|
|
881
|
-
// Check for both Mahindra and Shriram payment states
|
|
882
|
-
const isPaymentState = currentState === workflowConstants_1.WORKFLOW_STATES.PAYMENT ||
|
|
883
|
-
currentState === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.PAYMENT ||
|
|
884
|
-
currentState === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.PAYMENT;
|
|
885
|
-
if (isPaymentState && transactionId) {
|
|
886
|
-
try {
|
|
887
|
-
// Get user info and required IDs (prefer appData from continue context)
|
|
888
|
-
const userInfo = (0, appDataConfig_1.getUserInfoForAPI)();
|
|
889
|
-
let providerIdFromApp = resolveProviderIdFromApp(appData, MahindraProviderId, ShriramProviderId);
|
|
890
|
-
if (forcedSdkType === 'mahindra')
|
|
891
|
-
providerIdFromApp = MahindraProviderId;
|
|
892
|
-
if (forcedSdkType === 'shriram')
|
|
893
|
-
providerIdFromApp = ShriramProviderId;
|
|
894
|
-
const paymentReverseFeedRequest = {
|
|
895
|
-
providerId: providerIdFromApp || providerId,
|
|
896
|
-
workflowInstanceId: (appData === null || appData === void 0 ? void 0 : appData.workflow_instance_id) || (appData === null || appData === void 0 ? void 0 : appData.workflowInstanceId) || workflowInstanceId,
|
|
897
|
-
userreferenceid: userInfo.id,
|
|
898
|
-
applicationid: (appData === null || appData === void 0 ? void 0 : appData.application_id) || (appData === null || appData === void 0 ? void 0 : appData.applicationId) || applicationId,
|
|
899
|
-
entityid: (appData === null || appData === void 0 ? void 0 : appData.entity_id) || (appData === null || appData === void 0 ? void 0 : appData.entityId) || entityId,
|
|
900
|
-
transactionId: transactionId,
|
|
901
|
-
};
|
|
902
|
-
const response = await paymentReverseFeed(paymentReverseFeedRequest).unwrap();
|
|
903
|
-
// Handle the response based on payment status
|
|
904
|
-
const paymentStatus = (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.paymentStatus) || '').toLowerCase();
|
|
905
|
-
const statusParam = paymentStatus === 'success' ? 'success' : paymentStatus === 'failed' ? 'failed' : 'pending';
|
|
906
|
-
const fdDataParam = fdDisplay ? {
|
|
907
|
-
companyName: fdDisplay.name,
|
|
908
|
-
amount: Number(fdDisplay.invested) || 0,
|
|
909
|
-
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
910
|
-
tenure: fdDisplay.maturityDate ? `${fdDisplay.maturityDate}` : '-',
|
|
911
|
-
interestPayout: fdDisplay.interestPayout || 'Yearly',
|
|
912
|
-
} : activeFD ? {
|
|
913
|
-
companyName: activeFD.name,
|
|
914
|
-
amount: Number(activeFD.invested) || 0,
|
|
915
|
-
fdRate: `${activeFD.returns}% p.a.`,
|
|
916
|
-
tenure: activeFD.maturityDate ? `${activeFD.maturityDate}` : '-',
|
|
917
|
-
interestPayout: activeFD.interestPayout || 'Yearly',
|
|
918
|
-
} : undefined;
|
|
919
|
-
// Shriram: always navigate to Shriram SDK PaymentStatus, never FDSDK PaymentStatus
|
|
920
|
-
let paymentProviderId = resolveProviderIdFromApp(appData, MahindraProviderId, ShriramProviderId).toLowerCase();
|
|
921
|
-
if (forcedSdkType === 'mahindra')
|
|
922
|
-
paymentProviderId = MahindraProviderId.toLowerCase();
|
|
923
|
-
if (forcedSdkType === 'shriram')
|
|
924
|
-
paymentProviderId = ShriramProviderId.toLowerCase();
|
|
925
|
-
const isShriramPayment = paymentProviderId === ShriramProviderId.toLowerCase();
|
|
926
|
-
if (isShriramPayment && appData) {
|
|
927
|
-
if (!initializeExternalSDKFromFDList('shriram'))
|
|
928
|
-
return;
|
|
929
|
-
let ShriramSDKGlobalDataPayment = null;
|
|
930
|
-
if (customerApplications && !isCustomerApplicationsEmpty()) {
|
|
931
|
-
let applicationsData = [];
|
|
932
|
-
if (Array.isArray(customerApplications))
|
|
933
|
-
applicationsData = customerApplications;
|
|
934
|
-
else if ((customerApplications === null || customerApplications === void 0 ? void 0 : customerApplications.data) && Array.isArray(customerApplications.data))
|
|
935
|
-
applicationsData = customerApplications.data;
|
|
936
|
-
else if ((customerApplications === null || customerApplications === void 0 ? void 0 : customerApplications.applications) && Array.isArray(customerApplications.applications))
|
|
937
|
-
applicationsData = customerApplications.applications;
|
|
938
|
-
const completeApplications = applicationsData.filter((app) => {
|
|
939
|
-
const s = (app.wf_status || app.status || '').toString().toLowerCase();
|
|
940
|
-
return s === 'completed' || s === 'complete';
|
|
962
|
+
fdListSelectedData: fdListSelectedDataPayment,
|
|
963
|
+
masterData: masterDataPayment,
|
|
964
|
+
onboardingIds: onboardingIdsFromApp || onboardingIds,
|
|
965
|
+
initialRouteName: 'PaymentStatus',
|
|
966
|
+
initialPaymentStatusParams: { status: statusParam, transactionId, fdData: fdDataParam },
|
|
967
|
+
shriramSDKGlobalData: ShriramSDKGlobalDataPayment,
|
|
941
968
|
});
|
|
942
|
-
|
|
943
|
-
if (shriramComplete)
|
|
944
|
-
ShriramSDKGlobalDataPayment = shriramComplete;
|
|
969
|
+
return;
|
|
945
970
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
roi: `${fdDisplay.returns}% p.a.`,
|
|
952
|
-
tenure: fdDisplay.maturityDate || '-',
|
|
953
|
-
amount: Number(fdDisplay.invested) || 0,
|
|
954
|
-
maturityDate: fdDisplay.maturityDate || '-',
|
|
955
|
-
status: 'active',
|
|
956
|
-
creditRating: getStaticCreditRatingForFD({
|
|
957
|
-
name: fdDisplay.name,
|
|
971
|
+
if (isMahindraPayment && appData) {
|
|
972
|
+
if (!initializeExternalSDKFromFDList('mahindra'))
|
|
973
|
+
return;
|
|
974
|
+
const fdListSelectedDataPayment = fdDisplay ? {
|
|
975
|
+
id: appData.fd_id || appData.fdId || 'active-fd',
|
|
958
976
|
providerId: providerIdFromApp,
|
|
959
|
-
|
|
977
|
+
name: fdDisplay.name,
|
|
978
|
+
accountNumber: appData.account_number || appData.accountNumber || '',
|
|
979
|
+
roi: `${fdDisplay.returns}% p.a.`,
|
|
980
|
+
tenure: fdDisplay.tenure || '-',
|
|
981
|
+
amount: Number(fdDisplay.invested) || 0,
|
|
982
|
+
maturityDate: fdDisplay.maturityDate || '-',
|
|
983
|
+
status: 'active',
|
|
984
|
+
creditRating: getStaticCreditRatingForFD({
|
|
985
|
+
name: fdDisplay.name,
|
|
986
|
+
providerId: providerIdFromApp,
|
|
987
|
+
}),
|
|
988
|
+
companyName: fdDisplay.name,
|
|
989
|
+
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
990
|
+
interestPayout: fdDisplay.interestPayout || 'Yearly',
|
|
991
|
+
} : null;
|
|
992
|
+
const masterDataPayment = MahindraMasterData;
|
|
993
|
+
console.log("paymentStatus===>", paymentStatus);
|
|
994
|
+
if (paymentStatus === 'IN_PROGRESS') {
|
|
995
|
+
const userInfo = (0, appDataConfig_1.getUserInfoForAPI)();
|
|
996
|
+
const mahindraDetails = (_b = (0, globalData_1.getGlobalData)()) === null || _b === void 0 ? void 0 : _b.mahindraCustomerDetails;
|
|
997
|
+
// PAN is optional at SDK init — collect it from every available source
|
|
998
|
+
const panNo = ((_o = (_m = (_l = (_k = (_j = (_h = (_g = (_f = (_e = (_d = (_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.panNumber) !== null && _c !== void 0 ? _c : userInfo === null || userInfo === void 0 ? void 0 : userInfo.panNo) !== null && _d !== void 0 ? _d : userInfo === null || userInfo === void 0 ? void 0 : userInfo.pan) !== null && _e !== void 0 ? _e : mahindraDetails === null || mahindraDetails === void 0 ? void 0 : mahindraDetails.pan_number) !== null && _f !== void 0 ? _f : mahindraDetails === null || mahindraDetails === void 0 ? void 0 : mahindraDetails.panNumber) !== null && _g !== void 0 ? _g : mahindraDetails === null || mahindraDetails === void 0 ? void 0 : mahindraDetails.pan) !== null && _h !== void 0 ? _h : mahindraDetails === null || mahindraDetails === void 0 ? void 0 : mahindraDetails.kyc_pan) !== null && _j !== void 0 ? _j : mahindraDetails === null || mahindraDetails === void 0 ? void 0 : mahindraDetails.kycPan) !== null && _k !== void 0 ? _k : appData === null || appData === void 0 ? void 0 : appData.pan_number) !== null && _l !== void 0 ? _l : appData === null || appData === void 0 ? void 0 : appData.panNumber) !== null && _m !== void 0 ? _m : appData === null || appData === void 0 ? void 0 : appData.pan) !== null && _o !== void 0 ? _o : '').trim();
|
|
999
|
+
const appIdForUrl = (appData === null || appData === void 0 ? void 0 : appData.application_id) || (appData === null || appData === void 0 ? void 0 : appData.applicationId) || '';
|
|
1000
|
+
if (__DEV__) {
|
|
1001
|
+
console.log('[FDList][IN_PROGRESS] panNo:', panNo, '| appId:', appIdForUrl, '| provider:', providerIdFromApp);
|
|
1002
|
+
}
|
|
1003
|
+
let resolvedPaymentUrl;
|
|
1004
|
+
let resolvedTransactionId = transactionId;
|
|
1005
|
+
try {
|
|
1006
|
+
const urlResult = await getPaymentUrl({
|
|
1007
|
+
providerId: providerIdFromApp,
|
|
1008
|
+
workflowInstanceId: (appData === null || appData === void 0 ? void 0 : appData.workflow_instance_id) || (appData === null || appData === void 0 ? void 0 : appData.workflowInstanceId) || workflowInstanceId,
|
|
1009
|
+
userreferenceid: userInfo.id,
|
|
1010
|
+
applicationid: appIdForUrl,
|
|
1011
|
+
entityid: (appData === null || appData === void 0 ? void 0 : appData.entity_id) || (appData === null || appData === void 0 ? void 0 : appData.entityId) || entityId,
|
|
1012
|
+
applicationId: appIdForUrl,
|
|
1013
|
+
panNo,
|
|
1014
|
+
isRetry: true,
|
|
1015
|
+
}).unwrap();
|
|
1016
|
+
if (__DEV__) {
|
|
1017
|
+
console.log('[FDList][IN_PROGRESS] getPaymentUrl result:', urlResult);
|
|
1018
|
+
}
|
|
1019
|
+
resolvedPaymentUrl = (_q = (_p = urlResult === null || urlResult === void 0 ? void 0 : urlResult.data) === null || _p === void 0 ? void 0 : _p[0]) === null || _q === void 0 ? void 0 : _q.paymentUrl;
|
|
1020
|
+
resolvedTransactionId = ((_s = (_r = urlResult === null || urlResult === void 0 ? void 0 : urlResult.data) === null || _r === void 0 ? void 0 : _r[0]) === null || _s === void 0 ? void 0 : _s.transactionId) || transactionId;
|
|
1021
|
+
}
|
|
1022
|
+
catch (err) {
|
|
1023
|
+
if (__DEV__) {
|
|
1024
|
+
console.log('[FDList][IN_PROGRESS] getPaymentUrl error — navigating to Payment with existing session:', err);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
// Always navigate to Payment for IN_PROGRESS.
|
|
1028
|
+
// Pass initialPaymentUrl only when getPaymentUrl returned one;
|
|
1029
|
+
// otherwise Payment screen reads from mahindra's existing paymentSession.
|
|
1030
|
+
(0, helpers_1.navigate)('ExternalSDK', Object.assign({ sdkType: 'mahindra', providerId: providerIdFromApp, fdListSelectedData: fdListSelectedDataPayment, masterData: masterDataPayment, onboardingIds: onboardingIdsFromApp || onboardingIds, initialRouteName: 'Payment' }, (resolvedPaymentUrl ? {
|
|
1031
|
+
initialPaymentUrl: resolvedPaymentUrl,
|
|
1032
|
+
initialPaymentTransactionId: resolvedTransactionId,
|
|
1033
|
+
} : {})));
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
else {
|
|
1037
|
+
(0, helpers_1.navigate)('ExternalSDK', {
|
|
1038
|
+
sdkType: 'mahindra',
|
|
1039
|
+
providerId: providerIdFromApp,
|
|
1040
|
+
fdListSelectedData: fdListSelectedDataPayment,
|
|
1041
|
+
masterData: masterDataPayment,
|
|
1042
|
+
onboardingIds: onboardingIdsFromApp || onboardingIds,
|
|
1043
|
+
initialRouteName: 'PaymentStatus',
|
|
1044
|
+
initialPaymentStatusParams: { status: statusParam, transactionId, fdData: fdDataParam },
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
(0, helpers_1.navigate)('PaymentStatus', { status: statusParam, transactionId, fdData: fdDataParam });
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
catch (error) {
|
|
1053
|
+
// Handle error silently
|
|
1054
|
+
const fdDataParam = fdDisplay ? {
|
|
960
1055
|
companyName: fdDisplay.name,
|
|
1056
|
+
amount: Number(fdDisplay.invested) || 0,
|
|
961
1057
|
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
1058
|
+
tenure: fdDisplay.tenure ? `${fdDisplay.tenure}` : '-',
|
|
962
1059
|
interestPayout: fdDisplay.interestPayout || 'Yearly',
|
|
963
|
-
} :
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1060
|
+
} : activeFD ? {
|
|
1061
|
+
companyName: activeFD.name,
|
|
1062
|
+
amount: Number(activeFD.invested) || 0,
|
|
1063
|
+
fdRate: `${activeFD.returns}% p.a.`,
|
|
1064
|
+
tenure: activeFD.maturityDate ? `${activeFD.maturityDate}` : '-',
|
|
1065
|
+
interestPayout: activeFD.interestPayout || 'Yearly',
|
|
1066
|
+
} : undefined;
|
|
1067
|
+
let providerIdFromApp = resolveProviderIdFromApp(appData, MahindraProviderId, ShriramProviderId);
|
|
1068
|
+
if (forcedSdkType === 'mahindra')
|
|
1069
|
+
providerIdFromApp = MahindraProviderId;
|
|
1070
|
+
if (forcedSdkType === 'shriram')
|
|
1071
|
+
providerIdFromApp = ShriramProviderId;
|
|
1072
|
+
const paymentProviderIdCatch = providerIdFromApp.toLowerCase();
|
|
1073
|
+
const isShriramPaymentCatch = paymentProviderIdCatch === ShriramProviderId.toLowerCase();
|
|
1074
|
+
const isMahindraPaymentCatch = paymentProviderIdCatch === MahindraProviderId.toLowerCase();
|
|
1075
|
+
if (isShriramPaymentCatch && appData) {
|
|
1076
|
+
if (!initializeExternalSDKFromFDList('shriram'))
|
|
1077
|
+
return;
|
|
1078
|
+
let ShriramSDKGlobalDataPayment = null;
|
|
1079
|
+
if (customerApplications && !isCustomerApplicationsEmpty()) {
|
|
1080
|
+
let applicationsData = [];
|
|
1081
|
+
if (Array.isArray(customerApplications))
|
|
1082
|
+
applicationsData = customerApplications;
|
|
1083
|
+
else if ((customerApplications === null || customerApplications === void 0 ? void 0 : customerApplications.data) && Array.isArray(customerApplications.data))
|
|
1084
|
+
applicationsData = customerApplications.data;
|
|
1085
|
+
else if ((customerApplications === null || customerApplications === void 0 ? void 0 : customerApplications.applications) && Array.isArray(customerApplications.applications))
|
|
1086
|
+
applicationsData = customerApplications.applications;
|
|
1087
|
+
const completeApplications = applicationsData.filter((app) => {
|
|
1088
|
+
const s = (app.wf_status || app.status || '').toString().toLowerCase();
|
|
1089
|
+
return s === 'completed' || s === 'complete';
|
|
1090
|
+
});
|
|
1091
|
+
const shriramComplete = completeApplications.find((app) => (app.fd_provider_id || app.fdProviderId || app.provider_id || app.providerId || '').toLowerCase() === ShriramProviderId.toLowerCase());
|
|
1092
|
+
if (shriramComplete)
|
|
1093
|
+
ShriramSDKGlobalDataPayment = shriramComplete;
|
|
1094
|
+
}
|
|
1095
|
+
const fdListSelectedDataPayment = fdDisplay ? {
|
|
1096
|
+
id: appData.fd_id || appData.fdId || 'active-fd',
|
|
1097
|
+
providerId: providerIdFromApp,
|
|
1098
|
+
name: fdDisplay.name,
|
|
1099
|
+
accountNumber: appData.account_number || appData.accountNumber || '',
|
|
1100
|
+
roi: `${fdDisplay.returns}% p.a.`,
|
|
1101
|
+
tenure: fdDisplay.tenure || '-',
|
|
1102
|
+
amount: Number(fdDisplay.invested) || 0,
|
|
1103
|
+
maturityDate: fdDisplay.maturityDate || '-',
|
|
1104
|
+
status: 'active',
|
|
1105
|
+
creditRating: getStaticCreditRatingForFD({
|
|
1106
|
+
name: fdDisplay.name,
|
|
1107
|
+
providerId: providerIdFromApp,
|
|
1108
|
+
}),
|
|
1109
|
+
companyName: fdDisplay.name,
|
|
1110
|
+
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
1111
|
+
interestPayout: fdDisplay.interestPayout || 'Yearly',
|
|
1112
|
+
} : null;
|
|
1113
|
+
const masterDataPayment = ShriramMasterData;
|
|
1114
|
+
(0, helpers_1.navigate)('ExternalSDK', {
|
|
1115
|
+
sdkType: 'shriram',
|
|
1116
|
+
providerId: providerIdFromApp,
|
|
1117
|
+
fdListSelectedData: fdListSelectedDataPayment,
|
|
1118
|
+
masterData: masterDataPayment,
|
|
1119
|
+
onboardingIds: onboardingIdsFromApp || onboardingIds,
|
|
1120
|
+
initialRouteName: 'PaymentStatus',
|
|
1121
|
+
initialPaymentStatusParams: { status: 'pending', transactionId, fdData: fdDataParam },
|
|
1122
|
+
shriramSDKGlobalData: ShriramSDKGlobalDataPayment,
|
|
1123
|
+
});
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
if (isMahindraPaymentCatch && appData) {
|
|
1127
|
+
if (!initializeExternalSDKFromFDList('mahindra'))
|
|
1128
|
+
return;
|
|
1129
|
+
const fdListSelectedDataPayment = fdDisplay ? {
|
|
1130
|
+
id: appData.fd_id || appData.fdId || 'active-fd',
|
|
1131
|
+
providerId: providerIdFromApp,
|
|
1132
|
+
name: fdDisplay.name,
|
|
1133
|
+
accountNumber: appData.account_number || appData.accountNumber || '',
|
|
1134
|
+
roi: `${fdDisplay.returns}% p.a.`,
|
|
1135
|
+
tenure: fdDisplay.tenure || '-',
|
|
1136
|
+
amount: Number(fdDisplay.invested) || 0,
|
|
1137
|
+
maturityDate: fdDisplay.maturityDate || '-',
|
|
1138
|
+
status: 'active',
|
|
1139
|
+
creditRating: getStaticCreditRatingForFD({
|
|
1140
|
+
name: fdDisplay.name,
|
|
1141
|
+
providerId: providerIdFromApp,
|
|
1142
|
+
}),
|
|
1143
|
+
companyName: fdDisplay.name,
|
|
1144
|
+
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
1145
|
+
interestPayout: fdDisplay.interestPayout || 'Yearly',
|
|
1146
|
+
} : null;
|
|
1147
|
+
const masterDataPayment = MahindraMasterData;
|
|
1148
|
+
(0, helpers_1.navigate)('ExternalSDK', {
|
|
1149
|
+
sdkType: 'mahindra',
|
|
1150
|
+
providerId: providerIdFromApp,
|
|
1151
|
+
fdListSelectedData: fdListSelectedDataPayment,
|
|
1152
|
+
masterData: masterDataPayment,
|
|
1153
|
+
onboardingIds: onboardingIdsFromApp || onboardingIds,
|
|
1154
|
+
initialRouteName: 'PaymentStatus',
|
|
1155
|
+
initialPaymentStatusParams: { status: 'pending', transactionId, fdData: fdDataParam },
|
|
1156
|
+
});
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
(0, helpers_1.navigate)('PaymentStatus', { status: 'pending', transactionId, fdData: fdDataParam });
|
|
975
1160
|
return;
|
|
1161
|
+
;
|
|
976
1162
|
}
|
|
977
|
-
(0, helpers_1.navigate)('PaymentStatus', { status: statusParam, transactionId, fdData: fdDataParam });
|
|
978
|
-
return;
|
|
979
1163
|
}
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
const fdDataParam = fdDisplay ? {
|
|
983
|
-
companyName: fdDisplay.name,
|
|
984
|
-
amount: Number(fdDisplay.invested) || 0,
|
|
985
|
-
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
986
|
-
tenure: fdDisplay.maturityDate ? `${fdDisplay.maturityDate}` : '-',
|
|
987
|
-
interestPayout: fdDisplay.interestPayout || 'Yearly',
|
|
988
|
-
} : activeFD ? {
|
|
989
|
-
companyName: activeFD.name,
|
|
990
|
-
amount: Number(activeFD.invested) || 0,
|
|
991
|
-
fdRate: `${activeFD.returns}% p.a.`,
|
|
992
|
-
tenure: activeFD.maturityDate ? `${activeFD.maturityDate}` : '-',
|
|
993
|
-
interestPayout: activeFD.interestPayout || 'Yearly',
|
|
994
|
-
} : undefined;
|
|
1164
|
+
// Determine provider and navigate to appropriate SDK
|
|
1165
|
+
if (appData) {
|
|
995
1166
|
let providerIdFromApp = resolveProviderIdFromApp(appData, MahindraProviderId, ShriramProviderId);
|
|
996
1167
|
if (forcedSdkType === 'mahindra')
|
|
997
1168
|
providerIdFromApp = MahindraProviderId;
|
|
998
1169
|
if (forcedSdkType === 'shriram')
|
|
999
1170
|
providerIdFromApp = ShriramProviderId;
|
|
1000
|
-
const
|
|
1001
|
-
const
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
else if ((customerApplications === null || customerApplications === void 0 ? void 0 : customerApplications.data) && Array.isArray(customerApplications.data))
|
|
1011
|
-
applicationsData = customerApplications.data;
|
|
1012
|
-
else if ((customerApplications === null || customerApplications === void 0 ? void 0 : customerApplications.applications) && Array.isArray(customerApplications.applications))
|
|
1013
|
-
applicationsData = customerApplications.applications;
|
|
1014
|
-
const completeApplications = applicationsData.filter((app) => {
|
|
1015
|
-
const s = (app.wf_status || app.status || '').toString().toLowerCase();
|
|
1016
|
-
return s === 'completed' || s === 'complete';
|
|
1017
|
-
});
|
|
1018
|
-
const shriramComplete = completeApplications.find((app) => (app.fd_provider_id || app.fdProviderId || app.provider_id || app.providerId || '').toLowerCase() === ShriramProviderId.toLowerCase());
|
|
1019
|
-
if (shriramComplete)
|
|
1020
|
-
ShriramSDKGlobalDataPayment = shriramComplete;
|
|
1171
|
+
const providerIdLower = (providerIdFromApp || '').toLowerCase();
|
|
1172
|
+
const isMahindra = providerIdLower === MahindraProviderId.toLowerCase();
|
|
1173
|
+
const isShriram = providerIdLower === ShriramProviderId.toLowerCase();
|
|
1174
|
+
// Check for complete applications and create global data constants
|
|
1175
|
+
let ShriramSDKGlobalData = null;
|
|
1176
|
+
let MahindraSDKGlobalData = null;
|
|
1177
|
+
if (customerApplications && !isCustomerApplicationsEmpty()) {
|
|
1178
|
+
let applicationsData = [];
|
|
1179
|
+
if (Array.isArray(customerApplications)) {
|
|
1180
|
+
applicationsData = customerApplications;
|
|
1021
1181
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
status
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
sdkType: 'shriram',
|
|
1043
|
-
providerId: providerIdFromApp,
|
|
1044
|
-
fdListSelectedData: fdListSelectedDataPayment,
|
|
1045
|
-
masterData: masterDataPayment,
|
|
1046
|
-
onboardingIds: onboardingIdsFromApp || onboardingIds,
|
|
1047
|
-
initialRouteName: 'PaymentStatus',
|
|
1048
|
-
initialPaymentStatusParams: { status: 'pending', transactionId, fdData: fdDataParam },
|
|
1049
|
-
shriramSDKGlobalData: ShriramSDKGlobalDataPayment,
|
|
1182
|
+
else if (customerApplications.data && Array.isArray(customerApplications.data)) {
|
|
1183
|
+
applicationsData = customerApplications.data;
|
|
1184
|
+
}
|
|
1185
|
+
else if (customerApplications.applications && Array.isArray(customerApplications.applications)) {
|
|
1186
|
+
applicationsData = customerApplications.applications;
|
|
1187
|
+
}
|
|
1188
|
+
// Find complete applications
|
|
1189
|
+
const completeApplications = applicationsData.filter((app) => {
|
|
1190
|
+
const status = (app.wf_status || app.status || '').toString().toLowerCase();
|
|
1191
|
+
return status === 'completed' || status === 'complete';
|
|
1192
|
+
});
|
|
1193
|
+
// Separate by provider
|
|
1194
|
+
completeApplications.forEach((app) => {
|
|
1195
|
+
const appProviderId = (app.fd_provider_id || app.fdProviderId || app.provider_id || app.providerId || '').toLowerCase();
|
|
1196
|
+
if (appProviderId === ShriramProviderId.toLowerCase()) {
|
|
1197
|
+
ShriramSDKGlobalData = app;
|
|
1198
|
+
}
|
|
1199
|
+
else if (appProviderId === MahindraProviderId.toLowerCase()) {
|
|
1200
|
+
MahindraSDKGlobalData = app;
|
|
1201
|
+
}
|
|
1050
1202
|
});
|
|
1051
|
-
return;
|
|
1052
|
-
}
|
|
1053
|
-
(0, helpers_1.navigate)('PaymentStatus', { status: 'pending', transactionId, fdData: fdDataParam });
|
|
1054
|
-
return;
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
// Determine provider and navigate to appropriate SDK
|
|
1058
|
-
if (appData) {
|
|
1059
|
-
let providerIdFromApp = resolveProviderIdFromApp(appData, MahindraProviderId, ShriramProviderId);
|
|
1060
|
-
if (forcedSdkType === 'mahindra')
|
|
1061
|
-
providerIdFromApp = MahindraProviderId;
|
|
1062
|
-
if (forcedSdkType === 'shriram')
|
|
1063
|
-
providerIdFromApp = ShriramProviderId;
|
|
1064
|
-
const providerIdLower = (providerIdFromApp || '').toLowerCase();
|
|
1065
|
-
const isMahindra = providerIdLower === MahindraProviderId.toLowerCase();
|
|
1066
|
-
const isShriram = providerIdLower === ShriramProviderId.toLowerCase();
|
|
1067
|
-
// Check for complete applications and create global data constants
|
|
1068
|
-
let ShriramSDKGlobalData = null;
|
|
1069
|
-
let MahindraSDKGlobalData = null;
|
|
1070
|
-
if (customerApplications && !isCustomerApplicationsEmpty()) {
|
|
1071
|
-
let applicationsData = [];
|
|
1072
|
-
if (Array.isArray(customerApplications)) {
|
|
1073
|
-
applicationsData = customerApplications;
|
|
1074
|
-
}
|
|
1075
|
-
else if (customerApplications.data && Array.isArray(customerApplications.data)) {
|
|
1076
|
-
applicationsData = customerApplications.data;
|
|
1077
|
-
}
|
|
1078
|
-
else if (customerApplications.applications && Array.isArray(customerApplications.applications)) {
|
|
1079
|
-
applicationsData = customerApplications.applications;
|
|
1080
1203
|
}
|
|
1081
|
-
//
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1204
|
+
// Helper function to map workflow state to screen name
|
|
1205
|
+
const getScreenNameFromState = (state, isMahindraSDK, isShriramSDK) => {
|
|
1206
|
+
if (isMahindraSDK) {
|
|
1207
|
+
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.KYC)
|
|
1208
|
+
return 'AadhaarVerification';
|
|
1209
|
+
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.DEMOGRAPHIC_INFO)
|
|
1210
|
+
return 'ReviewKYC';
|
|
1211
|
+
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.OCCUPATION)
|
|
1212
|
+
return 'Employee';
|
|
1213
|
+
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.NOMINEE)
|
|
1214
|
+
return 'NomineeDetail';
|
|
1215
|
+
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.BANK_DETAILS)
|
|
1216
|
+
return 'BankDetail';
|
|
1217
|
+
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.AADHAAR_VERIFICATION)
|
|
1218
|
+
return 'AadhaarVerification';
|
|
1219
|
+
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.PAYMENT)
|
|
1220
|
+
return 'KYCSuccess';
|
|
1221
|
+
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.CREATE_FD)
|
|
1222
|
+
return 'PayNow';
|
|
1091
1223
|
}
|
|
1092
|
-
else if (
|
|
1093
|
-
|
|
1224
|
+
else if (isShriramSDK) {
|
|
1225
|
+
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.KYC)
|
|
1226
|
+
return 'ReviewKYC';
|
|
1227
|
+
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.OCCUPATION)
|
|
1228
|
+
return 'Employee';
|
|
1229
|
+
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.NOMINEE)
|
|
1230
|
+
return 'NomineeDetail';
|
|
1231
|
+
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.BANK_DETAILS)
|
|
1232
|
+
return 'BankDetail';
|
|
1233
|
+
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.PAYMENT)
|
|
1234
|
+
return 'PayNow';
|
|
1235
|
+
// State 411 (CREATE_FD): user has completed up to FD creation; next step is payment → open PayNow
|
|
1236
|
+
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.CREATE_FD)
|
|
1237
|
+
return 'PayNow';
|
|
1238
|
+
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.END)
|
|
1239
|
+
return 'PayNow';
|
|
1240
|
+
}
|
|
1241
|
+
// Default fallback
|
|
1242
|
+
return 'FDCalculator';
|
|
1243
|
+
};
|
|
1244
|
+
// Align pending flow with new-FD reliability: fetch provider-scoped master data right before navigation.
|
|
1245
|
+
let providerMasterData = isMahindra ? MahindraMasterData : isShriram ? ShriramMasterData : undefined;
|
|
1246
|
+
try {
|
|
1247
|
+
if (isMahindra) {
|
|
1248
|
+
const refreshed = await refetchMahindraMasterData();
|
|
1249
|
+
providerMasterData = (_t = refreshed === null || refreshed === void 0 ? void 0 : refreshed.data) !== null && _t !== void 0 ? _t : providerMasterData;
|
|
1250
|
+
}
|
|
1251
|
+
else if (isShriram) {
|
|
1252
|
+
const refreshed = await refetchShriramMasterData();
|
|
1253
|
+
providerMasterData = (_u = refreshed === null || refreshed === void 0 ? void 0 : refreshed.data) !== null && _u !== void 0 ? _u : providerMasterData;
|
|
1094
1254
|
}
|
|
1095
|
-
});
|
|
1096
|
-
}
|
|
1097
|
-
// Helper function to map workflow state to screen name
|
|
1098
|
-
const getScreenNameFromState = (state, isMahindraSDK, isShriramSDK) => {
|
|
1099
|
-
if (isMahindraSDK) {
|
|
1100
|
-
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.KYC_SUCCESS)
|
|
1101
|
-
return 'KYCSuccess';
|
|
1102
|
-
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.KYC)
|
|
1103
|
-
return 'ReviewKYC';
|
|
1104
|
-
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.OCCUPATION)
|
|
1105
|
-
return 'Employee';
|
|
1106
|
-
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.NOMINEE)
|
|
1107
|
-
return 'NomineeDetail';
|
|
1108
|
-
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.BANK_DETAILS)
|
|
1109
|
-
return 'BankDetail';
|
|
1110
|
-
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.AADHAAR_VERIFICATION)
|
|
1111
|
-
return 'AadhaarVerification';
|
|
1112
|
-
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.PAYMENT)
|
|
1113
|
-
return 'PayNow';
|
|
1114
|
-
if (state === workflowConstants_1.MAHINDRA_WORKFLOW_STATES.CREATE_FD)
|
|
1115
|
-
return 'FDCalculator';
|
|
1116
1255
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
return 'ReviewKYC';
|
|
1120
|
-
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.OCCUPATION)
|
|
1121
|
-
return 'Employee';
|
|
1122
|
-
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.NOMINEE)
|
|
1123
|
-
return 'NomineeDetail';
|
|
1124
|
-
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.BANK_DETAILS)
|
|
1125
|
-
return 'BankDetail';
|
|
1126
|
-
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.PAYMENT)
|
|
1127
|
-
return 'PayNow';
|
|
1128
|
-
// State 411 (CREATE_FD): user has completed up to FD creation; next step is payment → open PayNow
|
|
1129
|
-
if (state === workflowConstants_1.SHRIRAM_WORKFLOW_STATES.CREATE_FD)
|
|
1130
|
-
return 'PayNow';
|
|
1256
|
+
catch (_v) {
|
|
1257
|
+
// keep previously cached provider-specific master data
|
|
1131
1258
|
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1259
|
+
const masterDataToPass = providerMasterData || (masterData || masterDataContext);
|
|
1260
|
+
// Get onboardingIds - use the one from appData if available, otherwise from Redux store
|
|
1261
|
+
const onboardingIdsToPass = onboardingIdsFromApp || onboardingIds;
|
|
1262
|
+
// Get fdListSelectedData (already set in Redux, but we need it for navigation)
|
|
1263
|
+
// Use fdDisplay (derived from the tapped app) not activeFD (always first active app)
|
|
1264
|
+
const fdListSelectedDataToPass = fdDisplay ? {
|
|
1265
|
+
id: appData.fd_id || appData.fdId || 'active-fd',
|
|
1266
|
+
providerId: providerIdFromApp,
|
|
1267
|
+
name: fdDisplay.name,
|
|
1268
|
+
accountNumber: appData.account_number || appData.accountNumber || '',
|
|
1269
|
+
roi: `${fdDisplay.returns}% p.a.`,
|
|
1270
|
+
tenure: appData.tenure_in_months
|
|
1271
|
+
? `${appData.tenure_in_months} Months`
|
|
1272
|
+
: '-',
|
|
1273
|
+
amount: Number(fdDisplay.invested) || 0,
|
|
1274
|
+
maturityDate: fdDisplay.maturityDate || '-',
|
|
1275
|
+
status: 'active',
|
|
1276
|
+
creditRating: getStaticCreditRatingForFD({
|
|
1277
|
+
name: fdDisplay.name,
|
|
1278
|
+
providerId: providerIdFromApp,
|
|
1279
|
+
}),
|
|
1280
|
+
companyName: fdDisplay.name,
|
|
1281
|
+
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
1282
|
+
interestPayout: fdDisplay.interestPayout || '',
|
|
1283
|
+
} : null;
|
|
1284
|
+
// Navigate to appropriate SDK if provider is detected
|
|
1285
|
+
if (isMahindra || isShriram) {
|
|
1286
|
+
const screenName = getScreenNameFromState(currentStateCaption, isMahindra, isShriram);
|
|
1287
|
+
const sdkType = isMahindra ? 'mahindra' : 'shriram';
|
|
1288
|
+
if (!initializeExternalSDKFromFDList(sdkType))
|
|
1289
|
+
return;
|
|
1290
|
+
// #region agent log
|
|
1291
|
+
fetch('http://127.0.0.1:7653/ingest/94b18a39-caf3-48fd-98f5-bf1838d9491a', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '04da7c' }, body: JSON.stringify({ sessionId: '04da7c', runId: 'pending-masterdata-trace', hypothesisId: 'H2', location: 'fdsdk/screens/FDList.tsx:1315', message: 'Pending continue pre-navigation payload', data: { forcedSdkType: forcedSdkType || null, resolvedSdkType: sdkType, providerIdFromApp: providerIdFromApp || null, onboardingProviderId: (onboardingIdsToPass === null || onboardingIdsToPass === void 0 ? void 0 : onboardingIdsToPass.providerId) || null, fdListSelectedProviderId: (fdListSelectedDataToPass === null || fdListSelectedDataToPass === void 0 ? void 0 : fdListSelectedDataToPass.providerId) || null, usingMahindraMasterData: !!(sdkType === 'mahindra' && masterDataToPass), usingShriramMasterData: !!(sdkType === 'shriram' && masterDataToPass), masterDataHasDataKey: !!(masterDataToPass === null || masterDataToPass === void 0 ? void 0 : masterDataToPass.data) }, timestamp: Date.now() }) }).catch(() => { });
|
|
1292
|
+
// #endregion agent log
|
|
1293
|
+
(0, helpers_1.navigate)('ExternalSDK', Object.assign({ sdkType, providerId: providerIdFromApp, fdListSelectedData: fdListSelectedDataToPass, masterData: masterDataToPass, onboardingIds: onboardingIdsToPass, initialRouteName: screenName, shriramSDKGlobalData: ShriramSDKGlobalData, mahindraSDKGlobalData: MahindraSDKGlobalData }, (isMahindra ? { forceFetchCustomerDetails: true } : {})));
|
|
1294
|
+
return;
|
|
1145
1295
|
}
|
|
1146
1296
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1297
|
+
// Fallback: Use workflow navigation based on current state (non-payment states or no transactionId)
|
|
1298
|
+
if (currentStateCaption) {
|
|
1299
|
+
(0, workflowNavigator_1.handleWorkflowNavigation)({
|
|
1300
|
+
workflowState: currentStateCaption,
|
|
1301
|
+
investmentData: undefined,
|
|
1302
|
+
customerData: undefined,
|
|
1303
|
+
appData: undefined,
|
|
1304
|
+
fdData: undefined,
|
|
1305
|
+
completedApplications: [],
|
|
1306
|
+
transactionId,
|
|
1307
|
+
});
|
|
1149
1308
|
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
const onboardingIdsToPass = onboardingIdsFromApp || onboardingIds;
|
|
1153
|
-
// Get fdListSelectedData (already set in Redux, but we need it for navigation)
|
|
1154
|
-
// Use fdDisplay (derived from the tapped app) not activeFD (always first active app)
|
|
1155
|
-
const fdListSelectedDataToPass = fdDisplay ? {
|
|
1156
|
-
id: appData.fd_id || appData.fdId || 'active-fd',
|
|
1157
|
-
providerId: providerIdFromApp,
|
|
1158
|
-
name: fdDisplay.name,
|
|
1159
|
-
accountNumber: appData.account_number || appData.accountNumber || '',
|
|
1160
|
-
roi: `${fdDisplay.returns}% p.a.`,
|
|
1161
|
-
tenure: appData.tenure_in_months
|
|
1162
|
-
? `${appData.tenure_in_months} Months`
|
|
1163
|
-
: '-',
|
|
1164
|
-
amount: Number(fdDisplay.invested) || 0,
|
|
1165
|
-
maturityDate: fdDisplay.maturityDate || '-',
|
|
1166
|
-
status: 'active',
|
|
1167
|
-
creditRating: getStaticCreditRatingForFD({
|
|
1168
|
-
name: fdDisplay.name,
|
|
1169
|
-
providerId: providerIdFromApp,
|
|
1170
|
-
}),
|
|
1171
|
-
companyName: fdDisplay.name,
|
|
1172
|
-
fdRate: `${fdDisplay.returns}% p.a.`,
|
|
1173
|
-
interestPayout: fdDisplay.interestPayout || '',
|
|
1174
|
-
} : null;
|
|
1175
|
-
// Navigate to appropriate SDK if provider is detected
|
|
1176
|
-
if (isMahindra || isShriram) {
|
|
1177
|
-
const screenName = getScreenNameFromState(currentState, isMahindra, isShriram);
|
|
1178
|
-
const sdkType = isMahindra ? 'mahindra' : 'shriram';
|
|
1179
|
-
if (!initializeExternalSDKFromFDList(sdkType))
|
|
1180
|
-
return;
|
|
1181
|
-
// #region agent log
|
|
1182
|
-
fetch('http://127.0.0.1:7653/ingest/94b18a39-caf3-48fd-98f5-bf1838d9491a', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '04da7c' }, body: JSON.stringify({ sessionId: '04da7c', runId: 'pending-masterdata-trace', hypothesisId: 'H2', location: 'fdsdk/screens/FDList.tsx:1315', message: 'Pending continue pre-navigation payload', data: { forcedSdkType: forcedSdkType || null, resolvedSdkType: sdkType, providerIdFromApp: providerIdFromApp || null, onboardingProviderId: (onboardingIdsToPass === null || onboardingIdsToPass === void 0 ? void 0 : onboardingIdsToPass.providerId) || null, fdListSelectedProviderId: (fdListSelectedDataToPass === null || fdListSelectedDataToPass === void 0 ? void 0 : fdListSelectedDataToPass.providerId) || null, usingMahindraMasterData: !!(sdkType === 'mahindra' && masterDataToPass), usingShriramMasterData: !!(sdkType === 'shriram' && masterDataToPass), masterDataHasDataKey: !!(masterDataToPass === null || masterDataToPass === void 0 ? void 0 : masterDataToPass.data) }, timestamp: Date.now() }) }).catch(() => { });
|
|
1183
|
-
// #endregion agent log
|
|
1184
|
-
(0, helpers_1.navigate)('ExternalSDK', Object.assign({ sdkType, providerId: providerIdFromApp, fdListSelectedData: fdListSelectedDataToPass, masterData: masterDataToPass, onboardingIds: onboardingIdsToPass, initialRouteName: screenName, shriramSDKGlobalData: ShriramSDKGlobalData, mahindraSDKGlobalData: MahindraSDKGlobalData }, (isMahindra ? { forceFetchCustomerDetails: true } : {})));
|
|
1185
|
-
return;
|
|
1309
|
+
else {
|
|
1310
|
+
(0, helpers_1.navigate)('Employee');
|
|
1186
1311
|
}
|
|
1187
1312
|
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
(0, workflowNavigator_1.handleWorkflowNavigation)({
|
|
1191
|
-
workflowState: currentState,
|
|
1192
|
-
investmentData: undefined,
|
|
1193
|
-
customerData: undefined,
|
|
1194
|
-
appData: undefined,
|
|
1195
|
-
fdData: undefined,
|
|
1196
|
-
completedApplications: [],
|
|
1197
|
-
transactionId,
|
|
1198
|
-
});
|
|
1199
|
-
}
|
|
1200
|
-
else {
|
|
1201
|
-
(0, helpers_1.navigate)('Employee');
|
|
1313
|
+
finally {
|
|
1314
|
+
setIsPendingFDLoading(false);
|
|
1202
1315
|
}
|
|
1203
1316
|
};
|
|
1204
1317
|
// Derive identifiers for workflow termination from applications API
|
|
@@ -1726,7 +1839,7 @@ const FDList = ({ onGoBack, onSelectFD, onNavigateToFDCalculator, onNavigateToEx
|
|
|
1726
1839
|
react_native_1.Alert.alert('Warning', 'Failed to terminate existing workflow, but continuing with new FD booking.', [{ text: 'OK' }]);
|
|
1727
1840
|
}
|
|
1728
1841
|
} }),
|
|
1729
|
-
isLoadingMahindraCustomerDetails && (react_1.default.createElement(react_native_1.View, { style: styles.loadingOverlay, pointerEvents: "auto" },
|
|
1842
|
+
(isPendingFDLoading || isLoadingMahindraCustomerDetails) && (react_1.default.createElement(react_native_1.View, { style: styles.loadingOverlay, pointerEvents: "auto" },
|
|
1730
1843
|
react_1.default.createElement(react_native_1.ActivityIndicator, { size: "large", color: colors.primary })))));
|
|
1731
1844
|
};
|
|
1732
1845
|
const createStyles = (colors, typography, spacing, themeName) => react_native_1.StyleSheet.create({
|