
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 = "user_idx", def = "{'userId':1}"),
        @CompoundIndex(name = "shop_idx", def = "{'shopId':1}"),
        @CompoundIndex(name = "group_activity_idx", def = "{'groupActivityId':1}")
})
@Document("group_order")
@Data
@ToString
public class MongoGroupOrderBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    @Schema(description = "拼团订单id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long groupOrderId;

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

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

    @Schema(description = "拼团团队id")
    private Long groupTeamId;

    @Schema(description = "user_id(当user_id为0时标识为机器人)")
    private Long userId;

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

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

    @Schema(description = "身份标识(0:成员  1:团长)")
    private Integer identityType;

    @Schema(description = "活动商品金额")
    private Long activityProdPrice;

    @Schema(description = "支付金额")
    private Long payPrice;

    @Schema(description = "订单编号")
    private Long orderId;

    @Schema(description = "状态(0:待支付、1:支付成功、-1:失效)")
    private Integer status;

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


}
