package com.hdkj.lt.modle.dto.recon;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

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

/**
 * 电压结果 (volResult): summary 汇总(1:1) + details 节点详情(1:N).
 */
@Data
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class VolResultDTO {

    @JsonProperty("summary")
    private VolSummaryDTO summary;

    @JsonProperty("details")
    private List<VolDetailDTO> details;

    @Data
    @NoArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class VolSummaryDTO {

        @JsonProperty("_comment")
        private String comment;

        @JsonProperty("vlimit_max")
        private BigDecimal vlimitMax;

        @JsonProperty("vlimit_min")
        private BigDecimal vlimitMin;

        @JsonProperty("load_count")
        private Integer loadCount;

        @JsonProperty("load_count_mvtran")
        private Integer loadCountMvtran;

        @JsonProperty("load_count_mvcustomer")
        private Integer loadCountMvcustomer;

        @JsonProperty("load_count_mvpv")
        private Integer loadCountMvpv;

        @JsonProperty("before")
        private VolExtremesDTO before;

        @JsonProperty("after")
        private VolExtremesDTO after;
    }

    @Data
    @NoArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class VolDetailDTO {

        @JsonProperty("psrID")
        private String psrId;

        @JsonProperty("psrType")
        private String psrType;

        private String name;

        @JsonProperty("loadType")
        private String loadType;

        @JsonProperty("before_U")
        private BigDecimal beforeU;

        @JsonProperty("after_U")
        private BigDecimal afterU;

        @JsonProperty("before_Ulv")
        private BigDecimal beforeUlv;

        @JsonProperty("after_Ulv")
        private BigDecimal afterUlv;

        @JsonProperty("before_P")
        private BigDecimal beforeP;

        @JsonProperty("before_Q")
        private BigDecimal beforeQ;
    }
}