import { registerDecorator, ValidationOptions } from 'class-validator';
import { IsValidHourCategorizationRuleConstraint } from './isValidHourCategorizationRuleConstraint';

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