# SaveAdjDTO.java

    package cloud.wconnect.finance.pojo.dto.chargeback;

    import cloud.wconnect.commonlib.annotation.validator.DigitsCustom;
    import jakarta.validation.constraints.DecimalMin;
    import lombok.Data;
    import org.hibernate.validator.constraints.Length;
    import org.hibernate.validator.constraints.Range;

    import jakarta.validation.constraints.NotBlank;
    import jakarta.validation.constraints.NotNull;

    import java.math.BigDecimal;

    /**
     * DTO: Save Adj
     *
     * @author yyt
     * 2023/9/1
     */
    @Data
    public class SaveAdjDTO {

        /**
         * id
         */
        private Long cbAdjId;

        /**
         * 类型：1:Manual Created 2:Bind
         */
        @NotNull(message = "the type must not be null")
        @Range(min = 1, max = 2, message = "the type must in [1:Manual Created 2:Bind]")
        private Integer type;

        /**
         * 调账功能编号
         * 新增-手动创建：为空
         * 新增-绑定：非空
         * 修改：非空
         */
        private String adjNumber;

        /**
         * 责任选项：1:N/A 2:employee`s name
         */
        @NotNull(message = "the mistakeType must not be null")
        @Range(min = 1, max = 2, message = "the mistakeType must in [1:N/A 2:employee`s name]")
        private Integer mistakeType;

        /**
         * 责任描述/员工姓名（根据责任选项决定）
         */
        @NotBlank(message = "the mistakeBy must not be blank")
        @Length(max = 500, message = "the mistakeBy max length is 500")
        private String mistakeBy;

        /**
         * Revenue lost (yes / no)
         */
        @NotNull(message = "the revenueLost must not be null")
        private Boolean revenueLost;

        /**
         * 备注
         */
        @NotNull(message = "the comment must not be null")
        @Length(max = 500, message = "the comment max length is 500")
        private String comment;

        /**
         * 附件
         */
        @NotNull(message = "the attachments must not be null")
        private String attachments;

        /**
         * adjustment的trxCode
         */
        @NotBlank(message = "the trxCode must not be blank")
        @Length(max = 50, message = "the trxCode max length is 50")
        private String trxCode;

        /**
         * adjustment的trxDesc
         */
        @NotBlank(message = "the trxDesc must not be blank")
        @Length(max = 255, message = "the trxDesc max length is 255")
        private String trxDesc;

        /**
         * PMS的trxCode
         */
        @NotBlank(message = "the trxCodePms must not be blank")
        @Length(max = 50, message = "the trxCodePms max length is 50")
        private String trxCodePms;

        /**
         * PMS的trxDesc
         */
        @NotBlank(message = "the trxDescPms must not be blank")
        @Length(max = 255, message = "the trxDescPms max length is 255")
        private String trxDescPms;

        /**
         * 调整金额
         */
        @NotNull(message = "the disputeAmount must not be null")
        @DecimalMin(value = "0", message = "The disputeAmount must be greater than 0")
        @DigitsCustom(integer = 8, message = "The disputeAmount is wrong format")
        private BigDecimal disputeAmount;

    }