diff --git a/public/temp/tmp-1-1725516898089 b/public/temp/tmp-1-1725516898089 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-1-1725516898089 differ diff --git a/public/temp/tmp-1-1725517453448 b/public/temp/tmp-1-1725517453448 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-1-1725517453448 differ diff --git a/public/temp/tmp-1-1725517726185 b/public/temp/tmp-1-1725517726185 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-1-1725517726185 differ diff --git a/public/temp/tmp-1-1725517759615 b/public/temp/tmp-1-1725517759615 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-1-1725517759615 differ diff --git a/public/temp/tmp-1-1725518149346 b/public/temp/tmp-1-1725518149346 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-1-1725518149346 differ diff --git a/public/temp/tmp-1-1725596013284 b/public/temp/tmp-1-1725596013284 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-1-1725596013284 differ diff --git a/public/temp/tmp-10-1725516924774 b/public/temp/tmp-10-1725516924774 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-10-1725516924774 differ diff --git a/public/temp/tmp-10-1725517460034 b/public/temp/tmp-10-1725517460034 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-10-1725517460034 differ diff --git a/public/temp/tmp-11-1725516924777 b/public/temp/tmp-11-1725516924777 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-11-1725516924777 differ diff --git a/public/temp/tmp-11-1725517460037 b/public/temp/tmp-11-1725517460037 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-11-1725517460037 differ diff --git a/public/temp/tmp-12-1725516924779 b/public/temp/tmp-12-1725516924779 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-12-1725516924779 differ diff --git a/public/temp/tmp-12-1725517460048 b/public/temp/tmp-12-1725517460048 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-12-1725517460048 differ diff --git a/public/temp/tmp-13-1725517152823 b/public/temp/tmp-13-1725517152823 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-13-1725517152823 differ diff --git a/public/temp/tmp-13-1725517465401 b/public/temp/tmp-13-1725517465401 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-13-1725517465401 differ diff --git a/public/temp/tmp-14-1725517152825 b/public/temp/tmp-14-1725517152825 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-14-1725517152825 differ diff --git a/public/temp/tmp-14-1725517465404 b/public/temp/tmp-14-1725517465404 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-14-1725517465404 differ diff --git a/public/temp/tmp-15-1725517152828 b/public/temp/tmp-15-1725517152828 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-15-1725517152828 differ diff --git a/public/temp/tmp-15-1725517465407 b/public/temp/tmp-15-1725517465407 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-15-1725517465407 differ diff --git a/public/temp/tmp-16-1725517152830 b/public/temp/tmp-16-1725517152830 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-16-1725517152830 differ diff --git a/public/temp/tmp-16-1725517465410 b/public/temp/tmp-16-1725517465410 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-16-1725517465410 differ diff --git a/public/temp/tmp-17-1725517152833 b/public/temp/tmp-17-1725517152833 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-17-1725517152833 differ diff --git a/public/temp/tmp-17-1725517465413 b/public/temp/tmp-17-1725517465413 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-17-1725517465413 differ diff --git a/public/temp/tmp-18-1725517152835 b/public/temp/tmp-18-1725517152835 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-18-1725517152835 differ diff --git a/public/temp/tmp-18-1725517465415 b/public/temp/tmp-18-1725517465415 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-18-1725517465415 differ diff --git a/public/temp/tmp-19-1725517187702 b/public/temp/tmp-19-1725517187702 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-19-1725517187702 differ diff --git a/public/temp/tmp-2-1725516898093 b/public/temp/tmp-2-1725516898093 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-2-1725516898093 differ diff --git a/public/temp/tmp-2-1725517453451 b/public/temp/tmp-2-1725517453451 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-2-1725517453451 differ diff --git a/public/temp/tmp-2-1725517726188 b/public/temp/tmp-2-1725517726188 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-2-1725517726188 differ diff --git a/public/temp/tmp-2-1725517759618 b/public/temp/tmp-2-1725517759618 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-2-1725517759618 differ diff --git a/public/temp/tmp-2-1725518149349 b/public/temp/tmp-2-1725518149349 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-2-1725518149349 differ diff --git a/public/temp/tmp-2-1725596013295 b/public/temp/tmp-2-1725596013295 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-2-1725596013295 differ diff --git a/public/temp/tmp-20-1725517187704 b/public/temp/tmp-20-1725517187704 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-20-1725517187704 differ diff --git a/public/temp/tmp-21-1725517187706 b/public/temp/tmp-21-1725517187706 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-21-1725517187706 differ diff --git a/public/temp/tmp-22-1725517187708 b/public/temp/tmp-22-1725517187708 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-22-1725517187708 differ diff --git a/public/temp/tmp-23-1725517187710 b/public/temp/tmp-23-1725517187710 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-23-1725517187710 differ diff --git a/public/temp/tmp-24-1725517187711 b/public/temp/tmp-24-1725517187711 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-24-1725517187711 differ diff --git a/public/temp/tmp-3-1725516898096 b/public/temp/tmp-3-1725516898096 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-3-1725516898096 differ diff --git a/public/temp/tmp-3-1725517453456 b/public/temp/tmp-3-1725517453456 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-3-1725517453456 differ diff --git a/public/temp/tmp-3-1725517726191 b/public/temp/tmp-3-1725517726191 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-3-1725517726191 differ diff --git a/public/temp/tmp-3-1725517759621 b/public/temp/tmp-3-1725517759621 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-3-1725517759621 differ diff --git a/public/temp/tmp-3-1725518149352 b/public/temp/tmp-3-1725518149352 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-3-1725518149352 differ diff --git a/public/temp/tmp-3-1725596013305 b/public/temp/tmp-3-1725596013305 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-3-1725596013305 differ diff --git a/public/temp/tmp-4-1725516898098 b/public/temp/tmp-4-1725516898098 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-4-1725516898098 differ diff --git a/public/temp/tmp-4-1725517453459 b/public/temp/tmp-4-1725517453459 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-4-1725517453459 differ diff --git a/public/temp/tmp-4-1725517726194 b/public/temp/tmp-4-1725517726194 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-4-1725517726194 differ diff --git a/public/temp/tmp-4-1725517759623 b/public/temp/tmp-4-1725517759623 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-4-1725517759623 differ diff --git a/public/temp/tmp-4-1725518149354 b/public/temp/tmp-4-1725518149354 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-4-1725518149354 differ diff --git a/public/temp/tmp-4-1725596013322 b/public/temp/tmp-4-1725596013322 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-4-1725596013322 differ diff --git a/public/temp/tmp-5-1725516898101 b/public/temp/tmp-5-1725516898101 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-5-1725516898101 differ diff --git a/public/temp/tmp-5-1725517453462 b/public/temp/tmp-5-1725517453462 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-5-1725517453462 differ diff --git a/public/temp/tmp-5-1725517726199 b/public/temp/tmp-5-1725517726199 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-5-1725517726199 differ diff --git a/public/temp/tmp-5-1725517759626 b/public/temp/tmp-5-1725517759626 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-5-1725517759626 differ diff --git a/public/temp/tmp-5-1725518149357 b/public/temp/tmp-5-1725518149357 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-5-1725518149357 differ diff --git a/public/temp/tmp-5-1725596013329 b/public/temp/tmp-5-1725596013329 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-5-1725596013329 differ diff --git a/public/temp/tmp-6-1725516898103 b/public/temp/tmp-6-1725516898103 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-6-1725516898103 differ diff --git a/public/temp/tmp-6-1725517453464 b/public/temp/tmp-6-1725517453464 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-6-1725517453464 differ diff --git a/public/temp/tmp-6-1725517726201 b/public/temp/tmp-6-1725517726201 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-6-1725517726201 differ diff --git a/public/temp/tmp-6-1725517759629 b/public/temp/tmp-6-1725517759629 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-6-1725517759629 differ diff --git a/public/temp/tmp-6-1725518149370 b/public/temp/tmp-6-1725518149370 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-6-1725518149370 differ diff --git a/public/temp/tmp-6-1725596013343 b/public/temp/tmp-6-1725596013343 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-6-1725596013343 differ diff --git a/public/temp/tmp-7-1725516924758 b/public/temp/tmp-7-1725516924758 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-7-1725516924758 differ diff --git a/public/temp/tmp-7-1725517460027 b/public/temp/tmp-7-1725517460027 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-7-1725517460027 differ diff --git a/public/temp/tmp-8-1725516924759 b/public/temp/tmp-8-1725516924759 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-8-1725516924759 differ diff --git a/public/temp/tmp-8-1725517460029 b/public/temp/tmp-8-1725517460029 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-8-1725517460029 differ diff --git a/public/temp/tmp-9-1725516924762 b/public/temp/tmp-9-1725516924762 new file mode 100644 index 0000000..37d3563 Binary files /dev/null and b/public/temp/tmp-9-1725516924762 differ diff --git a/public/temp/tmp-9-1725517460031 b/public/temp/tmp-9-1725517460031 new file mode 100644 index 0000000..3e58726 Binary files /dev/null and b/public/temp/tmp-9-1725517460031 differ diff --git a/resources/KYC/KycController.js b/resources/KYC/KycController.js index adc5b06..a300ba9 100644 --- a/resources/KYC/KycController.js +++ b/resources/KYC/KycController.js @@ -110,6 +110,92 @@ export const createKyc = async (req, res) => { }); } }; +export const createretaildistributor = async (req, res) => { + const { + name, + trade_name, + address, + state, + city, + district, + pincode, + mobile_number, + pan_number, + aadhar_number, + gst_number, + } = req.body; + + try { + if (!mongoose.Types.ObjectId.isValid(req.user._id)) { + return res.status(400).json({ message: "Please login again" }); + } + + if (!req.files) { + return res.status(400).json({ message: "No files were uploaded." }); + } + + const { selfieEntranceImg, panImg, aadharImg, gstImg, pesticideLicenseImg } = req.files; + // console.log(req.files); + const fertilizerLicenseImg = req.files.fertilizerLicenseImg || null; + + if (!panImg || !aadharImg || !gstImg || !selfieEntranceImg || !pesticideLicenseImg) { + return res.status(400).json({ message: "Please upload all required images." }); + } + + // Upload images to Cloudinary + const uploadImage = async (image, folder) => { + if (!image) return null; + const result = await cloudinary.v2.uploader.upload(image.tempFilePath, { + folder, + }); + return { + public_id: result.public_id, + url: result.secure_url, + }; + }; + + const pan_img = await uploadImage(panImg, "KYC/pan"); + const aadhar_img = await uploadImage(aadharImg, "KYC/aadhar"); + const gst_img = await uploadImage(gstImg, "KYC/gst"); + const pesticide_license_img = await uploadImage(pesticideLicenseImg, "KYC/pesticide_license"); + const fertilizer_license_img= await uploadImage(fertilizerLicenseImg, "KYC/fertilizer_license"); + const selfie_entrance_img = await uploadImage(selfieEntranceImg, "KYC/selfie_entrance"); + + // Create KYC document + const kycData = { + name, + trade_name, + address, + state, + city, + district, + pincode, + mobile_number, + pan_number, + pan_img, + aadhar_number, + aadhar_img, + gst_number, + gst_img, + pesticide_license_img, + fertilizer_license_img: fertilizer_license_img || null, // Optional field + selfie_entrance_img, + status: "approved", + }; + + const kyc = await KYC.create(kycData); + + if (kyc) { + return res.status(201).json({ success: true, kyc, message: "KYC created" }); + } + } catch (error) { + res.status(500).json({ + success: false, + message: error.message ? error.message : "Something went wrong!", + }); + } +}; + // Get All KYC export const getAllKyc = async (req, res) => { try { @@ -165,40 +251,6 @@ export const getAllKycApproved = async (req, res) => { res.status(500).json({ message: "Server Error", error }); } }; -export const getAllKycApprovedbytmid = async (req, res) => { - try { - const { id } = req.params; // Extracting `addedBy` ID from req.params - const { tradename, page = 1, show = 10 } = req.query; // Extracting filters and pagination from req.query - - const query = { status: "approved", addedBy: id }; // Base query with status and addedBy - - if (tradename) { - query.trade_name = new RegExp(tradename, "i"); // Adding trade_name filter with case-insensitive regex - } - - const skip = (page - 1) * show; // Calculating the number of documents to skip - - // Fetch KYC documents from the database based on query, sorted by creation date, with pagination - const retaildistributor = await KYC.find(query) - .sort({ createdAt: -1 }) - .populate("principal_distributer", "name") - .populate("addedBy") - .skip(skip) - .limit(parseInt(show)); -const total_data = await KYC.countDocuments(query); - // Send the fetched data as a response - res.status(200).json({ - success: true, - total_data: total_data, - total_pages: Math.ceil(total_data / page), - retaildistributor - }); - } catch (error) { - // Handle any errors that occur during the fetch operation - console.error(error); - res.status(500).json({ message: "Server Error", error }); - } -}; // Get Single KYC export const getKycById = async (req, res) => { try { @@ -295,14 +347,26 @@ export const updateKycStatus = async (req, res) => { export const getAllPrincipalDistributers = async (req, res) => { try { - // Fetch all users with the role "principal-distributer" - const principalDistributers = await User.find({ - role: "principal-Distributor", - }); + // Define the filter for the query + let filter = { role: "principal-Distributor" }; + + // Check the user type and adjust the filter accordingly + if (req.userType === "SalesCoOrdinator") { + // If userType is "SalesCoOrdinator", filter by req.user.mappedBy + filter.mappedBy = req.user.mappedBy; + } else { + // Otherwise, filter by req.user._id + filter.mappedBy = req.user._id; + } + + // Fetch the principal distributors based on the filter + const principalDistributers = await User.find(filter); // Send the fetched data as a response - if (principalDistributers) { + if (principalDistributers.length > 0) { res.status(200).json(principalDistributers); + } else { + res.status(404).json({ message: "No Principal Distributors found" }); } } catch (error) { // Handle any errors that occur during the fetch operation @@ -310,6 +374,7 @@ export const getAllPrincipalDistributers = async (req, res) => { } }; + // Fcm token storing export const saveFCMTokenForSC = async (req, res) => { const { fcmToken } = req.body; @@ -366,3 +431,79 @@ export const saveFCMTokenForTM = async (req, res) => { res.status(500).send("Internal Server Error"); } }; +export const getAllKycApprovedbytmid = async (req, res) => { + try { + const { id } = req.params; // Extracting `addedBy` ID from req.params + const { tradename, page = 1, show = 10 } = req.query; + + const query = { status: "approved", mappedTM: id }; + + if (tradename) { + query.trade_name = new RegExp(tradename, "i"); + } + + const skip = (page - 1) * show; + + const retaildistributor = await KYC.find(query) + .sort({ createdAt: -1 }) + .populate("principal_distributer") + .populate("mappedTM") + .populate("mappedSC") + .populate("addedBy") + .skip(skip) + .limit(parseInt(show)); +const total_data = await KYC.countDocuments(query); + // Send the fetched data as a response + res.status(200).json({ + success: true, + total_data: total_data, + total_pages: Math.ceil(total_data / page), + retaildistributor + }); + } catch (error) { + // Handle any errors that occur during the fetch operation + console.error(error); + res.status(500).json({ message: "Server Error", error }); + } +}; + +export const updateKYCMapped = async (req, res) => { + try { + const { id } = req.params; // KYC document ID from params + const { principal_distributor, mappedTM, mappedSC } = req.body; // Fields to update from the request body + + // Find the KYC document by ID + const kyc = await KYC.findById(id); + + // If KYC not found, return 404 + if (!kyc) { + return res.status(404).json({ message: "KYC record not found" }); + } + + // Update the fields only if they are provided in the request body + if (principal_distributor) { + kyc.principal_distributer = principal_distributor; + } + if (mappedTM) { + kyc.mappedTM = mappedTM; + } + if (mappedSC) { + kyc.mappedSC = mappedSC; + } + + // Save the updated KYC document + await kyc.save(); + + // Send the updated KYC data as a response + res.status(200).json({ + message: "KYC record updated successfully", + data: kyc, + }); + } catch (error) { + // Handle any errors during the update + res.status(500).json({ + message: "Error updating KYC record", + error: error.message, + }); + } +}; \ No newline at end of file diff --git a/resources/KYC/KycModel.js b/resources/KYC/KycModel.js index b37994d..a40517d 100644 --- a/resources/KYC/KycModel.js +++ b/resources/KYC/KycModel.js @@ -39,7 +39,7 @@ const KycSchema = new Schema( principal_distributer: { type: Schema.Types.ObjectId, ref: "User", - required: true, + // required: true, }, pan_number: { type: String, @@ -95,6 +95,14 @@ const KycSchema = new Schema( // required: true, enum: ["SalesCoOrdinator", "TerritoryManager"], }, + mappedTM: { + type: mongoose.Schema.Types.ObjectId, + ref: "TerritoryManager", + }, + mappedSC: { + type: mongoose.Schema.Types.ObjectId, + ref: "SalesCoOrdinator", + }, notes: [ { message: { @@ -119,5 +127,13 @@ const KycSchema = new Schema( }, { timestamps: true } ); - +// Pre-save middleware to set 'mapped' based on 'userType' +KycSchema.pre("save", function (next) { + if (this.userType === "SalesCoOrdinator" && this.addedBy) { + this.mappedSC = this.addedBy; + } else if (this.userType === "TerritoryManager" && this.addedBy) { + this.mappedTM = this.addedBy; + } + next(); +}); export const KYC = model("KYC", KycSchema); diff --git a/resources/KYC/KycRoutes.js b/resources/KYC/KycRoutes.js index e74fd4e..b03e1a0 100644 --- a/resources/KYC/KycRoutes.js +++ b/resources/KYC/KycRoutes.js @@ -4,6 +4,7 @@ const router = express.Router(); import { createKyc, + createretaildistributor, getAllKyc, getAllKycApproved, getAllKycApprovedbytmid, @@ -12,6 +13,7 @@ import { getKycById, saveFCMTokenForSC, saveFCMTokenForTM, + updateKYCMapped, updateKycStatus, } from "./KycController.js"; import { isAuthenticatedSalesCoOrdinator } from "../../middlewares/SalesCoOrdinatorAuth.js"; @@ -31,9 +33,7 @@ router router .route("/kyc/getAllapproved/") .get(isAuthenticatedUser, authorizeRoles("admin"), getAllKycApproved); -router - .route("/kyc/getAllapprovedbytmid/:id") - .get(isAuthenticatedUser, authorizeRoles("admin"), getAllKycApprovedbytmid); + router .route("/kyc/get-single-kyc/:id") .get( @@ -48,6 +48,9 @@ router.route("/kyc/create/").post(isAuthenticatedSalesCoOrdinator, createKyc); router .route("/kyc/create-tm/") .post(isAuthenticatedTerritoryManager, createKyc); + router + .route("/kyc/create-admin/") + .post(isAuthenticatedUser,authorizeRoles("admin"), createretaildistributor); router .route("/kyc/getAllrejected/") @@ -75,4 +78,11 @@ router router .route("/kyc/save-fcm-tm/") .post(isAuthenticatedTerritoryManager, saveFCMTokenForTM); +//mapping part +router + .route("/kyc/getAllapprovedbytmid/:id") + .get(isAuthenticatedUser, authorizeRoles("admin"), getAllKycApprovedbytmid); +router + .route("/kyc/mapped/:id") + .get(isAuthenticatedUser, authorizeRoles("admin"), updateKYCMapped); export default router;