package com.jeesharp.business.modules.finance.merchantsettle.dto;

import com.jeesharp.framework.pojo.dto.BaseSaveDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 商户结算配置保存请求 DTO，用于后台新增或更新。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商户结算配置保存请求")
public class MerchantSettleConfigSaveDTO extends BaseSaveDTO {

    @NotBlank(message = "商户租户ID不能为空")
    @Schema(description = "商户租户ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private String merchantTenantId;

    @NotBlank(message = "结算模式不能为空")
    @Schema(description = "结算模式：PLATFORM_COLLECT、WECHAT_PROFIT_SHARING", requiredMode = Schema.RequiredMode.REQUIRED)
    private String settleMode;

    @NotNull(message = "佣金比例不能为空")
    @DecimalMin(value = "0", message = "佣金比例不能小于0")
    @DecimalMax(value = "1", message = "佣金比例不能大于1")
    @Schema(description = "平台佣金比例（0~1）", requiredMode = Schema.RequiredMode.REQUIRED)
    private BigDecimal commissionRate;

    @Schema(description = "微信特约子商户号（冗余）")
    private String subMchId;

    @NotNull(message = "状态不能为空")
    @Schema(description = "状态：0-禁用 1-启用", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer status;

    @Schema(description = "备注")
    private String remarks;
}
