
package com.tmerclub.cloud.flow.bo;

import com.tmerclub.cloud.common.model.BaseModel;
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.Serializable;


/**
 * 商城用户操作行为统计
 *
 * @author YXF
 * @date 2020-07-13 13:18:33
 */
@CompoundIndexes({
        @CompoundIndex(name = "date_type_type_idx", def = "{'dateType':1, 'type':1}")
})
@Document("flow_user")
@Data
@ToString
public class FlowUserBO extends BaseModel implements Serializable {

    public static final Integer ID_LENGTH = 16;

    /**
     * id: 日期（yyMMdd）+ 时间类型 + 编号
     * 长度：16位
     */
    @Id
    private Long id;

    /**
     * 日、周、月
     */
    private Integer dateType;

    /**
     * 数据类型  0: 所有用户 1：免费用户  2 付费用户
     */
    private Integer type;

    /**
     * 用户数
     */
    private Integer userNum;

    /**
     * 领券用户数
     */
    private Integer receiveCouponUser;

    /**
     * 新增用户数
     */
    private Integer newUserNum;

    /**
     * 支付用户数
     */
    private Integer payUser;

    /**
     * 支付订单数
     */
    private Integer payOrder;

    /**
     * 支付金额
     */
    private Long payAmount;

    public FlowUserBO() {
        this.userNum = 0;
        this.receiveCouponUser = 0;
        this.newUserNum = 0;
        this.payUser = 0;
        this.payOrder = 0;
        this.payAmount = 0L;
    }


}
