package com.ylx.massage.domain.dto;

import lombok.Data;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

@Data
public class DriverFeeDTO {
    @NotNull(message = "商户ID不能为空")
    private Long merchantId;
    /**
     * 模式：1-统一设置，2-按项目设置
     */
    @NotNull(message = "设置模式不能为空")
    private Integer mode;

    private String openId;

    /**
     * 统一设置的值 (当 mode=1 时必填)
     */
    private FeeItem unifiedConfig;

    /**
     * 按项目设置的列表 (当 mode=2 时必填)
     */
    private List<CategoryFeeItem> categoryConfigs;

    @Data
    public static class FeeItem {
        @NotNull(message = "白天免费里程必填")
        private BigDecimal dayFreeKm;
        @NotNull(message = "夜间免费里程必填")
        private BigDecimal nightFreeKm;
    }

    @Data
    public static class CategoryFeeItem {
        @NotNull(message = "分类ID不能为空")
        private Long categoryId;
        @NotNull(message = "分类name不能为空")
        private String categoryName;
        @NotNull(message = "白天免费里程必填")
        private BigDecimal dayFreeKm;
        @NotNull(message = "夜间免费里程必填")
        private BigDecimal nightFreeKm;
    }
}
