@finspringinnovations/fixeddepositsdk 1.0.1 → 1.0.3

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.
@@ -66,6 +66,150 @@ import { useTheme } from '../theme/ThemeContext';
66
66
  const Stack = createStackNavigator<RootStackParamList>();
67
67
  const MahindraRootNavigatorAny = MahindraRootNavigator as React.ComponentType<any>;
68
68
 
69
+ // ─── Module-level SDK content components ───────────────────────────────────
70
+ // Defined OUTSIDE the render prop so React sees a stable component type on
71
+ // every parent re-render. Defining them inside the render prop creates a new
72
+ // function reference each render, causing React to unmount + remount the
73
+ // entire SDK NavigationContainer (and all child screens) on every render.
74
+
75
+ interface ShriramSDKContentProps {
76
+ masterData: any;
77
+ routeParams: any;
78
+ onSDKExit: (fdDetails?: any) => void;
79
+ onSDKPanRequired: () => void;
80
+ }
81
+
82
+ const ShriramSDKContent: React.FC<ShriramSDKContentProps> = ({
83
+ masterData,
84
+ routeParams,
85
+ onSDKExit,
86
+ onSDKPanRequired,
87
+ }) => {
88
+ const { setMasterData } = useShriramMasterData();
89
+ const shriramDispatch = useShriramAppDispatch();
90
+
91
+ React.useEffect(() => {
92
+ if (masterData) {
93
+ const dataToSet = masterData.data || masterData;
94
+ setMasterData(dataToSet);
95
+ }
96
+ }, [masterData, setMasterData]);
97
+
98
+ React.useEffect(() => {
99
+ if (routeParams.fdListSelectedData) {
100
+ try {
101
+ shriramDispatch(setShriramFDListSelected(routeParams.fdListSelectedData));
102
+ } catch (e) {
103
+ console.log('[RootNavigator] Error setting Shriram FDListSelected:', e);
104
+ }
105
+ }
106
+ }, [routeParams.fdListSelectedData, shriramDispatch]);
107
+
108
+ React.useEffect(() => {
109
+ if (routeParams.onboardingIds) {
110
+ try {
111
+ shriramDispatch(setShriramOnboardingIds({
112
+ ...routeParams.onboardingIds,
113
+ providerId: routeParams.providerId || routeParams.onboardingIds?.providerId,
114
+ }));
115
+ } catch (e) {
116
+ console.log('[RootNavigator] Error setting Shriram OnboardingIds:', e);
117
+ }
118
+ }
119
+ }, [routeParams.onboardingIds, shriramDispatch]);
120
+
121
+ React.useEffect(() => {
122
+ if (routeParams.shriramSDKGlobalData) {
123
+ try {
124
+ const completeFDData = !!routeParams.shriramSDKGlobalData;
125
+ setShriramGlobalData({ completeFDData });
126
+ } catch (e) {
127
+ console.log('[RootNavigator] Error setting Shriram GlobalData:', e);
128
+ }
129
+ }
130
+ }, [routeParams.shriramSDKGlobalData]);
131
+
132
+ return (
133
+ <ShriramRootNavigator
134
+ config={{
135
+ initialRouteName: routeParams.initialRouteName || 'FDCalculator',
136
+ initialPaymentStatusParams: routeParams.initialPaymentStatusParams,
137
+ initialFDContext: {
138
+ providerId: routeParams.providerId,
139
+ fdListSelectedData: routeParams.fdListSelectedData,
140
+ completeFDData: routeParams.completeFDData,
141
+ },
142
+ } as any}
143
+ onExit={onSDKExit}
144
+ onPanRequired={onSDKPanRequired}
145
+ />
146
+ );
147
+ };
148
+
149
+ interface MahindraSDKContentProps {
150
+ masterData: any;
151
+ routeParams: any;
152
+ onSDKExit: (fdDetails?: any) => void;
153
+ onSDKPanRequired: () => void;
154
+ }
155
+
156
+ const MahindraSDKContent: React.FC<MahindraSDKContentProps> = ({
157
+ masterData,
158
+ routeParams,
159
+ onSDKExit,
160
+ onSDKPanRequired,
161
+ }) => {
162
+ const { setMasterData } = useMahindraMasterData();
163
+ const mahindraDispatch = useMahindraAppDispatch();
164
+
165
+ React.useEffect(() => {
166
+ if (masterData) {
167
+ const dataToSet = masterData.data || masterData;
168
+ setMasterData(dataToSet);
169
+ }
170
+ }, [masterData, setMasterData]);
171
+
172
+ React.useEffect(() => {
173
+ if (routeParams.fdListSelectedData) {
174
+ try {
175
+ mahindraDispatch(setMahindraFDListSelected(routeParams.fdListSelectedData));
176
+ } catch (e) {
177
+ console.log('[RootNavigator] Error setting Mahindra FDListSelected:', e);
178
+ }
179
+ }
180
+ }, [routeParams.fdListSelectedData, mahindraDispatch]);
181
+
182
+ React.useEffect(() => {
183
+ if (routeParams.onboardingIds) {
184
+ try {
185
+ mahindraDispatch(setMahindraOnboardingIds({
186
+ ...routeParams.onboardingIds,
187
+ providerId: routeParams.providerId || routeParams.onboardingIds?.providerId,
188
+ }));
189
+ } catch (e) {
190
+ console.log('[RootNavigator] Error setting Mahindra OnboardingIds:', e);
191
+ }
192
+ }
193
+ }, [routeParams.onboardingIds, mahindraDispatch]);
194
+
195
+ return (
196
+ <MahindraRootNavigatorAny
197
+ config={{
198
+ initialRouteName: routeParams.initialRouteName || 'FDCalculator',
199
+ forceFetchCustomerDetails: !!routeParams.forceFetchCustomerDetails,
200
+ initialFDContext: {
201
+ providerId: routeParams.providerId,
202
+ fdListSelectedData: routeParams.fdListSelectedData,
203
+ completeFDData: routeParams.completeFDData,
204
+ },
205
+ }}
206
+ onExit={onSDKExit}
207
+ onPanRequired={onSDKPanRequired}
208
+ />
209
+ );
210
+ };
211
+ // ───────────────────────────────────────────────────────────────────────────
212
+
69
213
  interface RootNavigatorProps {
70
214
  config?: SDKNavigationConfig;
71
215
  onExit?: (fdDetails?: any) => void;
@@ -81,6 +225,36 @@ const RootNavigator: React.FC<RootNavigatorProps> = ({
81
225
  const [externalSDK, setExternalSDK] = React.useState<'shriram' | 'mahindra' | null>(null);
82
226
  const [externalSDKFDData, setExternalSDKFDData] = React.useState<any>(null);
83
227
 
228
+ // Stable exit callbacks — defined here so they're memoized across renders
229
+ // and can be passed as stable props to the module-level SDK content components.
230
+ const handleShriramExit = React.useCallback((fdDetails?: any) => {
231
+ setExternalSDK(null);
232
+ setExternalSDKFDData(null);
233
+ navigate('FDList');
234
+ if (fdDetails) onExit?.(fdDetails);
235
+ }, [onExit]);
236
+
237
+ const handleShriramPanRequired = React.useCallback(() => {
238
+ setExternalSDK(null);
239
+ setExternalSDKFDData(null);
240
+ onPanRequired?.();
241
+ onExit?.();
242
+ }, [onExit, onPanRequired]);
243
+
244
+ const handleMahindraExit = React.useCallback((fdDetails?: any) => {
245
+ setExternalSDK(null);
246
+ setExternalSDKFDData(null);
247
+ navigate('FDList');
248
+ if (fdDetails) onExit?.(fdDetails);
249
+ }, [onExit]);
250
+
251
+ const handleMahindraPanRequired = React.useCallback(() => {
252
+ setExternalSDK(null);
253
+ setExternalSDKFDData(null);
254
+ onPanRequired?.();
255
+ onExit?.();
256
+ }, [onExit, onPanRequired]);
257
+
84
258
  // Get master data and theme from fdsdk – same theme (and themeName for dark/primary) is passed to Shriram and Mahindra
85
259
  const { masterData } = useMasterData();
86
260
  const { theme: fdsdkTheme, themeName: fdsdkThemeName } = useTheme();
@@ -316,157 +490,6 @@ const RootNavigator: React.FC<RootNavigatorProps> = ({
316
490
  if (!ok) return null;
317
491
  }
318
492
 
319
- // Component to set master data and initial FD context in external SDK
320
- const ShriramSDKWithMasterData: React.FC<{ masterData: any }> = ({ masterData }) => {
321
- const { setMasterData } = useShriramMasterData();
322
- const shriramDispatch = useShriramAppDispatch();
323
- const routeParams = (props.route.params as any) || {};
324
-
325
- // Set master data
326
- React.useEffect(() => {
327
- if (masterData) {
328
- const dataToSet = masterData.data || masterData;
329
- setMasterData(dataToSet);
330
- }
331
- }, [masterData, setMasterData]);
332
-
333
- // Set FDListSelectedData using Shriram setter
334
- React.useEffect(() => {
335
- if (routeParams.fdListSelectedData) {
336
- try {
337
- shriramDispatch(setShriramFDListSelected(routeParams.fdListSelectedData));
338
- } catch (e) {
339
- console.log('[RootNavigator] Error setting Shriram FDListSelected:', e);
340
- }
341
- }
342
- }, [routeParams.fdListSelectedData, shriramDispatch]);
343
-
344
- // Set OnboardingIds using Shriram setter
345
- React.useEffect(() => {
346
- if (routeParams.onboardingIds) {
347
- try {
348
- shriramDispatch(setShriramOnboardingIds({
349
- ...routeParams.onboardingIds,
350
- providerId: routeParams.providerId || routeParams.onboardingIds?.providerId,
351
- }));
352
- } catch (e) {
353
- console.log('[RootNavigator] Error setting Shriram OnboardingIds:', e);
354
- }
355
- }
356
- }, [routeParams.onboardingIds, shriramDispatch]);
357
-
358
- // Set GlobalData using Shriram setter if present - only set completeFDData boolean
359
- React.useEffect(() => {
360
- if (routeParams.shriramSDKGlobalData) {
361
- try {
362
- const completeFDData = !!routeParams.shriramSDKGlobalData;
363
- setShriramGlobalData({ completeFDData });
364
- console.log('[RootNavigator] Set ShriramSDKGlobalData completeFDData:', completeFDData);
365
- } catch (e) {
366
- console.log('[RootNavigator] Error setting Shriram GlobalData:', e);
367
- }
368
- }
369
- }, [routeParams.shriramSDKGlobalData]);
370
-
371
- return (
372
- <ShriramRootNavigator
373
- config={{
374
- initialRouteName: routeParams.initialRouteName || 'FDCalculator',
375
- initialPaymentStatusParams: routeParams.initialPaymentStatusParams,
376
- initialFDContext: {
377
- providerId: routeParams.providerId,
378
- fdListSelectedData: routeParams.fdListSelectedData,
379
- completeFDData: routeParams.completeFDData,
380
- },
381
- } as any}
382
- onExit={(fdDetails?: any) => {
383
- // When exiting external SDK, go back to FDList
384
- setExternalSDK(null);
385
- setExternalSDKFDData(null);
386
- navigate('FDList');
387
- if (fdDetails) {
388
- onExit?.(fdDetails);
389
- }
390
- }}
391
- onPanRequired={() => {
392
- // Exit full SDK flow back to host app and notify callback
393
- setExternalSDK(null);
394
- setExternalSDKFDData(null);
395
- onPanRequired?.();
396
- onExit?.();
397
- }}
398
- />
399
- );
400
- };
401
-
402
- const MahindraSDKWithMasterData: React.FC<{ masterData: any }> = ({ masterData }) => {
403
- const { setMasterData } = useMahindraMasterData();
404
- const mahindraDispatch = useMahindraAppDispatch();
405
-
406
- // Set master data
407
- React.useEffect(() => {
408
- if (masterData) {
409
- const dataToSet = masterData.data || masterData;
410
- setMasterData(dataToSet);
411
- }
412
- }, [masterData, setMasterData]);
413
-
414
- // Set FDListSelectedData using Mahindra setter
415
- React.useEffect(() => {
416
- if (routeParams.fdListSelectedData) {
417
- try {
418
- mahindraDispatch(setMahindraFDListSelected(routeParams.fdListSelectedData));
419
- } catch (e) {
420
- console.log('[RootNavigator] Error setting Mahindra FDListSelected:', e);
421
- }
422
- }
423
- }, [routeParams.fdListSelectedData, mahindraDispatch]);
424
-
425
- // Set OnboardingIds using Mahindra setter
426
- React.useEffect(() => {
427
- if (routeParams.onboardingIds) {
428
- try {
429
- mahindraDispatch(setMahindraOnboardingIds({
430
- ...routeParams.onboardingIds,
431
- providerId: routeParams.providerId || routeParams.onboardingIds?.providerId,
432
- }));
433
- } catch (e) {
434
- console.log('[RootNavigator] Error setting Mahindra OnboardingIds:', e);
435
- }
436
- }
437
- }, [routeParams.onboardingIds, mahindraDispatch]);
438
-
439
- return (
440
- <MahindraRootNavigatorAny
441
- config={{
442
- initialRouteName: routeParams.initialRouteName || 'FDCalculator',
443
- forceFetchCustomerDetails: !!routeParams.forceFetchCustomerDetails,
444
- initialFDContext: {
445
- providerId: routeParams.providerId,
446
- fdListSelectedData: routeParams.fdListSelectedData,
447
- completeFDData: routeParams.completeFDData,
448
- },
449
- }}
450
- onExit={(fdDetails?: any) => {
451
- // When exiting external SDK, go back to FDList
452
- setExternalSDK(null);
453
- setExternalSDKFDData(null);
454
- navigate('FDList');
455
- if (fdDetails) {
456
- onExit?.(fdDetails);
457
- }
458
- }}
459
- onPanRequired={() => {
460
- // Exit full SDK flow back to host app and notify callback
461
- setExternalSDK(null);
462
- setExternalSDKFDData(null);
463
- onPanRequired?.();
464
- onExit?.();
465
- }}
466
- />
467
- );
468
- };
469
-
470
493
  if (sdkType === 'shriram') {
471
494
  return (
472
495
  <ShriramApiProvider>
@@ -474,7 +497,12 @@ const RootNavigator: React.FC<RootNavigatorProps> = ({
474
497
  <ShriramThemeProvider theme={fdsdkTheme as any} initialTheme={fdsdkThemeName as any}>
475
498
  <NavigationIndependentTree>
476
499
  <NavigationContainer ref={shriramNavigationRef}>
477
- <ShriramSDKWithMasterData masterData={externalMasterData} />
500
+ <ShriramSDKContent
501
+ masterData={externalMasterData}
502
+ routeParams={routeParams}
503
+ onSDKExit={handleShriramExit}
504
+ onSDKPanRequired={handleShriramPanRequired}
505
+ />
478
506
  </NavigationContainer>
479
507
  </NavigationIndependentTree>
480
508
  </ShriramThemeProvider>
@@ -490,7 +518,12 @@ const RootNavigator: React.FC<RootNavigatorProps> = ({
490
518
  <MahindraThemeProvider theme={fdsdkTheme as any} initialTheme={fdsdkThemeName as any}>
491
519
  <NavigationIndependentTree>
492
520
  <NavigationContainer ref={mahindraNavigationRef}>
493
- <MahindraSDKWithMasterData masterData={externalMasterData} />
521
+ <MahindraSDKContent
522
+ masterData={externalMasterData}
523
+ routeParams={routeParams}
524
+ onSDKExit={handleMahindraExit}
525
+ onSDKPanRequired={handleMahindraPanRequired}
526
+ />
494
527
  </NavigationContainer>
495
528
  </NavigationIndependentTree>
496
529
  </MahindraThemeProvider>
@@ -285,7 +285,7 @@ const FDCalculator: React.FC<FDCalculatorProps> = ({ onGoBack, onNavigateToRevie
285
285
  }, [interestRates]);
286
286
 
287
287
  useEffect(() => {
288
- console.log("following are the tenure options at the fd",tenureOptions)
288
+ console.log("following are the tenure options at the fd", tenureOptions)
289
289
  })
290
290
 
291
291
  const [tenureValue, setTenureValue] = useState<string>('');
@@ -636,7 +636,7 @@ const FDCalculator: React.FC<FDCalculatorProps> = ({ onGoBack, onNavigateToRevie
636
636
  {/* Company Header */}
637
637
  <CompanyHeader
638
638
  companyName={effectiveFdData?.name || ''}
639
- rating={effectiveFdData?.creditRating || 'AA+'}
639
+ rating="AAA"
640
640
  />
641
641
 
642
642
  {/* Amount Input */}
@@ -998,5 +998,5 @@ const createStyles = (typography: any, colors: any, themeName: string) => StyleS
998
998
  backgroundColor: 'rgba(0, 0, 0, 0.3)',
999
999
  zIndex: 1000,
1000
1000
  },
1001
-
1001
+
1002
1002
  });
@@ -57,6 +57,13 @@ function getLogoTypeForFD(fd: { name?: string; providerId?: string }): 'shriram'
57
57
  return undefined;
58
58
  }
59
59
 
60
+ function getStaticCreditRatingForFD(fd: { name?: string; providerId?: string }): string {
61
+ const logoType = getLogoTypeForFD(fd);
62
+ if (logoType === 'mahindra') return 'AAA';
63
+ if (logoType === 'shriram') return 'AAA';
64
+ return 'AAA';
65
+ }
66
+
60
67
  /** Statuses that count as pending/active (in-progress) workflow. */
61
68
  const PENDING_ACTIVE_STATUSES = ['active', 'pending', 'in_progress', 'in-progress'];
62
69
 
@@ -981,7 +988,10 @@ const FDList: React.FC<FDListProps> = ({
981
988
  amount: Number(fdDisplay.invested) || 0,
982
989
  maturityDate: fdDisplay.maturityDate || '-',
983
990
  status: 'active' as const,
984
- creditRating: appData.credit_rating || appData.creditRating || selectedFD?.creditRating || 'NA',
991
+ creditRating: getStaticCreditRatingForFD({
992
+ name: fdDisplay.name,
993
+ providerId: providerIdFromApp,
994
+ }),
985
995
  companyName: fdDisplay.name,
986
996
  fdRate: `${fdDisplay.returns}% p.a.`,
987
997
  interestPayout: fdDisplay.interestPayout || '',
@@ -1076,20 +1086,23 @@ const FDList: React.FC<FDListProps> = ({
1076
1086
  const shriramComplete = completeApplications.find((app: any) => (app.fd_provider_id || app.fdProviderId || app.provider_id || app.providerId || '').toLowerCase() === ShriramProviderId.toLowerCase());
1077
1087
  if (shriramComplete) ShriramSDKGlobalDataPayment = shriramComplete;
1078
1088
  }
1079
- const fdListSelectedDataPayment = activeFD ? {
1089
+ const fdListSelectedDataPayment = fdDisplay ? {
1080
1090
  id: appData.fd_id || appData.fdId || 'active-fd',
1081
1091
  providerId: providerIdFromApp,
1082
- name: activeFD.name,
1092
+ name: fdDisplay.name,
1083
1093
  accountNumber: appData.account_number || appData.accountNumber || '',
1084
- roi: `${activeFD.returns}% p.a.`,
1085
- tenure: activeFD.maturityDate || '-',
1086
- amount: Number(activeFD.invested) || 0,
1087
- maturityDate: activeFD.maturityDate || '-',
1094
+ roi: `${fdDisplay.returns}% p.a.`,
1095
+ tenure: fdDisplay.maturityDate || '-',
1096
+ amount: Number(fdDisplay.invested) || 0,
1097
+ maturityDate: fdDisplay.maturityDate || '-',
1088
1098
  status: 'active' as const,
1089
- creditRating: appData.credit_rating || appData.creditRating || 'NA',
1090
- companyName: activeFD.name,
1091
- fdRate: `${activeFD.returns}% p.a.`,
1092
- interestPayout: activeFD.interestPayout || 'Yearly',
1099
+ creditRating: getStaticCreditRatingForFD({
1100
+ name: fdDisplay.name,
1101
+ providerId: providerIdFromApp,
1102
+ }),
1103
+ companyName: fdDisplay.name,
1104
+ fdRate: `${fdDisplay.returns}% p.a.`,
1105
+ interestPayout: fdDisplay.interestPayout || 'Yearly',
1093
1106
  } : null;
1094
1107
  const masterDataPayment = ShriramMasterData;
1095
1108
 
@@ -1144,20 +1157,23 @@ const FDList: React.FC<FDListProps> = ({
1144
1157
  const shriramComplete = completeApplications.find((app: any) => (app.fd_provider_id || app.fdProviderId || app.provider_id || app.providerId || '').toLowerCase() === ShriramProviderId.toLowerCase());
1145
1158
  if (shriramComplete) ShriramSDKGlobalDataPayment = shriramComplete;
1146
1159
  }
1147
- const fdListSelectedDataPayment = activeFD ? {
1160
+ const fdListSelectedDataPayment = fdDisplay ? {
1148
1161
  id: appData.fd_id || appData.fdId || 'active-fd',
1149
1162
  providerId: providerIdFromApp,
1150
- name: activeFD.name,
1163
+ name: fdDisplay.name,
1151
1164
  accountNumber: appData.account_number || appData.accountNumber || '',
1152
- roi: `${activeFD.returns}% p.a.`,
1153
- tenure: activeFD.maturityDate || '-',
1154
- amount: Number(activeFD.invested) || 0,
1155
- maturityDate: activeFD.maturityDate || '-',
1165
+ roi: `${fdDisplay.returns}% p.a.`,
1166
+ tenure: fdDisplay.maturityDate || '-',
1167
+ amount: Number(fdDisplay.invested) || 0,
1168
+ maturityDate: fdDisplay.maturityDate || '-',
1156
1169
  status: 'active' as const,
1157
- creditRating: appData.credit_rating || appData.creditRating || 'NA',
1158
- companyName: activeFD.name,
1159
- fdRate: `${activeFD.returns}% p.a.`,
1160
- interestPayout: activeFD.interestPayout || 'Yearly',
1170
+ creditRating: getStaticCreditRatingForFD({
1171
+ name: fdDisplay.name,
1172
+ providerId: providerIdFromApp,
1173
+ }),
1174
+ companyName: fdDisplay.name,
1175
+ fdRate: `${fdDisplay.returns}% p.a.`,
1176
+ interestPayout: fdDisplay.interestPayout || 'Yearly',
1161
1177
  } : null;
1162
1178
  const masterDataPayment = ShriramMasterData;
1163
1179
  navigate('ExternalSDK', {
@@ -1261,22 +1277,26 @@ const FDList: React.FC<FDListProps> = ({
1261
1277
  const onboardingIdsToPass = onboardingIdsFromApp || onboardingIds;
1262
1278
 
1263
1279
  // Get fdListSelectedData (already set in Redux, but we need it for navigation)
1264
- const fdListSelectedDataToPass = activeFD ? {
1280
+ // Use fdDisplay (derived from the tapped app) not activeFD (always first active app)
1281
+ const fdListSelectedDataToPass = fdDisplay ? {
1265
1282
  id: appData.fd_id || appData.fdId || 'active-fd',
1266
1283
  providerId: providerIdFromApp,
1267
- name: activeFD.name,
1284
+ name: fdDisplay.name,
1268
1285
  accountNumber: appData.account_number || appData.accountNumber || '',
1269
- roi: `${activeFD.returns}% p.a.`,
1270
- tenure: activeFD.tenure_in_months
1271
- ? `${activeFD.tenure_in_months} Months`
1286
+ roi: `${fdDisplay.returns}% p.a.`,
1287
+ tenure: appData.tenure_in_months
1288
+ ? `${appData.tenure_in_months} Months`
1272
1289
  : '-',
1273
- amount: Number(activeFD.invested) || 0,
1274
- maturityDate: activeFD.maturityDate || '-',
1290
+ amount: Number(fdDisplay.invested) || 0,
1291
+ maturityDate: fdDisplay.maturityDate || '-',
1275
1292
  status: 'active' as const,
1276
- creditRating: appData.credit_rating || appData.creditRating || selectedFD?.creditRating || 'NA',
1277
- companyName: activeFD.name,
1278
- fdRate: `${activeFD.returns}% p.a.`,
1279
- interestPayout: activeFD.interestPayout || '',
1293
+ creditRating: getStaticCreditRatingForFD({
1294
+ name: fdDisplay.name,
1295
+ providerId: providerIdFromApp,
1296
+ }),
1297
+ companyName: fdDisplay.name,
1298
+ fdRate: `${fdDisplay.returns}% p.a.`,
1299
+ interestPayout: fdDisplay.interestPayout || '',
1280
1300
  } : null;
1281
1301
 
1282
1302
  // Navigate to appropriate SDK if provider is detected
@@ -1285,7 +1305,7 @@ const FDList: React.FC<FDListProps> = ({
1285
1305
  const sdkType = isMahindra ? 'mahindra' : 'shriram';
1286
1306
  if (!initializeExternalSDKFromFDList(sdkType)) return;
1287
1307
  // #region agent log
1288
- 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?.providerId||null,fdListSelectedProviderId:fdListSelectedDataToPass?.providerId||null,usingMahindraMasterData:!!(sdkType==='mahindra'&&masterDataToPass),usingShriramMasterData:!!(sdkType==='shriram'&&masterDataToPass),masterDataHasDataKey:!!masterDataToPass?.data},timestamp:Date.now()})}).catch(()=>{});
1308
+ 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?.providerId || null, fdListSelectedProviderId: fdListSelectedDataToPass?.providerId || null, usingMahindraMasterData: !!(sdkType === 'mahindra' && masterDataToPass), usingShriramMasterData: !!(sdkType === 'shriram' && masterDataToPass), masterDataHasDataKey: !!masterDataToPass?.data }, timestamp: Date.now() }) }).catch(() => { });
1289
1309
  // #endregion agent log
1290
1310
 
1291
1311
  navigate('ExternalSDK', {
@@ -1484,7 +1504,10 @@ const FDList: React.FC<FDListProps> = ({
1484
1504
  amount: 5000,
1485
1505
  maturityDate: '2025-12-31',
1486
1506
  status: 'active' as const,
1487
- creditRating: rate.creditRating || 'AA+',
1507
+ creditRating: getStaticCreditRatingForFD({
1508
+ name: rate.providerName || '',
1509
+ providerId: rate.providerId || `provider-${index}`,
1510
+ }),
1488
1511
  interestPayout: rate.interestPayout || rate.interest_payout_term || rate.payout_term || 'Yearly'
1489
1512
  }));
1490
1513
  }
@@ -1913,7 +1936,10 @@ const FDList: React.FC<FDListProps> = ({
1913
1936
  amount: selectedFD.amount,
1914
1937
  maturityDate: selectedFD.maturityDate,
1915
1938
  status: selectedFD.status as 'active' | 'matured' | 'pending' | undefined,
1916
- creditRating: selectedFD.creditRating,
1939
+ creditRating: getStaticCreditRatingForFD({
1940
+ name: selectedFD.name,
1941
+ providerId: selectedFD.providerId,
1942
+ }),
1917
1943
  companyName: selectedFD.name,
1918
1944
  fdRate: selectedFD.roi,
1919
1945
  interestPayout: selectedFD.interestPayout || 'Yearly',
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { View, Text, StyleSheet, ScrollView, Alert, Image, BackHandler, Platform, StatusBar } from 'react-native';
2
+ import { View, Text, StyleSheet, ScrollView, Alert, Image, BackHandler, Platform, StatusBar, TouchableOpacity } from 'react-native';
3
3
  import Icon from 'react-native-vector-icons/Ionicons';
4
4
  import { base64Images } from '../constants/strings/base64Images';
5
5
  import SafeAreaWrapper from '../components/SafeAreaWrapper';
@@ -334,6 +334,11 @@ const PaymentStatus: React.FC<PaymentStatusProps> = ({
334
334
  }
335
335
  };
336
336
 
337
+ // Back button: navigate to FDList for all statuses
338
+ const handleNavigateToFDList = () => {
339
+ navigate('FDList');
340
+ };
341
+
337
342
  // Disable hardware back button on PaymentStatus screen
338
343
  useEffect(() => {
339
344
  if (Platform.OS !== 'android') return;
@@ -361,9 +366,9 @@ const PaymentStatus: React.FC<PaymentStatusProps> = ({
361
366
  {Platform.OS === 'ios' && <StatusBar barStyle="light-content" />}
362
367
 
363
368
  <View style={styles.container}>
364
- {/* <Text style={styles.headerTitle}>
365
- {status === 'success' ? 'PAYMENT SUCCESSFUL' : 'PAYMENT FAILED'}
366
- </Text> */}
369
+ <TouchableOpacity onPress={handleNavigateToFDList} style={styles.backIconBtn}>
370
+ <Icon name="arrow-back" size={24} color={colors.text} />
371
+ </TouchableOpacity>
367
372
 
368
373
  <ScrollView
369
374
  showsVerticalScrollIndicator={false}
@@ -479,6 +484,13 @@ const createStyles = (colors: any, typography: any, status: 'success' | 'failed'
479
484
  flex: 1,
480
485
  backgroundColor: colors.background,
481
486
  },
487
+ backIconBtn: {
488
+ position: 'absolute',
489
+ top: 16,
490
+ left: 16,
491
+ zIndex: 10,
492
+ padding: 8,
493
+ },
482
494
  headerTitle: {
483
495
  fontSize: 14,
484
496
  fontWeight: '600',
@@ -946,6 +946,7 @@ const ReviewKYC: React.FC<ReviewKYCProps> = ({
946
946
  {/* Overlay to disable screen interactions during API call */}
947
947
  {isLoadingPanRapid && (
948
948
  <View style={styles.loadingOverlay} pointerEvents="auto">
949
+ <ActivityIndicator size="large" color={colors.primary} />
949
950
  </View>
950
951
  )}
951
952
  {/* Loading overlay for back navigation */}