package com.bocloud.ims.entity.common;

import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.Generic;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * SKU价格
 * 
 * @author wangyu
 * @version 1.0
 * @since 2020年3月10日
 *
 */
@NoArgsConstructor
@AllArgsConstructor
@Table("sku_price")
public class SkuPrice extends Generic {

	/**
	 * id
	 */
	@Setter
	@Getter
	@PK(PKStrategy.AUTO)
	private Long id;
	/**
	 * 商品sku id
	 */
	@Setter
	@Getter
	@Column("sku_id")
	private Long skuId;
	/**
	 * 计费周期
	 */
	@Setter
	@Getter
	@Column("period")
	private String period;
	/**
	 * 数量
	 */
	@Setter
	@Getter
	@Column("amount")
	private Long amount;
	/**
	 * 单位
	 */
	@Setter
	@Getter
	@Column("unit")
	private String unit;
	/**
	 * 价格
	 */
	@Setter
	@Getter
	@Column("price")
	private BigDecimal price;
	/**
	 * 折扣
	 */
	@Setter
	@Getter
	@Column("discount")
	private BigDecimal discount;
	/**
	 * 计费模式
	 */
	@Setter
	@Getter
	@Column("mode")
	private String mode;
	@Setter
	@Getter
	@Column("gmt_create")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtCreate;
	@Setter
	@Getter
	@Column("gmt_modify")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtModify;
	@Setter
	@Getter
	@Column("creator_id")
	private Long creatorId;
	@Setter
	@Getter
	@Column("mender_id")
	private Long menderId;

}
