package com.gxwebsoft.shop.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 购物车
 *
 * @author 科技小王子
 * @since 2025-01-11 10:45:12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ShopCart对象", description = "购物车")
public class ShopCart 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")
    private Long goodsId;

    @Schema(description = "商品SKU ID")
    private Integer skuId;

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

    @Schema(description = "规格信息，如：颜色:红色|尺寸:L")
    private String specInfo;

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

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

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

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

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

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

    @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 LocalDateTime createTime;

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

}
