import express from "express";
import isAuth from "../middleware/isAuth";

import * as WhatsAppController from "../controllers/WhatsAppController";

const whatsappRoutes = express.Router();

whatsappRoutes.get("/whatsapp/", isAuth, WhatsAppController.index);

whatsappRoutes.post("/whatsapp/", isAuth, WhatsAppController.store);

whatsappRoutes.get(
  "/whatsapp/official/matchQueue",
  WhatsAppController.whatsAppOfficialMatchQueue
);

whatsappRoutes.get(
  "/whatsapp/official/matchQueueUser",
  WhatsAppController.whatsAppOfficialMatchQueueUser
);

whatsappRoutes.get("/whatsapp/official/media/:filename", WhatsAppController.media);

whatsappRoutes.post("/whatsapp/webhook", WhatsAppController.weebhook);

whatsappRoutes.get("/whatsapp/webhook", WhatsAppController.weebhook);

whatsappRoutes.get("/whatsapp/:whatsappId", isAuth, WhatsAppController.show);

whatsappRoutes.put("/whatsapp/:whatsappId", isAuth, WhatsAppController.update);

whatsappRoutes.delete(
  "/whatsapp/:whatsappId",
  isAuth,
  WhatsAppController.remove
);

export default whatsappRoutes;
