package com.yc.ship.module.trade.api.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.List;


@Schema(description = "RPC 服务 - 退款金额计算返回信息 Response DTO")
@Data
@Accessors(chain = true)
public class TradeRefundCalculateRespDTO {

    private Long orderId;
    @Schema(description = "退款金额")
    private BigDecimal refundAmount;
    @Schema(description = "手续费")
    private BigDecimal fee;
    @Schema(description = "退款原始金额")
    private BigDecimal originRefundAmount;
    @Schema(description = "最大可退款金额")
    private BigDecimal maxRefundAmount;
    @Schema(description = "退款项列表")
    private List<RefundItem> refundItemList;

    @Schema(description = "退款项")
    @Data
    @Valid
    public static class RefundItem{

        @Schema(description = "订单明细ID", example = "")
        private Long orderDetailId;
        @Schema(description = "券码", example = "")
        private String voucherCode;
        @Schema(description = "退款金额（元）", example = "100")
        private BigDecimal refundAmount;
        @Schema(description = "手续费")
        private BigDecimal fee;
        @Schema(description = "退款原始金额")
        private BigDecimal originRefundAmount;

        @Schema(description = "订单明细子项列表,全部退时为空", example = "")
        private List<RefundSubItem> detailList;

    }

    @Schema(description = "退款子项")
    @Data
    @Valid
    public static class RefundSubItem{

        @Schema(description = "产品ID", example = "")
        private Long orderDetailBaseId;
        @Schema(description = "退款金额（元）", example = "100")
        private BigDecimal refundAmount;
        @Schema(description = "手续费")
        private BigDecimal fee;
        @Schema(description = "退款原始金额")
        private BigDecimal originRefundAmount;

    }
}
