package com.yc.ship.module.trade.controller.admin.order.vo.refund;


import com.yc.ship.module.trade.api.dto.TradeRefundCreateReqDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

@Schema(description = "交易退款创建 Request VO")
@Data
public class TradeRefundCreateReqVO {

    @Schema(description = "退款方式0正常退票 1强制退票", example = "")
    @NotNull(message = "退款方式不能为空")
    private Integer refundMethod;

    @Schema(description = "退款类型，0退单 1退票 2退子票", example = "")
    @NotNull(message = "退款类型不能为空")
    private Integer refundType;

    @Schema(description = "退款归还类型0原路返回 1线下退款，默认0", example = "")
    private Integer refundBackType;

    @Schema(description = "退款渠道", example = "")
//    @InEnum(value = RefundChannelEnum.class,message = "退款渠道不正确")
    private Integer refundChannel;

    @Schema(description = "退款订单列表，退款类型 0时必填", example = "")
    private List<RefundOrderInfo> orderInfoList;

    @NotNull(message = "退款金额")
    private BigDecimal refundAmount;

    @Schema(description = "手续费")
    private BigDecimal fee;

    @Schema(description = "退款原始金额")
    private BigDecimal originRefundAmount;

    @Schema(description = "退款用户，平台退款时为分销商ID，旅行社端退款时为售票员、会员ID", example = "")
    private Long refundUser;

    @Schema(description = "退款原因", example = "")
    private String refundReason;

    @Schema(description = "忽略平台退款", example = "")
    private boolean ignorePlatRefund;

    @Schema(description = "退款项列表，退款类型 1退票 2退子票必填", example = "")
    private List<TradeRefundCreateReqDTO.RefundItem> refundItemList;

    @Data
    public static class RefundOrderInfo{
        private Long orderId;
        private String orderNo;

//        @NotNull(message = "退款金额")
        private BigDecimal refundAmount;
        @Schema(description = "手续费")
        private BigDecimal fee;
        @Schema(description = "退款原始金额")
        private BigDecimal originRefundAmount;
    }

    @Schema(description = "会员ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long memberId;
}
