package com.xy.dto;

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

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

/**
 * <p>
 * 设备类型算法预充配置
 * </p>
 *
 * @author lijin
 * @since 2023-07-10
 */
public class DeviceTypeAlgorithmBeforConfigDto {

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

        @ApiModelProperty(value = "商户编码")
        private List<String> mercCodes;
    }

    @Data
    @Accessors(chain = true)
    public static class DeviceActiveFeeDTO {
        @ApiModelProperty(value = "id")
        private Long id;
        @NotNull(message = "商户ID不可为空")
        @ApiModelProperty(value = "商户id")
        private Long mercId;

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

        @ApiModelProperty(value = "算法id")
        private Long algorithmId;


    }

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

        @ApiModelProperty(value = "字典默认配置")
        private List<DeviceActiveDictVO> deviceActiveDicts;

        @ApiModelProperty(value = "平台给商家定义的配置")
        private List<DeviceActiveMercFeeVO> deviceActiveMercFees;

    }

    /**
     * 平台给商家定义的费用配置
     */
    @Data
    @Accessors(chain = true)
    public static class DeviceActiveMercFeeVO {

        @ApiModelProperty(value = "id")
        private Long id;

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

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

        @ApiModelProperty(value = "算法id")
        private Long algorithmId;

        @ApiModelProperty(value = "算法名称")
        private String algorithmName;

        @ApiModelProperty(value = "预充金额;单位：分")
        private Integer money;

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

        @ApiModelProperty(value = "更新时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updateTime;


        @ApiModelProperty(value = "商户编码")
        private String mercCode;

        @ApiModelProperty(value = "代理商额外收取金额;单位：分")
        private Integer extraMoney;


    }

    /**
     * 字典默认配置
     */
    @Data
    @Accessors(chain = true)
    public static class DeviceActiveDictVO {
        @ApiModelProperty(value = "算法笔数")
        private Integer size;

        @ApiModelProperty(value = "算法id")
        private Long algorithmId;

        @ApiModelProperty(value = "算法名称")
        private String algorithmName;

        @ApiModelProperty(value = "预充金额;单位：分")
        private Integer money;


    }


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

        @NotNull(message = "mercId不能为空")
        @ApiModelProperty(value = "商户id")
        private Long mercId;

        @NotNull(message = "deviceType不能为空")
        @ApiModelProperty(value = "设备类型")
        private Integer deviceType;

        @NotNull(message = "algorithmId不能为空")
        @ApiModelProperty(value = "算法id")
        private Long algorithmId;

        @NotNull(message = "money不能为空")
        @ApiModelProperty(value = "预充金额;单位：分")
        private Integer money;
    }

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

        @NotNull(message = "id不能为空")
        @ApiModelProperty(value = "id")
        private Long id;

        @NotNull(message = "money不能为空")
        @ApiModelProperty(value = "预充金额;单位：分")
        private Integer money;
    }

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

        @NotNull(message = "id不能为空")
        @ApiModelProperty(value = "id")
        private Long id;
    }

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

        @ApiModelProperty(value = "id")
        private Long id;

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

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

        @ApiModelProperty(value = "算法id")
        private Long algorithmId;

        @ApiModelProperty(value = "预充金额;单位：分")
        private Integer money;

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

        @ApiModelProperty(value = "更新时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updateTime;

        @ApiModelProperty(value = "商户编码")
        private String mercCode;

        @ApiModelProperty(value = "代理商额外收取金额;单位：分")
        private Integer extraMoney;


    }

}
