
package com.tmerclub.cloud.order.dto.app;

import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 申请退款参数
 *
 * @author tmerclub
 */
@Data
@ToString
@Schema(description = "app-申请退款参数")
public class OrderRefundDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "订单号不能为空")
    private Long orderId;

    @Schema(description = "退款单类型（1:整单退款,2:单个物品退款）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "退款单类型不能为空")
    private Integer refundType;

    @Schema(description = "订单项ID(0:为全部订单项)", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long orderItemId;

    @Schema(description = "退货数量(0:为全部订单项)", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer refundCount;

    @Schema(description = "申请类型:1,仅退款,2退款退货", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "申请类型不能为空")
    private Integer applyType;

    @Schema(description = "是否接收到商品(1:已收到,0:未收到)", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否接收到商品不能为空")
    private Integer isReceived;

    @Schema(description = "申请原因(下拉选择)", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "申请原因不能为空")
    private Integer buyerReason;

    @Schema(description = "退款金额", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "退款金额不能为空")
    private Long refundAmount;

    @Schema(description = "手机号码（默认当前订单手机号码）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "手机号码不能为空")
    private String buyerMobile;

    @Schema(description = "申请说明", requiredMode = Schema.RequiredMode.REQUIRED)
    private String buyerDesc;

    @Schema(description = "文件凭证(逗号隔开)", requiredMode = Schema.RequiredMode.REQUIRED)
    private String imgUrls;


    @Schema(description = "选中的赠品orderItemId列表", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<Long> giveawayItemIds;

    @Schema(description = "退款退回的赠品订单项ids")
    private String returnGiveawayIds;

    @Schema(description = "当前退款的实付金额（实付金额减去不退回赠品的金额）")
    private Long refundActualTotal;

    @Hidden
    @Schema(description = "赠品退款数量")
    private Integer giveawayRefundCount;
    @Schema(description = "退款id")
    private Long refundId;

}
