package com.xhpc.order.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.xhpc.evcs.domain.XhpcStatisticsTimeInterval;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ChargeDetails {

    @JsonProperty("DetailStartTime")
    private String detailStartTime;

    @JsonProperty("DetailEndTime")
    private String detailEndTime;

    @JsonProperty("ElecPrice")
    private Double elecPrice = 0.0;

    @JsonProperty("SevicePrice")
    private Double sevicePrice = 0.0;

    @JsonProperty("DetailPower")
    private Double detailPower = 0.0;

    @JsonProperty("DetailElecMoney")
    private Double detailElecMoney = 0.0;

    @JsonProperty("DetailSeviceMoney")
    private Double detailSeviceMoney = 0.0;

    private int idx;

    public ChargeDetails(XhpcStatisticsTimeInterval statistics) {

        this.detailElecMoney = statistics.getPowerPrice().doubleValue();
        this.detailSeviceMoney = statistics.getServicePrice().doubleValue();
        this.elecPrice = statistics.getElecPriceEvcs().doubleValue();
        this.sevicePrice = statistics.getServicePriceEvcs().doubleValue();
        this.detailPower = statistics.getChargingDegree().doubleValue();
        this.detailStartTime = statistics.getStartTimeEvcs();
        this.detailEndTime = statistics.getEndTimeEvcs();
    }

    public ChargeDetails() {

        super();
    }

}
