package org.springblade.common.enums;

import lombok.Getter;

/**
 * 优惠券状态枚举
 */
@Getter
public enum TransactionStatusEnum {
	NOT_PAY("未支付", 1),
	PAID("已支付", 2),
	CANCEL("已取消", 3);
	private String name;
	private Integer value;

	TransactionStatusEnum(String name, Integer value) {
		this.name = name;
		this.value = value;
	}

	public static String getNameByValue(Integer value) {
		for (TransactionStatusEnum orderTypeEnum : TransactionStatusEnum.values()) {
			if (orderTypeEnum.value.equals(value)) {
				return orderTypeEnum.getName();
			}
		}
		return "未知";
	}
}
