package com.jeesharp.business.modules.marketing.couponVerifyLog.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 会员券核销类型枚举，对应 {@code app_member_coupon_verify_log.verify_type}。
 *
 * @author jeesharp
 * @since 2026-06-25
 */
@Getter
@AllArgsConstructor
public enum CouponVerifyTypeEnum {

    /**
     * 线下扫码核销
     */
    OFFLINE_SCAN("OFFLINE_SCAN", "线下扫码核销");

    private final String value;
    private final String desc;

    public static CouponVerifyTypeEnum fromValue(String value) {
        if (value == null) {
            return null;
        }
        for (CouponVerifyTypeEnum e : values()) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        return null;
    }

    public static String getDescByValue(String value) {
        CouponVerifyTypeEnum e = fromValue(value);
        return e != null ? e.getDesc() : "";
    }
}
