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.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 设备计费配置表
 * </p>
 *
 * @author lijin
 * @since 2023-07-28
 */
public class DeviceChargingConfigDto {

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


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

        @ApiModelProperty(value = "商户id", required = true)
        private List<String> mercCodes;

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

        @ApiModelProperty(value = "设备类型", required = true)
        private List<Integer> deviceTypes;
    }

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

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


        @NotEmpty(message = "设备类型不可为空")
        @ApiModelProperty(value = "设备类型", required = true)
        private List<Integer> deviceTypes;
    }

    @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;

        @ApiModelProperty(value = "佣金;单位：分")
        private Integer extraMoney;

    }

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

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

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

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

        @NotNull(message = "type不能为空")
        @ApiModelProperty(value = "类型", required = true)
        private Integer type;

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


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

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

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

        @NotEmpty(message = "values不能为空")
        @ApiModelProperty(value = "参数值", required = true)
        private List<ConfigValue> configValues;

        @ApiModelProperty(value = "备注")
        private String note;

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

            @NotNull(message = "type不能为空")
            @ApiModelProperty(value = "类型", required = true)
            private Integer type;

            @NotNull(message = "values不能为空")
            @ApiModelProperty(value = "赠送天数/预充金额", required = true)
            private Integer configValue;
        }
    }

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

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

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

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

        @ApiModelProperty(value = "赠送天数/预充金额")
        private Integer configValue;

        @ApiModelProperty(value = "备注")
        private String note;

        @ApiModelProperty(value = "类型")
        private Integer type;

        @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 Integer extraMoney;


    }

    /**
     * 设备管理费配置
     */
    @Data
    @Accessors(chain = true)
    public static class DeviceManagerFeeConfigVO {
        @ApiModelProperty(value = "设备管理费-平台默认配置")
        private List<DeviceManagerFeePlatformVO> dmFeePlatforms;
        @ApiModelProperty(value = "设备管理费-商家自定义费用")
        private List<DeviceManagerFeeMercVO> dmFeeMercs;
    }

    /**
     * 设备管理费-平台默认配置
     */
    @Data
    @Accessors(chain = true)
    public static class DeviceManagerFeePlatformVO {
        @ApiModelProperty(value = "默认赠送年费")
        private Integer defFee;
        @ApiModelProperty(value = "默认赠送天数")
        private Integer defGiveDay;

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


    }

    /**
     * 设备管理费-商家自定义费用
     */
    @Data
    @Accessors(chain = true)
    public static class DeviceManagerFeeMercVO {
        @ApiModelProperty(value = "默认赠送年费")
        private Integer defFee;
        @ApiModelProperty(value = "默认赠送天数")
        private Integer defGiveDay;

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

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

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

        @ApiModelProperty(value = "自定义赠送天数")
        private Integer giveDay;

        @ApiModelProperty(value = "自定义年费")
        private Integer fee;

        @ApiModelProperty(value = "备注")
        private String note;

        @ApiModelProperty(value = "类型")
        private Integer type;

        @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 Integer extraMoney;


    }

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

        @ApiModelProperty(value = "默认赠送年费")
        private Integer defFee;
        @ApiModelProperty(value = "默认赠送天数")
        private Integer defGiveDay;


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

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

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

        @ApiModelProperty(value = "自定义赠送天数")
        private Integer giveDay;

        @ApiModelProperty(value = "自定义年费")
        private Integer fee;

        @ApiModelProperty(value = "备注")
        private String note;

        @ApiModelProperty(value = "类型")
        private Integer type;

        @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;


    }

}
