package com.jeesharp.business.modules.pay.paysubmerchantapplyment.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 特约商户进件展示状态（本地草稿/微信进件态/商户注销终态）。
 *
 * @author jeesharp
 * @since 2026-06-15
 */
@Getter
@AllArgsConstructor
public enum PaySubMerchantApplyStatusEnum {

    /** 商户注销完成（微信 apply-cancel-withdraw 终态 FINISH 回写） */
    SUB_MCH_CANCELLED("SUB_MCH_CANCELLED", "商户已注销");

    private final String value;
    private final String desc;

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

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