package com.caliverse.admin.Indicators.entity;

import com.caliverse.admin.logs.Indicatordomain.ItemMongoLog;
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.util.List;

@Getter
@Setter
@Document(collection = "item")
@CompoundIndexes({
        @CompoundIndex(name = "logDay_userGuid_idx", def = "{'logDay': 1, 'userGuid': 1}")
})
public class ItemLogInfo extends LogInfoBase{
    @Indexed
    private String logDay;
    private String accountId;
    @Indexed
    private String userGuid;
    private String userNickname;
    private Integer totalItems;
    private List<ItemMongoLog.ItemDetail> itemDetails;
    private List<ItemMongoLog.ItemTypeLargeStat> itemTypeLargeStats;

    public ItemLogInfo(String logDay,
                       String accountId,
                       String userGuid,
                       String userNickname,
                       Integer totalItems,
                       List<ItemMongoLog.ItemDetail> itemDetails,
                       List<ItemMongoLog.ItemTypeLargeStat> itemTypeLargeStats
    ) {
        super(StatisticsType.ITEM);

        this.logDay = logDay;
        this.accountId = accountId;
        this.userGuid = userGuid;
        this.userNickname = userNickname;
        this.totalItems = totalItems;
        this.itemDetails = itemDetails;
        this.itemTypeLargeStats = itemTypeLargeStats;
    }

}
