"use strict";
/*
 * @adonisjs/validator
 *
 * (c) Harminder Virk <virk@adonisjs.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.afterOrEqualToField = void 0;
const helpers_1 = require("../../Validator/helpers");
const field_1 = require("./helpers/field");
const RULE_NAME = 'afterOrEqualToField';
const DEFAULT_MESSAGE = 'after or equal to date validation failed';
/**
 * Ensure the date is after the defined field.
 */
exports.afterOrEqualToField = {
    compile: (0, helpers_1.wrapCompile)(RULE_NAME, [], (options, _, __, rulesTree) => {
        return (0, field_1.compile)(RULE_NAME, '>=', options, rulesTree);
    }),
    validate(value, compiledOptions, runtimeOptions) {
        return (0, field_1.validate)(RULE_NAME, DEFAULT_MESSAGE, value, compiledOptions, runtimeOptions);
    },
};
