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 = "assets")
@CompoundIndexes({
        @CompoundIndex(name = "logDay_userGuid_idx", def = "{'logDay': 1, 'userGuid': 1}", background = true),
        @CompoundIndex(name = "logDay_idx", def = "{'logDay': 1}", background = true)
})
public class SnapshotLogInfo extends LogInfoBase{
    @Indexed
    private String logDay;
    private String accountId;
    @Indexed
    private String userGuid;
    private String userNickname;
    private Double gold;
    private Double sapphire;
    private Double calium;
    private Double ruby;
    private Integer item_11570001;
    private Integer item_11570002;
    private Integer item_13080002;
    private Integer item_13080004;
    private Integer item_13080005;
    private Integer item_13080006;
    private Integer item_13080007;
    private Integer item_13080008;
    private Integer item_13080009;
    private LocalDateTime lastLogoutTime;

    public SnapshotLogInfo(String logDay,
                           String accountId,
                           String userGuid,
                           String userNickname,
                           Double gold,
                           Double sapphire,
                           Double calium,
                           Double ruby,
                           Integer item_11570001,
                           Integer item_11570002,
                           Integer item_13080002,
                           Integer item_13080004,
                           Integer item_13080005,
                           Integer item_13080006,
                           Integer item_13080007,
                           Integer item_13080008,
                           Integer item_13080009,
                           LocalDateTime lastLogoutTime

    ) {
        super(StatisticsType.SNAPSHOT);

        this.logDay = logDay;
        this.accountId = accountId;
        this.userGuid = userGuid;
        this.userNickname = userNickname;
        this.gold = gold;
        this.sapphire = sapphire;
        this.calium = calium;
        this.ruby = ruby;
        this.item_11570001 = item_11570001;
        this.item_11570002 = item_11570002;
        this.item_13080002 = item_13080002;
        this.item_13080004 = item_13080004;
        this.item_13080005 = item_13080005;
        this.item_13080006 = item_13080006;
        this.item_13080007 = item_13080007;
        this.item_13080008 = item_13080008;
        this.item_13080009 = item_13080009;
        this.lastLogoutTime = lastLogoutTime;
    }

}
