import Joi from "joi";
import { Result, RuleValidator } from "../../../../../common";

export interface ISendQuote_Request_DTO {
  sent_date: string;
}

export function ensureSendQuote_Request_DTOIsValid(quoteDTO: ISendQuote_Request_DTO) {
  const schema = Joi.object({
    sent_date: Joi.string(),
  });

  const result = RuleValidator.validate<ISendQuote_Request_DTO>(schema, quoteDTO);

  if (result.isFailure) {
    return Result.fail(result.error);
  }

  return Result.ok(result.object);
}
