package com.caliverse.admin.dynamodb.domain.atrrib;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;

@Setter
@ToString(callSuper = true)
@NoArgsConstructor
@DynamoDbBean
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class CaliumStorageAttrib {
    @JsonProperty("calium_converter_storage")
    private CaliumConverterStorage caliumConverterStorage;

    @JsonProperty("calium_exchanger_storage")
    private CaliumExchangerStorage caliumExchangerStorage;

    @JsonProperty("calium_operator_storage")
    private CaliumOperatorStorage caliumOperatorStorage;

    @JsonProperty("daily_epoch")
    private Integer dailyEpoch;

    @JsonProperty("mis_epoch")
    private Integer misEpoch;

    @JsonProperty("daily_pivot_date")
    private String dailyPivotDate;

    @JsonProperty("daily_rollup_check_date")
    private String dailyRollupCheckDate;

    @DynamoDbAttribute("calium_converter_storage")
    public CaliumConverterStorage getCaliumConverterStorage() {
        return caliumConverterStorage;
    }

    @DynamoDbAttribute("calium_exchanger_storage")
    public CaliumExchangerStorage getCaliumExchangerStorage() {
        return caliumExchangerStorage;
    }

    @DynamoDbAttribute("calium_operator_storage")
    public CaliumOperatorStorage getCaliumOperatorStorage() {
        return caliumOperatorStorage;
    }

    @DynamoDbAttribute("daily_epoch")
    public Integer getDailyEpoch() {
        return dailyEpoch;
    }

    @DynamoDbAttribute("mis_epoch")
    public Integer getMisEpoch() { return misEpoch; }

    @DynamoDbAttribute("daily_pivot_date")
    public String getDailyPivotDate() { return dailyPivotDate; }

    @DynamoDbAttribute("daily_rollup_check_date")
    public String getDailyRollupCheckDate() { return dailyRollupCheckDate; }

    @Setter
    @ToString
    @NoArgsConstructor
    @DynamoDbBean
    @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
    public static class CaliumConverterStorage {
        private Double converterCumulativeCalium;
        private Double converterDailyConvertRate;
        private Double converterDailyFillUpStandardCalium;
        private String converterLastFillUpDate;
        private Double converterTotalCalium;

        @DynamoDbAttribute("converter_cumulative_calium")
        public Double getConverterCumulativeCalium() {
            return converterCumulativeCalium;
        }

        @DynamoDbAttribute("converter_daily_convert_rate")
        public Double getConverterDailyConvertRate() {
            return converterDailyConvertRate;
        }

        @DynamoDbAttribute("converter_daily_fill_up_standard_calium")
        public Double getConverterDailyFillUpStandardCalium() {
            return converterDailyFillUpStandardCalium;
        }

        @DynamoDbAttribute("converter_last_fill_up_date")
        public String getConverterLastFillUpDate() {
            return converterLastFillUpDate;
        }

        @DynamoDbAttribute("converter_total_calium")
        public Double getConverterTotalCalium() {
            return converterTotalCalium;
        }
    }

    @Setter
    @ToString
    @NoArgsConstructor
    @DynamoDbBean
    @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
    public static class CaliumExchangerStorage {
        private Integer exchangerDailyInflationRate;

        @DynamoDbAttribute("exchanger_daily_inflation_rate")
        public Integer getExchangerDailyInflationRate() {
            return exchangerDailyInflationRate;
        }
    }

    @Setter
    @ToString
    @NoArgsConstructor
    @DynamoDbBean
    @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
    public static class CaliumOperatorStorage {
        private Double operatorTotalCalium;
        private Double operatorCalium;
        private String operatorCaliumFillUpDate;

        @DynamoDbAttribute("operator_calium")
        public Double getOperatorCalium() {
            return operatorCalium;
        }

        @DynamoDbAttribute("operator_calium_fill_up_date")
        public String getOperatorCaliumFillUpDate() {
            return operatorCaliumFillUpDate;
        }

        @DynamoDbAttribute("operator_total_calium")
        public Double getOperatorTotalCalium() {
            return operatorTotalCalium;
        }
    }
}

