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;

@Getter
@Setter
@Document(collection = "currency")
@CompoundIndexes({
        @CompoundIndex(name = "logDay_userGuid_idx", def = "{'logDay': 1, 'userGuid': 1}")
})
public class CurrencyItemLogInfo extends LogInfoBase{
    private String id;
    @Indexed
    private String logDay;
    private String accountId;
    @Indexed
    private String userGuid;
    private String userNickname;
    private String tranId;
    private String action;
    private String logTime;
    private String currencyType;
    private String amountDeltaType;
    private Double deltaAmount;
    private Double currencyAmount;
    private String itemIDs;

    public CurrencyItemLogInfo(String id,
                               String logDay,
                               String accountId,
                               String userGuid,
                               String userNickname,
                               String tranId,
                               String action,
                               String logTime,
                               String currencyType,
                               String amountDeltaType,
                               Double deltaAmount,
                               Double currencyAmount,
                               String itemIDs
    ) {
        super(StatisticsType.CURRENCY);

        this.id = id;
        this.logDay = logDay;
        this.accountId = accountId;
        this.userGuid = userGuid;
        this.userNickname = userNickname;
        this.tranId = tranId;
        this.action = action;
        this.logTime = logTime;
        this.currencyType = currencyType;
        this.amountDeltaType = amountDeltaType;
        this.deltaAmount = deltaAmount;
        this.currencyAmount = currencyAmount;
        this.itemIDs = itemIDs;
    }

}
