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

export class SocialNetworkEmailsValidator extends AbstractValidator {
  constructor() {
    super();
  }
  sendEmail() {
    return [
      check("list").exists().isArray(),
      check("list.*.subject").exists().isString(),
      check("list.*.html").exists().isString(),
      check("list.*.email").exists().isString(),
      check("list.*.data").exists().isObject(),
      (req, res, next) => {
        validateResult(req, res, next);
      },
    ];
  }
  sendVerification() {
    return [
      check("email").exists().isString(),
      (req, res, next) => {
        validateResult(req, res, next);
      },
    ];
  }
  verify() {
    return [
      check("email").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);
      },
    ];
  }
}
