package com.izouma.jiashanxia.domain;

import com.izouma.jiashanxia.converter.StringArrayConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Convert;
import java.math.BigDecimal;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel("零食")
public class Snack extends BaseEntity {
    private String name;

    private BigDecimal amount;

    @ApiModelProperty(value = "库存")
    private long inventory;

    @ApiModelProperty(value = "套餐标签")
    @Convert(converter = StringArrayConverter.class)
    private List<String> tag;

    @ApiModelProperty(value = "图")
    @Column(columnDefinition = "TEXT")
    @Convert(converter = StringArrayConverter.class)
    private List<String> img;

    private String content;

    @ApiModelProperty(value = "是否单独分销")
    private boolean separateDistribution;

    @ApiModelProperty(value = "108将奖励比例")
    private BigDecimal generalRatio;

    @ApiModelProperty(value = "创客奖励比例")
    private BigDecimal makerRatio;

    @ApiModelProperty(value = "直推奖励比例")
    private BigDecimal personalRatio0;

    @ApiModelProperty(value = "间推奖励比例")
    private BigDecimal personalRatio1;
}
