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;

/**
 * 订单统计请求DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrderReportRequest {

    @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 = 20;

    private String platform;

    private Long shopId;

    private String startDate; // yyyy-MM-dd

    private String endDate; // yyyy-MM-dd

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

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