package com.njcn.gather.tool.parsepqdif.pojo.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel("PQDIF解析响应")
public class PqdifParseResponse {

    @ApiModelProperty("状态")
    private String status;

    @ApiModelProperty("提示信息")
    private String message;

    @ApiModelProperty("文件名")
    private String fileName;

    @ApiModelProperty("native 解析库版本")
    private String nativeVersion;

    @ApiModelProperty("Record 总数")
    private Long recordCount;

    @ApiModelProperty("Observation Record 总数")
    private Long observationCount;

    @ApiModelProperty("每个 Series 返回的样例值数量")
    private Integer sampleValueCount;

    @ApiModelProperty("Record 列表")
    private List<RecordInfoVO> records;

    @ApiModelProperty("Observation 列表")
    private List<ObservationVO> observations;

    @Data
    public static class RecordInfoVO {
        private Long recordIndex;
        private String typeGuid;
        private String typeName;
        private Boolean observation;
    }

    @Data
    public static class ObservationVO {
        private Long recordIndex;
        private String name;
        private Double timeStartExcelDays;
        private String timeStartText;
        private Long channelCount;
        private List<ChannelInfoVO> channels;
    }

    @Data
    public static class ChannelInfoVO {
        private Long channelIndex;
        private String name;
        private Long seriesCount;
        private Long phaseId;
        private String quantityTypeGuid;
        private Long quantityMeasuredId;
        private List<SeriesInfoVO> series;
    }

    @Data
    public static class SeriesInfoVO {
        private Long seriesIndex;
        private Long quantityUnitsId;
        private String quantityCharacteristicGuid;
        private String valueTypeGuid;
        private Long seriesBaseType;
        private Double scale;
        private Double offset;

        /**
         * DATA_SUCCESS / DATA_FAILED
         */
        private String dataStatus;

        /**
         * 数据读取失败原因
         */
        private String dataMessage;

        private Integer valueCount;
        private List<Double> firstValues;
    }
}