package com.zt.plat.module.api.dto.unitconversion;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import java.util.List;

/**
 * 批量单位转换响应 DTO
 * 用于Feign远程调用
 *
 * @author ZT
 */
@Schema(description = "RPC 服务 - 批量单位转换 Response DTO")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BatchUnitConvertRespDTO {

    @Schema(description = "转换结果列表")
    private List<UnitConvertResultItem> results;

    @Schema(description = "成功数量", example = "10")
    private Integer successCount;

    @Schema(description = "失败数量", example = "0")
    private Integer failureCount;

    @Schema(description = "总数量", example = "10")
    private Integer totalCount;

    /**
     * 转换结果项
     */
    @Schema(description = "转换结果项")
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class UnitConvertResultItem {

        @Schema(description = "是否成功", example = "true")
        private Boolean success;

        @Schema(description = "转换结果(成功时返回)")
        private UnitConvertRespDTO data;

        @Schema(description = "错误信息(失败时返回)", example = "找不到转换规则")
        private String errorMessage;

        @Schema(description = "原始请求")
        private UnitConvertReqDTO request;
    }
}
