# HotelKpiSettingCalculationDTO.java

    package cloud.wconnect.workperformance.pojo.dto.hotelkpi.old.setting;

    import cloud.wconnect.commonlib.pojo.dto.jsonview.Views;
    import com.fasterxml.jackson.annotation.JsonView;
    import lombok.AllArgsConstructor;
    import lombok.Builder;
    import lombok.Data;
    import lombok.NoArgsConstructor;
    import org.hibernate.validator.constraints.Length;
    import org.hibernate.validator.constraints.Range;

    import jakarta.validation.Valid;
    import jakarta.validation.constraints.NotEmpty;
    import jakarta.validation.constraints.NotNull;
    import java.util.List;

    /**
     * DTO: Hotel KPI Setting Calculation
     *
     * @author zc
     * @date 2024/06/29
     */
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public class HotelKpiSettingCalculationDTO {

        /**
         * 指标类型
         */
        @NotNull(message = "The metricsType cannot be null")
        @Range(min = 1, max = 29, message = "The metricsType must be in [1 - 29]")
        private Integer metricsType;

        /**
         * 是否开启：true: 开启; false: 关闭
         */
        @NotNull(message = "The valueCategory cannot be null")
        @Range(min = 1, max = 2, message = "The valueCategory must be in [1:Actual 2:Target]")
        private Integer valueCategory;

        /**
         * 计算结果是否是百分比: true:是 false:否
         * calculationFactor.size = 1 时，percent = null
         * calculationFactor.size = 2 时，percent != null
         */
        @JsonView(Views.GeneralView.class)
        private Boolean percent;

        /**
         * 计算因子
         */
        @JsonView(Views.GeneralView.class)
        @Valid
        @NotEmpty(message = "The calculationFactor cannot be empty")
        private List<HotelKpiSettingCalculationFactorDTO> calculationFactor;

        /**
         * 除数为0时的显示内容
         * calculationFactor.size = 1 时，dividerZeroContent = null
         * calculationFactor.size = 2 时，dividerZeroContent = 自定义字符串 或 null
         */
        @JsonView(Views.GeneralView.class)
        @Length(max = 20, message = "The dividerZeroContent is limited 20 characters")
        private String dividerZeroContent;
    }