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;

/**
 * API调用统计响应DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ApiUsageReportResponse {

    private String period;

    private List<ApiUsageStatItem> list;

    private PaginationInfo pagination;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ApiUsageStatItem {
        // day维度
        private String date;
        // platform/pull_type维度
        private String platformType;
        private String pullType;
        // 统计值
        private Long pullCount;
        private Long totalOrders;
        private Long successCount;
        private Long failedCount;
        private BigDecimal successRate;
    }

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