package com.zsElectric.boot.charging.vo;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

@Data
@Accessors(chain = true)
@Schema(description = "充电桩价格策略响应VO")
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
public class ChargingPricePolicyVO {

    @Schema(description = "设备业务序列号", example = "123456789123456789123456789")
    @JsonProperty("EquipBizSeq")
    private String EquipBizSeq;

    @Schema(description = "充电桩ID", example = "TEST0000901_1")
    @JsonProperty("ConnectorID")
    private String ConnectorID;

    @Schema(description = "成功状态(0-成功,1-失败)", example = "0")
    @JsonProperty("SuccStat")
    private Integer SuccStat;

    @Schema(description = "失败原因(0-无错误)", example = "0")
    @JsonProperty("FailReason")
    private Integer FailReason;

    @Schema(description = "总时段数", example = "3")
    @JsonProperty("SumPeriod")
    private Integer SumPeriod;

    @Schema(description = "价格策略信息列表")
    @JsonProperty("PolicyInfos")
    private List<PolicyInfo> PolicyInfos;

    @Data
    @Accessors(chain = true)
    @Schema(description = "价格策略信息")
    @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
    public static class PolicyInfo {

        @Schema(description = "时段开始时间(HHmmss格式)", example = "000000")
        @JsonProperty("StartTime")
        private String StartTime;

        @Schema(description = "电价(元/度)", example = "0.7")
        @JsonProperty("ElecPrice")
        private BigDecimal ElecPrice;

        @Schema(description = "服务费(元/度)", example = "1.0")
        @JsonProperty("ServicePrice")
        private BigDecimal ServicePrice;

        @Schema(description = "时段标志(平台扩展字段,1-尖,2-峰,3-平,4-谷)", example = "1")
        @JsonProperty("PeriodFlag")
        private Integer PeriodFlag;
    }
}