package com.gxwebsoft.shop.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.gxwebsoft.common.core.constants.BaseConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 秒杀活动
 *
 * @author xm
 * @since 2026-04-22 17:18:17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ShopFlashSaleActivity对象", description = "秒杀活动")
@TableName("shop_flash_sale_activity")
public class ShopFlashSaleActivity implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "秒杀活动编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "秒杀活动名称")
    private String name;

    @Schema(description = "秒杀活动商品")
    private Integer goodsId;

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

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

    @Schema(description = "秒杀活动商品价格")
    private BigDecimal price;

    @Schema(description = "活动状态 0-开启 1-关闭")
    private Integer status;

    @Schema(
            description = "活动开始时间",
            type = "string",
            pattern = BaseConstants.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
            example = "2026-04-01 12:00:00"
    )
    private LocalDateTime startTime;

    @Schema(
            description = "活动结束时间",
            type = "string",
            pattern = BaseConstants.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
            example = "2027-01-01 12:00:00"
    )
    private LocalDateTime endTime;

    @Schema(description = "活动限购数量")
    private Integer saleLimit;

    @Schema(description = "库存")
    private Integer stock;

    @Schema(description = "展示类型，0：普通用户，1：新用户")
    private Integer displayType;

    @Schema(description = "备注")
    private String remark;

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

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

    @Schema(description = "创建者")
    private String creator;

    @Schema(description = "创建时间", pattern = BaseConstants.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime createTime;

    @Schema(description = "更新者")
    private String updater;

    @Schema(description = "更新时间")
    @DateTimeFormat(pattern = BaseConstants.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime updateTime;

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

}
