
package com.tmerclub.cloud.group.bo.mongo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * Mongodb拼团团队表
 * @author TRACK
 */
@CompoundIndexes({
        @CompoundIndex(name = "shop_idx", def = "{'shopId':1}"),
        @CompoundIndex(name = "share_user_idx", def = "{'shareUserId':1}"),
        @CompoundIndex(name = "group_spu_idx", def = "{'groupSpuId':1}"),
        @CompoundIndex(name = "group_activity_idx", def = "{'groupActivityId':1}")
})
@Document("group_team")
@Data
@ToString
public class MongoGroupTeamBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "拼团团队id", requiredMode = Schema.RequiredMode.REQUIRED)
    @Id
    private Long groupTeamId;

    @Schema(description = "店铺id")
    private Long shopId;

    @Schema(description = "拼团活动id")
    private Long groupActivityId;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "活动商品Id")
    private Long groupSpuId;

    @Schema(description = "已参团人数")
    private Integer joinNum;

    @Schema(description = "拼团状态(0:待成团，1:拼团中，2:拼团成功，3:拼团失败)")
    private Integer status;

    @Schema(description = "团队订单总额")
    private Long totalPrice;

    @Schema(description = "开始时间（团长支付成功时间）")
    private Date startTime;

    @Schema(description = "剩余时间")
    private Date endTime;

    @Schema(description = "团长user_Id")
    private Long shareUserId;


}
