package com.erp.order.dto.response;

import lombok.Builder;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Data
@Builder
public class OrderStatisticsResponse {

    /** 订单状态统计 */
    private Map<String, Long> statusStats;

    /** 审核状态统计 */
    private Map<String, Long> auditStats;

    /** 发货状态统计 */
    private Map<String, Long> deliveryStats;

    /** 金额统计 */
    private AmountStats amountStats;

    /** 平台分布统计 */
    private List<PlatformStat> platformStats;

    /** 时间趋势统计 */
    private List<TrendStat> trendStats;

    /** 订单总数 */
    private Long totalOrders;

    /** 日期范围 */
    private DateRange dateRange;

    @Data
    @Builder
    public static class AmountStats {
        private BigDecimal totalGoodsAmount;
        private BigDecimal totalDiscountAmount;
        private BigDecimal totalFreight;
        private BigDecimal totalAmount;
        private BigDecimal avgOrderAmount;
    }

    @Data
    @Builder
    public static class PlatformStat {
        private String platform;
        private Long count;
        private BigDecimal amount;
    }

    @Data
    @Builder
    public static class TrendStat {
        private String dateGroup;
        private Long orderCount;
        private BigDecimal totalAmount;
    }

    @Data
    @Builder
    public static class DateRange {
        private String startDate;
        private String endDate;
    }
}
