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

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

import java.util.List;

@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 CommonRequest.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 = "退款信息")
    @AllArgsConstructor
    @NoArgsConstructor
    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;

    }

}
