package com.erp.dashboard.dto;

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

import java.util.List;

/**
 * Dashboard首页响应DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "Dashboard首页响应")
public class DashboardResponse {

    @Schema(description = "错误码，200表示成功")
    private Integer code;

    @Schema(description = "消息")
    private String message;

    @Schema(description = "数据")
    private DashboardData data;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "Dashboard数据")
    public static class DashboardData {

        @Schema(description = "核心统计卡片")
        private Summary summary;

        @Schema(description = "预警列表")
        private List<AlertDTO> alerts;

        @Schema(description = "近期订单列表")
        private List<RecentOrderDTO> recentOrders;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "统计汇总")
    public static class Summary {

        @Schema(description = "本月订单统计")
        private MonthOrdersDTO monthOrders;

        @Schema(description = "本月API调用统计")
        private MonthApiCallsDTO monthApiCalls;

        @Schema(description = "订单配额")
        private OrderQuotaDTO orderQuota;

        @Schema(description = "API配额")
        private ApiQuotaDTO apiQuota;

        @Schema(description = "云仓统计")
        private CloudWarehouseStatsDTO cloudWarehouse;
    }
}
