package com.erp.tenant.service.report;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.erp.tenant.dto.report.ReportPageResponse;

import java.util.List;
import java.util.Map;
import com.erp.common.core.model.PageResponse;

/**
 * 租户端报表统计服务接口
 */
public interface ReportService {

    // ==================== 订单报表 ====================

    /**
     * 订单统计（按平台/日期）
     */
    IPage<Map<String, Object>> getOrderReport(Long tenantId, String platform, Long shopId,
                                              String startDate, String endDate,
                                              String groupBy, String trend,
                                              int page, int pageSize);

    // ==================== 销售报表 ====================

    /**
     * 销售统计
     */
    ReportPageResponse.SalesReportDTO getSalesSummary(Long tenantId, String platform, Long shopId,
                                                       String startDate, String endDate, String period);

    IPage<Map<String, Object>> getSalesReport(Long tenantId, String platform, Long shopId,
                                               String startDate, String endDate,
                                               String period, String trend,
                                               int page, int pageSize);

    // ==================== 库存报表 ====================

    /**
     * 库存统计概览
     */
    ReportPageResponse.StockReportDTO getStockOverview(Long tenantId, Long warehouseId, Integer slowDays);

    IPage<Map<String, Object>> getSlowMovingReport(Long tenantId, Long warehouseId,
                                                     Integer slowDays, int page, int pageSize);

    IPage<Map<String, Object>> getTurnoverReport(Long tenantId, Long warehouseId,
                                                  int page, int pageSize);

    // ==================== API调用统计 ====================

    IPage<Map<String, Object>> getApiUsageReport(Long tenantId, String platform,
                                                  String startDate, String endDate,
                                                  String period, String trend,
                                                  int page, int pageSize);
}
