2024-06-29 19:39:25 +00:00
|
|
|
import { checkUser } from "@/contexts/auth";
|
2024-07-01 17:12:15 +00:00
|
|
|
import {
|
|
|
|
|
createQuoteController,
|
2024-07-09 16:21:12 +00:00
|
|
|
getQuoteController,
|
2024-07-01 17:12:15 +00:00
|
|
|
listQuotesController,
|
2024-07-09 16:21:12 +00:00
|
|
|
updateQuoteController,
|
2024-07-01 17:12:15 +00:00
|
|
|
} from "@/contexts/sales/infrastructure/express/controllers";
|
2024-07-03 10:27:58 +00:00
|
|
|
import { getDealerMiddleware } from "@/contexts/sales/infrastructure/express/middlewares/dealerMiddleware";
|
2024-05-23 15:38:41 +00:00
|
|
|
import Express from "express";
|
|
|
|
|
|
2024-07-01 17:12:15 +00:00
|
|
|
export const QuoteRouter = (appRouter: Express.Router) => {
|
|
|
|
|
const quoteRoutes: Express.Router = Express.Router({ mergeParams: true });
|
2024-05-23 15:38:41 +00:00
|
|
|
|
2024-07-03 10:27:58 +00:00
|
|
|
quoteRoutes.get("/", checkUser, getDealerMiddleware, listQuotesController);
|
2024-07-09 16:21:12 +00:00
|
|
|
quoteRoutes.get("/:quoteId", checkUser, getDealerMiddleware, getQuoteController);
|
2024-07-19 17:28:25 +00:00
|
|
|
//quoteRoutes.get("/:quoteId/report", checkUser, getDealerMiddleware, getReportController;
|
2024-07-03 10:27:58 +00:00
|
|
|
quoteRoutes.post("/", checkUser, getDealerMiddleware, createQuoteController);
|
2024-07-09 16:21:21 +00:00
|
|
|
quoteRoutes.put("/:quoteId", checkUser, getDealerMiddleware, updateQuoteController);
|
2024-07-01 17:12:15 +00:00
|
|
|
|
2024-07-09 16:21:12 +00:00
|
|
|
/*
|
2024-07-01 17:12:15 +00:00
|
|
|
quoteRoutes.post("/", isAdmin, createQuoteController);
|
|
|
|
|
|
2024-07-09 16:21:21 +00:00
|
|
|
quoteRoutes.delete("/:quoteId", isAdmin, getDealerMiddleware, deleteQuoteController);*/
|
2024-05-23 15:38:41 +00:00
|
|
|
|
|
|
|
|
appRouter.use("/quotes", quoteRoutes);
|
|
|
|
|
};
|