package com.caliverse.admin.Indicators.entity;

import com.caliverse.admin.logs.Indicatordomain.CurrencyMongoLog;
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;
import java.util.Map;

@Getter
@Setter
@Document(collection = "currency")
@CompoundIndexes({
        @CompoundIndex(name = "logDay_userGuid_idx", def = "{'logDay': 1, 'userGuid': 1}")
})
public class CurrencyLogInfo extends LogInfoBase{
    @Indexed
    private String logDay;
    private String accountId;
    @Indexed
    private String userGuid;
    private String userNickname;
    private Double sapphireAcquired;
    private Double sapphireConsumed;
    private Double sapphireNet;
    private Double goldAcquired;
    private Double goldConsumed;
    private Double goldNet;
    private Double caliumAcquired;
    private Double caliumConsumed;
    private Double caliumNet;
    private Double beamAcquired;
    private Double beamConsumed;
    private Double beamNet;
    private Double rubyAcquired;
    private Double rubyConsumed;
    private Double rubyNet;
    private Integer totalCurrencies;
    private List<CurrencyMongoLog.currency> currencies;

    public CurrencyLogInfo(String logDay,
                           String accountId,
                           String userGuid,
                           String userNickname,
                           Double sapphireAcquired,
                           Double sapphireConsumed,
                           Double sapphireNet,
                           Double goldAcquired,
                           Double goldConsumed,
                           Double goldNet,
                           Double caliumAcquired,
                           Double caliumConsumed,
                           Double caliumNet,
                           Double beamAcquired,
                           Double beamConsumed,
                           Double beamNet,
                           Double rubyAcquired,
                           Double rubyConsumed,
                           Double rubyNet,
                           Integer totalCurrencies,
                           List<CurrencyMongoLog.currency> currencies
    ) {
        super(StatisticsType.CURRENCY);

        this.logDay = logDay;
        this.accountId = accountId;
        this.userGuid = userGuid;
        this.userNickname = userNickname;
        this.sapphireAcquired = sapphireAcquired;
        this.sapphireConsumed = sapphireConsumed;
        this.sapphireNet = sapphireNet;
        this.goldAcquired = goldAcquired;
        this.goldConsumed = goldConsumed;
        this.goldNet = goldNet;
        this.caliumAcquired = caliumAcquired;
        this.caliumConsumed = caliumConsumed;
        this.caliumNet = caliumNet;
        this.beamAcquired = beamAcquired;
        this.beamConsumed = beamConsumed;
        this.beamNet = beamNet;
        this.rubyAcquired = rubyAcquired;
        this.rubyConsumed = rubyConsumed;
        this.rubyNet = rubyNet;
        this.totalCurrencies = totalCurrencies;
        this.currencies = currencies;
    }

}
