letest
This commit is contained in:
@@ -46,7 +46,6 @@ export default function MainStack() {
|
||||
<Stack.Screen name={NavigationString.Registration} component={Screens.Registration} options={option} />
|
||||
<Stack.Screen name={NavigationString.Partnership} component={Screens.Partnership} options={option} />
|
||||
<Stack.Screen name={NavigationString.LiveTenderDetail} component={Screens.LiveTenderDetail} options={option} />
|
||||
<Stack.Screen name={NavigationString.StartReverseBidding} component={Screens.StartReverseBidding} options={option} />
|
||||
|
||||
</Stack.Navigator>
|
||||
);
|
||||
|
||||
@@ -35,7 +35,6 @@ const Screens = {
|
||||
ProceedToPurTender,
|
||||
TenderBidding,
|
||||
ProceedToBidDetail,
|
||||
StartReverseBidding,
|
||||
Signup,
|
||||
Registration,
|
||||
Partnership,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { contractorStageThreeSubmit, contractorStageTwoSubmit, fetchAuctionItem, fetchCityDropdown, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchMasterData, fetchPurchaseAuction, fetchPurchaseTender, fetchTenderById, getDesignation, getRagistrationState, offlineAuctionPurchase, offlineTenderPurchase, partnerShipSubmit, proceedToBid, registerContractor, sendAadhaarOtp, submitEnvelopeA, submitEnvelopeB, uploadEnvelopeFile, userAuctionLogin, userLogin, verifyAadhaarOtp, verifyGstNumber, verifyPanHandler } from './apis';
|
||||
import { contractorStageThreeSubmit, contractorStageTwoSubmit, fetchAuctionItem, fetchCityDropdown, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchMasterData, fetchPurchaseAuction, fetchPurchaseAuctionList, fetchPurchaseTender, fetchTenderById, getAuction, getDesignation, getRagistrationState, offlineAuctionPurchase, offlineTenderPurchase, partnerShipSubmit, proceedToBid, registerContractor, sendAadhaarOtp, submitEnvelopeA, submitEnvelopeB, uploadEnvelopeFile, userAuctionLogin, userLogin, verifyAadhaarOtp, verifyGstNumber, verifyPanHandler, viewAuctionDocumentDownload, viewAuctionDocuments, viewAuctionItemDocuments } from './apis';
|
||||
import { apiCall } from '../../Axios/Axios';
|
||||
|
||||
// User
|
||||
@@ -236,4 +236,41 @@ export const useUploadEnvelopeFile = () =>
|
||||
mutationFn: uploadEnvelopeFile,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
// Purchase Auction List
|
||||
export const usePurchaseAuctionList = () => {
|
||||
return useMutation({
|
||||
mutationFn: (payload: any) => fetchPurchaseAuctionList(payload),
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetAuciton = (payload: { auctionId: string }) => {
|
||||
return useQuery({
|
||||
queryKey: ['getAuction'],
|
||||
queryFn: () => getAuction(payload)
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetAucitonDocument = (payload: { auctionId: number }) => {
|
||||
return useQuery({
|
||||
queryKey: ['viewAuctionDocuments'],
|
||||
queryFn: () => viewAuctionDocuments(payload)
|
||||
});
|
||||
};
|
||||
|
||||
export const useAucitonItemDetail = (payload: { auctionItemId: number }) => {
|
||||
return useQuery({
|
||||
queryKey: ['viewAuctionItemDocuments'],
|
||||
queryFn: () => viewAuctionItemDocuments(payload)
|
||||
});
|
||||
};
|
||||
|
||||
export const useAucitonDocDownload = () => {
|
||||
return useMutation({
|
||||
mutationFn: (payload: { documentId: number, isAmendment: boolean }) => viewAuctionDocumentDownload(payload),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
+186
-1
@@ -1,5 +1,5 @@
|
||||
import axios from "axios";
|
||||
import { AUCTION_DOCUMENT_DOWNLOAD, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_AUCTION_DETAILS, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN, PURCHASE_AUCTION_LIST, PURCHASE_OFFLINE_AUCTION, REVERSE_AUCTION_ITEM, VIEW_AUCTION_DOCUMENTS, VIEW_AUCTION_ITEM_DETAIL } from "./ApiUrls";
|
||||
import { AUCTION_DOCUMENT_DOWNLOAD, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_AUCTION_DETAILS, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN, PURCHASE_AUCTION_LIST, PURCHASE_OFFLINE_AUCTION, REVERSE_AUCTION_ITEM, VIEW_AUCTION_DOCUMENTS, VIEW_AUCTION_ITEM_DETAIL, STAGETHREE, REJ_STAGE_TWO, GETCONTRACTORBYSTATE, GET_MASTER_DATA, ALL_DESIGNATION, GET_REGISTRATION_STATE, PARTNER_API_ENDPOINT, SAVE_CONTRACTOR_STAGE1, VERIFY_GST, VERIFY_ADHAR, SEND_ADHAROTP, SUBMIT_ENVELOPE_FILE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, VERIFY_ORGPAN } from "./ApiUrls";
|
||||
import { apiCall } from "../../Axios/Axios";
|
||||
|
||||
// User
|
||||
@@ -32,6 +32,15 @@ export const userLogin = async (payload: { emailAdd: string, password: string })
|
||||
}
|
||||
};
|
||||
|
||||
export const userAuctionLogin = async (payload: { emailAdd: string, password: string }): Promise<any> => {
|
||||
try {
|
||||
const response = await axios.post(LOG_IN_URL, { ...payload, device: "mobileApp" });
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
throw error.response?.data || error.message;
|
||||
}
|
||||
};
|
||||
|
||||
export const fetchDashboard = async (): Promise<any> => {
|
||||
const data = await apiCall<any>('get', `${DASHBOARD_COUNT}`);
|
||||
return data
|
||||
@@ -129,6 +138,19 @@ export const proceedToBid = async (tenderId: string): Promise<any> => {
|
||||
return data;
|
||||
}
|
||||
|
||||
export const verifyPanHandler = (
|
||||
payload: {
|
||||
dob: string;
|
||||
name: string;
|
||||
panNumber: string;
|
||||
}
|
||||
): Promise<any> => {
|
||||
return apiCall<any>(
|
||||
'post',
|
||||
VERIFY_ORGPAN,
|
||||
payload,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export const fetchPurchaseAuctionList = async (payload: any): Promise<any> => {
|
||||
@@ -151,4 +173,167 @@ export const viewAuctionDocuments = async (payload: { auctionId: number }) => {
|
||||
export const viewAuctionDocumentDownload = async (payload: { documentId: number, isAmendment: boolean }) => {
|
||||
const selectedRes = await apiCall<any>('get', AUCTION_DOCUMENT_DOWNLOAD, {}, payload);
|
||||
return selectedRes.data;
|
||||
}
|
||||
export const contractorStageThreeSubmit = (
|
||||
payload: any
|
||||
): Promise<any> => {
|
||||
return apiCall<any>(
|
||||
'post',
|
||||
STAGETHREE,
|
||||
payload,
|
||||
);
|
||||
};
|
||||
|
||||
export const contractorStageTwoSubmit = (
|
||||
fileData: any
|
||||
): Promise<any> => {
|
||||
return apiCall<any>(
|
||||
'post',
|
||||
REJ_STAGE_TWO,
|
||||
fileData,
|
||||
undefined,
|
||||
'multipart/form-data'
|
||||
);
|
||||
};
|
||||
|
||||
export const fetchCityDropdown = async (stateId: number): Promise<any> => {
|
||||
const res = await apiCall<{ statusCode: number; data: City[] }>(
|
||||
'get',
|
||||
`${GETCONTRACTORBYSTATE}?stateId=${stateId}`,
|
||||
);
|
||||
console.log("--",res)
|
||||
if (res.statusCode !== 200 || !res.data) {
|
||||
throw new Error('Failed load cities');
|
||||
}
|
||||
|
||||
return res.data.map(item => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
export const fetchMasterData = async (): Promise<any> => {
|
||||
const data = await apiCall<any>(
|
||||
'get',
|
||||
`${GET_MASTER_DATA}`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
export const getDesignation = async (): Promise<any> => {
|
||||
const data = await axios.get(ALL_DESIGNATION).then((response) => response.data);
|
||||
return data;
|
||||
}
|
||||
|
||||
export const getRagistrationState = async (): Promise<any> => {
|
||||
const data = await apiCall<any>(
|
||||
'get',
|
||||
`${GET_REGISTRATION_STATE}`
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
export const partnerShipSubmit = (
|
||||
payload: any
|
||||
): Promise<any> => {
|
||||
return apiCall<any>(
|
||||
'post',
|
||||
PARTNER_API_ENDPOINT,
|
||||
payload,
|
||||
);
|
||||
};
|
||||
|
||||
export const registerContractor = async (payload: any): Promise<any> => {
|
||||
console.log("registerContractor payload : ", payload)
|
||||
try {
|
||||
const response = await axios.post(SAVE_CONTRACTOR_STAGE1, { ...payload, device: "mobileApp" });
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
throw error.response?.data || error.message;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const sendAadhaarOtp = (
|
||||
payload: any
|
||||
): Promise<any> => {
|
||||
return apiCall<any>('post', SEND_ADHAROTP, payload);
|
||||
};
|
||||
|
||||
|
||||
export type VerifyAadhaarOtpPayload = {
|
||||
otp: string;
|
||||
refNumber: string;
|
||||
};
|
||||
|
||||
export const verifyAadhaarOtp = (
|
||||
payload: {
|
||||
otp: string;
|
||||
refNumber: string;
|
||||
}
|
||||
): Promise<any> => {
|
||||
return apiCall<any>(
|
||||
'post',
|
||||
VERIFY_ADHAR,
|
||||
payload,
|
||||
);
|
||||
};
|
||||
|
||||
export type VerifyGstPayload = {
|
||||
gstNumber: string;
|
||||
};
|
||||
|
||||
export const verifyGstNumber = (
|
||||
payload: {
|
||||
gstNumber: string;
|
||||
}
|
||||
): Promise<any> => {
|
||||
return apiCall<any>(
|
||||
'post',
|
||||
VERIFY_GST,
|
||||
payload,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export const submitEnvelopeA = async (payload: any) => {
|
||||
console.log('SUBMIT ENVELOPE A API CALLED', payload)
|
||||
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_A, payload)
|
||||
console.log("data : ", data)
|
||||
return data
|
||||
}
|
||||
export const submitEnvelopeB = async (payload: any) => {
|
||||
console.log('SUBMIT ENVELOPE B API CALLED', payload)
|
||||
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_B, payload)
|
||||
console.log("data : ", data)
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
export const uploadEnvelopeFile = async ({
|
||||
activeEnvelope,
|
||||
file,
|
||||
payload,
|
||||
}: UploadArgs) => {
|
||||
const formData = new FormData()
|
||||
|
||||
formData.append('files', {
|
||||
uri: file.uri,
|
||||
name: file.name,
|
||||
type: file.type,
|
||||
} as any)
|
||||
|
||||
formData.append('requestDto', JSON.stringify(payload))
|
||||
|
||||
const url =
|
||||
activeEnvelope === 'B' ? SUBMIT_ENVELOPE_FILE_B : SUBMIT_ENVELOPE_FILE_A
|
||||
|
||||
const data = await apiCall('post', url, formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
})
|
||||
|
||||
return data
|
||||
}
|
||||
Reference in New Issue
Block a user