package com.crm.rely.backend.core.enums;

/**
 * 卡操作类型
 * @author gao
 * @date 2025/11/4 16:29
 */
public enum CardOperateTypeEnum {
    REGISTER_INFO(1, "注册信息"),
    UPDATE_INFO(2, "修改信息"),
    GET_FACE_AUTH_LINK(3, "获取人脸认证链接"),
    KYC_MANUAL_REVIEW(4, "kyc手动审核"),
    CARD_APPLICATION(5, "开卡申请"),
    CARD_APPROVAL(6, "开卡审批"),
    GET_ACTIVATION_CODE(7, "获取激活码"),
    ACTIVATE_CARD(8, "激活卡"),
    RECHARGE_DEFAULT_AMOUNT(9, "充值默认金额"),
    WITHDRAW_TO_WALLET(10, "出金到钱包"),
    DEPOSIT_TO_WALLET(11, "入金到钱包"),
    CARD_RECHARGE_APPLICATION(12, "卡充值申请"),
    RECHARGE_APPROVAL(13, "充值审批"),
    FREEZE(14, "冻结"),
    UNFREEZE(15, "解冻"),
    UPDATE_PASSWORD(16, "修改密码"),
    MANUAL_UPLOAD_PHOTO(17, "手动上传证件照"),
    DEDUCT_MONEY(18, "扣款"),
    GLOBAL_CREATE_ORDER(19, "创建速汇订单"),
    GLOBAL_ORDER_APPROVAL(20, "速汇订单审核"),
    GLOBAL_ORDER_CANCEL(21, "速汇订单取消"),
    GLOBAL_SUBMIT_DATA(22, "提交补充资料"),
    CARD_CANCEL(23, "销卡"),
    WALLET_WITHDRAWAL_REQUEST(24, "钱包提现申请"),
    WALLET_WITHDRAWAL_APPROVAL(25, "钱包提现审批");

    private final int code;
    private final String description;

    CardOperateTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
    public static CardOperateTypeEnum fromCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (CardOperateTypeEnum operateType : values()) {
            if (operateType.getCode() == code) {
                return operateType;
            }
        }
        return null;
    }

    public static String matchCode(Integer code) {
        CardOperateTypeEnum operateType = fromCode(code);
        return operateType != null ? operateType.getDescription() : "";
    }

}
