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 StockReportRequest {

    @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 Long warehouseId;

    @Pattern(regexp = "overview|slow_moving|turnover", message = "type必须是: overview, slow_moving, turnover")
    @Builder.Default
    private String type = "overview";

    @Min(value = 1, message = "呆滞天数最小为1")
    @Max(value = 365, message = "呆滞天数最大为365")
    @Builder.Default
    private Integer slowDays = 30;

    @Pattern(regexp = "quantity|turnover_rate|last_move_at", message = "sort必须是: quantity, turnover_rate, last_move_at")
    @Builder.Default
    private String sort = "quantity";

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