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

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

import java.util.List;

@Data
@ApiModel(value = "SqbVoucherStatusDTO", description = "收钱吧券状态推送内容详情")
public class CouponCallbackContent {

    @ApiModelProperty(value = "订单Sn")
    private String orderSn;

    @ApiModelProperty(value = "商城Sn")
    private String mallSn;

    @ApiModelProperty(value = "商户Sn")
    private String merchantSn;

    @ApiModelProperty(value = "门店id")
    private String storeId;

    @ApiModelProperty(value = "券列表信息")
    private List<VoucherItem> voucherList;

    @Data
    @ApiModel("VoucherItem")
    public static class VoucherItem {
        @ApiModelProperty(value = "券号")
        private String voucherNo;

        @ApiModelProperty(value = "类型")
        private String type;

        @ApiModelProperty(value = "券状态 (0未核销, 1已核销, 2未核销退款, 3已核销退款中, 4未核销退款完成, 5已核销退款完成, 6已失效)")
        private Byte targetState;

        @ApiModelProperty(value = "券原状态")
        private Byte sourceState;

        @ApiModelProperty(value = "券名称")
        private String voucherName;

        @ApiModelProperty(value = "操作时间 (yyyy-MM-dd HH:mm:ss)")
        private String operationTime;

        @ApiModelProperty(value = "券对应的商品信息")
        private VoucherProductInfo item;

        @ApiModelProperty(value = "券二维码地址")
        private String qrCodeUrl;

        @ApiModelProperty(value = "券二维码内容")
        private String qrCodeContent;

        @ApiModelProperty(value = "原金额 (单位：分)")
        private Long oriAmount;

        @ApiModelProperty(value = "实收金额 (单位：分)")
        private Long receivedAmount;

        @ApiModelProperty(value = "核销信息 (已核销会有这部分)")
        private RedeemInfo redeemInfo;
    }

    @Data
    @ApiModel("VoucherProductInfo")
    public static class VoucherProductInfo {
        @ApiModelProperty(value = "spuId")
        private Long spuId;

        @ApiModelProperty(value = "skuId")
        private Long skuId;

        @ApiModelProperty(value = "商品标题")
        private String title;

        @ApiModelProperty(value = "商品图片地址")
        private String img;
    }

    @Data
    @ApiModel("RedeemInfo")
    public static class RedeemInfo {
        @ApiModelProperty(value = "操作来源 (如: EXTERN)")
        private String redeemSource;

        @ApiModelProperty(value = "操作appId")
        private String redeemAppId;

        @ApiModelProperty(value = "客户端编码")
        private String redeemClientSn;

        @ApiModelProperty(value = "外部编码 (appId + 请求号)")
        private String redeemExternalOrderSn;

        @ApiModelProperty(value = "操作商户 (userId)")
        private String operatorMerchantId;
    }

}
