package com.erp.report.dto;

import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

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

/**
 * 订单统计响应DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrderReportResponse {

    private String groupBy;

    private List<OrderStatItem> list;

    private PaginationInfo pagination;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class OrderStatItem {
        private String date;          // groupBy=day/month时
        private String month;         // groupBy=month时
        private String platform;      // groupBy=platform/shop时
        private Long shopId;          // groupBy=shop时
        private String shopName;      // groupBy=shop时
        private Long orderCount;
        private BigDecimal totalAmount;
        private BigDecimal goodsAmount;
        private BigDecimal freight;
        private Long completedCount;
        private Long cancelledCount;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PaginationInfo {
        private Integer currentPage;
        private Integer perPage;
        private Long total;
        private Integer lastPage;
    }
}
