@finspringinnovations/fdsdk 0.0.1
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/README.md +184 -0
- package/lib/api/applicationApi.d.ts +1 -0
- package/lib/api/applicationApi.js +11 -0
- package/lib/api/bankApi.d.ts +352 -0
- package/lib/api/bankApi.js +54 -0
- package/lib/api/baseApi.d.ts +8 -0
- package/lib/api/baseApi.js +456 -0
- package/lib/api/customerApi.d.ts +855 -0
- package/lib/api/customerApi.js +213 -0
- package/lib/api/fdApi.d.ts +979 -0
- package/lib/api/fdApi.js +112 -0
- package/lib/api/fdCalculatorApi.d.ts +179 -0
- package/lib/api/fdCalculatorApi.js +36 -0
- package/lib/api/index.d.ts +14 -0
- package/lib/api/index.js +45 -0
- package/lib/api/interestRateApi.d.ts +585 -0
- package/lib/api/interestRateApi.js +101 -0
- package/lib/api/kycApi.d.ts +486 -0
- package/lib/api/kycApi.js +71 -0
- package/lib/api/masterDataApi.d.ts +158 -0
- package/lib/api/masterDataApi.js +32 -0
- package/lib/api/nomineeApi.d.ts +325 -0
- package/lib/api/nomineeApi.js +46 -0
- package/lib/api/onboardingApi.d.ts +192 -0
- package/lib/api/onboardingApi.js +41 -0
- package/lib/api/panApi.d.ts +0 -0
- package/lib/api/panApi.js +23 -0
- package/lib/api/paymentApi.d.ts +325 -0
- package/lib/api/paymentApi.js +46 -0
- package/lib/api/workflowApi.d.ts +654 -0
- package/lib/api/workflowApi.js +90 -0
- package/lib/assets/images/images.d.ts +4 -0
- package/lib/assets/images/images.js +10 -0
- package/lib/components/AadhaarInput.d.ts +13 -0
- package/lib/components/AadhaarInput.js +47 -0
- package/lib/components/ActionButton.d.ts +12 -0
- package/lib/components/ActionButton.js +87 -0
- package/lib/components/ActiveFDCard.d.ts +16 -0
- package/lib/components/ActiveFDCard.js +95 -0
- package/lib/components/AmountInput.d.ts +20 -0
- package/lib/components/AmountInput.js +144 -0
- package/lib/components/CheckboxOption.d.ts +11 -0
- package/lib/components/CheckboxOption.js +41 -0
- package/lib/components/CompanyHeader.d.ts +7 -0
- package/lib/components/CompanyHeader.js +57 -0
- package/lib/components/DropdownSelector.d.ts +9 -0
- package/lib/components/DropdownSelector.js +49 -0
- package/lib/components/EmptyState.d.ts +17 -0
- package/lib/components/EmptyState.js +44 -0
- package/lib/components/ErrorDisplay.d.ts +17 -0
- package/lib/components/ErrorDisplay.js +69 -0
- package/lib/components/FAQItem.d.ts +9 -0
- package/lib/components/FAQItem.js +52 -0
- package/lib/components/FDCard.d.ts +21 -0
- package/lib/components/FDCard.js +96 -0
- package/lib/components/FormDropdown.d.ts +18 -0
- package/lib/components/FormDropdown.js +155 -0
- package/lib/components/FormSection.d.ts +14 -0
- package/lib/components/FormSection.js +38 -0
- package/lib/components/Header.d.ts +14 -0
- package/lib/components/Header.js +52 -0
- package/lib/components/IFSCSearchResultCard.d.ts +13 -0
- package/lib/components/IFSCSearchResultCard.js +70 -0
- package/lib/components/InfoBox.d.ts +8 -0
- package/lib/components/InfoBox.js +39 -0
- package/lib/components/InterestRateCard.d.ts +8 -0
- package/lib/components/InterestRateCard.js +46 -0
- package/lib/components/LoadingIndicator.d.ts +12 -0
- package/lib/components/LoadingIndicator.js +30 -0
- package/lib/components/OTPInput.d.ts +17 -0
- package/lib/components/OTPInput.js +144 -0
- package/lib/components/PaymentDetailsCard.d.ts +20 -0
- package/lib/components/PaymentDetailsCard.js +68 -0
- package/lib/components/PendingFDBottomSheet.d.ts +18 -0
- package/lib/components/PendingFDBottomSheet.js +122 -0
- package/lib/components/SafeAreaWrapper.d.ts +13 -0
- package/lib/components/SafeAreaWrapper.js +41 -0
- package/lib/components/ScreenHeader.d.ts +11 -0
- package/lib/components/ScreenHeader.js +46 -0
- package/lib/components/StatusDisplay.d.ts +15 -0
- package/lib/components/StatusDisplay.js +88 -0
- package/lib/components/TextFieldWithLabel.d.ts +46 -0
- package/lib/components/TextFieldWithLabel.js +326 -0
- package/lib/components/TrustBox.d.ts +8 -0
- package/lib/components/TrustBox.js +45 -0
- package/lib/components/ValidationErrorAlert.d.ts +23 -0
- package/lib/components/ValidationErrorAlert.js +39 -0
- package/lib/components/ValidationMessage.d.ts +9 -0
- package/lib/components/ValidationMessage.js +98 -0
- package/lib/components/index.d.ts +35 -0
- package/lib/components/index.js +64 -0
- package/lib/config/apiConfig.d.ts +34 -0
- package/lib/config/apiConfig.js +158 -0
- package/lib/config/appDataConfig.d.ts +114 -0
- package/lib/config/appDataConfig.js +264 -0
- package/lib/config/encryptionConfig.d.ts +21 -0
- package/lib/config/encryptionConfig.js +61 -0
- package/lib/config/workflowConstants.d.ts +37 -0
- package/lib/config/workflowConstants.js +38 -0
- package/lib/constants/strings/bank.d.ts +72 -0
- package/lib/constants/strings/bank.js +86 -0
- package/lib/constants/strings/base64Images.d.ts +25 -0
- package/lib/constants/strings/base64Images.js +28 -0
- package/lib/constants/strings/common.d.ts +53 -0
- package/lib/constants/strings/common.js +62 -0
- package/lib/constants/strings/employee.d.ts +61 -0
- package/lib/constants/strings/employee.js +77 -0
- package/lib/constants/strings/faq.d.ts +14 -0
- package/lib/constants/strings/faq.js +20 -0
- package/lib/constants/strings/fd.d.ts +122 -0
- package/lib/constants/strings/fd.js +151 -0
- package/lib/constants/strings/home.d.ts +49 -0
- package/lib/constants/strings/home.js +62 -0
- package/lib/constants/strings/index.d.ts +16 -0
- package/lib/constants/strings/index.js +44 -0
- package/lib/constants/strings/kyc.d.ts +80 -0
- package/lib/constants/strings/kyc.js +94 -0
- package/lib/constants/strings/nominee.d.ts +64 -0
- package/lib/constants/strings/nominee.js +81 -0
- package/lib/hooks/useAuth.d.ts +25 -0
- package/lib/hooks/useAuth.js +39 -0
- package/lib/hooks/useFDData.d.ts +11 -0
- package/lib/hooks/useFDData.js +40 -0
- package/lib/index.d.ts +69 -0
- package/lib/index.js +182 -0
- package/lib/navigation/RootNavigator.d.ts +8 -0
- package/lib/navigation/RootNavigator.js +205 -0
- package/lib/navigation/SimpleNavigator.d.ts +11 -0
- package/lib/navigation/SimpleNavigator.js +107 -0
- package/lib/navigation/helpers.d.ts +11 -0
- package/lib/navigation/helpers.js +83 -0
- package/lib/navigation/index.d.ts +15 -0
- package/lib/navigation/index.js +42 -0
- package/lib/navigation/types.d.ts +113 -0
- package/lib/navigation/types.js +2 -0
- package/lib/navigation/workflowNavigator.d.ts +22 -0
- package/lib/navigation/workflowNavigator.js +104 -0
- package/lib/providers/ApiProvider.d.ts +7 -0
- package/lib/providers/ApiProvider.js +34 -0
- package/lib/providers/MasterDataProvider.d.ts +10 -0
- package/lib/providers/MasterDataProvider.js +54 -0
- package/lib/screens/AadhaarVerification.d.ts +7 -0
- package/lib/screens/AadhaarVerification.js +627 -0
- package/lib/screens/AddBankAccount.d.ts +22 -0
- package/lib/screens/AddBankAccount.js +381 -0
- package/lib/screens/BankDetail.d.ts +16 -0
- package/lib/screens/BankDetail.js +596 -0
- package/lib/screens/BookFD.d.ts +0 -0
- package/lib/screens/BookFD.js +315 -0
- package/lib/screens/Employee.d.ts +18 -0
- package/lib/screens/Employee.js +594 -0
- package/lib/screens/FDCalculator.d.ts +18 -0
- package/lib/screens/FDCalculator.js +759 -0
- package/lib/screens/FDList.d.ts +27 -0
- package/lib/screens/FDList.js +1008 -0
- package/lib/screens/FindIFSC.d.ts +16 -0
- package/lib/screens/FindIFSC.js +248 -0
- package/lib/screens/Home.d.ts +0 -0
- package/lib/screens/Home.js +143 -0
- package/lib/screens/NomineeDetail.d.ts +17 -0
- package/lib/screens/NomineeDetail.js +592 -0
- package/lib/screens/PayNow.d.ts +14 -0
- package/lib/screens/PayNow.js +230 -0
- package/lib/screens/Payment.d.ts +11 -0
- package/lib/screens/Payment.js +191 -0
- package/lib/screens/PaymentStatus.d.ts +16 -0
- package/lib/screens/PaymentStatus.js +397 -0
- package/lib/screens/ReviewKYC.d.ts +21 -0
- package/lib/screens/ReviewKYC.js +660 -0
- package/lib/state/paymentSession.d.ts +8 -0
- package/lib/state/paymentSession.js +13 -0
- package/lib/store/fdListSelectedSlice.d.ts +21 -0
- package/lib/store/fdListSelectedSlice.js +26 -0
- package/lib/store/hooks.d.ts +8 -0
- package/lib/store/hooks.js +31 -0
- package/lib/store/index.d.ts +3 -0
- package/lib/store/index.js +8 -0
- package/lib/store/onboardingSlice.d.ts +12 -0
- package/lib/store/onboardingSlice.js +32 -0
- package/lib/store/store.d.ts +13 -0
- package/lib/store/store.js +33 -0
- package/lib/theme/ThemeContext.d.ts +210 -0
- package/lib/theme/ThemeContext.js +90 -0
- package/lib/theme/colors.d.ts +80 -0
- package/lib/theme/colors.js +85 -0
- package/lib/theme/index.d.ts +34 -0
- package/lib/theme/index.js +69 -0
- package/lib/theme/shadows.d.ts +53 -0
- package/lib/theme/shadows.js +58 -0
- package/lib/theme/typography.d.ts +134 -0
- package/lib/theme/typography.js +143 -0
- package/lib/types/dataTypes.d.ts +34 -0
- package/lib/types/dataTypes.js +2 -0
- package/lib/types/workflowTypes.d.ts +2 -0
- package/lib/types/workflowTypes.js +2 -0
- package/lib/utils/apiLogger.d.ts +48 -0
- package/lib/utils/apiLogger.js +105 -0
- package/lib/utils/encryption.d.ts +28 -0
- package/lib/utils/encryption.js +113 -0
- package/lib/utils/getFDData.d.ts +48 -0
- package/lib/utils/getFDData.js +154 -0
- package/lib/utils/globalData.d.ts +2 -0
- package/lib/utils/globalData.js +10 -0
- package/package.json +76 -0
- package/src/api/applicationApi.ts +12 -0
- package/src/api/bankApi.ts +42 -0
- package/src/api/baseApi.ts +513 -0
- package/src/api/customerApi.ts +291 -0
- package/src/api/fdApi.ts +150 -0
- package/src/api/fdCalculatorApi.ts +41 -0
- package/src/api/index.ts +29 -0
- package/src/api/interestRateApi.ts +143 -0
- package/src/api/kycApi.ts +63 -0
- package/src/api/masterDataApi.ts +34 -0
- package/src/api/nomineeApi.ts +34 -0
- package/src/api/onboardingApi.ts +64 -0
- package/src/api/panApi.ts +25 -0
- package/src/api/paymentApi.ts +34 -0
- package/src/api/workflowApi.ts +94 -0
- package/src/assets/images/arrow-filled.png +0 -0
- package/src/assets/images/arrow-left.png +0 -0
- package/src/assets/images/backicon.png +0 -0
- package/src/assets/images/calendar.png +0 -0
- package/src/assets/images/chevron-down.png +0 -0
- package/src/assets/images/chevron-down@2x.png +0 -0
- package/src/assets/images/chevron-down@3x.png +0 -0
- package/src/assets/images/images.js +8 -0
- package/src/components/AadhaarInput.tsx +91 -0
- package/src/components/ActionButton.tsx +129 -0
- package/src/components/ActiveFDCard.tsx +158 -0
- package/src/components/AmountInput.tsx +217 -0
- package/src/components/CheckboxOption.tsx +93 -0
- package/src/components/CompanyHeader.tsx +78 -0
- package/src/components/DropdownSelector.tsx +77 -0
- package/src/components/EmptyState.tsx +109 -0
- package/src/components/ErrorDisplay.tsx +135 -0
- package/src/components/FAQItem.tsx +90 -0
- package/src/components/FDCard.tsx +165 -0
- package/src/components/FormDropdown.tsx +214 -0
- package/src/components/FormSection.tsx +86 -0
- package/src/components/Header.tsx +110 -0
- package/src/components/IFSCSearchResultCard.tsx +139 -0
- package/src/components/InfoBox.tsx +55 -0
- package/src/components/InterestRateCard.tsx +77 -0
- package/src/components/LoadingIndicator.tsx +63 -0
- package/src/components/OTPInput.tsx +213 -0
- package/src/components/PaymentDetailsCard.tsx +120 -0
- package/src/components/PendingFDBottomSheet.tsx +235 -0
- package/src/components/README.md +210 -0
- package/src/components/SafeAreaWrapper.tsx +68 -0
- package/src/components/ScreenHeader.tsx +83 -0
- package/src/components/StatusDisplay.tsx +139 -0
- package/src/components/TextFieldWithLabel.tsx +502 -0
- package/src/components/TrustBox.tsx +63 -0
- package/src/components/ValidationErrorAlert.tsx +57 -0
- package/src/components/ValidationMessage.tsx +134 -0
- package/src/components/index.tsx +47 -0
- package/src/config/apiConfig.ts +217 -0
- package/src/config/appDataConfig.ts +279 -0
- package/src/config/encryptionConfig.ts +65 -0
- package/src/config/workflowConstants.ts +43 -0
- package/src/constants/strings/README.md +146 -0
- package/src/constants/strings/bank.ts +92 -0
- package/src/constants/strings/base64Images.ts +29 -0
- package/src/constants/strings/common.ts +63 -0
- package/src/constants/strings/employee.ts +85 -0
- package/src/constants/strings/faq.ts +23 -0
- package/src/constants/strings/fd.ts +172 -0
- package/src/constants/strings/home.ts +67 -0
- package/src/constants/strings/index.ts +21 -0
- package/src/constants/strings/kyc.ts +100 -0
- package/src/constants/strings/nominee.ts +90 -0
- package/src/hooks/useAuth.ts +42 -0
- package/src/hooks/useFDData.ts +48 -0
- package/src/index.tsx +173 -0
- package/src/navigation/RootNavigator.tsx +352 -0
- package/src/navigation/SimpleNavigator.tsx +107 -0
- package/src/navigation/helpers.ts +85 -0
- package/src/navigation/index.tsx +81 -0
- package/src/navigation/types.ts +124 -0
- package/src/navigation/workflowNavigator.ts +131 -0
- package/src/providers/ApiProvider.tsx +43 -0
- package/src/providers/MasterDataProvider.tsx +30 -0
- package/src/screens/AadhaarVerification.tsx +809 -0
- package/src/screens/AddBankAccount.tsx +541 -0
- package/src/screens/BankDetail.tsx +826 -0
- package/src/screens/BookFD.tsx +330 -0
- package/src/screens/Employee.tsx +822 -0
- package/src/screens/FDCalculator.tsx +987 -0
- package/src/screens/FDList.tsx +1284 -0
- package/src/screens/FindIFSC.tsx +332 -0
- package/src/screens/Home.tsx +152 -0
- package/src/screens/NomineeDetail.tsx +800 -0
- package/src/screens/PayNow.tsx +282 -0
- package/src/screens/Payment.tsx +224 -0
- package/src/screens/PaymentStatus.tsx +561 -0
- package/src/screens/ReviewKYC.tsx +956 -0
- package/src/state/paymentSession.ts +13 -0
- package/src/store/fdListSelectedSlice.ts +42 -0
- package/src/store/hooks.ts +27 -0
- package/src/store/index.ts +3 -0
- package/src/store/onboardingSlice.ts +37 -0
- package/src/store/store.ts +35 -0
- package/src/theme/ThemeContext.tsx +82 -0
- package/src/theme/colors.ts +90 -0
- package/src/theme/index.ts +64 -0
- package/src/theme/shadows.ts +61 -0
- package/src/theme/typography.ts +151 -0
- package/src/types/dataTypes.ts +37 -0
- package/src/types/env.d.ts +93 -0
- package/src/types/workflowTypes.ts +12 -0
- package/src/utils/apiLogger.ts +166 -0
- package/src/utils/encryption.ts +159 -0
- package/src/utils/getFDData.ts +175 -0
- package/src/utils/globalData.ts +7 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const stack_1 = require("@react-navigation/stack");
|
|
41
|
+
const react_native_1 = require("react-native");
|
|
42
|
+
const helpers_1 = require("./helpers");
|
|
43
|
+
// Import screens
|
|
44
|
+
const FDList_1 = __importDefault(require("../screens/FDList"));
|
|
45
|
+
const FDCalculator_1 = __importDefault(require("../screens/FDCalculator"));
|
|
46
|
+
const AadhaarVerification_1 = __importDefault(require("../screens/AadhaarVerification"));
|
|
47
|
+
const ReviewKYC_1 = __importDefault(require("../screens/ReviewKYC"));
|
|
48
|
+
const Employee_1 = __importDefault(require("../screens/Employee"));
|
|
49
|
+
const NomineeDetail_1 = __importDefault(require("../screens/NomineeDetail"));
|
|
50
|
+
const BankDetail_1 = __importDefault(require("../screens/BankDetail"));
|
|
51
|
+
const AddBankAccount_1 = __importDefault(require("../screens/AddBankAccount"));
|
|
52
|
+
const FindIFSC_1 = __importDefault(require("../screens/FindIFSC"));
|
|
53
|
+
const PayNow_1 = __importDefault(require("../screens/PayNow"));
|
|
54
|
+
const Payment_1 = __importDefault(require("../screens/Payment"));
|
|
55
|
+
const PaymentStatus_1 = __importDefault(require("../screens/PaymentStatus"));
|
|
56
|
+
// Import navigation helpers
|
|
57
|
+
const helpers_2 = require("./helpers");
|
|
58
|
+
const paymentSession_1 = require("../state/paymentSession");
|
|
59
|
+
const Stack = (0, stack_1.createStackNavigator)();
|
|
60
|
+
const RootNavigator = ({ config = {}, onExit }) => {
|
|
61
|
+
// Handle Android hardware back button
|
|
62
|
+
(0, react_1.useEffect)(() => {
|
|
63
|
+
if (react_native_1.Platform.OS !== 'android')
|
|
64
|
+
return;
|
|
65
|
+
let lastBackPressTime = 0;
|
|
66
|
+
const onBackPress = () => {
|
|
67
|
+
var _a, _b, _c;
|
|
68
|
+
// Check if navigation is ready
|
|
69
|
+
if (!((_a = helpers_1.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady())) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const now = Date.now();
|
|
73
|
+
// Ignore synthetic back events triggered during forward navigation (debounce)
|
|
74
|
+
if (now - lastBackPressTime < 300) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
lastBackPressTime = now;
|
|
78
|
+
const currentRoute = (_c = (_b = helpers_1.navigationRef.current) === null || _b === void 0 ? void 0 : _b.getCurrentRoute()) === null || _c === void 0 ? void 0 : _c.name;
|
|
79
|
+
// Block back on Payment and PaymentStatus screens
|
|
80
|
+
if (currentRoute === "Payment" || currentRoute === "PaymentStatus") {
|
|
81
|
+
return true; // block hardware back
|
|
82
|
+
}
|
|
83
|
+
// FD Calculator should always redirect to FD List
|
|
84
|
+
if (currentRoute === "FDCalculator") {
|
|
85
|
+
helpers_1.navigationRef.current.navigate('FDList');
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
// Note: Screen-specific BackHandlers take priority over this global handler
|
|
89
|
+
// The following screens handle their own hardware back button:
|
|
90
|
+
// - Payment: BLOCKED (handled above)
|
|
91
|
+
// - PaymentStatus: BLOCKED (handled above)
|
|
92
|
+
// - FDList: → Main App (screen-specific handler)
|
|
93
|
+
// - FDCalculator: → FDList (handled above)
|
|
94
|
+
// - AadhaarVerification: previousState API → ReviewKYC (screen-specific handler)
|
|
95
|
+
// - ReviewKYC: previousState API → FDCalculator (screen-specific handler)
|
|
96
|
+
// - Employee: previousState API → ReviewKYC (screen-specific handler)
|
|
97
|
+
// - NomineeDetail: previousState API → Employee (screen-specific handler)
|
|
98
|
+
// - BankDetail: previousState API → NomineeDetail (screen-specific handler)
|
|
99
|
+
// - PayNow: previousState API → BankDetail (screen-specific handler)
|
|
100
|
+
// - AddBankAccount: → BankDetail (screen-specific handler)
|
|
101
|
+
// - FindIFSC: → AddBankAccount (screen-specific handler)
|
|
102
|
+
// Skip FDList - let screen-specific handler handle it
|
|
103
|
+
if (currentRoute === "FDList") {
|
|
104
|
+
return false; // Let screen-specific handler handle it
|
|
105
|
+
}
|
|
106
|
+
// Enable back navigation everywhere else - use the same goBack() helper that header back buttons use
|
|
107
|
+
(0, helpers_2.goBack)(); // This calls the same function as the header back button
|
|
108
|
+
return true;
|
|
109
|
+
};
|
|
110
|
+
const subscription = react_native_1.BackHandler.addEventListener("hardwareBackPress", onBackPress);
|
|
111
|
+
return () => {
|
|
112
|
+
subscription.remove();
|
|
113
|
+
};
|
|
114
|
+
}, []);
|
|
115
|
+
const { initialRouteName = 'FDList', customScreenOptions = {}, } = config;
|
|
116
|
+
// Default screen options
|
|
117
|
+
const defaultScreenOptions = Object.assign({ headerShown: false, cardStyle: { backgroundColor: '#f8f9fa' }, animationEnabled: true, gestureEnabled: true }, customScreenOptions);
|
|
118
|
+
return (react_1.default.createElement(Stack.Navigator, { initialRouteName: initialRouteName, screenOptions: defaultScreenOptions },
|
|
119
|
+
react_1.default.createElement(Stack.Screen, { name: "FDList", options: { title: 'Fixed Deposits' } }, (props) => (react_1.default.createElement(FDList_1.default, Object.assign({ onGoBack: () => {
|
|
120
|
+
console.log('🔙 [RootNavigator] FDList onGoBack called, triggering onExit');
|
|
121
|
+
if (onExit) {
|
|
122
|
+
onExit();
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
console.warn('⚠️ [RootNavigator] onExit is undefined!');
|
|
126
|
+
}
|
|
127
|
+
}, onSelectFD: (fdId) => {
|
|
128
|
+
// FD selected
|
|
129
|
+
}, onNavigateToFDCalculator: (fdData) => {
|
|
130
|
+
(0, helpers_2.navigate)('FDCalculator', { fdData });
|
|
131
|
+
} }, props)))),
|
|
132
|
+
react_1.default.createElement(Stack.Screen, { name: "FDCalculator", options: { title: 'FD Calculator' } }, (props) => {
|
|
133
|
+
var _a;
|
|
134
|
+
return (react_1.default.createElement(FDCalculator_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onNavigateToReviewKYC: () => { var _a; return (0, helpers_2.navigate)('ReviewKYC', { fdData: (_a = props.route.params) === null || _a === void 0 ? void 0 : _a.fdData }); }, fdData: (_a = props.route.params) === null || _a === void 0 ? void 0 : _a.fdData }, props)));
|
|
135
|
+
}),
|
|
136
|
+
react_1.default.createElement(Stack.Screen, { name: "AadhaarVerification", options: { title: 'Aadhaar Verification' } }, (props) => (react_1.default.createElement(AadhaarVerification_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onVerificationComplete: (aadhaarNumber) => {
|
|
137
|
+
// Navigate to Employee (occupation) screen after verification
|
|
138
|
+
(0, helpers_2.navigate)('Employee');
|
|
139
|
+
} }, props)))),
|
|
140
|
+
react_1.default.createElement(Stack.Screen, { name: "ReviewKYC", options: { title: 'Review KYC' } }, (props) => (react_1.default.createElement(ReviewKYC_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onContinue: (kycData) => {
|
|
141
|
+
// Navigate to Employee screen after KYC review
|
|
142
|
+
(0, helpers_2.navigate)('Employee');
|
|
143
|
+
} }, props)))),
|
|
144
|
+
react_1.default.createElement(Stack.Screen, { name: "Employee", options: { title: 'Occupation' } }, (props) => (react_1.default.createElement(Employee_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onContinue: () => {
|
|
145
|
+
// Navigate to NomineeDetail after Employee details
|
|
146
|
+
(0, helpers_2.navigate)('NomineeDetail');
|
|
147
|
+
} }, props)))),
|
|
148
|
+
react_1.default.createElement(Stack.Screen, { name: "NomineeDetail", options: { title: 'Nominee Details' } }, (props) => (react_1.default.createElement(NomineeDetail_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onSave: (nomineeData) => {
|
|
149
|
+
// Navigate to BankDetail after Nominee details
|
|
150
|
+
(0, helpers_2.navigate)('BankDetail');
|
|
151
|
+
} }, props)))),
|
|
152
|
+
react_1.default.createElement(Stack.Screen, { name: "BankDetail", options: { title: 'Bank Details' } }, (props) => (react_1.default.createElement(BankDetail_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onContinue: (bankData) => {
|
|
153
|
+
// Navigate to PayNow screen after Bank details
|
|
154
|
+
(0, helpers_2.navigate)('PayNow');
|
|
155
|
+
}, onAddAccount: () => {
|
|
156
|
+
// Navigate to AddBankAccount screen
|
|
157
|
+
(0, helpers_2.navigate)('AddBankAccount');
|
|
158
|
+
} }, props)))),
|
|
159
|
+
react_1.default.createElement(Stack.Screen, { name: "AddBankAccount", options: { title: 'Add Bank Account' } }, (props) => (react_1.default.createElement(AddBankAccount_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onContinue: (bankData) => {
|
|
160
|
+
// Go back to BankDetail screen after adding account
|
|
161
|
+
(0, helpers_2.goBack)();
|
|
162
|
+
}, onFindIFSC: () => {
|
|
163
|
+
// Navigate to FindIFSC screen
|
|
164
|
+
(0, helpers_2.navigate)('FindIFSC');
|
|
165
|
+
}, selectedIFSC: (() => {
|
|
166
|
+
const params = props.route.params;
|
|
167
|
+
return params === null || params === void 0 ? void 0 : params.selectedIFSC;
|
|
168
|
+
})() }, props)))),
|
|
169
|
+
react_1.default.createElement(Stack.Screen, { name: "FindIFSC", options: { title: 'Find IFSC' } }, (props) => {
|
|
170
|
+
var _a;
|
|
171
|
+
return (react_1.default.createElement(FindIFSC_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onSelect: (ifscData) => {
|
|
172
|
+
// Pop the FindIFSC screen and navigate to AddBankAccount with the selected data
|
|
173
|
+
(0, helpers_2.pop)(1); // Remove FindIFSC from stack
|
|
174
|
+
(0, helpers_2.navigate)('AddBankAccount', { selectedIFSC: ifscData });
|
|
175
|
+
}, initialSearchTerm: (_a = props.route.params) === null || _a === void 0 ? void 0 : _a.initialSearchTerm }, props)));
|
|
176
|
+
}),
|
|
177
|
+
react_1.default.createElement(Stack.Screen, { name: "PayNow", options: { title: 'Pay Now' } }, (props) => {
|
|
178
|
+
var _a;
|
|
179
|
+
return (react_1.default.createElement(PayNow_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), onConfirm: () => {
|
|
180
|
+
// onConfirm is now handled inside PayNow after createFD; keep fallback
|
|
181
|
+
}, fdData: (_a = props.route.params) === null || _a === void 0 ? void 0 : _a.fdData }, props)));
|
|
182
|
+
}),
|
|
183
|
+
react_1.default.createElement(Stack.Screen, { name: "Payment", options: { title: 'Payment' } }, (props) => (react_1.default.createElement(Payment_1.default, Object.assign({ onGoBack: () => (0, helpers_2.goBack)(), paymentUrl: ((0, paymentSession_1.getPaymentSession)().paymentUrl) || '', onPaymentSuccess: (data) => {
|
|
184
|
+
(0, helpers_2.navigate)('PaymentStatus', {
|
|
185
|
+
status: 'success',
|
|
186
|
+
paymentData: data
|
|
187
|
+
});
|
|
188
|
+
}, onPaymentFailure: (error) => {
|
|
189
|
+
(0, helpers_2.navigate)('PaymentStatus', {
|
|
190
|
+
status: 'failed',
|
|
191
|
+
paymentData: error
|
|
192
|
+
});
|
|
193
|
+
} }, props)))),
|
|
194
|
+
react_1.default.createElement(Stack.Screen, { name: "PaymentStatus", options: { title: 'Payment Status' } }, (props) => {
|
|
195
|
+
var _a, _b, _c;
|
|
196
|
+
return (react_1.default.createElement(PaymentStatus_1.default, Object.assign({ status: ((_a = props.route.params) === null || _a === void 0 ? void 0 : _a.status) || 'pending', transactionId: (_b = props.route.params) === null || _b === void 0 ? void 0 : _b.transactionId, fdData: (_c = props.route.params) === null || _c === void 0 ? void 0 : _c.fdData, onRetry: () => {
|
|
197
|
+
// Go back to Payment screen to retry
|
|
198
|
+
(0, helpers_2.navigate)('Payment');
|
|
199
|
+
}, onContinue: (fdDetails) => {
|
|
200
|
+
// Exit SDK to main app after successful payment with FD details
|
|
201
|
+
onExit === null || onExit === void 0 ? void 0 : onExit(fdDetails);
|
|
202
|
+
} }, props)));
|
|
203
|
+
})));
|
|
204
|
+
};
|
|
205
|
+
exports.default = RootNavigator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type SimpleNavigationRoute = 'Home' | 'FDList' | 'BookFD' | 'FDCalculator';
|
|
3
|
+
export interface SimpleNavigationConfig {
|
|
4
|
+
initialRouteName?: SimpleNavigationRoute;
|
|
5
|
+
}
|
|
6
|
+
interface SimpleNavigatorProps {
|
|
7
|
+
config?: SimpleNavigationConfig;
|
|
8
|
+
onExit?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const SimpleNavigator: React.FC<SimpleNavigatorProps>;
|
|
11
|
+
export default SimpleNavigator;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
//import Home from '../screens/Home';
|
|
41
|
+
const FDList_1 = __importDefault(require("../screens/FDList"));
|
|
42
|
+
//import BookFD from '../screens/BookFD';
|
|
43
|
+
const FDCalculator_1 = __importDefault(require("../screens/FDCalculator"));
|
|
44
|
+
const SimpleNavigator = ({ config, onExit }) => {
|
|
45
|
+
const [currentRoute, setCurrentRoute] = (0, react_1.useState)((config === null || config === void 0 ? void 0 : config.initialRouteName) || 'FDList');
|
|
46
|
+
const [routeParams, setRouteParams] = (0, react_1.useState)(null);
|
|
47
|
+
const navigate = (routeName, params) => {
|
|
48
|
+
setCurrentRoute(routeName);
|
|
49
|
+
setRouteParams(params);
|
|
50
|
+
};
|
|
51
|
+
const goBack = () => {
|
|
52
|
+
// Simple back navigation logic
|
|
53
|
+
switch (currentRoute) {
|
|
54
|
+
case 'FDList':
|
|
55
|
+
// FDList is now the first screen, so exit SDK
|
|
56
|
+
if (onExit) {
|
|
57
|
+
onExit();
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case 'BookFD':
|
|
61
|
+
case 'FDCalculator':
|
|
62
|
+
setCurrentRoute('FDList');
|
|
63
|
+
setRouteParams(null);
|
|
64
|
+
break;
|
|
65
|
+
case 'Home':
|
|
66
|
+
// If somehow on Home, go back to FDList
|
|
67
|
+
setCurrentRoute('FDList');
|
|
68
|
+
setRouteParams(null);
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
if (onExit) {
|
|
72
|
+
onExit();
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
// const handleBookingComplete = (data: FDBookingData) => {
|
|
78
|
+
// goBack(); // Go back to FD List after booking
|
|
79
|
+
// };
|
|
80
|
+
const renderCurrentScreen = () => {
|
|
81
|
+
switch (currentRoute) {
|
|
82
|
+
// case 'Home':
|
|
83
|
+
// return (
|
|
84
|
+
// <Home
|
|
85
|
+
// onNavigateToBookFD={() => navigate('BookFD')}
|
|
86
|
+
// onNavigateToFDList={() => navigate('FDList')}
|
|
87
|
+
// />
|
|
88
|
+
// );
|
|
89
|
+
case 'FDList':
|
|
90
|
+
return (react_1.default.createElement(FDList_1.default, { onGoBack: goBack, onSelectFD: (fdId) => { }, onNavigateToFDCalculator: (fdData) => navigate('FDCalculator', { fdData }) }));
|
|
91
|
+
// case 'BookFD':
|
|
92
|
+
// return (
|
|
93
|
+
// <BookFD
|
|
94
|
+
// onGoBack={goBack}
|
|
95
|
+
// onBookingComplete={handleBookingComplete}
|
|
96
|
+
// fdData={routeParams?.fdData}
|
|
97
|
+
// />
|
|
98
|
+
// );
|
|
99
|
+
case 'FDCalculator':
|
|
100
|
+
return (react_1.default.createElement(FDCalculator_1.default, { onGoBack: goBack, fdData: routeParams === null || routeParams === void 0 ? void 0 : routeParams.fdData }));
|
|
101
|
+
default:
|
|
102
|
+
return (react_1.default.createElement(FDList_1.default, { onGoBack: goBack, onSelectFD: (fdId) => { }, onNavigateToFDCalculator: (fdData) => navigate('FDCalculator', { fdData }) }));
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return renderCurrentScreen();
|
|
106
|
+
};
|
|
107
|
+
exports.default = SimpleNavigator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RootStackParamList } from './types';
|
|
2
|
+
export declare const navigationRef: import("react").RefObject<any>;
|
|
3
|
+
export declare function navigate<T extends keyof RootStackParamList>(name: T, params?: RootStackParamList[T]): void;
|
|
4
|
+
export declare function goBack(): void;
|
|
5
|
+
export declare function resetNavigation(routeName: keyof RootStackParamList, params?: any): void;
|
|
6
|
+
export declare function replace<T extends keyof RootStackParamList>(name: T, params?: RootStackParamList[T]): void;
|
|
7
|
+
export declare function push<T extends keyof RootStackParamList>(name: T, params?: RootStackParamList[T]): void;
|
|
8
|
+
export declare function pop(count?: number): void;
|
|
9
|
+
export declare function getCurrentRouteName(): any;
|
|
10
|
+
export declare function canGoBack(): any;
|
|
11
|
+
export declare function exitSDK(): void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.navigationRef = void 0;
|
|
4
|
+
exports.navigate = navigate;
|
|
5
|
+
exports.goBack = goBack;
|
|
6
|
+
exports.resetNavigation = resetNavigation;
|
|
7
|
+
exports.replace = replace;
|
|
8
|
+
exports.push = push;
|
|
9
|
+
exports.pop = pop;
|
|
10
|
+
exports.getCurrentRouteName = getCurrentRouteName;
|
|
11
|
+
exports.canGoBack = canGoBack;
|
|
12
|
+
exports.exitSDK = exitSDK;
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const native_1 = require("@react-navigation/native");
|
|
15
|
+
// Navigation ref to access navigation outside of components
|
|
16
|
+
exports.navigationRef = (0, react_1.createRef)();
|
|
17
|
+
// Helper to navigate outside of React components
|
|
18
|
+
function navigate(name, params) {
|
|
19
|
+
var _a;
|
|
20
|
+
if ((_a = exports.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady()) {
|
|
21
|
+
exports.navigationRef.current.navigate(name, params);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Helper to go back
|
|
25
|
+
function goBack() {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
if (((_a = exports.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady()) && ((_b = exports.navigationRef.current) === null || _b === void 0 ? void 0 : _b.canGoBack())) {
|
|
28
|
+
exports.navigationRef.current.goBack();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Helper to reset navigation stack
|
|
32
|
+
function resetNavigation(routeName, params) {
|
|
33
|
+
var _a;
|
|
34
|
+
if ((_a = exports.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady()) {
|
|
35
|
+
exports.navigationRef.current.dispatch(native_1.CommonActions.reset({
|
|
36
|
+
index: 0,
|
|
37
|
+
routes: [{ name: routeName, params }],
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Helper to replace current screen
|
|
42
|
+
function replace(name, params) {
|
|
43
|
+
var _a;
|
|
44
|
+
if ((_a = exports.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady()) {
|
|
45
|
+
exports.navigationRef.current.dispatch(native_1.StackActions.replace(name, params));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Helper to push a new screen onto the stack
|
|
49
|
+
function push(name, params) {
|
|
50
|
+
var _a;
|
|
51
|
+
if ((_a = exports.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady()) {
|
|
52
|
+
exports.navigationRef.current.dispatch(native_1.StackActions.push(name, params));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Helper to pop screens from the stack
|
|
56
|
+
function pop(count = 1) {
|
|
57
|
+
var _a;
|
|
58
|
+
if ((_a = exports.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady()) {
|
|
59
|
+
exports.navigationRef.current.dispatch(native_1.StackActions.pop(count));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Helper to get current route name
|
|
63
|
+
function getCurrentRouteName() {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
if ((_a = exports.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady()) {
|
|
66
|
+
return (_b = exports.navigationRef.current.getCurrentRoute()) === null || _b === void 0 ? void 0 : _b.name;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
// Helper to check if can go back
|
|
71
|
+
function canGoBack() {
|
|
72
|
+
var _a;
|
|
73
|
+
if ((_a = exports.navigationRef.current) === null || _a === void 0 ? void 0 : _a.isReady()) {
|
|
74
|
+
return exports.navigationRef.current.canGoBack();
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
// Helper for SDK exit functionality
|
|
79
|
+
function exitSDK() {
|
|
80
|
+
// This can be customized based on how the SDK is integrated
|
|
81
|
+
// For now, we'll reset to the home screen
|
|
82
|
+
resetNavigation('Home');
|
|
83
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SimpleNavigator from './SimpleNavigator';
|
|
3
|
+
import type { SDKNavigationConfig } from './types';
|
|
4
|
+
import type { ThemeName, Theme } from '../theme';
|
|
5
|
+
interface SDKNavigationContainerProps {
|
|
6
|
+
config?: SDKNavigationConfig;
|
|
7
|
+
onExit?: (fdDetails?: any) => void;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
theme?: ThemeName | Theme;
|
|
10
|
+
useReactNavigation?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const SDKNavigationContainer: React.FC<SDKNavigationContainerProps>;
|
|
13
|
+
export default SDKNavigationContainer;
|
|
14
|
+
export declare const ShriramSDKNavigator: React.FC<Omit<SDKNavigationContainerProps, 'useReactNavigation'>>;
|
|
15
|
+
export { SimpleNavigator };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SimpleNavigator = exports.ShriramSDKNavigator = exports.SDKNavigationContainer = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const native_1 = require("@react-navigation/native");
|
|
9
|
+
const RootNavigator_1 = __importDefault(require("./RootNavigator"));
|
|
10
|
+
const SimpleNavigator_1 = __importDefault(require("./SimpleNavigator"));
|
|
11
|
+
exports.SimpleNavigator = SimpleNavigator_1.default;
|
|
12
|
+
const ThemeContext_1 = require("../theme/ThemeContext");
|
|
13
|
+
const ApiProvider_1 = require("../providers/ApiProvider");
|
|
14
|
+
const MasterDataProvider_1 = require("../providers/MasterDataProvider");
|
|
15
|
+
const helpers_1 = require("./helpers");
|
|
16
|
+
// Main navigation container for the SDK
|
|
17
|
+
const SDKNavigationContainer = ({ config, onExit, children, theme, useReactNavigation = true, // Default to React Navigation
|
|
18
|
+
}) => {
|
|
19
|
+
// Choose navigator based on flag
|
|
20
|
+
const navigator = useReactNavigation
|
|
21
|
+
? react_1.default.createElement(RootNavigator_1.default, { config: config, onExit: onExit })
|
|
22
|
+
: react_1.default.createElement(SimpleNavigator_1.default, { config: config, onExit: onExit });
|
|
23
|
+
const content = children || (useReactNavigation ? (react_1.default.createElement(native_1.NavigationContainer, { ref: helpers_1.navigationRef }, navigator)) : (navigator));
|
|
24
|
+
if (theme) {
|
|
25
|
+
const themeProps = typeof theme === 'string'
|
|
26
|
+
? { initialTheme: theme }
|
|
27
|
+
: { theme };
|
|
28
|
+
return (react_1.default.createElement(ApiProvider_1.ApiProvider, null,
|
|
29
|
+
react_1.default.createElement(MasterDataProvider_1.MasterDataProvider, null,
|
|
30
|
+
react_1.default.createElement(ThemeContext_1.ThemeProvider, Object.assign({}, themeProps), content))));
|
|
31
|
+
}
|
|
32
|
+
// Default theme provider with API provider
|
|
33
|
+
return (react_1.default.createElement(ApiProvider_1.ApiProvider, null,
|
|
34
|
+
react_1.default.createElement(MasterDataProvider_1.MasterDataProvider, null,
|
|
35
|
+
react_1.default.createElement(ThemeContext_1.ThemeProvider, null, content))));
|
|
36
|
+
};
|
|
37
|
+
exports.SDKNavigationContainer = SDKNavigationContainer;
|
|
38
|
+
// Default export for easy import
|
|
39
|
+
exports.default = exports.SDKNavigationContainer;
|
|
40
|
+
// React Navigation version - always uses React Navigation Stack Navigator
|
|
41
|
+
const ShriramSDKNavigator = (props) => (react_1.default.createElement(exports.SDKNavigationContainer, Object.assign({}, props, { useReactNavigation: true })));
|
|
42
|
+
exports.ShriramSDKNavigator = ShriramSDKNavigator;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export type RootStackParamList = {
|
|
2
|
+
Home: undefined;
|
|
3
|
+
FDList: undefined;
|
|
4
|
+
FDCalculator: {
|
|
5
|
+
fdData?: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
accountNumber: string;
|
|
9
|
+
roi: string;
|
|
10
|
+
tenure: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
maturityDate: string;
|
|
13
|
+
status: 'active' | 'matured' | 'pending';
|
|
14
|
+
creditRating: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
AadhaarVerification: {
|
|
18
|
+
fdData?: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
accountNumber: string;
|
|
22
|
+
roi: string;
|
|
23
|
+
tenure: string;
|
|
24
|
+
amount: number;
|
|
25
|
+
maturityDate: string;
|
|
26
|
+
status: 'active' | 'matured' | 'pending';
|
|
27
|
+
creditRating: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
ReviewKYC: {
|
|
31
|
+
fdData?: {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
accountNumber: string;
|
|
35
|
+
roi: string;
|
|
36
|
+
tenure: string;
|
|
37
|
+
amount: number;
|
|
38
|
+
maturityDate: string;
|
|
39
|
+
status: 'active' | 'matured' | 'pending';
|
|
40
|
+
creditRating: string;
|
|
41
|
+
};
|
|
42
|
+
kycData?: any;
|
|
43
|
+
};
|
|
44
|
+
BookFD: {
|
|
45
|
+
fdData?: {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
accountNumber: string;
|
|
49
|
+
roi: string;
|
|
50
|
+
tenure: string;
|
|
51
|
+
amount: number;
|
|
52
|
+
maturityDate: string;
|
|
53
|
+
status: 'active' | 'matured' | 'pending';
|
|
54
|
+
creditRating: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
Employee: undefined;
|
|
58
|
+
NomineeDetail: undefined;
|
|
59
|
+
BankDetail: undefined;
|
|
60
|
+
AddBankAccount: {
|
|
61
|
+
selectedIFSC?: {
|
|
62
|
+
bankName: string;
|
|
63
|
+
branchName: string;
|
|
64
|
+
ifscCode: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
FindIFSC: {
|
|
68
|
+
initialSearchTerm?: string;
|
|
69
|
+
};
|
|
70
|
+
PayNow: {
|
|
71
|
+
fdData?: {
|
|
72
|
+
companyName: string;
|
|
73
|
+
amount: number;
|
|
74
|
+
fdRate: string;
|
|
75
|
+
tenure: string;
|
|
76
|
+
interestPayout: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
Payment: undefined;
|
|
80
|
+
PaymentStatus: {
|
|
81
|
+
status?: 'success' | 'failed' | 'pending';
|
|
82
|
+
transactionId?: string;
|
|
83
|
+
fdData?: {
|
|
84
|
+
companyName: string;
|
|
85
|
+
amount: number;
|
|
86
|
+
fdRate: string;
|
|
87
|
+
tenure: string;
|
|
88
|
+
interestPayout: string;
|
|
89
|
+
};
|
|
90
|
+
paymentData?: any;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export type NavigationProps = {
|
|
94
|
+
navigation: any;
|
|
95
|
+
route: any;
|
|
96
|
+
};
|
|
97
|
+
export type ScreenProps<T extends keyof RootStackParamList> = {
|
|
98
|
+
navigation: any;
|
|
99
|
+
route: {
|
|
100
|
+
params: RootStackParamList[T];
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export interface SDKNavigationConfig {
|
|
104
|
+
initialRouteName?: keyof RootStackParamList;
|
|
105
|
+
onExit?: (fdDetails?: any) => void;
|
|
106
|
+
customScreenOptions?: object;
|
|
107
|
+
}
|
|
108
|
+
export interface NavigationContextType {
|
|
109
|
+
navigate: (screen: keyof RootStackParamList, params?: any) => void;
|
|
110
|
+
goBack: () => void;
|
|
111
|
+
reset: (routeName: keyof RootStackParamList) => void;
|
|
112
|
+
exit: () => void;
|
|
113
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { InvestmentData, CustomerData, AppData, FDData } from '../types/dataTypes';
|
|
2
|
+
import type { WorkflowStateSriram } from '../types/workflowTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Centralized navigation for FD workflow based on Flutter implementation
|
|
5
|
+
*/
|
|
6
|
+
export declare function handleWorkflowNavigation({ workflowState, investmentData, customerData, appData, fdData, completedApplications, transactionId, }: {
|
|
7
|
+
workflowState: WorkflowStateSriram;
|
|
8
|
+
investmentData?: InvestmentData;
|
|
9
|
+
customerData?: CustomerData;
|
|
10
|
+
appData?: AppData;
|
|
11
|
+
fdData?: FDData;
|
|
12
|
+
completedApplications?: any[];
|
|
13
|
+
transactionId?: string;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Handle FD selection from FDList and start the workflow
|
|
17
|
+
*/
|
|
18
|
+
export declare function handleFDSelection(fdData: FDData, investmentData?: InvestmentData): void;
|
|
19
|
+
/**
|
|
20
|
+
* Navigate through the complete FD creation flow
|
|
21
|
+
*/
|
|
22
|
+
export declare function navigateFDCreationFlow(fdData: FDData, investmentData?: InvestmentData): void;
|