package com.gxwebsoft.common.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 购物车
 *
 * @author 科技小王子
 * @since 2024-10-26 10:54:51
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "Cart对象", description = "购物车")
@TableName("sys_cart")
public class Cart implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "购物车表ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "类型 0商城 1应用插件")
    private Integer type;

    @Schema(description = "唯一标识")
    private String code;

    @Schema(description = "项目ID，0 goodId 1 companyId")
    private Long itemId;

    @Schema(description = "商品规格")
    private String spec;

    @Schema(description = "商品价格")
    private BigDecimal price;

    @Schema(description = "购买时长")
    private Integer month;

    @Schema(description = "商品数量")
    private Integer cartNum;

    @Schema(description = "单商品合计")
    private BigDecimal totalPrice;

    @Schema(description = "0 = 未购买 1 = 已购买")
    private Boolean isPay;

    @Schema(description = "是否为立即购买")
    private Boolean isNew;

    @Schema(description = "拼团id")
    private Integer combinationId;

    @Schema(description = "秒杀产品ID")
    private Integer seckillId;

    @Schema(description = "砍价id")
    private Integer bargainId;

    @Schema(description = "是否选中")
    private Boolean selected;

    @Schema(description = "商户ID")
    private Long merchantId;

    @Schema(description = "用户ID")
    private Integer userId;

    @Schema(description = "租户id")
    private Integer tenantId;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Schema(description = "商品描述")
    @TableField(exist = false)
    private String comments;

    @Schema(description = "支付方式")
    @TableField(exist = false)
    private Integer payType;

    @Schema(description = "支付金额")
    @TableField(exist = false)
    private BigDecimal payPrice;

    @Schema(description = "应用列表")
    private List<Company> list;

}
