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

import io.swagger.v3.oas.annotations.media.Schema;
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")
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;

    public Long getCouponUserId() {
        return couponUserId;
    }

    public void setCouponUserId(Long couponUserId) {
        this.couponUserId = couponUserId;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }

    public Date getUserStartTime() {
        return userStartTime;
    }

    public void setUserStartTime(Date userStartTime) {
        this.userStartTime = userStartTime;
    }

    public Date getUserEndTime() {
        return userEndTime;
    }

    public void setUserEndTime(Date userEndTime) {
        this.userEndTime = userEndTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "MongoCouponUserBO{" +
                "couponUserId=" + couponUserId +
                ", couponId=" + couponId +
                ", userId=" + userId +
                ", shopId=" + shopId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", receiveTime=" + receiveTime +
                ", userStartTime=" + userStartTime +
                ", userEndTime=" + userEndTime +
                ", status=" + status +
                ", isDelete=" + isDelete +
                '}';
    }
}
