import { SocialNetworkSmssController } from "../../controllers/social-network/social-network-sms.controller";
import { AuthMiddleware } from "../../middleware/auth.middleware";
import { SocialNetworkSmssValidator } from "../../validators/social-network/social-network-sms.validator";
import { AbstractRoute } from "../abstract.route";

const express = require("express");
const router = express.Router();
const controller = new SocialNetworkSmssController();

class SocialNetworkSmssRoute extends AbstractRoute {
  constructor(_controller, _router) {
    super(_controller, _router, new SocialNetworkSmssValidator(), [
      "getItem", "getItems", "createItem",
      "sendMessage",
      "sendVerification",
      "verify",
    ]);
  }
  /**
   * Get all social network sms
   * @swagger
   * /social-networks/sms:
   *    get:
   *      tags:
   *        - SocialNetworksSms
   *      summary: "Get all social network sms"
   *      description: "List all social network sms with details"
   *      security:
   *        - bearerAuth: []
   *      operationId: "GETsocialNetworkSmss"
   *      produces:
   *      - "application/xml"
   *      - "application/json"
   *      parameters:
   *      - $ref: '#/components/parameters/store'
   *      - $ref: '#/components/parameters/pageParam'
   *      - $ref: '#/components/parameters/limitParam'
   *      - name: "sort"
   *        in: "query"
   *        description: "The type of sort of items to return."
   *        required: false
   *        schema:
   *          type: "string"
   *          enum: [createdAt, -createdAt]
   *      responses:
   *        "200":
   *          description: "successful operation"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemsSchema'
   *        "204":
   *          description: "successful operation with empty respose"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemsSchema'
   *        "401":
   *          description: "Not allow because you need a Authentication Token"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        '403':
   *          description: "Not allow because you need more permissions"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        "404":
   *          description: "social network sms not found"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        default:
   *          description: "Unexpected Error"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   */
  /**
   * Find social network sms by ID
   * @swagger
   * /social-networks/sms/{id}:
   *    get:
   *      tags:
   *        - SocialNetworksSms
   *      summary: "Find social network sms by ID"
   *      description: "Returns a single social network sms"
   *      security:
   *        - bearerAuth: []
   *      operationId: "GETsocialNetworkSms"
   *      produces:
   *      - "application/xml"
   *      - "application/json"
   *      parameters:
   *      - $ref: '#/components/parameters/store'
   *      - name: "id"
   *        in: "path"
   *        description: "ID of social network sms to return"
   *        required: true
   *      responses:
   *        "200":
   *          description: "successful operation"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "204":
   *          description: "successful operation with empty respose"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "401":
   *          description: "Not allow because you need a Authentication Token"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        '403':
   *          description: "Not allow because you need more permissions"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        "404":
   *          description: "social network sms not found"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        default:
   *          description: "Unexpected Error"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   */
  /**
   * Add a social network sms
   * @swagger
   * /social-networks/sms:
   *    post:
   *      tags:
   *        - SocialNetworksSms
   *      summary: "Add a social network sms"
   *      description: "Add a social network sms"
   *      operationId: "ADDsocialNetworkSms"
   *      security:
   *        - bearerAuth: []
   *      parameters:
   *      - $ref: '#/components/parameters/store'
   *      requestBody:
   *        content:
   *          application/json:
   *            schema:
   *              $ref: "#/definitions/SocialNetworkSmssCreateItemSchema"
   *      responses:
   *        "200":
   *          description: "successful operation"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "201":
   *          description: "Created successfully"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "401":
   *          description: "Not allow because you need a Authentication Token"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        '403':
   *          description: "Not allow because you need more permissions"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        "404":
   *          description: "social network sms not found"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        default:
   *          description: "Unexpected Error"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   */
  /**
   * Send message to social network sms
   * @swagger
   * /social-networks/sms/send-message:
   *    post:
   *      tags:
   *        - SocialNetworksSms
   *      summary: "Send message to social network sms"
   *      description: "Send message to social network sms"
   *      operationId: "SENDsocialNetworkSms"
   *      security:
   *        - bearerAuth: []
   *      parameters:
   *      - $ref: '#/components/parameters/store'
   *      requestBody:
   *        content:
   *          application/json:
   *            schema:
   *              $ref: "#/definitions/SocialNetworkWhatsappsSendMessageItem"
   *      responses:
   *        "200":
   *          description: "successful operation"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "201":
   *          description: "Created successfully"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "401":
   *          description: "Not allow because you need a Authentication Token"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        '403':
   *          description: "Not allow because you need more permissions"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        "404":
   *          description: "social network sms not found"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        default:
   *          description: "Unexpected Error"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   */
  sendMessage() {
    this.router.post(
      "/send-message",
      AuthMiddleware,
      this.validator.sendMessage(),
      this.controller.sendMessage.bind(this.controller)
    );
  }
  /**
   * Send verification to social network sms
   * @swagger
   * /social-networks/sms/send-verification:
   *    post:
   *      tags:
   *        - SocialNetworksSms
   *      summary: "Send verification to social network sms"
   *      description: "Send verification to social network sms"
   *      operationId: "SENDVerificationSocialNetworkSms"
   *      security:
   *        - bearerAuth: []
   *      parameters:
   *      - $ref: '#/components/parameters/store'
   *      requestBody:
   *        content:
   *          application/json:
   *            schema:
   *              $ref: "#/definitions/SocialNetworkSmsSendVerificationItem"
   *      responses:
   *        "200":
   *          description: "successful operation"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "201":
   *          description: "Created successfully"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "401":
   *          description: "Not allow because you need a Authentication Token"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        '403':
   *          description: "Not allow because you need more permissions"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        "404":
   *          description: "social network sms not found"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        default:
   *          description: "Unexpected Error"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   */
  sendVerification() {
    this.router.post(
      "/send-verification",
      AuthMiddleware,
      this.validator.sendVerification(),
      this.controller.sendVerification.bind(this.controller)
    );
  }
  /**
   * Verify code to social network sms
   * @swagger
   * /social-networks/sms/verify:
   *    post:
   *      tags:
   *        - SocialNetworksSms
   *      summary: "Verify code to social network sms"
   *      description: "Verify code to social network sms"
   *      operationId: "VERIFYsocialNetworkSms"
   *      security:
   *        - bearerAuth: []
   *      parameters:
   *      - $ref: '#/components/parameters/store'
   *      requestBody:
   *        content:
   *          application/json:
   *            schema:
   *              $ref: "#/definitions/SocialNetworkSmsVerifyItem"
   *      responses:
   *        "200":
   *          description: "successful operation"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "201":
   *          description: "Created successfully"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/SocialNetworkSmssGetItemSchema'
   *        "401":
   *          description: "Not allow because you need a Authentication Token"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        '403':
   *          description: "Not allow because you need more permissions"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        "404":
   *          description: "social network sms not found"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   *        default:
   *          description: "Unexpected Error"
   *          content:
   *            application/json:
   *              schema:
   *                $ref: '#/definitions/ErrorSchema'
   */
  verify() {
    this.router.post(
      "/verify",
      AuthMiddleware,
      this.validator.verify(),
      this.controller.verify.bind(this.controller)
    );
  }
}

export const socialNetworkSmssRouter = new SocialNetworkSmssRoute(
  controller,
  router
).init();
