package com.gxwebsoft.shop.entity;

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

/**
 * 秒杀活动
 *
 * @author 科技小王子
 * @since 2026-06-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ShopSeckill对象", description = "秒杀活动")
public class ShopSeckill implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "秒杀活动ID")
    @TableId(value = "seckill_id", type = IdType.AUTO)
    private Integer seckillId;

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

    @Schema(description = "商品名称")
    @TableField(exist = false)
    private String goodsName;

    @Schema(description = "商品封面图")
    @TableField(exist = false)
    private String goodsImage;

    @Schema(description = "SKU ID（多规格商品时指定SKU）")
    private Integer skuId;

    @Schema(description = "秒杀价格")
    private BigDecimal seckillPrice;

    @Schema(description = "原价")
    @TableField(exist = false)
    private BigDecimal originalPrice;

    @Schema(description = "秒杀库存")
    private Integer seckillStock;

    @Schema(description = "已售数量")
    private Integer soldCount;

    @Schema(description = "每人限购数量")
    private Integer limitPerUser;

    @Schema(description = "活动开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @Schema(description = "活动结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    @Schema(description = "状态：0-未开始 1-进行中 2-已结束")
    private Integer status;

    @Schema(description = "排序号")
    private Integer sortNumber;

    @Schema(description = "是否删除, 0否, 1是")
    @TableLogic
    private Integer deleted;

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

    /** 关联的商品信息（非数据库字段） */
    @Schema(description = "关联商品信息")
    @TableField(exist = false)
    private ShopGoods product;

}
