import { check } from "express-validator";
import { validateResult } from "../../utils/handlers/validator.handle";
import { AbstractValidator } from "../abstract.validator";

export class SocialNetworkSmssValidator extends AbstractValidator {
  constructor() {
    super();
  }
  sendMessage() {
    return [
      check("username").exists().isString(),
      check("list").exists().isArray({ min: 1 }),
      check("list.*.number").exists().isString(),
      check("list.*.message").exists().isString(),
      (req, res, next) => {
        validateResult(req, res, next);
      },
    ];
  }
  sendVerification() {
    return [
      check("number").exists().isString(),
      (req, res, next) => {
        validateResult(req, res, next);
      },
    ];
  }
  verify() {
    return [
      check("number").exists().isString(),
      check("code").exists().isString(),
      (req, res, next) => {
        validateResult(req, res, next);
      },
    ];
  }
  createItem() {
    return [
      (req, res, next) => {
        validateResult(req, res, next);
      },
    ];
  }
  updateItem() {
    return [
      check("_id").exists().isMongoId(),
      (req, res, next) => {
        validateResult(req, res, next);
      },
    ];
  }
}
