21 lines
706 B
TypeScript
21 lines
706 B
TypeScript
import { validateRequestDTO } from "@common/presentation";
|
|
import { checkTabContext, checkUser } from "@contexts/auth/infraestructure";
|
|
import { ListCustomerInvoicesSchema } from "@contexts/customer-billing/presentation";
|
|
import { NextFunction, Request, Response, Router } from "express";
|
|
|
|
export const customerInvoicesRouter = (appRouter: Router) => {
|
|
const routes: Router = Router({ mergeParams: true });
|
|
|
|
routes.get(
|
|
"/",
|
|
validateRequestDTO(ListCustomerInvoicesSchema),
|
|
checkTabContext,
|
|
checkUser,
|
|
(req: Request, res: Response, next: NextFunction) => {
|
|
listCustomerInvoicesController().execute(req, res, next);
|
|
}
|
|
);
|
|
|
|
appRouter.use("/customer-invoices", routes);
|
|
};
|