package com.greenorange.promotion.annotation;

import com.greenorange.promotion.model.enums.ProjectStatusEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class ProjectStatusEnumValidator implements ConstraintValidator<ProjectStatusEnumValue, String> {

    @Override
    public void initialize(ProjectStatusEnumValue constraintAnnotation) {

    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return ProjectStatusEnum.getEnumByValue(value) != null;
    }
}
