40 lines
1009 B
JavaScript
40 lines
1009 B
JavaScript
import express from "express";
|
|
|
|
const router = express.Router();
|
|
|
|
import {
|
|
createKyc,
|
|
getAllKyc,
|
|
getAllPrincipalDistributers,
|
|
getKycById,
|
|
updateKycStatus,
|
|
} from "./KycController.js";
|
|
import { isAuthenticatedSalesCoOrdinator } from "../../middlewares/SalesCoOrdinatorAuth.js";
|
|
import { authorizeRoles, isAuthenticatedUser } from "../../middlewares/auth.js";
|
|
// Pd routes
|
|
router
|
|
.route("/kyc/update/:id")
|
|
.patch(
|
|
isAuthenticatedUser,
|
|
authorizeRoles("principal-Distributor"),
|
|
updateKycStatus
|
|
);
|
|
router
|
|
.route("/kyc/getAll/")
|
|
.get(isAuthenticatedUser, authorizeRoles("principal-Distributor"), getAllKyc);
|
|
router
|
|
.route("/kyc/get-single-kyc/:id")
|
|
.get(
|
|
isAuthenticatedUser,
|
|
authorizeRoles("principal-Distributor"),
|
|
getKycById
|
|
);
|
|
|
|
// sales coordinator routes
|
|
router.route("/kyc/create/").post(isAuthenticatedSalesCoOrdinator, createKyc);
|
|
router
|
|
.route("/kyc/get-pd/")
|
|
.get(isAuthenticatedSalesCoOrdinator, getAllPrincipalDistributers);
|
|
|
|
export default router;
|