import { registerDecorator, ValidationOptions } from 'class-validator';
import { IsStartDateBeforeEndDateConstraint } from './isStartDateBeforeEndDateConstraint';

export function IsStartDateBeforeEndDate(validationOptions?: ValidationOptions) {
    return function (object: object, propertyName: string) {
        registerDecorator({
            constraints: [],
            options: validationOptions,
            propertyName,
            target: object.constructor,
            validator: IsStartDateBeforeEndDateConstraint,
        });
    };
}
