package com.ai.da.model.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.Pattern;

@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "查询affiliate列表")
public class AffiliateQueryDTO extends TimeQueryBaseDTO{
    @Schema(description = "Active（活跃） || Inactive（过期） || Pending（待审批） || Refused(拒绝)")
    private String status;

    @Schema(description = "推广者id")
    private Long affiliateId;

    @Pattern(regexp = "id|createTime|totalIncome|", message = "允许排序字段只有id|createTime|totalIncome")
    @Schema(description = "目前允许按id, createTime, totalIncome进行排序")
    private String orderBy = "id";

    @Schema(description = "按时间 DESC 降序 || ASC 升序")
    private String order = "ASC";

    @Override
    public String toString() {
        return "AffiliateQueryDTO{" +
                "status='" + status + '\'' + ' ' +
                "startTime='" + super.getStartTime() + '\'' + ' ' +
                "endTime='" + super.getEndTime() + '\'' + ' ' +
                "page='" + super.getPage() + '\'' + ' ' +
                "size='" + super.getSize() + '\'' + ' ' +
                '}';
    }
}
