import { Router } from "express";
import { requireAuth } from "../../../../pkg/middleware/authMiddleware.js";

import addInvoice from "./addInvoice.js";
import getInvoices from "./getInvoices.js";
import updateInvoice from "./updateInvoices.js";

const router = Router();

router.use(
	"/",
	requireAuth("forklifts", ["systemAdmin", "admin", "manager"]),
	getInvoices,
);
router.use("/", requireAuth("forklifts", ["systemAdmin", "admin"]), addInvoice);
router.use(
	"/",
	requireAuth("forklifts", ["systemAdmin", "admin"]),
	updateInvoice,
);

export default router;
