package com.liquidnet.service.goblin.param.shouqianba.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Map;

@Data
@ApiModel(value = "券退款请求参数")
public class CouponRefundRequest {

    @ApiModelProperty(required = true, value = "应用ID（收钱吧分配的应用id）")
    private String appid;

    @ApiModelProperty(required = true, value = "卖家信息")
    private CommonRequest.Seller seller;

    @ApiModelProperty(required = true, value = "订单信息")
    private OrderInfo orderID;

    @ApiModelProperty(required = true, value = "申请退款信息不能为空")
    private RefundInfo refundInfo;

    @ApiModelProperty(required = false, value = "退款请求id（${AppCode}+id）")
    private String requestId;

    @ApiModelProperty(required = true, value = "退款来源（固定值：EXTERN）")
    private String requestSource;

    @Data
    @ApiModel(value = "订单信息")
    public static class OrderInfo {
        @ApiModelProperty(required = true, value = "单号（前置操作后拿到）")
        private String sn;

        @ApiModelProperty(required = true, value = "密码（前置操作后拿到）")
        private String signature;

    }

    @Data
    @ApiModel(value = "退款信息")
    public static class RefundInfo {
        @ApiModelProperty(required = true, value = "金额")
        private Long applyAmount;

        @ApiModelProperty(required = true, value = "退款类型（1商品 2金额）")
        private Byte type;

        @ApiModelProperty(required = false, value = "退款明细（商品必填）")
        private List<RefundItem> items;

        @ApiModelProperty(required = true, value = "退款原因")
        private String refundReason;

    }

    @Data
    @ApiModel(value = "退款明细商品")
    public static class RefundItem {
        @ApiModelProperty(required = true, value = "spu")
        private String spuId;

        @ApiModelProperty(required = true, value = "sku")
        private String skuId;

        @ApiModelProperty(required = true, value = "标题")
        private String title;

        @ApiModelProperty(required = true, value = "商品图片")
        private String img;

        @ApiModelProperty(required = true, value = "数量")
        private String quantity;

        @ApiModelProperty(required = false, value = "退款类型（0正常商品 1自定义商品）")
        private Byte type;

    }

}
