
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 = "retain_type_idx", def = "{'retainType':1}")
})
@Document("flow_user_retain")
@Data
@ToString
public class FlowUserRetainBO extends BaseModel implements Serializable{

    public static final Integer ID_LENGTH = 5;

    /**
     * id: 日期（yyMM） + retainType
     * 长度：5位
     */
    @Id
    private Integer id;

    /**
     * 留存类型 1: 访问留存  2：成交留存
     */
    private Integer retainType;

    /**
     * 新访问/成交客户数
     */
    private Integer newCustomers;

    /**
     * 第1月留存
     */
    private Integer firstMonthRemain;


    /**
     * 第2月留存
     */
    private Integer secondMonthRemain;

    /**
     * 第3月留存
     */
    private Integer thirdMonthRemain;

    /**
     * 第4月留存
     */
    private Integer fourthMonthRemain;


    /**
     * 第5月留存
     */
    private Integer fifthMonthRemain;

    /**
     * 第6月留存
     */
    private Integer sixthMonthRemain;


    public FlowUserRetainBO() {
        this.newCustomers = 0;
        this.firstMonthRemain = 0;
        this.secondMonthRemain = 0;
        this.thirdMonthRemain = 0;
        this.fourthMonthRemain = 0;
        this.fifthMonthRemain = 0;
        this.sixthMonthRemain = 0;
    }


}
