package com.izouma.dingdong.domain.merchant;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.izouma.dingdong.domain.BaseEntity;
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.*;
import java.io.Serializable;
import java.time.LocalDate;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})
@ApiModel(value = "Sales", description = "销售额表")
public class Sales extends BaseEntity implements Serializable {

    private Long merchantId;

    @ApiModelProperty(value = "商品ID")
    private Long goodsId;

    @ApiModelProperty(value = "日销售数量")
    private Integer daySales;

    @ApiModelProperty(value = "日点赞数")
    private Integer dayLikes;

    @ApiModelProperty(value = "日差评数")
    private Integer dayBad;

    @ApiModelProperty(value = "日期")
    private LocalDate day;

    @ApiModelProperty(value = "好评")
    private Integer praise;

    @ApiModelProperty(value = "人气")
    private Integer popularity;

//    @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.DETACH)
//    @JoinColumn(name = "goodsId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
//    private Goods goods;
}
