
package com.tmerclub.cloud.user.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 客户标签DTO
 *
 * @author YXF
 * @date 2020-12-08 10:16:53
 */
@Data
@ToString
public class UserTagDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 新增标签校验
     */
    public interface AddUserTag {
    }

    /**
     * 修改标签校验
     */
    public interface UpdateUserTag {
    }

    @Schema(description = "自增id")
    @NotNull(message = "自增id不能为空", groups = UpdateUserTag.class)
    private Long userTagId;

    @Schema(description = "标签名字")
    @NotBlank(message = "标签名字不能为空", groups = {AddUserTag.class, UpdateUserTag.class})
    private String tagName;

    @Schema(description = "标签类型0手动1条件")
    @Max(value = 1, message = "只能为0或1", groups = AddUserTag.class)
    @Min(value = 0, message = "只能为0或1", groups = AddUserTag.class)
    @NotNull(message = "标签类型不能为空。", groups = AddUserTag.class)
    private Integer tagType;

    @Schema(description = "系统标签是否开启")
    @Max(value = 1, message = "只能为0或1", groups = UpdateUserTag.class)
    @Min(value = 0, message = "只能为0或1", groups = UpdateUserTag.class)
    private Integer isSysTurnOn;

    @Schema(description = "成为客户开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date registerMinTime;

    @Schema(description = "成为客户结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date registerMaxTime;

    @Schema(description = "清空成为客户时间标记")
    private Boolean clearRegisterTime;

    @Schema(description = "关注开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date subscribeMinTime;

    @Schema(description = "关注结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date subscribeMaxTime;

    @Schema(description = "清空关注时间标记")
    private Boolean clearSubscribeTime;

    @Schema(description = "成为会员开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date toBeMemberMinTime;

    @Schema(description = "成为会员结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date toBeMemberMaxTime;

    @Schema(description = "清空成为会员时间标记")
    private Boolean clearToBeMemberTime;

    @Schema(description = "最近消费时间范围0(不限)1(今天)2(最近7天)3(最近15天)4(最近30天)5(最近45天)6(最近60天)7(最近90天)8(最近180天)")
    @Max(value = 8, message = "最大值为8", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Integer recentPurchaseTime;

    @Schema(description = "清空成为会员时间标记")
    private Boolean clearRecentPurchaseTime;

    @Schema(description = "消费次数时间范围0(不限)1(今天)2(最近7天)3(最近15天)4(最近30天)5(最近45天)6(最近60天)7(最近90天)8(最近180天)")
    @Max(value = 8, message = "最大值为8", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Integer purchaseNumTime;

    @Schema(description = "消费次数最小次数")
    @Max(value = 100000, message = "最大值为100000", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Long purchaseNumMinNum;

    @Schema(description = "消费次数最大次数")
    @Max(value = 100000, message = "最大值为100000", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Long purchaseNumMaxNum;

    @Schema(description = "清空消费次数标记")
    private Boolean clearPurchaseNum;

    @Schema(description = "消费金额时间范围0(不限)1(今天)2(最近7天)3(最近15天)4(最近30天)5(最近45天)6(最近60天)7(最近90天)8(最近180天)")
    @Max(value = 8, message = "最大值为8", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Integer purchaseAmountTime;

    @Schema(description = "消费金额最小金额")
    @DecimalMax(value = "100000000", message = "最大值为100000000", groups = {AddUserTag.class, UpdateUserTag.class})
    @DecimalMin(value = "0", message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private BigDecimal purchaseAmountMinAmount;

    @Schema(description = "消费金额最大金额")
    @DecimalMax(value = "100000000", message = "最大值为100000000", groups = {AddUserTag.class, UpdateUserTag.class})
    @DecimalMin(value = "0", message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private BigDecimal purchaseAmountMaxAmount;

    @Schema(description = "清空消费次数标记")
    private Boolean clearPurchaseAmount;

    @Schema(description = "订单均价时间范围0(不限)1(今天)2(最近7天)3(最近15天)4(最近30天)5(最近45天)6(最近60天)7(最近90天)8(最近180天)")
    @Max(value = 8, message = "最大值为8", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Integer orderAveragePriceTime;

    @Schema(description = "订单均价最小金额")
    @DecimalMax(value = "100000000", message = "最大值为100000000", groups = {AddUserTag.class, UpdateUserTag.class})
    @DecimalMin(value = "0", message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private BigDecimal orderAveragePriceMinAmount;

    @Schema(description = "订单均价最大金额")
    @DecimalMax(value = "100000000", message = "最大值为100000000", groups = {AddUserTag.class, UpdateUserTag.class})
    @DecimalMin(value = "0", message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private BigDecimal orderAveragePriceMaxAmount;

    @Schema(description = "清空订单均价标记")
    private Boolean clearOrderAveragePrice;

    @Schema(description = "充值金额时间范围0(不限)1(今天)2(最近7天)3(最近15天)4(最近30天)5(最近45天)6(最近60天)7(最近90天)8(最近180天)")
    @Max(value = 8, message = "最大值为8", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Integer rechargeAmountTime;

    @Schema(description = "充值金额最小金额")
    @DecimalMax(value = "100000000", message = "最大值为100000000", groups = {AddUserTag.class, UpdateUserTag.class})
    @DecimalMin(value = "0", message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Long rechargeAmountMinAmount;

    @Schema(description = "充值金额最大金额")
    @DecimalMax(value = "100000000", message = "最大值为100000000", groups = {AddUserTag.class, UpdateUserTag.class})
    @DecimalMin(value = "0", message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Long rechargeAmountMaxAmount;

    @Schema(description = "清空充值金额标记")
    private Boolean clearRechargeAmount;

    @Schema(description = "充值次数时间范围0(不限)1(今天)2(最近7天)3(最近15天)4(最近30天)5(最近45天)6(最近60天)7(最近90天)8(最近180天)")
    @Max(value = 8, message = "最大值为8", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Integer rechargeNumTime;

    @Schema(description = "充值次数最小次数")
    @Max(value = 100000, message = "最大值为100000", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Long rechargeNumMinNum;

    @Schema(description = "充值次数最大次数")
    @Max(value = 100000, message = "最大值为100000", groups = {AddUserTag.class, UpdateUserTag.class})
    @Min(value = 0, message = "最小值为0", groups = {AddUserTag.class, UpdateUserTag.class})
    private Long rechargeNumMaxNum;

    @Schema(description = "清空充值次数标记")
    private Boolean clearRechargeNum;

    @Schema(description = "符合标签的人数")
    private Long userNum;

    @Schema(description = "统计更新时间")
    private Date statisticUpdateTime;

}
