"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.socialNetworkWhatsappsRouter = void 0;
const social_network_whatsapp_controller_1 = require("../../controllers/social-network/social-network-whatsapp.controller");
const auth_middleware_1 = require("../../middleware/auth.middleware");
const store_handle_1 = require("../../utils/handlers/store.handle");
const social_network_whatsapp_validator_1 = require("../../validators/social-network/social-network-whatsapp.validator");
const abstract_route_1 = require("../abstract.route");
const express = require("express");
const router = express.Router();
const controller = new social_network_whatsapp_controller_1.SocialNetworkWhatsappsController();
class SocialNetworkWhatsappsRoute extends abstract_route_1.AbstractRoute {
    constructor(_controller, _router) {
        super(_controller, _router, new social_network_whatsapp_validator_1.SocialNetworkWhatsappsValidator(), []);
        this.customMethods = ["getItem", "getItems", "createItem", "connect", "sendMessages", "sendPhotos", "sendVideos", "sendAudios", "disconnect", "session"];
    }
    connect() {
        this.router.post("/connect", auth_middleware_1.AuthMiddleware, this.validator.connect(), this.controller.connect.bind(this.controller));
    }
    disconnect() {
        this.router.post("/disconnect", auth_middleware_1.AuthMiddleware, this.validator.connect(), this.controller.disconnect.bind(this.controller));
    }
    sendMessages() {
        this.router.post("/send-message", auth_middleware_1.AuthMiddleware, this.validator.sendMessages(), this.controller.sendMessages.bind(this.controller));
    }
    sendPhotos() {
        this.router.post("/send-photo", auth_middleware_1.AuthMiddleware, this.validator.sendPhotos(), this.controller.sendPhotos.bind(this.controller));
    }
    sendVideos() {
        this.router.post("/send-video", auth_middleware_1.AuthMiddleware, this.validator.sendVideos(), this.controller.sendVideos.bind(this.controller));
    }
    sendAudios() {
        this.router.post("/send-audio", auth_middleware_1.AuthMiddleware, this.validator.sendAudios(), this.controller.sendAudios.bind(this.controller));
    }
    sendStory() {
        this.router.post("/story", auth_middleware_1.AuthMiddleware, store_handle_1.upload.single("file"), this.controller.sendStory.bind(this.controller));
    }
    session() {
        this.router.get("/session/:id", auth_middleware_1.AuthMiddleware, this.validator.session(), this.controller.session.bind(this.controller));
    }
}
exports.socialNetworkWhatsappsRouter = new SocialNetworkWhatsappsRoute(controller, router).init();
