package com.ym.mec.biz.dal.entity;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.ym.mec.common.enums.BaseEnum;

public class LuckDrawPrize {

	public enum ActiveRewardType implements BaseEnum<String, ActiveRewardType> {

		/** 优惠券 */
		COUPON("优惠券"),
		/** 积分 */
		POINTS("积分"),
		/** 现金 */
		CASH("现金"),
		/** 抽奖 */
		LUCK_DRAW("抽奖"),
		/** 其他 */
		OTHER("其他");

		private String description;

		private ActiveRewardType(String description) {
			this.description = description;
		}

		public String getDescription() {
			return description;
		}

		@Override
		public String getCode() {
			return this.name();
		}

		public static ActiveRewardType codeOf(String name) {
			for (ActiveRewardType type : ActiveRewardType.values()) {
				if (StringUtils.equals(type.name(), name)) {
					return type;
				}
			}
			return null;
		}
	}

	private Integer id;

	private String name;

	private Double chances;

	private Integer stock;

	private Boolean enabled;

	private ActiveRewardType rewardType;

	private String memo;

	private Date createOn;

	private Date modifyOn;

	private Integer groupId;
	
	private Boolean isDefault;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}

	public Double getChances() {
		return chances;
	}

	public void setChances(Double chances) {
		this.chances = chances;
	}

	public Integer getStock() {
		return stock;
	}

	public void setStock(Integer stock) {
		this.stock = stock;
	}

	public Boolean getEnabled() {
		return enabled;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	public ActiveRewardType getRewardType() {
		return rewardType;
	}

	public void setRewardType(ActiveRewardType rewardType) {
		this.rewardType = rewardType;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Date getCreateOn() {
		return createOn;
	}

	public void setCreateOn(Date createOn) {
		this.createOn = createOn;
	}

	public Date getModifyOn() {
		return modifyOn;
	}

	public void setModifyOn(Date modifyOn) {
		this.modifyOn = modifyOn;
	}

	public Integer getGroupId() {
		return groupId;
	}

	public void setGroupId(Integer groupId) {
		this.groupId = groupId;
	}

	public Boolean getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}
}