first commit
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
const BASE_URL = `https://procurelinc.in/EProcurementSB/`
|
||||
// const BASE_URL_Auction = `https://procurelinc.in/AuctionPostgre/api/auction/`
|
||||
export const BASE_URL_Auction = `https://procurelinc.in/Auction/`
|
||||
// const BASE_URL = `https://192.168.29.226:8090/EProcurementSB/`
|
||||
const GET_DESIGNATION = `${BASE_URL}contractor/getAllDesignationContractor`
|
||||
const SAVE_CONTRACTOR_STAGE1 = `${BASE_URL}contractor/registerContractorStage1`
|
||||
const GET_CONTRACTOR_CLASS = `${BASE_URL}contractor/allContractorClassSecond`
|
||||
const VERIFY_ORGPAN = `${BASE_URL}ekycdocverify/companyPanVerification`
|
||||
const SEND_ADHAROTP = `${BASE_URL}ekycdocverify/aadhaarVerification`
|
||||
const VERIFY_ADHAR = `${BASE_URL}ekycdocverify/aadhaarOtpVerification`
|
||||
const VERIFY_GST = `${BASE_URL}ekycdocverify/gstVerification`
|
||||
const ALLORG = `${BASE_URL}contractor/allOrganization`
|
||||
const ALLSOCIALCAT = `${BASE_URL}contractor/allSocialCategories`
|
||||
const ALLMSME = `${BASE_URL}contractor/allMsMeOrg`
|
||||
const ALLCONTRACTOR = `${BASE_URL}contractor/getAllStatesContractor`
|
||||
const GETCONTRACTORBYSTATE = `${BASE_URL}contractor/getCitiesContractorByStateId`
|
||||
const REJ_STAGE_TWO = `${BASE_URL}contractor/indianContractorStage2`
|
||||
const STAGETHREE = `${BASE_URL}contractor/contractorstage3`
|
||||
const PARTNER_API_ENDPOINT = `${BASE_URL}contractor/contstage3_Partnership`
|
||||
const ALL_DESIGNATION = `${BASE_URL}contractor/getAllDesignationContractor`
|
||||
const ALL_MSME = `${BASE_URL}contractor/allMsMeOrg`
|
||||
const CONTRACTOR_PROFILE = `${BASE_URL}contractor/getPreviousContractorDetails?regisId=`
|
||||
const CONTRACTOR_BASIC_PROFILE = `${BASE_URL}contractor/getContractorById?contId=`
|
||||
const CONTRACTOR_PROFILE_UPDATE = `${BASE_URL}contractor/updateContBasicDetails?id=`
|
||||
const GET_REGISTRATION_STATE = `${BASE_URL}contractor/getContractorOrgTypeandStatus`
|
||||
const GET_MASTER_DATA = `${BASE_URL}contractor/masterdata/all`
|
||||
|
||||
const LOG_IN_URL = `${BASE_URL_Auction}auction/loginWithoutDecryption`
|
||||
const LIVE_TENDER = `${BASE_URL}liveTender/getAllLiveTenders`
|
||||
const LIVE_AUCTION = `${BASE_URL_Auction}api/auction/getLiveAuctionForMobile`
|
||||
const PROCEED_PURCHASE_AUCTION = `${BASE_URL_Auction}api/auction/proceedToPurchase`
|
||||
const PURCHASE_AUCTION = `${BASE_URL_Auction}api/auction/purchaseAuction`
|
||||
const PURCHASE_OFFLINE_AUCTION = `${BASE_URL_Auction}api/auction/purchaseAuctionOffline`
|
||||
const PURCHASE_TENDER = `https://procurelinc.in/EProcurementSB/tenderPayment/purchaseTender`
|
||||
const AUCTION_PURCHASE_STATUS = `https://api.godemo.in/Auction/api/auction/transactionStatus?orderNo=`
|
||||
const GET_TENDER_DETAILS = `${BASE_URL}eTendering/getTenderById?tenderId=`
|
||||
const GET_DOCID = `${BASE_URL}eTendering/download/docId?docId=`
|
||||
// https://procurelinc.in/EProcurementSB/eTendering/download/docId?docId=158
|
||||
// const DOWNLOAD_DOC = `${BASE_URL}eTende ring/download/docId?docId=`
|
||||
const DOWNLOAD_DOC = `${BASE_URL}eTendering/download/docId?docId=`
|
||||
const TWO_FACTOR_AUTH = `${BASE_URL}contractor/two-factor-auth?status=`
|
||||
const AUCTION_LOGIN = `https://api.godemo.in/Auction/auction/loginWithoutDecryption`
|
||||
const GET_AUCTION_DETAILS = `${BASE_URL_Auction}api/auction/getAuction/id?id=`
|
||||
const TANDER_PURCHASE_STATUS = `https://procurelinc.in/EProcurementSB/tenderPayment/transactionStatus?orderNo=`
|
||||
const GET_MY_AUCTION = `${BASE_URL_Auction}api/auction/getMyAuction`
|
||||
const GET_MY_TENDER = "https://procurelinc.in/EProcurementSB/tenderBidding/getAllPurchasedTendersByConId"
|
||||
const GET_DOCID_AUCTION = `${BASE_URL_Auction}api/auction/viewDocumentsForAuction?auctionId=`
|
||||
const DOWNLOAD_DOC_AUCTION = "https://api.godemo.in/Auction/api/auction/downloadDocumentForAuction?documentId="
|
||||
const FORARD_AUCTION_ITEM = `${BASE_URL_Auction}api/auction/getForwardAuctionItems/auctionNumber`
|
||||
const AUCTION_ITEM_SUBMIT = `${BASE_URL_Auction}api/auction/addEMDDocumentsItemWise`
|
||||
const EMD_CHECK = `${BASE_URL_Auction}api/auction/getEMDDocumentsForAuction`
|
||||
const REVERSE_AUCTION_ITEM = `${BASE_URL_Auction}api/auction/getReverseAuctionItems/auctionNumber`
|
||||
const FORWARD_AUCTION_ITEM = `${BASE_URL_Auction}api/auction/getForwardAuctionItems/auctionNumber`
|
||||
const SELECTED_AUCTION_ITEM = `${BASE_URL_Auction}api/auction/getEMDDocumentsForAuction`
|
||||
const GET_TECHNICAL_DOCUMENTAION = `${BASE_URL_Auction}api/auction/getAllTechnicalDocumentTemplates`
|
||||
const CHECK_TECHNICAL_DOCUMENTAION = `${BASE_URL_Auction}api/auction/checkContractorAuctionMatch`
|
||||
const TECHNICAL_VALUE_SUBMIT = `${BASE_URL_Auction}api/auction/saveTechnicalDocumentTemplateValue`
|
||||
const TECHNICAL_DOCUMENT_SUBMIT = `${BASE_URL_Auction}api/auction/TechnicalDocumentUpload`
|
||||
const ITEM_DETAIL = `${BASE_URL_Auction}api/auction/home/viewDocuments/inventoryId`
|
||||
const ITEM_DOCUMENT_DOWNLOAD = `${BASE_URL_Auction}api/auction/home/downloadDocument/documentId`
|
||||
|
||||
// Rohit
|
||||
const DASHBOARD_COUNT = `${BASE_URL_Auction}api/auction/home/dashboard/counts`
|
||||
|
||||
export {
|
||||
// Rohit
|
||||
DASHBOARD_COUNT,
|
||||
ITEM_DOCUMENT_DOWNLOAD,
|
||||
ITEM_DETAIL,
|
||||
TECHNICAL_DOCUMENT_SUBMIT,
|
||||
TECHNICAL_VALUE_SUBMIT,
|
||||
CHECK_TECHNICAL_DOCUMENTAION,
|
||||
GET_TECHNICAL_DOCUMENTAION,
|
||||
SELECTED_AUCTION_ITEM,
|
||||
REVERSE_AUCTION_ITEM,
|
||||
FORWARD_AUCTION_ITEM,
|
||||
EMD_CHECK,
|
||||
AUCTION_ITEM_SUBMIT,
|
||||
FORARD_AUCTION_ITEM,
|
||||
DOWNLOAD_DOC_AUCTION,
|
||||
GET_DOCID_AUCTION,
|
||||
GET_MY_TENDER,
|
||||
GET_MY_AUCTION,
|
||||
TANDER_PURCHASE_STATUS,
|
||||
GET_TENDER_DETAILS,
|
||||
GET_DESIGNATION,
|
||||
SAVE_CONTRACTOR_STAGE1,
|
||||
LOG_IN_URL,
|
||||
GET_CONTRACTOR_CLASS,
|
||||
VERIFY_ORGPAN,
|
||||
SEND_ADHAROTP,
|
||||
VERIFY_ADHAR,
|
||||
VERIFY_GST,
|
||||
GET_REGISTRATION_STATE,
|
||||
ALLMSME,
|
||||
ALLCONTRACTOR,
|
||||
ALLORG,
|
||||
ALLSOCIALCAT,
|
||||
ALL_MSME,
|
||||
GETCONTRACTORBYSTATE,
|
||||
REJ_STAGE_TWO,
|
||||
PARTNER_API_ENDPOINT,
|
||||
STAGETHREE,
|
||||
ALL_DESIGNATION,
|
||||
BASE_URL,
|
||||
CONTRACTOR_PROFILE,
|
||||
CONTRACTOR_PROFILE_UPDATE,
|
||||
LIVE_TENDER,
|
||||
LIVE_AUCTION,
|
||||
PROCEED_PURCHASE_AUCTION,
|
||||
PURCHASE_AUCTION,
|
||||
AUCTION_PURCHASE_STATUS,
|
||||
CONTRACTOR_BASIC_PROFILE,
|
||||
PURCHASE_TENDER,
|
||||
GET_DOCID,
|
||||
DOWNLOAD_DOC,
|
||||
GET_AUCTION_DETAILS,
|
||||
AUCTION_LOGIN,
|
||||
TWO_FACTOR_AUTH,
|
||||
GET_MASTER_DATA,
|
||||
PURCHASE_OFFLINE_AUCTION
|
||||
};
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { fetchDashboard, fetchLiveAuction, fetchLiveTender, fetchPurchaseAuction, fetchPurchaseTender, offlineAuctionPurchase, userLogin } from './apis';
|
||||
|
||||
// User
|
||||
|
||||
export const useLogin = () => {
|
||||
return useMutation({
|
||||
mutationFn: (payload: { emailAdd: string, password: string }) => userLogin(payload),
|
||||
});
|
||||
};
|
||||
|
||||
// Dashboard
|
||||
export const useDashboard = () => {
|
||||
return useQuery({
|
||||
queryKey: ['fetchDashboard'],
|
||||
queryFn: () => fetchDashboard()
|
||||
});
|
||||
};
|
||||
|
||||
// Auction & Tender
|
||||
|
||||
export const useFetchPurchaseTender = () => {
|
||||
return useQuery({
|
||||
queryKey: [],
|
||||
queryFn: () => fetchPurchaseTender()
|
||||
});
|
||||
};
|
||||
|
||||
export const useFetchLiveTender = () => {
|
||||
return useQuery({
|
||||
queryKey: [],
|
||||
queryFn: () => fetchLiveTender()
|
||||
});
|
||||
};
|
||||
export const useFetchPurchaseAuction = () => {
|
||||
return useQuery({
|
||||
queryKey: ['fetchPurchaseAuction',],
|
||||
queryFn: () => fetchPurchaseAuction()
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const useFetchLiveAuction = () => {
|
||||
return useInfiniteQuery<any>({
|
||||
queryKey: ['fetchLiveAuction',],
|
||||
queryFn: ({ pageParam = 1 }) =>
|
||||
fetchLiveAuction({
|
||||
page: pageParam,
|
||||
size: 10,
|
||||
}),
|
||||
initialPageParam: 1,
|
||||
getNextPageParam: (lastPage) => {
|
||||
const { page, size, totalCount } = lastPage;
|
||||
const totalPages = Math.ceil(totalCount / size);
|
||||
const nextPage = page + 1;
|
||||
return nextPage < totalPages ? nextPage : undefined;
|
||||
},
|
||||
select: (data) => {
|
||||
|
||||
const mergedResults = data.pages.flatMap((page: any) => page.data ?? []);
|
||||
return {
|
||||
...data,
|
||||
result: mergedResults,
|
||||
};
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Auction Purchase offline
|
||||
|
||||
export const useOfflineAuctionPurchase = () => {
|
||||
return useMutation({
|
||||
mutationFn: (payload: any) => offlineAuctionPurchase(payload),
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
import axios from "axios";
|
||||
import { DASHBOARD_COUNT, GET_MY_AUCTION, GET_MY_TENDER, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION } from "./ApiUrls";
|
||||
import { apiCall } from "../../Axios/Axios";
|
||||
|
||||
// User
|
||||
|
||||
export const userLogin = async (payload: { emailAdd: string, password: string }): Promise<any> => {
|
||||
try {
|
||||
const response = await axios.post(LOG_IN_URL, { ...payload, divice: "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
|
||||
}
|
||||
|
||||
|
||||
export const fetchPurchaseTender = async (): Promise<any> => {
|
||||
const data = await apiCall<any>('get', `${GET_MY_TENDER}`);
|
||||
return data
|
||||
}
|
||||
export const fetchLiveTender = async (): Promise<any> => {
|
||||
const data = await apiCall<any>('get', `${LIVE_TENDER}`);
|
||||
return data
|
||||
}
|
||||
export const fetchPurchaseAuction = async (): Promise<any> => {
|
||||
const data = await apiCall<any>('get', `${GET_MY_AUCTION}`);
|
||||
return data
|
||||
}
|
||||
export const fetchLiveAuction = async (payload: any): Promise<any> => {
|
||||
const data = await apiCall<any>('get', `${LIVE_AUCTION}`, {}, { payload });
|
||||
return data
|
||||
}
|
||||
|
||||
// Auction Purchase offline
|
||||
export const offlineAuctionPurchase = async (payload: any): Promise<any> => {
|
||||
try {
|
||||
const response = await axios.post(PROCEED_PURCHASE_AUCTION, payload);
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
throw error.response?.data || error.message;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,248 @@
|
||||
export interface DeviceDetailItem {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface DeviceDetail {
|
||||
detail: DeviceDetailItem[];
|
||||
}
|
||||
|
||||
export interface CategoryPaylaodType {
|
||||
mid: string;
|
||||
secretKey: string;
|
||||
reqId?: string;
|
||||
// txnId: string;
|
||||
clientUserId: string
|
||||
deviceDetial: DeviceDetail;
|
||||
udf1: string
|
||||
udf2: string,
|
||||
udf3: string,
|
||||
udf4: string,
|
||||
udf5: string,
|
||||
udf6: string,
|
||||
udf7: string,
|
||||
udf8: string,
|
||||
udf9: string,
|
||||
udf10: string
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface DeviceDetailItem {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface DeviceDetail {
|
||||
detail: DeviceDetailItem[];
|
||||
}
|
||||
|
||||
export interface ServicePayloadType {
|
||||
mid: string;
|
||||
secretKey: string;
|
||||
reqId: string;
|
||||
|
||||
deviceDetial: DeviceDetail;
|
||||
|
||||
udf1: string;
|
||||
udf2: string;
|
||||
udf3: string;
|
||||
udf4: string;
|
||||
udf5: string;
|
||||
udf6: string;
|
||||
udf7: string;
|
||||
udf8: string;
|
||||
udf9: string;
|
||||
udf10: string;
|
||||
|
||||
billerName?: string;
|
||||
category?: string;
|
||||
billerId?: string
|
||||
pageNo?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface ProviderType {
|
||||
mid: string;
|
||||
secretKey: string;
|
||||
deviceDetial: {
|
||||
detail: DeviceDetail[];
|
||||
};
|
||||
udf1: string;
|
||||
udf2: string;
|
||||
udf3: string;
|
||||
udf4: string;
|
||||
udf5: string;
|
||||
udf6: string;
|
||||
udf7: string;
|
||||
udf8: string;
|
||||
udf9: string;
|
||||
udf10: string;
|
||||
billerId: string;
|
||||
billerName?: string; // optional if needed later
|
||||
}
|
||||
|
||||
|
||||
export interface DeviceDetailItem {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface DeviceDetail {
|
||||
detail: DeviceDetailItem[];
|
||||
}
|
||||
|
||||
export interface DeviceBlockTag {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface CustomerParamsRequest {
|
||||
tags: any[]; // you can replace any[] with your exact param type
|
||||
}
|
||||
|
||||
export interface RemitterIdentity {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface BillFetchPayload {
|
||||
mid: string;
|
||||
secretKey: string;
|
||||
reqId?: string; // generated by uniqueIdGenerator
|
||||
// txnId?: string; // optional if needed
|
||||
deviceDetial: DeviceDetail;
|
||||
billerId: string;
|
||||
billerName: string;
|
||||
billerCategory: string;
|
||||
|
||||
clientReqId: string;
|
||||
macAdress: string;
|
||||
customerMobNo: string;
|
||||
remitterName: string;
|
||||
paymentChannel: string;
|
||||
|
||||
deviceBlockTags: DeviceBlockTag[];
|
||||
|
||||
customerParamsRequest: CustomerParamsRequest;
|
||||
|
||||
remitterIdentity: RemitterIdentity[];
|
||||
}
|
||||
|
||||
export interface PlansPayload {
|
||||
mid: string;
|
||||
secretKey: string;
|
||||
reqId: string;
|
||||
deviceDetial: DeviceDetail; // Note: deviceDetial name retained as per JSON
|
||||
udf1: string;
|
||||
udf2: string;
|
||||
udf3: string;
|
||||
udf4: string;
|
||||
udf5: string;
|
||||
udf6: string;
|
||||
udf7: string;
|
||||
udf8: string;
|
||||
udf9: string;
|
||||
udf10: string;
|
||||
billerId: string;
|
||||
category: string;
|
||||
amountInRupees: string;
|
||||
circle: string;
|
||||
page: number;
|
||||
pagesize: number;
|
||||
}
|
||||
|
||||
|
||||
export interface BillValidationPayload {
|
||||
mid: string;
|
||||
secretKey: string;
|
||||
deviceDetial: DeviceDetail;
|
||||
udf1: string;
|
||||
udf2: string;
|
||||
udf3: string;
|
||||
udf4: string;
|
||||
udf5: string;
|
||||
udf6: string;
|
||||
udf7: string;
|
||||
udf8: string;
|
||||
udf9: string;
|
||||
udf10: string;
|
||||
billerId?: string | number;
|
||||
billerName?: string;
|
||||
billerCategory?: string;
|
||||
customerMobNo: string;
|
||||
macAddress: string;
|
||||
customerParamsRequest: CustomerParamsRequest;
|
||||
}
|
||||
|
||||
|
||||
export interface PaymentRequest {
|
||||
mid: string | number;
|
||||
secretKey: string;
|
||||
clientUserId: string;
|
||||
|
||||
deviceDetial: {
|
||||
detail: {
|
||||
name: string;
|
||||
value: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
udf1?: string;
|
||||
udf2?: string;
|
||||
udf3?: string;
|
||||
udf4?: string;
|
||||
udf5?: string;
|
||||
udf6?: string;
|
||||
udf7?: string;
|
||||
udf8?: string;
|
||||
udf9?: string;
|
||||
udf10?: string;
|
||||
udf11?: string;
|
||||
udf12?: string;
|
||||
udf13?: string;
|
||||
udf14?: string;
|
||||
|
||||
amount: number;
|
||||
currency: string;
|
||||
|
||||
emailId?: string;
|
||||
customerVpa?: string;
|
||||
|
||||
mobileNo: string;
|
||||
respUrl: string;
|
||||
|
||||
txnReqType: 'PAY' | 'REFUND' | 'STATUS';
|
||||
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface PaymentPullbackType {
|
||||
mid: string | number;
|
||||
secretKey: string;
|
||||
clientUserId: string;
|
||||
deviceDetial: {
|
||||
detail: {
|
||||
name: string;
|
||||
value: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
udf1?: string;
|
||||
udf2?: string;
|
||||
udf3?: string;
|
||||
udf4?: string;
|
||||
udf5?: string;
|
||||
udf6?: string;
|
||||
udf7?: string;
|
||||
udf8?: string;
|
||||
udf9?: string;
|
||||
udf10?: string;
|
||||
udf11?: string;
|
||||
udf12?: string;
|
||||
udf13?: string;
|
||||
udf14?: string;
|
||||
orderId: string,
|
||||
}
|
||||
Reference in New Issue
Block a user