package com.greenorange.promotion.annotation;

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

public class WithdrawStatusEnumValidator implements ConstraintValidator<WithdrawStatusEnumValue, String> {

    @Override
    public void initialize(WithdrawStatusEnumValue constraintAnnotation) {

    }

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