
package com.tmerclub.cloud.coupon.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 = "coupon_idx", def = "{'couponId':1}"),
        @CompoundIndex(name = "shop_idx", def = "{'shopId':1}")
})
@Document("coupon_user")
@Data
@ToString
public class MongoCouponUserBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    @Schema(description = "优惠券用户ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long couponUserId;

    @Schema(description = "优惠券ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long couponId;

    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long userId;

    @Schema(description = "店铺id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long shopId;

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

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

    @Schema(description = "领券时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private Date receiveTime;

    @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private Date userStartTime;

    @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private Date userEndTime;

    @Schema(description = "优惠券状态 0:失效 1:有效 2:使用过", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer status;

    @Schema(description = "优惠券是否被删除 0:未删除 1:已删除", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer isDelete;


}
