import { ValidationConstraints as constraints } from "@autoplex-api/request";
import { Request } from "@autoplex/webserver";
import { FastifyRequest } from "fastify";
import validate from "validate.js";

export class MovieSearchRequest extends Request
{
	public validate(request: FastifyRequest) {
		return validate.async(request.query, {
			query: constraints.api.movie.search.query,
			year: constraints.api.movie.search.year
		},<any>{ fullMessages: false });
	}
}
