package com.neusoft.smart.pos.card.constants;

public enum CardCapitalChangeType {

	//金额变动方式：0:充值 1：消费 2: 退款 3:积分核销 4: 手动修改
	RECHARGE(0, "充值"),
	TRANSACTION(1, "消费"),
	REFUND(2, "退款"),
	WRITE_OFF(3, "积分核销"),
	MODIFY(4, "手动修改"),
	EMPTY(5, "清卡"),
	ACTIVITY_RECHARGE(6, "活动充值"),
	TRANSFER(7, "转账"),
	;

	private Integer code;

	private String value;

	CardCapitalChangeType(Integer code, String value) {
		this.code = code;
		this.value = value;
	}
	
	public Integer getCode() {
		return code;
	}
	
	public String getValue() {
		return value;
	}
	
	public static CardCapitalChangeType getEnumByCode(String enumName, Integer code) {
		for (CardCapitalChangeType dictEnum : CardCapitalChangeType.values()) {
			if (dictEnum.name().startsWith(enumName) && code.equals(dictEnum.getCode())) {
				return dictEnum;
			}
		}
		return null;
	}
}
