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 SellerInfo 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;

    @ApiModelProperty(required = false, value = "拓展参数（自定义信息）")
    private Map<String, Object> bizExtended;

    @Data
    @ApiModel(value = "卖家信息")
    public static class SellerInfo {
        @ApiModelProperty(required = true, value = "商户Id（固定值）")
        private String merchantId;

        @ApiModelProperty(required = true, value = "商户userId（固定值）")
        private String merchantUserId;

        @ApiModelProperty(required = true, value = "角色（固定值：super_admin）")
        private String role;

    }

    @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;

    }

}
