package com.caliverse.admin.Indicators.entity;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

@Getter
@Setter
@Document(collection = "userCreate")
@CompoundIndexes({
        @CompoundIndex(name = "logDay_userGuid_idx", def = "{'logDay': 1, 'userGuid': 1}")
})
public class UserCreateLogInfo extends LogInfoBase{
    @Indexed
    private String logDay;
    private String accountId;
    @Indexed
    private String userGuid;
    private String userNickname;
    private LocalDateTime createdTime;

    public UserCreateLogInfo(String logDay, String accountId, String userGuid, String userNickname, LocalDateTime createdTime) {
        super(StatisticsType.USER_CREATE);

        this.logDay = logDay;
        this.accountId = accountId;
        this.userGuid = userGuid;
        this.userNickname = userNickname;
        this.createdTime = createdTime;
    }
}
