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 SalesReportResponse {

    private String period;

    private SalesSummary summary;

    private List<SalesStatItem> list;

    private PaginationInfo pagination;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SalesSummary {
        private Long totalOrders;
        private BigDecimal totalSales;
        private BigDecimal avgOrderAmount;
        private Long completedCount;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SalesStatItem {
        private String date;          // period=day时
        private String week;           // period=week时
        private String month;          // period=month时
        private Long orderCount;
        private BigDecimal salesAmount;
        private BigDecimal goodsAmount;
        private BigDecimal avgOrderAmount;
        private Long completedCount;
    }

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