package com.xy.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xy.utils.PageBean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 设备年费表
 * </p>
 *
 * @author lijin
 * @since 2025-02-28
 */
public class DeviceAnnualFeeDto {

    @Data
    @Accessors(chain = true)
    public static class Check {

        @ApiModelProperty(value = "设备id")
        private Long deviceId;

        @ApiModelProperty(value = "设备sn")
        private String sn;

        @NotBlank(message = "运行环境")
        @ApiModelProperty(value = "运行环境", required = true)
        private String runPlatform;
    }

    @Data
    @Accessors(chain = true)
    public static class Page extends Vo {

        @ApiModelProperty(value = "分页对象", required = true)
        private PageBean page;

        @ApiModelProperty(value = "开始时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime beginTime;

        @ApiModelProperty(value = "结束时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime endTime;

        @ApiModelProperty(value = "商家平台标识")
        private String code;

    }

    @Data
    @Accessors(chain = true)
    public static class SendDeviceInfo {

        @NotEmpty(message = "deviceIds不能为空")
        @ApiModelProperty(value = "设备ID集合", required = true)
        private List<Long> deviceIds;

    }

    @Data
    @Accessors(chain = true)
    public static class Evn {

        @NotNull(message = "deviceId不能为空")
        @ApiModelProperty(value = "设备ID", required = true)
        private Long deviceId;

        @NotNull(message = "type不能为空")
        @ApiModelProperty(value = "类型 1=兴元系统 2=商家系统", required = true)
        private Integer type;

    }

    @Data
    @Accessors(chain = true)
    public static class Vo {

        private Long id;

        @ApiModelProperty(value = "商户id")
        private Long mercId;

        @ApiModelProperty(value = "设备id")
        private Long deviceId;

        @ApiModelProperty(value = "设备类型")
        private Integer deviceType;

        @ApiModelProperty(value = "注册状态")
        private Boolean registerStatus;

        @ApiModelProperty(value = "注册时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime registerTime;

        @ApiModelProperty(value = "过期时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime timeout;

        @ApiModelProperty(value = "运行环境")
        private String runPlatform;

        @ApiModelProperty(value = "首次付费时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime firstTime;

        @ApiModelProperty(value = "创建时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createTime;

        @ApiModelProperty(value = "当前使用")
        private Boolean isThis;

        @ApiModelProperty(value = "年费标准")
        private Integer money;

        @ApiModelProperty(value = "商户名称")
        private String mercName;
    }

}
