with encrypted data on envolope submit

This commit is contained in:
Abin Toppo
2026-02-05 16:03:26 +05:30
parent 499e680404
commit c1ecc97e29
56 changed files with 4788 additions and 1482 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import React, { useState, useRef, useMemo } from 'react';
import { View, Text, StyleSheet, TouchableOpacity, Animated, Dimensions } from 'react-native';
import { InsideHeader } from '../../Component/Index';
import { useFetchLiveAuction, useFetchPurchaseAuction } from '../../Services/BBPS/Hooks';
import { useFetchLiveAuction, useFetchPurchaseAuction } from '../../Services/ApiCall/Hooks';
import colors from '../../Constant/Color';
import LiveAuction from './LiveAuction';
import PurchaseAuction from './PurchaseAuction';
+2 -4
View File
@@ -2,14 +2,14 @@ import React, { useCallback, useState, useEffect, useRef } from 'react';
import { View, FlatList, ActivityIndicator, RefreshControl, Text } from 'react-native';
import Animated, { FadeInDown, FadeOutUp } from 'react-native-reanimated';
import LiveAuctionTile from './LiveAuctionTile';
import { useFetchLiveAuction } from '../../Services/BBPS/Hooks';
import { useFetchLiveAuction } from '../../Services/ApiCall/Hooks';
import { SearchInput } from '../../Component/Serach/SeacrhInput';
import { Skelton } from '../../Component/Index';
import colors from '../../Constant/Color';
import { useDispatch, useSelector } from 'react-redux';
import { togglePurchaseAuction } from '../../Redux/Slices/selectPurchaseAuction';
import { apiCall } from '../../Axios/Axios';
import { GET_MY_AUCTION } from '../../Services/BBPS/ApiUrls';
import { GET_MY_AUCTION } from '../../Services/ApiCall/ApiUrls';
import SkeltonList from '../../Component/Skelton/SkeltonList';
import Skeleton from '../../Component/Skelton/Skelton';
@@ -21,13 +21,11 @@ const LiveAuction = () => {
const [showRefreshBanner, setShowRefreshBanner] = useState(false);
const [allBoolean, setAllBoolean] = useState({ liveAuctionData: [], isLoading: false })
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch, isPending }: any = useFetchLiveAuction();
console.log("object----",data,)
// My Methods
const renderItem = useCallback(
({ item, index }: any) => {
console.log("item core ",item)
const isPurchase = SelectedPurchaseList.findIndex((prev: any) => prev.auctionNumber === item.auctionNumber)
return <LiveAuctionTile
data={item}
-1
View File
@@ -17,7 +17,6 @@ const LiveAuctionTile: React.FC<LiveAuctionTileProps> = ({
auctionNumber,
isPurchasedByContractor
}) => {
console.log("1",data)
const [showDetail, setShowDetail] = React.useState(false);
const purchaseEnded = moment().isAfter(moment(purchaseEnd, 'DD-MM-YYYY HH:mm:ss'));
+2 -4
View File
@@ -1,9 +1,9 @@
import React, { memo, useEffect, useState } from 'react';
import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Platform, StatusBar, Modal } from 'react-native';
import { Briefcase, Calendar, FileText, Download, Eye, Layers, ArrowLeft, Clock } from 'lucide-react-native';
import { useAuctionItem, useGetAuciton, useGetAucitonDocument } from '../../../Services/BBPS/Hooks';
import { useAuctionItem, useGetAuciton, useGetAucitonDocument } from '../../../Services/ApiCall/Hooks';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { AUCTION_DOCUMENT_DOWNLOAD } from '../../../Services/BBPS/ApiUrls';
import { AUCTION_DOCUMENT_DOWNLOAD } from '../../../Services/ApiCall/ApiUrls';
import ReactNativeBlobUtil from 'react-native-blob-util';
import AuctionItemDetail from './AuctionItemDetail';
import { Loader } from '../../../Component/Index';
@@ -20,7 +20,6 @@ const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
const [allBoolean, setAllBoolean] = useState({ showItemDetail: false, selectedItem: {}, fileLoading: false });
const { data: auctionDocuments } = useGetAucitonDocument({ auctionId: data?.auctionId })
const { mutate } = useAuctionItem()
console.log("jkjkjk",auctionData)
const formatDate = (date?: string) => {
if (!date) return '-';
@@ -75,7 +74,6 @@ const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
});
const stat = await ReactNativeBlobUtil.fs.stat(path);
console.log('File size:', stat.size);
} catch (error: any) {
console.log('Error:', error?.message || error);
@@ -3,9 +3,9 @@ import { View, Text, StyleSheet, TouchableOpacity, ScrollView, Platform, Modal }
import { Package, IndianRupee, FileText, Download, ArrowLeft, Info, } from 'lucide-react-native';
import colors from '../../../Constant/Color';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useAucitonItemDetail } from '../../../Services/BBPS/Hooks';
import { useAucitonItemDetail } from '../../../Services/ApiCall/Hooks';
import ReactNativeBlobUtil from 'react-native-blob-util';
import { AUCTION_ITEM_DOCUMENT_DOWNLOAD } from '../../../Services/BBPS/ApiUrls';
import { AUCTION_ITEM_DOCUMENT_DOWNLOAD } from '../../../Services/ApiCall/ApiUrls';
import { Loader } from '../../../Component/Index';
interface Props { visible: boolean; onClose: () => void; data?: any; }
@@ -62,7 +62,6 @@ const AuctionItemDetail: React.FC<Props> = ({ visible, onClose, data }) => {
});
const stat = await ReactNativeBlobUtil.fs.stat(path);
console.log(' File size:', stat.size);
} catch (error: any) {
console.log('Error:', error?.message || error);
@@ -25,10 +25,8 @@ const FilterModal: React.FC<Props> = ({ visible, onClose, setFilter, filter }) =
if (pickerType === 'FROM') {
setFromDate(date);
console.log('FROM date set');
} else {
setToDate(date);
console.log('TO date set');
}
setOpenPicker(false);
+1 -2
View File
@@ -3,7 +3,7 @@ import { View, Text, StyleSheet, FlatList, RefreshControl, ActivityIndicator } f
import LiveAuctionTile from './LiveAuctionTile';
import { useNavigation } from '@react-navigation/native';
import moment from 'moment';
import { useFetchLiveAuctionPage, useFetchPurchaseAuction } from '../../Services/BBPS/Hooks';
import { useFetchLiveAuctionPage, useFetchPurchaseAuction } from '../../Services/ApiCall/Hooks';
import PurchaseAuctionTile from './PurchaseAuctionTile';
import { useDispatch } from 'react-redux';
import { setAuction } from '../../Redux/Slices/SelectedAuction';
@@ -35,7 +35,6 @@ const PurchaseAuction = () => {
}
function isAuctionEnd(item: any): boolean {
console.log("item wih power ",item)
const now = moment();
const end = moment(item.auctionStatus === "Amended" ? item?.amendedkeyDates?.auctionBidding?.endDateTime : item?.keyDates?.auctionBidding?.endDateTime, format);
+3 -3
View File
@@ -4,7 +4,7 @@ import { InsideHeader, Loader } from '../../Component/Index';
import colors from '../../Constant/Color';
import { CreditCard, Calendar, User, DollarSign, ArrowRight } from 'lucide-react-native';
import { useDispatch, useSelector } from 'react-redux';
import { useOfflineAuctionPurchase, usePurchaseAuctionList } from '../../Services/BBPS/Hooks';
import { useOfflineAuctionPurchase, usePurchaseAuctionList } from '../../Services/ApiCall/Hooks';
import { showSuccessAlert } from '../../Constant/ShowDailog';
import { clearPurchaseAuction } from '../../Redux/Slices/selectPurchaseAuction';
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
@@ -79,7 +79,7 @@ const PurchaseAuctionList = () => {
}
},
onError: (error) => {
// console.log(error, "================purchse Error");
console.log(error, "purchse Error");
}
})
@@ -149,7 +149,7 @@ const PurchaseAuctionList = () => {
}
},
onError: (error) => {
console.log(error, "=================purchase list error");
console.log(error, "purchase list error");
}
})
}
@@ -10,7 +10,6 @@ const PurchaseAuctionTile = ({ item, onPressDetails, onStartBidding, buttonEnabl
const [showDetail, setShowDetail] = React.useState(false);
const scale = useSharedValue(1);
const elevation = useSharedValue(8);
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", item);
const animatedStyle = useAnimatedStyle(() => {
return {
transform: [{ scale: scale.value }],
-1
View File
@@ -38,7 +38,6 @@ useEffect(() => {
{/* Cards */}
{SelectedPurchaseList.map((item: any, index: any) => {
console.log("item nn", item);
const expanded = expandedIndex === index;
return (
<Animated.View
@@ -93,7 +93,6 @@ const BiddingCard = ({ item, bidValue, onIncrease, onDecrease, onPlaceBid, Selec
setAllState((prev: any) => ({ ...prev, isLoading: false }))
}
}
// console.log(item, 'jkjjj');
return (
<View>
@@ -5,7 +5,7 @@ import * as Yup from 'yup'
import { pick } from '@react-native-documents/picker'
import { useSelector } from 'react-redux'
import { apiCall } from '../../../Axios/Axios'
import { TECHNICAL_DOCUMENT_SUBMIT, TECHNICAL_VALUE_SUBMIT } from '../../../Services/BBPS/ApiUrls'
import { TECHNICAL_DOCUMENT_SUBMIT, TECHNICAL_VALUE_SUBMIT } from '../../../Services/ApiCall/ApiUrls'
import { Props } from '../Type/BidType'
import colors from '../../../Constant/Color'
import { Loader } from '../../../Component/Index'
+2 -2
View File
@@ -9,9 +9,9 @@ import EmdComplete from './Component/EmdComplete';
import NavigationString from '../../Constant/NavigationString';
import { useNavigation } from '@react-navigation/native';
import { useSelector } from 'react-redux';
import { useAuctionItem, useEmdCheck } from '../../Services/BBPS/Hooks';
import { useAuctionItem, useEmdCheck } from '../../Services/ApiCall/Hooks';
import { apiCall } from '../../Axios/Axios';
import { AUCITON_SINGLE_EMD, AUCTION_ITEM_SUBMIT, CHECK_TECHNICAL_DOCUMENTAION, GET_AUCTION_DETAILS, GET_TECHNICAL_DOCUMENTAION } from '../../Services/BBPS/ApiUrls';
import { AUCITON_SINGLE_EMD, AUCTION_ITEM_SUBMIT, CHECK_TECHNICAL_DOCUMENTAION, GET_AUCTION_DETAILS, GET_TECHNICAL_DOCUMENTAION } from '../../Services/ApiCall/ApiUrls';
import TemplateFormModal from './Component/TemplateFormModal';
import { SelectedItem } from './Type/BidType';
import FontsFamily from '../../Constant/FontsFamily';
+2 -3
View File
@@ -7,7 +7,7 @@ import { useWebSocketService } from '../../socket/Socket';
import Variables from '../../Constant/Variable';
import { useSelector } from 'react-redux';
import { apiCall } from '../../Axios/Axios';
import { AUCTION_ONE_TIME_BID, FORWARD_AUCTION_ITEM, GET_AUCTION_DETAILS, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/BBPS/ApiUrls';
import { AUCTION_ONE_TIME_BID, FORWARD_AUCTION_ITEM, GET_AUCTION_DETAILS, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/ApiCall/ApiUrls';
import BiddingCard from './Component/BiddingCard';
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
import NavigationString from '../../Constant/NavigationString';
@@ -163,7 +163,7 @@ const StartBidding = () => {
};
subscribe(`/topic/room/${SelectedAuction.auctionNumber}`, async (message) => {
// console.log('RAW MESSAGE:', message[message.length - 1]);
const result = message[message.length - 1]
const updatedBidItem = (prev: any[]) =>
@@ -300,7 +300,6 @@ const StartBidding = () => {
return () => subscription.remove();
}, [Navigation])
);
// console.log(bidValues, 'jjfdlsjfldsjfl');
return (
<View style={styles.container}>
+1 -2
View File
@@ -7,7 +7,7 @@ import { useWebSocketService } from '../../socket/Socket';
import Variables from '../../Constant/Variable';
import { useSelector } from 'react-redux';
import { apiCall } from '../../Axios/Axios';
import { AUCTION_ONE_TIME_BID, GET_AUCTION_DETAILS, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/BBPS/ApiUrls';
import { AUCTION_ONE_TIME_BID, GET_AUCTION_DETAILS, REVERSE_AUCTION_ITEM, SELECTED_AUCTION_ITEM } from '../../Services/ApiCall/ApiUrls';
import { CommonActions, useFocusEffect, useNavigation } from '@react-navigation/native';
import NavigationString from '../../Constant/NavigationString';
import CountdownTimer from '../../Component/Counter/CountdownTimer';
@@ -239,7 +239,6 @@ const StartReverseBidding = () => {
const placeBidSubmit = async (data: any) => {
try {
const result: any = await placeBid(data);
console.log(result, 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk');
if (result?.status && result.data) {
const updatedBidItem = (prev: any[]) =>
+12 -9
View File
@@ -1,10 +1,10 @@
import React, { useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { View, Text, StyleSheet, Dimensions, FlatList, ActivityIndicator, Alert } from 'react-native';
import Animated, { useSharedValue, useAnimatedStyle, withDelay, withTiming } from 'react-native-reanimated';
import { Layers, Clock, ShoppingCart, X, FileText } from 'lucide-react-native';
import { Header } from '../../Component/Index';
import colors from '../../Constant/Color';
import { useDashboard, useESetuAdharVarification, useTenderDashboard } from '../../Services/BBPS/Hooks';
import { useDashboard, useESetuAdharVarification, useTenderDashboard } from '../../Services/ApiCall/Hooks';
import { useSelector } from 'react-redux';
import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog';
import { generateTransactionId } from '../../Helper/uniqueId';
@@ -71,9 +71,15 @@ const Home = () => {
const [showDialog, setShowDialog] = useState<boolean>(false);
const [isNavigating, setIsNavigating] = useState<boolean>(false);
const [DASHBOARD_CARDS,setDASHBOARD_CARDS]=useState<any>([])
useFocusEffect(() => {
setIsNavigating(false)
})
useFocusEffect(
useCallback(() => {
setIsNavigating(false);
return () => {
// cleanup if needed
};
}, [])
);
useEffect(() => {
if (user?.esetuVerified === 'Not Verified') {
setShowDialog(true);
@@ -93,18 +99,15 @@ const Home = () => {
udf4: "string",
};
console.log("Payload:", payload);
const res = await eSetuAdharVarification(payload);
console.log("Verification response:", res);
setShowDialog(false);
Navigation.navigate(NavigationString.KycWebViewScreen, { res });
} catch (err) {
console.log("Verification error:", err);
Alert.alert('Error', 'Failed to initiate verification. Please try again.');
Alert.alert('Error', 'Failed to initiate verification. Please try again.');
setIsNavigating(false);
}
};
+4 -5
View File
@@ -3,11 +3,11 @@ import { View, Text, Dimensions, TextInput, TouchableOpacity, StyleSheet, Keyboa
import LinearGradient from 'react-native-linear-gradient';
import { Formik } from 'formik';
import * as Yup from 'yup';
import Animated, { FadeInUp, FadeInDown } from 'react-native-reanimated';
import Animated, { FadeInUp, FadeInDown } from 'react-native-reanimated';
import { Mail, Lock, Eye, EyeOff, ArrowRight } from 'lucide-react-native';
import colors from '../../Constant/Color';
import ImagePath from '../../Constant/ImagePath';
import { useAuctionLogin, usefetchMasterData, useGetDesignation, useLogin, useRagistrationState } from '../../Services/BBPS/Hooks';
import { useAuctionLogin, usefetchMasterData, useGetDesignation, useLogin, useRagistrationState } from '../../Services/ApiCall/Hooks';
import { useDispatch } from 'react-redux';
import { setToken } from '../../Redux/Slices/Token';
import { showErrorAlert } from '../../Constant/ShowDailog';
@@ -37,11 +37,11 @@ const Login = () => {
const [auctionLoading, setAuctionLoading] = useState(false);
const { mutate: loginMutate } = useLogin();
const { mutate: auctionMutate } = useAuctionLogin();
const { data } = useGetDesignation();
// const { data } = useGetDesignation();
const { mutate: registrationStateMutate } = useRagistrationState();
const [forgotPassword, setForgotPassword] = useState(false)
const { data: MasterData } = usefetchMasterData()
// const { data: MasterData } = usefetchMasterData()
const handleGetData = async () => {
registrationStateMutate(undefined, {
@@ -73,7 +73,6 @@ const Login = () => {
break;
default:
{
console.log("attempting navigation to Ragistration")
Navigation.replace(NavigationString.Registration);
}
break;
+1 -2
View File
@@ -17,7 +17,7 @@ import {
ToastAndroid,
} from 'react-native';
import { Eye, EyeOff } from 'lucide-react-native';
import { BASE_URL } from '../../Services/BBPS/ApiUrls';
import { BASE_URL } from '../../Services/ApiCall/ApiUrls';
import colors from '../../Constant/Color';
interface ResetPasswordProps {
@@ -273,7 +273,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
);
if (res.data?.statusCode === 200) {
console.log("ress",res)
ToastAndroid.show('OTP sent successfully', ToastAndroid.SHORT);
setOtp(['', '', '', '', '', '']);
setIsOtpVerified(false);
+1 -3
View File
@@ -54,7 +54,7 @@ import {
} from 'lucide-react-native';
import { useFocusEffect, useNavigation } from '@react-navigation/native';
import { useContractorProfile, useUpdateUserProfile, useESetuAdharVarification } from '../../Services/BBPS/Hooks';
import { useContractorProfile, useUpdateUserProfile, useESetuAdharVarification } from '../../Services/ApiCall/Hooks';
import colors from '../../Constant/Color';
import { useSelector } from 'react-redux';
import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog';
@@ -212,7 +212,6 @@ const ProfileTab: React.FC = () => {
Navigation.navigate(NavigationString.KycWebViewScreen, { res });
} catch (err) {
console.log("Verification error:", err);
Alert.alert('Error', 'Failed to initiate verification. Please try again.');
setIsNavigating(false);
}
@@ -466,7 +465,6 @@ const EditProfileModal: React.FC<EditProfileModalProps> = ({
try {
const result = await updateProfileMutation.mutateAsync(formData);
console.log("UserProfile ",result)
Alert.alert('Success', 'Profile updated successfully');
onSuccess();
onClose();
+2 -5
View File
@@ -14,8 +14,8 @@ import colors from '../../Constant/Color';
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
import MyInput from '../../Component/MyInput';
import { showToast } from '../../Constant/ShowDailog';
import { PARTNER_API_ENDPOINT } from '../../Services/BBPS/ApiUrls';
import { usePartnerShipSubmit } from '../../Services/BBPS/Hooks';
import { PARTNER_API_ENDPOINT } from '../../Services/ApiCall/ApiUrls';
import { usePartnerShipSubmit } from '../../Services/ApiCall/Hooks';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { Navigation } from 'lucide-react-native';
import { NavigationString } from '../../Constant/AllImports';
@@ -118,12 +118,9 @@ const Partnership = () => {
return;
}
console.log("Partner ship payload:", payload);
const response = await partnerShipSubmit(payload);
console.log("first ====== ", response)
if (response?.statusCode === 200) {
console.log('✅ Partners submitted successfully:', response);
showToast(response.message || 'Submitted successfully!');
navigation.replace(NavigationString.Home);
+6 -113
View File
@@ -23,7 +23,7 @@ import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
import StepProgressBar from '../../Component/StepProgressBar';
import { formatDateInput } from '../../Helper/formatDateInput';
import { showToast } from '../../Constant/ShowDailog';
import { useCityDropdown, useContractorStageTwoSubmit, usefetchMasterData, useSendAadhaarOtp, useVerifyAadhaarOtp, useVerifyGstNumber, useVerifyPan } from '../../Services/BBPS/Hooks';
import { useCityDropdown, useContractorStageTwoSubmit, usefetchMasterData, useSendAadhaarOtp, useVerifyAadhaarOtp, useVerifyGstNumber, useVerifyPan } from '../../Services/ApiCall/Hooks';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useSelector } from 'react-redux';
@@ -102,7 +102,6 @@ const Registration: React.FC = () => {
const { mutateAsync: verifyGstNumber } = useVerifyGstNumber();
const { mutateAsync: contractorStageTwoSubmit } = useContractorStageTwoSubmit();
const { data: masterData } = usefetchMasterData();
console.log("master",masterData)
useEffect(() => {
if (!masterData?.data) return;
const contractorClasses = masterData.data.contractorClasses || [];
@@ -153,14 +152,10 @@ useEffect(() => {
}
useEffect(() => {
const fetchUserData = async (user:any) => {
console.log("hitting it ")
try {
console.log("hitting it 1 ")
console.log("object====",user)
if (user) {
const parsedUser = user;
console.log(parsedUser);
setFormData(prev => ({
...prev,
firstName: parsedUser?.firstName || userData?.userData?.firstName,
@@ -169,7 +164,6 @@ useEffect(() => {
middleName: parsedUser?.middleName || userData?.userData?.middleName,
email: parsedUser?.email || userData?.userData?.email,
}));
console.log('User Data from Storage:', parsedUser);
} else {
console.log('No user data found');
}
@@ -230,7 +224,6 @@ useEffect(() => {
};
const sendAdharOTPHandler = async (text: string) => {
console.log('Sending Aadhaar OTP...');
setAadhaarVerifying(true);
setadharreference('');
@@ -329,7 +322,6 @@ useEffect(() => {
gistnNo: formData.gstnNo,
stateName: MasterData?.data?.states?.find((state:any)=>state.stateId==formData.state)?.stateName || '',
};
console.log('Form Data for registration',formData);
try {
const fileData = new FormData();
@@ -341,25 +333,20 @@ useEffect(() => {
fileData.append('pancardfile', documents.panCard as any);
fileData.append('regfile', documents.registrationCertificate as any);
console.log('File Data for registration',fileData);
const res = await contractorStageTwoSubmit(fileData);
console.log('Register contractor Response : ', res);
if (res.status === 200) {
if (res) {
showToast('Form submitted successfully!');
console.log('response?.data?.contOtherId : ', res?.data?.contOtherId);
const orgType = selectedOrg;
const params = { otherId: res?.data?.contOtherId, orgType: orgType };
if ([4, 5, 6].includes(orgType)) {
navigation.replace('StageThree' as never, params as never);
} else if (orgType === 7) {
console.log('org type else if : ', orgType);
navigation.replace('PartnerShip' as never, { otherId: res?.data?.contOtherId } as never);
} else {
console.log('org type else : ', orgType);
navigation.replace('Dashboard' as never);
}
} else {
@@ -370,9 +357,7 @@ useEffect(() => {
}
} catch (error: any) {
if (axios.isAxiosError(error)) {
console.log('11111', error.response?.status);
console.log('22222', error.response?.data);
console.log('3333333', error.response?.headers);
} else {
console.error('Unexpected error', error);
}
@@ -383,27 +368,11 @@ useEffect(() => {
}
};
// const fetchAllMSME = async () => {
// try {
// console.log('Fetching MSME');
// const msmeOption = await getAllMsMeOrg();
// console.log('msme options fetched:', msmeOption);
// setAllMSME(msmeOption);
// } catch (error) {
// setAllMSME([]);
// console.error('Error in city fetch:', error);
// }
// };
const fetchCity = async (stateId: number) => {
cityDropdownMutate(stateId, {
onSuccess: (data) => {
console.log('City options fetched:', data);
// const cityList = data.data || [];
// const mappedCity = cityList.map((item:any)=> ({
// label: item.name,
// value: item.id,
// }));
onSuccess: (data) => {
setCities(data);
},
onError: (error) => {
@@ -411,88 +380,12 @@ useEffect(() => {
console.error('Error in city fetch:', error);
}
});
// try {
// console.log('Fetching cities for state ID:', stateId);
// console.log('City options fetched:', cityOptions);
// setCities(cityOptions);
// } catch (error) {
// setCities([]);
// console.error('Error in city fetch:', error);
// }
};
// const contactorClassHandler = async () => {
// try {
// setloader(true);
// const mappedItems = await getClassDropdown();
// console.log(mappedItems, 'Contractor class items');
// setContractorClassItems(mappedItems);
// } catch (error) {
// console.log('Contractor class fetch error:', error);
// } finally {
// setloader(false);
// }
// };
// const contactorORG = async () => {
// try {
// setloader(true);
// const mappedItems = await getOrgDropdown();
// setAllOrganizations(mappedItems);
// } catch (error) {
// console.log('Contractor ORG fetch error:', error);
// } finally {
// setloader(false);
// }
// };
// const contactorRegistration = async () => {
// try {
// setloader(true);
// const mappedItems = await getMsmeDropdown();
// setAllMsmeOrgs(mappedItems);
// } catch (error) {
// console.log('Contractor ORG fetch error:', error);
// } finally {
// setloader(false);
// }
// };
console.log('formdata : ', formData);
// const contactorSocial = async () => {
// try {
// setloader(true);
// const mappedItems = await getSocialDropdown();
// setAllSocialCategories(mappedItems);
// } catch (error) {
// console.log('Contractor ORG fetch error:', error);
// } finally {
// setloader(false);
// }
// };
// const allState = async () => {
// try {
// setloader(true);
// const mappedItems = await getStateDropdown();
// setstates(mappedItems);
// } catch (error) {
// console.log('all states error:', error);
// } finally {
// setloader(false);
// }
// };
// useEffect(() => {
// contactorClassHandler();
// contactorORG();
// contactorRegistration();
// contactorSocial();
// allState();
// fetchAllMSME();
// }, []);
useEffect(() => {
if (formData?.state) {
+2 -2
View File
@@ -17,8 +17,8 @@ import colors from '../../Constant/Color';
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
import MyInput from '../../Component/MyInput';
import { showToast } from '../../Constant/ShowDailog';
import { STAGETHREE } from '../../Services/BBPS/ApiUrls';
import { useContractorStageThreeSubmit } from '../../Services/BBPS/Hooks';
import { STAGETHREE } from '../../Services/ApiCall/ApiUrls';
import { useContractorStageThreeSubmit } from '../../Services/ApiCall/Hooks';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
+1 -1
View File
@@ -15,7 +15,7 @@ import {
} from 'react-native';
import colors from '../../Constant/Color';
import { User, Phone, Mail, Lock, Eye, EyeOff, ArrowLeft, CheckSquare, Square } from 'lucide-react-native';
import { useGetDesignation, useRegisterContractor } from '../../Services/BBPS/Hooks';
import { useGetDesignation, useRegisterContractor } from '../../Services/ApiCall/Hooks';
import MyDropdown from '../../Component/Dropdown/MyDropdown';
import PrimaryButton from '../../Component/PrimaryButton/PrimaryButton';
import TermsAndConditionsModal from '../../Component/TermsAndConditionsModal/TermsAndConditionsModal';
+1 -6
View File
@@ -6,7 +6,7 @@ import { useSelector } from 'react-redux';
import { useStore } from 'react-redux'; // For hydration check
import { showToast } from '../../Constant/ShowDailog';
import { useRagistrationState } from '../../Services/BBPS/Hooks';
import { useRagistrationState } from '../../Services/ApiCall/Hooks';
import NavigationString from '../../Constant/NavigationString';
// Navigation type
@@ -24,7 +24,6 @@ const Splash: React.FC = () => {
const isFocused = useIsFocused();
const fadeAnim = useRef(new Animated.Value(0)).current;
const reduxToken = useSelector((state: any) => state.token?.token);
console.log("user Token", reduxToken)
const store = useStore();
const { mutateAsync: registrationStateMutate } = useRagistrationState();
const [isHydrated, setIsHydrated] = useState(false);
@@ -54,8 +53,6 @@ const Splash: React.FC = () => {
// const orgType = params.orgType;
const orgType = "7" as string; // For testing purpose
console.log("orgType value:", orgType);
console.log("orgType type:", typeof orgType);
if (orgType === '4' || orgType === '5' || orgType === '6') {
navigation.replace(NavigationString.StageThreeScreen, params);
@@ -73,7 +70,6 @@ console.log("orgType type:", typeof orgType);
const handleGetData = async () => {
try {
const res = await registrationStateMutate();
console.log("ragister", res)
if ( res?.data?.message==="No Response From Server"&& res?.data?.success===false){
navigation.reset({
@@ -90,7 +86,6 @@ console.log("orgType type:", typeof orgType);
if (res?.statusCode === 200 && res?.data) {
const { registrationStatus, contOtherId, contOrganization } = res.data;
const params = { otherId: contOtherId, orgType: contOrganization };
console.log('Registration status:', registrationStatus);
switch (registrationStatus) {
case null:
@@ -11,13 +11,27 @@ import {
} from 'react-native';
import RNFS from 'react-native-fs';
import * as XLSX from 'xlsx';
import axios from 'axios';
import axios, { AxiosError } from 'axios';
import { useSelector } from 'react-redux';
import colors from '../../../Constant/Color';
import { GET_ENVELOPE_C, SUBMIT_ENVELOPE_C_UPLOAD } from '../../../Services/BBPS/ApiUrls';
import { GET_ENVELOPE_C, SUBMIT_ENVELOPE_C_UPLOAD } from '../../../Services/ApiCall/ApiUrls';
import { useNavigation } from '@react-navigation/native';
import { encrypt, encryptWithRSA } from '../../../Services/Encryption/encrypt';
/* -------------------- UTILS -------------------- */
interface OfficerKey {
officersId: number;
officerPublicKey: string;
officerType: string;
}
interface SaveEnvelopeOfficerDetail {
officerId: number;
officerEncryptedKey: string;
officerType: string;
}
// Convert ArrayBuffer → Base64
const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
@@ -29,37 +43,54 @@ const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
return global.btoa(binary);
};
// Find column dynamically by keywords
const findColumnKey = (columns: string[], keywords: string[]) =>
columns.find(col =>
keywords.some(k => col.toLowerCase().includes(k.toLowerCase()))
);
// Detect TOTAL row (any column contains TOTAL)
const isTotalRow = (row: any) =>
Object.values(row).some(v => String(v).toUpperCase() === 'TOTAL');
/* -------------------- COMPONENT -------------------- */
const EnvelopeCExcelPreview = (props: any) => {
const tenderData = props;
console.log("Tender Data",tenderData)
const token = useSelector((state: any) => state.token.token);
const navigation = useNavigation() as any;
const [data, setData] = useState<any[]>([]);
const [columns, setColumns] = useState<string[]>([]);
const [loading, setLoading] = useState(false);
useEffect(() => {
loadExcelFromApi();
}, []);
/* -------------------- LOAD EXCEL -------------------- */
const loadExcelFromApi = async () => {
try {
setLoading(true);
console.log('\n📊 LOADING EXCEL FROM API');
console.log('═══════════════════════════════════════════════════════');
console.log('🔗 API URL:', `${GET_ENVELOPE_C}${tenderData?.tenderId?.tenderId}`);
console.log('🆔 Tender ID:', tenderData?.tenderId?.tenderId);
console.log('🔑 Token:', token.token ? 'Present' : 'Missing');
const response = await axios.get(
`${GET_ENVELOPE_C}${tenderData?.tenderId?.tenderId}`,
{
@@ -70,45 +101,71 @@ const EnvelopeCExcelPreview = (props: any) => {
}
);
console.log('\n✅ API RESPONSE RECEIVED');
console.log('───────────────────────────────────────────────────────');
console.log('📡 Status:', response.status);
console.log('📡 Status Text:', response.statusText);
console.log('📦 Response Data Size (KB):', (response.data.byteLength / 1024).toFixed(2));
const base64 = arrayBufferToBase64(response.data);
const workbook = XLSX.read(base64, { type: 'base64' });
const sheet = workbook.Sheets[workbook.SheetNames[0]];
const rows: any[] = XLSX.utils.sheet_to_json(sheet, { defval: '' });
console.log('📊 PARSED DATA - Total Rows:', rows.length);
setColumns(Object.keys(rows[0] || {}));
setData(rows);
} catch (e) {
Alert.alert('Error', 'Failed to load Excel');
console.log('✅ EXCEL LOADED SUCCESSFULLY\n');
} catch (e: any) {
console.log('\n❌ ERROR LOADING EXCEL');
console.error('Error:', e.message);
Alert.alert('Error', 'Failed to load Excel: ' + e.message);
} finally {
setLoading(false);
}
};
/* -------------------- UPDATE CELL -------------------- */
const updateCell = (rowIndex: number, key: string, value: string) => {
const updated = [...data];
const row = updated[rowIndex];
if (isTotalRow(row)) return;
const qtyKey:any = findColumnKey(columns, ['qty', 'quantity']);
const rateKey:any = findColumnKey(columns, ['rate', 'price']);
const valueKey = findColumnKey(columns, ['value', 'amount', 'total']);
if (key === qtyKey || key === rateKey) {
row[key] = value;
const qty = Number(row[qtyKey]);
const rate = Number(row[rateKey]);
if (valueKey) {
row[valueKey] =
!isNaN(qty) && !isNaN(rate) ? qty * rate : 0;
}
}
// Recalculate TOTAL
const totalRowIndex = updated.findIndex(isTotalRow);
if (totalRowIndex !== -1 && valueKey) {
@@ -119,67 +176,248 @@ const EnvelopeCExcelPreview = (props: any) => {
}, 0);
}
setData(updated);
};
/* -------------------- SAVE & UPLOAD EXCEL -------------------- */
const buildOfficerEncryptedKeys = (envelopeKey: string): SaveEnvelopeOfficerDetail[] => {
const officerKeys: OfficerKey[] = tenderData?.tenderId?.envelopeKeyDetailsResDTO?.departmentOfficerPublicKeys || [];
console.log('\n🔐 ENCRYPTING ENVELOPE KEY FOR OFFICERS');
console.log('═══════════════════════════════════════════════════════');
console.log('📌 Envelope Key to encrypt:', envelopeKey);
console.log('👥 Number of officers:', officerKeys.length);
const encryptedKeys: SaveEnvelopeOfficerDetail[] = [];
for (let i = 0; i < officerKeys.length; i++) {
const officer = officerKeys[i];
console.log(`\n🔄 Officer ${i + 1}/${officerKeys.length}`);
console.log(' ID:', officer.officersId);
console.log(' Type:', officer.officerType);
try {
const encryptedKey = encryptWithRSA(envelopeKey, officer.officerPublicKey);
if (!encryptedKey) {
console.error(` ❌ FAILED to encrypt key for officer ${officer.officersId}`);
} else {
console.log(` ✅ SUCCESS - Encrypted key length: ${encryptedKey.length}`);
}
encryptedKeys.push({
officerId: officer.officersId,
officerEncryptedKey: encryptedKey || '',
officerType: officer.officerType,
});
} catch (error) {
console.error(` ❌ ERROR encrypting for officer ${officer.officersId}:`, error);
encryptedKeys.push({
officerId: officer.officersId,
officerEncryptedKey: '',
officerType: officer.officerType,
});
}
}
console.log('\n✅ ALL OFFICER KEYS ENCRYPTED');
console.log('═══════════════════════════════════════════════════════\n');
return encryptedKeys;
};
// ✅ NEW: Encrypt Excel file content (binary) after creation
const encryptExcelFile = async (filePath: string, encryptionKey: string): Promise<string> => {
console.log('\n🔐 ENCRYPTING EXCEL FILE CONTENT');
console.log('═══════════════════════════════════════════════════════');
console.log('📁 File Path:', filePath);
console.log('🔑 Encryption Key:', encryptionKey);
try {
// Read the Excel file as Base64
const fileContent = await RNFS.readFile(filePath, 'base64');
console.log('📖 File read successfully, Base64 length:', fileContent.length);
// Encrypt the entire file content
console.log('🔒 Encrypting file content...');
const encryptedContent:any = encrypt(fileContent, encryptionKey);
console.log('✅ File content encrypted, Encrypted length:', encryptedContent?.length);
// Save encrypted content to a new file
const encryptedFilePath = `${RNFS.DocumentDirectoryPath}/envelopeC_encrypted.xlsx`;
await RNFS.writeFile(encryptedFilePath, encryptedContent, 'utf8');
console.log('💾 Encrypted file saved at:', encryptedFilePath);
console.log('✅ EXCEL FILE ENCRYPTION COMPLETED');
console.log('═══════════════════════════════════════════════════════\n');
return encryptedFilePath;
} catch (error) {
console.error('❌ ERROR ENCRYPTING EXCEL FILE:', error);
throw error;
}
};
const saveUpdatedExcel = async () => {
try {
setLoading(true);
console.log('\n💾 SAVING UPDATED EXCEL');
console.log('═══════════════════════════════════════════════════════');
const ENCRYPTION_KEY = tenderData?.tenderId?.envelopeKeyDetailsResDTO?.envelopeCGenerateKey || '';
if (!ENCRYPTION_KEY) {
console.error('❌ ENCRYPTION KEY NOT FOUND');
Alert.alert('Error', 'Encryption key not available');
setLoading(false);
return;
}
console.log('🔑 Encryption Key:', ENCRYPTION_KEY);
// Step 1: Create normal Excel workbook with user data (NOT ENCRYPTED YET)
console.log('\n📝 STEP 1: Creating Excel workbook with user data');
console.log('───────────────────────────────────────────────────────');
const worksheet = XLSX.utils.json_to_sheet(data);
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
const binary = XLSX.write(workbook, {
bookType: 'xlsx',
type: 'binary',
});
const buffer = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) {
buffer[i] = binary.charCodeAt(i) & 0xff;
}
const filePath = `${RNFS.DocumentDirectoryPath}/envelopeC_updated.xlsx`;
await RNFS.writeFile(filePath, buffer.toString(), 'ascii');
// Step 2: Save the plain Excel file
console.log('\n📝 STEP 2: Saving plain Excel file');
console.log('───────────────────────────────────────────────────────');
const plainFilePath = `${RNFS.DocumentDirectoryPath}/envelopeC_plain.xlsx`;
await RNFS.writeFile(plainFilePath, buffer.toString(), 'ascii');
console.log('✅ Plain Excel saved at:', plainFilePath);
// Step 3: Encrypt the entire Excel file
console.log('\n📝 STEP 3: Encrypting the Excel file');
console.log('───────────────────────────────────────────────────────');
const encryptedFilePath = await encryptExcelFile(plainFilePath, ENCRYPTION_KEY);
console.log('✅ Encrypted Excel file ready');
// Step 4: Build officer encrypted keys
console.log('\n📝 STEP 4: Building officer encrypted keys');
console.log('───────────────────────────────────────────────────────');
const officerEncryptedKeys = buildOfficerEncryptedKeys(ENCRYPTION_KEY);
// Step 5: Prepare FormData for upload
console.log('\n📝 STEP 5: Building FormData');
console.log('───────────────────────────────────────────────────────');
const formData = new FormData();
formData.append(
'requestDto',
JSON.stringify({
tenderId: tenderData?.tenderId?.tenderId,
deptId: tenderData?.tenderId?.deptId,
typesOfTender: tenderData?.tenderId?.typesOfTender,
fieldValue: '',
fieldValueInWord: 'zero',
})
);
const requestDto = {
tenderId: tenderData?.tenderId?.tenderId,
deptId: tenderData?.tenderId?.deptId,
typesOfTender: tenderData?.tenderId?.typesOfTender,
fieldValue: '',
fieldValueInWord: 'zero',
deviceType: 'MOBILE',
fileName: 'envelopeC_encrypted.xlsx',
saveEnvelopesOfficersDetailsResDTO: officerEncryptedKeys,
};
formData.append('requestDto', JSON.stringify(requestDto));
// Use the ENCRYPTED file for upload
formData.append('file', {
uri: `file://${filePath}`,
name: 'envelopeC_updated.xlsx',
uri: `file://${encryptedFilePath}`,
name: 'envelopeC_encrypted.xlsx',
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
} as any);
await axios.post(SUBMIT_ENVELOPE_C_UPLOAD, formData, {
console.log('📋 Request DTO:', JSON.stringify(requestDto, null, 2));
console.log('📎 Encrypted File Path:', encryptedFilePath);
// Step 6: Upload to server
console.log('\n📝 STEP 6: Uploading encrypted file to server');
console.log('───────────────────────────────────────────────────────');
console.log('FormData prepared:', formData);
const response = await axios.post(SUBMIT_ENVELOPE_C_UPLOAD, formData, {
headers: {
'Content-Type': 'multipart/form-data',
Authentication: `Bearer ${token.token}`,
},
});
console.log('✅ UPLOAD SUCCESSFUL');
console.log('Response:', response.data);
console.log('═══════════════════════════════════════════════════════\n');
// Clean up temporary files
await RNFS.unlink(plainFilePath).catch(e => console.log('Plain file cleanup:', e.message));
await RNFS.unlink(encryptedFilePath).catch(e => console.log('Encrypted file cleanup:', e.message));
Alert.alert('Success', 'Excel uploaded successfully');
navigation.goBack();
} catch (e) {
Alert.alert('Error', 'Save failed');
} catch (e: any) {
console.error('❌ Error saving/uploading Excel:', {
message: e?.message,
response: e?.response?.data,
status: e?.response?.status,
statusText: e?.response?.statusText,
});
Alert.alert('Error', e?.response?.data?.message || 'Save failed');
} finally {
setLoading(false);
}
};
/* -------------------- UI -------------------- */
if (loading) {
return (
<View style={styles.loader}>
@@ -188,10 +426,12 @@ const EnvelopeCExcelPreview = (props: any) => {
);
}
const qtyKey = findColumnKey(columns, ['qty', 'quantity']);
const rateKey = findColumnKey(columns, ['rate', 'price']);
const valueKey = findColumnKey(columns, ['value', 'amount', 'total']);
return (
<View style={styles.container}>
<ScrollView horizontal contentContainerStyle={{ padding: 10 }}>
@@ -203,6 +443,7 @@ const EnvelopeCExcelPreview = (props: any) => {
))}
</View>
{/* DATA */}
<ScrollView style={{ maxHeight: 420 }}>
{data.map((row, rowIndex) => (
@@ -211,6 +452,7 @@ const EnvelopeCExcelPreview = (props: any) => {
const editable =
!isTotalRow(row) && (key === qtyKey || key === rateKey);
return (
<TextInput
key={key}
@@ -234,6 +476,7 @@ const EnvelopeCExcelPreview = (props: any) => {
</View>
</ScrollView>
{tenderData?.buttonEnable && (
<TouchableOpacity style={styles.button} onPress={saveUpdatedExcel}>
<Text style={styles.buttonText}>Save Updated Excel</Text>
@@ -243,10 +486,13 @@ const EnvelopeCExcelPreview = (props: any) => {
);
};
export default EnvelopeCExcelPreview;
/* -------------------- STYLES -------------------- */
const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#fff' },
loader: { flex: 1, justifyContent: 'center', alignItems: 'center' },
@@ -282,4 +528,4 @@ const styles = StyleSheet.create({
textAlign: 'center',
fontWeight: '600',
},
});
});
+1 -4
View File
@@ -2,7 +2,7 @@ import React, { useCallback, useState, useEffect } from 'react';
import { View, FlatList, ActivityIndicator, RefreshControl, Text } from 'react-native';
import Animated, { FadeInDown, FadeOutUp } from 'react-native-reanimated';
import { useNavigation } from '@react-navigation/native';
import { useFetchLiveAuction, useFetchLiveTender } from '../../Services/BBPS/Hooks';
import { useFetchLiveAuction, useFetchLiveTender } from '../../Services/ApiCall/Hooks';
import { SearchInput } from '../../Component/Serach/SeacrhInput';
import { Skelton } from '../../Component/Index';
import colors from '../../Constant/Color';
@@ -14,10 +14,8 @@ const LiveTender = () => {
const navigation: any = useNavigation();
const Dispatch = useDispatch()
const user = useSelector((state: any) => state?.token.token);
console.log("userdata",user)
const SelectedPurchaseList = useSelector((state: any) => state.selectPurchaseTender);
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch }: any = useFetchLiveTender();
console.log("to show ",data)
const [showRefreshBanner, setShowRefreshBanner] = useState(false);
useEffect(() => {
@@ -49,7 +47,6 @@ const LiveTender = () => {
const renderItem = useCallback(
({ item, index }: any) => {
console.log("opopopopoopopopop",item.tenderNumber,item)
if(item.tenderStatus==="Cancelled") return null;
const isPurchase = SelectedPurchaseList.findIndex((prev: any) => prev.tenderId === item.tenderId)
return <LiveTenderTile
+2 -4
View File
@@ -12,11 +12,11 @@ import {
import { useRoute, useNavigation } from '@react-navigation/native';
import {
useFetchLiveTenderById,
} from '../../Services/BBPS/Hooks';
} from '../../Services/ApiCall/Hooks';
import { InsideHeader } from '../../Component/Index';
import colors from '../../Constant/Color';
import ReactNativeBlobUtil from 'react-native-blob-util';
import { GET_DOCID } from '../../Services/BBPS/ApiUrls';
import { GET_DOCID } from '../../Services/ApiCall/ApiUrls';
import {
Layers,
Briefcase,
@@ -50,9 +50,7 @@ const LiveTenderDetail = () => {
const route = useRoute<any>();
const navigation = useNavigation<any>();
const tender = route?.params;
console.log("object---",tender)
const { data } = useFetchLiveTenderById(tender?.tenderId);
console.log("huh",data)
const [downloadingId, setDownloadingId] = useState<string | number | null>(null);
const insets = useSafeAreaInsets()
if (!data?.data?.[0]) return null;
-1
View File
@@ -30,7 +30,6 @@ const LiveTenderTile: React.FC<LiveTenderTileProps> = ({
: [];
const purchased = contractorIds.includes(String(contractorId));
console.log("item is ",data)
if(data.tenderStatus==="Amended"){
}
@@ -23,7 +23,7 @@ import {
} from 'lucide-react-native';
import colors from '../../../Constant/Color';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useFetchTenderById } from '../../../Services/BBPS/Hooks';
import { useFetchTenderById } from '../../../Services/ApiCall/Hooks';
interface Props {
visible: boolean;
+6 -5
View File
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect } from 'react'
import { InsideHeader } from '../../Component/Index'
import colors from '../../Constant/Color'
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native'
import { useFetchTenderById, useProceedToBid } from '../../Services/BBPS/Hooks'
import { useFetchTenderById, useProceedToBid } from '../../Services/ApiCall/Hooks'
const ProceedToBidDetail = () => {
// Sample data based on your JSON
@@ -12,13 +12,10 @@ const ProceedToBidDetail = () => {
const { data, refetch, isRefetching } = useProceedToBid(tenderDataId?.tenderId);
const { data: tenderResponse, refetch: tenderRefetch }: any = useFetchTenderById(tenderDataId?.tenderId);
const tenderData = tenderResponse?.data;
console.log("dataopop",tenderData)
const [refreshing, setRefreshing] = React.useState(false);
const [loading, setLoading] = React.useState(false);
// console.log("proceed to bid tender detail : ", tenderDataId)
// console.log("proceed to data detail : ", data)
// console.log("tender data for updated : ", tenderData)
const navigation = useNavigation<any>()
// Format date from array
@@ -176,7 +173,11 @@ const ProceedToBidDetail = () => {
<View style={styles.statusGrid}>
<StatusIndicator status={tenderData?.envelopeASubmittStatus} label="Envelope A" />
{tenderData?.showEB &&<StatusIndicator status={tenderData?.envelopeBSubmittStatus} label="Envelope B" />}
{tenderData?.showLCS &&<StatusIndicator status={tenderData?.envelopeBSubmittStatus} label="Envelope LCS" />}
{tenderData?.showQCBS &&<StatusIndicator status={tenderData?.envelopeBSubmittStatus} label="Envelope QCBS" />}
{tenderData?.showEC &&<StatusIndicator status={tenderData?.envelopeCSubmittStatus} label="Envelope C" />}
</View>
</View>
+1 -3
View File
@@ -4,7 +4,7 @@ import { InsideHeader, Loader } from '../../Component/Index';
import colors from '../../Constant/Color';
import { CreditCard, Calendar, User, DollarSign, ArrowRight } from 'lucide-react-native';
import { useDispatch, useSelector } from 'react-redux';
import { useOfflineTenderPurchase } from '../../Services/BBPS/Hooks';
import { useOfflineTenderPurchase } from '../../Services/ApiCall/Hooks';
import { StackActions, useNavigation } from '@react-navigation/native';
import NavigationString from '../../Constant/NavigationString';
import { showErrorAlert, showToast } from '../../Constant/ShowDailog';
@@ -50,11 +50,9 @@ const ProceedToPurTender = () => {
orderNo: orderNo,
};
console.log("tender offline body : ", body)
try {
mutate(body, {
onSuccess: (res) => {
console.log(res, '---------------------purchsase response');
if (res.statusCode === 200) {
showToast(res.message);
navigation.dispatch(StackActions.pop(2));
+1 -1
View File
@@ -2,7 +2,7 @@ import React, { useState, useCallback, memo, useEffect } from 'react';
import { View, Text, StyleSheet, FlatList, RefreshControl, ActivityIndicator } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import moment from 'moment';
import { useFetchPurchaseTender } from '../../Services/BBPS/Hooks';
import { useFetchPurchaseTender } from '../../Services/ApiCall/Hooks';
import PurchaseTenderTile from './PurchaseTenderTile';
import { useDispatch } from 'react-redux';
import { setTender } from '../../Redux/Slices/SelectedTender';
@@ -19,7 +19,6 @@ const PurchaseTenderList = () => {
};
useEffect(()=>{
console.log("dcj",SelectedPurchaseList)
if(SelectedPurchaseList.length === 0){
Navigation.goBack()
}
@@ -36,7 +35,6 @@ const PurchaseTenderList = () => {
{/* Cards */}
{SelectedPurchaseList.map((item: any, index: any) => {
const expanded = expandedIndex === index;
console.log("item gvsdvgfsv h ca : ", item)
return (
<Animated.View
key={item.auctionId}
+1 -2
View File
@@ -4,7 +4,7 @@ import Animated, { FadeInUp, useAnimatedStyle, useSharedValue, withTiming } from
import moment from 'moment';
import CountdownTimer from '../../Component/Counter/CountdownTimer';
import colors from '../../Constant/Color';
import { useFetchTenderById } from '../../Services/BBPS/Hooks';
import { useFetchTenderById } from '../../Services/ApiCall/Hooks';
import { useNavigation } from '@react-navigation/native';
import TenderFullDetail from './Modal/TenderFullDetail';
@@ -12,7 +12,6 @@ const PurchaseTenderTile = ({ item, onPressDetails }: any) => {
const scale = useSharedValue(1);
const elevation = useSharedValue(8);
const navigation = useNavigation<any>();
console.log("obj000ect",item)
const animatedStyle = useAnimatedStyle(() => ({
transform: [{ scale: scale.value }],
elevation: elevation.value,
+1 -1
View File
@@ -11,7 +11,7 @@ import { InsideHeader } from '../../Component/Index';
import {
useFetchLiveTender,
useFetchPurchaseTender,
} from '../../Services/BBPS/Hooks';
} from '../../Services/ApiCall/Hooks';
import colors from '../../Constant/Color';
import { ShoppingCart, Lock } from 'lucide-react-native';
import { useNavigation } from '@react-navigation/native';
File diff suppressed because it is too large Load Diff
+449
View File
@@ -0,0 +1,449 @@
import React, { useState, useEffect } from 'react';
import {
View,
Text,
StyleSheet,
ScrollView,
TouchableOpacity,
Alert,
} from 'react-native';
import { useNavigation } from '@react-navigation/native';
import { decrypt } from '../../Services/Encryption/encrypt';
import { Clipboard, Copy, Eye, EyeOff, RefreshCw } from 'lucide-react-native';
import colors from '../../Constant/Color';
import { InsideHeader } from '../../Component/Index';
const DecryptionScreen = () => {
const navigation = useNavigation();
// ==========================================
// 🔹 HARDCODED INPUT - CHANGE VALUES HERE
// ==========================================
const CIPHER_TEXT = 'xoqT29mkmo0m4O5dmYIc+akKJO8oXD7tTUCWyLKLbF3dXS/PFReGRMgOXDsENnwtrjspBSNL7eoGYUrxi/gUbQ==';
const ENCRYPTION_KEY = "Lv7GctxTJZWFxM7"
// ==========================================
const [decryptedText, setDecryptedText] = useState('');
const [showKey, setShowKey] = useState(false);
const [showCipher, setShowCipher] = useState(true);
const [showDecrypted, setShowDecrypted] = useState(true);
useEffect(() => {
// Auto-decrypt on component mount
handleDecrypt();
}, []);
const handleDecrypt = () => {
console.log('\n🔓 DECRYPTION INITIATED');
console.log('═══════════════════════════════════════════════════════');
console.log('📝 Cipher Text:', CIPHER_TEXT);
console.log('🔑 Encryption Key:', ENCRYPTION_KEY);
console.log('📏 Cipher Text Length:', CIPHER_TEXT.length);
try {
const result = decrypt(CIPHER_TEXT, ENCRYPTION_KEY);
if (result) {
console.log('✅ Decryption successful');
console.log('📄 Decrypted Text:', result);
console.log('📏 Decrypted Length:', result.length);
setDecryptedText(result);
} else {
console.log('❌ Decryption failed - returned null');
Alert.alert('Error', 'Decryption failed. Please check your encrypted text and key.');
setDecryptedText('Decryption failed');
}
} catch (error) {
console.error('❌ Decryption error:', error);
Alert.alert('Error', 'An error occurred during decryption');
setDecryptedText('Error occurred');
} finally {
console.log('═══════════════════════════════════════════════════════\n');
}
};
const handleCopyDecrypted = () => {
if (decryptedText) {
Clipboard.setString(decryptedText);
Alert.alert('Copied', 'Decrypted text copied to clipboard');
console.log('📋 Decrypted text copied to clipboard');
}
};
const handleCopyCipher = () => {
Clipboard.setString(CIPHER_TEXT);
Alert.alert('Copied', 'Encrypted text copied to clipboard');
console.log('📋 Encrypted text copied to clipboard');
};
const handleCopyKey = () => {
Clipboard.setString(ENCRYPTION_KEY);
Alert.alert('Copied', 'Encryption key copied to clipboard');
console.log('📋 Encryption key copied to clipboard');
};
return (
<View style={styles.container}>
<InsideHeader title="Decrypt Data" showArrow />
<ScrollView contentContainerStyle={styles.scrollContainer}>
{/* Info Card */}
<View style={styles.infoCard}>
<Text style={styles.infoTitle}>🔓 AES Decryption Tool</Text>
<Text style={styles.infoText}>
Decryption performed automatically on screen load
</Text>
<Text style={styles.infoSubText}>
Mode: AES/ECB/PKCS7Padding
</Text>
</View>
{/* Encrypted Text Display */}
<View style={styles.card}>
<View style={styles.labelRow}>
<Text style={styles.label}>📝 Encrypted Text</Text>
<View style={styles.iconRow}>
<TouchableOpacity
onPress={() => setShowCipher(!showCipher)}
style={styles.iconButton}
>
{showCipher ? (
<EyeOff size={18} color={colors.primary} />
) : (
<Eye size={18} color={colors.primary} />
)}
</TouchableOpacity>
<TouchableOpacity
onPress={handleCopyCipher}
style={styles.iconButton}
>
<Copy size={18} color={colors.primary} />
</TouchableOpacity>
</View>
</View>
{showCipher ? (
<View style={styles.dataBox}>
<Text style={styles.dataText}>{CIPHER_TEXT}</Text>
</View>
) : (
<View style={styles.dataBox}>
<Text style={styles.hiddenText}>
{'•'.repeat(Math.min(CIPHER_TEXT.length, 50))}
</Text>
</View>
)}
<View style={styles.infoRow}>
<Text style={styles.infoLabel}>Length:</Text>
<Text style={styles.infoValue}>{CIPHER_TEXT.length}</Text>
</View>
</View>
{/* Encryption Key Display */}
<View style={styles.card}>
<View style={styles.labelRow}>
<Text style={styles.label}>🔑 Encryption Key</Text>
<View style={styles.iconRow}>
<TouchableOpacity
onPress={() => setShowKey(!showKey)}
style={styles.iconButton}
>
{showKey ? (
<EyeOff size={18} color={colors.primary} />
) : (
<Eye size={18} color={colors.primary} />
)}
</TouchableOpacity>
<TouchableOpacity
onPress={handleCopyKey}
style={styles.iconButton}
>
<Copy size={18} color={colors.primary} />
</TouchableOpacity>
</View>
</View>
{showKey ? (
<View style={styles.dataBox}>
<Text style={styles.dataText}>{ENCRYPTION_KEY}</Text>
</View>
) : (
<View style={styles.dataBox}>
<Text style={styles.hiddenText}>
{'•'.repeat(ENCRYPTION_KEY.length)}
</Text>
</View>
)}
<View style={styles.infoRow}>
<Text style={styles.infoLabel}>Length:</Text>
<Text style={styles.infoValue}>{ENCRYPTION_KEY.length}</Text>
</View>
</View>
{/* Decrypt Button */}
<TouchableOpacity
style={styles.decryptButton}
onPress={handleDecrypt}
>
<RefreshCw size={20} color="#fff" />
<Text style={styles.decryptButtonText}>Re-Decrypt</Text>
</TouchableOpacity>
{/* Decrypted Result */}
{decryptedText !== '' && (
<View style={[styles.card, styles.resultCard]}>
<View style={styles.labelRow}>
<Text style={styles.label}>✅ Decrypted Text</Text>
<View style={styles.iconRow}>
<TouchableOpacity
onPress={() => setShowDecrypted(!showDecrypted)}
style={styles.iconButton}
>
{showDecrypted ? (
<EyeOff size={18} color={colors.primary} />
) : (
<Eye size={18} color={colors.primary} />
)}
</TouchableOpacity>
<TouchableOpacity
onPress={handleCopyDecrypted}
style={styles.iconButton}
>
<Copy size={18} color={colors.primary} />
</TouchableOpacity>
</View>
</View>
{showDecrypted ? (
<View style={styles.resultBox}>
<Text style={styles.resultText}>
{decryptedText}
</Text>
</View>
) : (
<View style={styles.resultBox}>
<Text style={styles.hiddenText}>
{'•'.repeat(Math.min(decryptedText.length, 50))}
</Text>
</View>
)}
<View style={styles.statsRow}>
<View style={styles.statItem}>
<Text style={styles.statLabel}>Length</Text>
<Text style={styles.statValue}>{decryptedText.length}</Text>
</View>
<View style={styles.statItem}>
<Text style={styles.statLabel}>Status</Text>
<Text style={[styles.statValue, styles.successText]}>
✓ Success
</Text>
</View>
<View style={styles.statItem}>
<Text style={styles.statLabel}>Type</Text>
<Text style={styles.statValue}>
{isNaN(Number(decryptedText)) ? 'Text' : 'Number'}
</Text>
</View>
</View>
</View>
)}
{/* Instructions */}
<View style={styles.instructionCard}>
<Text style={styles.instructionTitle}>📌 How to Use</Text>
<Text style={styles.instructionText}>
1. Open this file in your code editor{'\n'}
2. Find the "HARDCODED INPUT" section at the top{'\n'}
3. Change CIPHER_TEXT and ENCRYPTION_KEY values{'\n'}
4. Save the file and reload the app{'\n'}
5. Screen will auto-decrypt on load
</Text>
</View>
</ScrollView>
</View>
);
};
export default DecryptionScreen;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: colors.white,
},
scrollContainer: {
padding: 16,
paddingBottom: 40,
},
infoCard: {
backgroundColor: '#E8F4FD',
borderRadius: 12,
padding: 16,
marginBottom: 16,
borderLeftWidth: 4,
borderLeftColor: colors.primary,
},
infoTitle: {
fontSize: 18,
fontWeight: '700',
color: '#333',
marginBottom: 8,
},
infoText: {
fontSize: 14,
color: '#555',
lineHeight: 20,
marginBottom: 4,
},
infoSubText: {
fontSize: 12,
color: '#777',
fontStyle: 'italic',
},
card: {
backgroundColor: colors.primaryHighlight,
borderRadius: 12,
padding: 16,
marginBottom: 16,
elevation: 2,
shadowColor: '#000',
shadowOffset: { width: 0, height: 1 },
shadowOpacity: 0.1,
shadowRadius: 2,
},
resultCard: {
backgroundColor: '#F0FDF4',
borderWidth: 2,
borderColor: '#10B981',
},
labelRow: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 12,
},
label: {
fontSize: 15,
fontWeight: '600',
color: '#333',
},
iconButton: {
padding: 4,
},
iconRow: {
flexDirection: 'row',
gap: 12,
},
dataBox: {
backgroundColor: '#F8F9FA',
borderRadius: 10,
padding: 14,
borderWidth: 1,
borderColor: '#E0E0E0',
marginBottom: 10,
},
dataText: {
fontSize: 14,
color: '#222',
lineHeight: 20,
fontFamily: 'monospace',
},
hiddenText: {
fontSize: 18,
color: '#999',
letterSpacing: 2,
},
infoRow: {
flexDirection: 'row',
justifyContent: 'space-between',
paddingTop: 8,
borderTopWidth: 1,
borderTopColor: '#E0E0E0',
},
infoLabel: {
fontSize: 13,
color: '#777',
},
infoValue: {
fontSize: 13,
fontWeight: '600',
color: '#333',
},
decryptButton: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: 10,
backgroundColor: colors.primary,
paddingVertical: 16,
borderRadius: 12,
marginBottom: 16,
elevation: 3,
},
decryptButtonText: {
color: '#fff',
fontSize: 16,
fontWeight: '700',
},
resultBox: {
backgroundColor: '#fff',
borderRadius: 10,
padding: 16,
borderWidth: 2,
borderColor: '#10B981',
minHeight: 80,
marginBottom: 12,
},
resultText: {
fontSize: 16,
color: '#222',
lineHeight: 24,
fontWeight: '500',
},
statsRow: {
flexDirection: 'row',
justifyContent: 'space-around',
paddingTop: 12,
borderTopWidth: 1,
borderTopColor: '#D1FAE5',
},
statItem: {
alignItems: 'center',
},
statLabel: {
fontSize: 12,
color: '#059669',
marginBottom: 4,
fontWeight: '600',
},
statValue: {
fontSize: 15,
fontWeight: '700',
color: '#333',
},
successText: {
color: '#10B981',
},
instructionCard: {
backgroundColor: '#FFFBEB',
borderRadius: 12,
padding: 16,
borderWidth: 1,
borderColor: '#FCD34D',
},
instructionTitle: {
fontSize: 16,
fontWeight: '700',
color: '#92400E',
marginBottom: 10,
},
instructionText: {
fontSize: 13,
color: '#78350F',
lineHeight: 22,
},
});
+4 -1
View File
@@ -21,6 +21,7 @@ import ProceedToPurTender from "./Tender/ProceedToPurTender";
import PurchaseTenderList from "./Tender/PurchaseTenderList";
import Tender from "./Tender/Tender";
import TenderBidding from "./Tender/tenderBidding/TenderBidding";
import DecryptionScreen from "./TestScreen/DecryptionScreen";
const Screens = {
@@ -46,7 +47,9 @@ const Screens = {
ProfileTab,
ResetPassword,
KycWebViewScreen,
StageThreeScreen
StageThreeScreen,
DecryptionScreen
}
export default Screens