package com.erp.report.dto;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

/**
 * API调用统计请求DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ApiUsageReportRequest {

    @Min(value = 1, message = "页码最小为1")
    @Builder.Default
    private Integer page = 1;

    @Min(value = 1, message = "每页数量最小为1")
    @Max(value = 100, message = "每页数量最大为100")
    @Builder.Default
    private Integer pageSize = 30;

    private String platform;

    private String startDate; // yyyy-MM-dd

    private String endDate; // yyyy-MM-dd

    @Pattern(regexp = "day|platform|pull_type", message = "period必须是: day, platform, pull_type")
    @Builder.Default
    private String period = "day";

    @Pattern(regexp = "asc|desc", message = "trend必须是: asc, desc")
    @Builder.Default
    private String trend = "desc";
}
