package com.seer.teach.mall.request;

import com.seer.teach.common.enums.AfterSaleStatusEnum;
import com.seer.teach.common.enums.AfterSaleWayEnum;
import com.seer.teach.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Set;

@Schema(description = "管理端 - 交易售后分页 Request VO")
@Data
@ToString(callSuper = true)
public class AfterSalePageReq {

    public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss";

    @Schema(name = "页码，从 1 开始", example = "1")
    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码最小值为 1")
    private Integer pageNo;

    @Schema(name = "每页条数，最大值为 100",  example = "10")
    @NotNull(message = "每页条数不能为空")
    @Min(value = 1, message = "每页条数最小值为 1")
    @Max(value = 100, message = "每页条数最大值为 100")
    private Integer pageSize ;

    @Schema(name = "用户编号", example = "1024")
    private Integer userId;

    @Schema(name = "商户编号", example = "1024")
    private Integer merchantUserId;

    @Schema(name = "售后流水号")
    private String afterSaleSn;

    @Schema(name = "售后状态", example = "10")
    @InEnum(value = AfterSaleStatusEnum.class, message = "售后状态必须是 {value}")
    private Integer status;

    @Schema(name = "售后状态", example = "10, 20")
    private Set<Integer> statuses;

    @Schema(name = "售后类型", example = "20")
    private Integer type;

    @Schema(name = "售后方式", example = "10")
    @InEnum(value = AfterSaleWayEnum.class, message = "售后方式必须是 {value}")
    private Integer way;

    @Schema(name = "订单编号", example = "18078")
    private String orderNo;

    @Schema(name = "商品名称")
    private String goodName;

    @Schema(name = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

}