package cn.superdesk.uniorder.openapi.api._thirdpart.qchjc._dto.accounting;

import cn.superdesk.uniorder.openapi.annotation.GreaterThanZero;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

@NoArgsConstructor
@AllArgsConstructor
@Data
@ToString
public class QchjcSupplierOrderGoodsDto implements Serializable {

    @ApiModelProperty("成功持久化后产生-不必传")
    private Long unifiedOrderGoodsId;

    @ApiModelProperty("三级分类 一级分类 ID")
    private String cateIdLv1;
    @ApiModelProperty("三级分类 一级分类 名称")
    private String cateNameLv1;
    @ApiModelProperty("三级分类 二级分类 ID")
    private String cateIdLv2;
    @ApiModelProperty("三级分类 二级分类 名称")
    private String cateNameLv2;
    @ApiModelProperty("三级分类 三级分类 ID")
    private String cateIdLv3;
    @ApiModelProperty("三级分类 三级分类 名称")
    private String cateNameLv3;

    @ApiModelProperty("商品成本价")
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "金额需大于等于0.00")
    private BigDecimal costPrice;
    @ApiModelProperty("商品方向:1-正单;-1-退单")
    @NotNull(message = "不能为空")
    @Range(min = -1, max = 1, message = "商品方向参数异常，-1-退单、1-正单")
    private Integer    direction;
    @ApiModelProperty("商品名称 别名")
    private String     goodsAlias;
    @ApiModelProperty("商品Id")
    @NotNull(message = "不能为空")
    private String     goodsId;
    @ApiModelProperty("商品名称")
    @NotBlank(message = "不能为空")
    private String     goodsName;
    @ApiModelProperty("其他属性(第三方系统对映统一订单商品字段对映不上时,字段差集作为Json结构体填充)")
    private String     goodsParams;
    @ApiModelProperty("商品类型:1-商品;2-运费;3-杂费;4-赠品;")
    @NotNull(message = "不能为空")
    @Range(min = 1, max = 2, message = "集采商品类型适用 1-商品 2-运费")
    private Integer    goodsType;

    @ApiModelProperty("商户税率 税率 取值(0-100%)")
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "税率需大于等于0.00")
    private BigDecimal merchTaxRate;
    @ApiModelProperty("商户税率 编码")
    @NotNull(message = "不能为空")
    private String     merchTaxCode;
    @ApiModelProperty("商户税率 ID")
    @NotNull(message = "不能为空")
    private String     merchTaxId;

    @ApiModelProperty("平台税率 税率 取值(0-100%)")
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "税率需大于等于0.00")
    private BigDecimal operationTaxRate;
    @ApiModelProperty("平台税率 编码")
    @NotNull(message = "不能为空")
    private String     operationTaxCode;
    @ApiModelProperty("平台税率 ID")
    @NotNull(message = "不能为空")
    private String     operationTaxId;

    @ApiModelProperty("订单号")
    @NotBlank(message = "不能为空")
    private String orderSn;
    @ApiModelProperty("退单号")
    private String refundOrderSn;

    @ApiModelProperty("第三方接口-快照订单商品Id")
    @NotNull(message = "不能为空")
    private String outSnapshotOrderGoodsId;

    @ApiModelProperty("商品数量")
    @NotNull(message = "不能为空")
    @GreaterThanZero(message = "商品数量不能小于等于0")
    private Integer    quantity;
    @ApiModelProperty("商品规格")
    private String     selfOption;
    @ApiModelProperty("商品销售价")
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "金额需大于等于0.00")
    private BigDecimal sellingPrice;
    @ApiModelProperty("商品单位")
    @NotBlank(message = "不能为空")
    private String     unit;

    private static final long serialVersionUID = 1L;
}
