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

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 创建并发起退款请求 DTO（售后/运营触发）。
 * <p>非商城业态仅需 {@code bizScene} + {@code bizOrderId} + {@code refundAmount}；
 * {@code payBatchId} 仅商城 {@code MALL_ORDER} 合并支付（多子单同笔微信单）时填写。</p>
 *
 * @author jeesharp
 * @since 2026-06-11
 */
@Data
@Schema(description = "创建退款请求")
public class PayRefundCreateDTO {

    @Schema(description = "业务场景，见 PayRecordBizSceneEnum；商城可省略（默认 MALL_ORDER）")
    private String bizScene;

    @Schema(description = "业务子单主键（酒店/美食等业态必填；商城可与 mallOrderId 二选一）")
    private String bizOrderId;

    @Schema(description = "商城子订单主键（与 bizOrderId 二选一，兼容历史调用）")
    private String mallOrderId;

    @Schema(description = "关联业务单ID（如商城售后单ID）")
    private String afterSaleId;

    @Schema(description = "合并支付批次主键；仅 MALL_ORDER 多子单合单时填写，其他业态勿传")
    private String payBatchId;

    @NotNull(message = "退款金额不能为空")
    @DecimalMin(value = "0.01", message = "退款金额必须大于0")
    @Schema(description = "退款金额（元）", required = true)
    private BigDecimal refundAmount;

    @Schema(description = "退款原因")
    private String reason;

    @Schema(description = "操作人ID")
    private String operatorId;
}
