import { Router } from "express";

import { ExternalInvoiceController } from "./externalInvoice.controller";

import { authMiddleware } from "../auth/auth.middleware";

const invoicerouter = Router();

const controller = new ExternalInvoiceController();

//Obtener todas las facturas

invoicerouter.get("/", authMiddleware, controller.getAll);

//Obtener factura por ID
 
invoicerouter.get("/:id", authMiddleware, controller.getById);

//Crear factura
 
invoicerouter.post("/", authMiddleware, controller.create);

//Actualizar factura
 
invoicerouter.put("/:id", authMiddleware, controller.update);

//Buscar por estado
 
invoicerouter.get("/status/:status", authMiddleware, controller.getByStatus);

//Buscar por zona
 
invoicerouter.get("/zone/:zone", authMiddleware, controller.getByZone);

//Eliminar factura
 
invoicerouter.delete("/:id", authMiddleware, controller.delete);

export default invoicerouter;