package com.erp.tenant.dto.report;

import com.erp.common.core.model.PageResponse;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;
import com.erp.tenant.entity.report.ReportSummary;

/**
 * 报表分页响应DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ReportPageResponse {

    private ReportSummary summary;
    private PageResponse<Object> list;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class SalesReportDTO {
        private String period;
        private Long orderCount;
        private BigDecimal salesAmount;
        private BigDecimal goodsAmount;
        private BigDecimal avgOrderAmount;
        private Long completedCount;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PlatformReportDTO {
        private String platform;
        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 StockReportDTO {
        private Long totalStocks;
        private Integer totalQuantity;
        private Integer totalAvailable;
        private Long lowStockCount;
        private Long outOfStockCount;
        private Long slowMovingCount;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ApiUsageDTO {
        private String platform;
        private Long pullCount;
        private Long totalOrders;
        private Long successCount;
        private Long failedCount;
        private BigDecimal successRate;
    }
}
