package com.liquidnet.service.goblin.param.shouqianba.response.data;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel(value = "收银台查询Data")
@JsonIgnoreProperties(ignoreUnknown = true)
public class CashierQueryData {

    @ApiModelProperty(value = "支付工具列表")
    private List<PayTool> payTools;

    @ApiModelProperty(value = "已选中的支付工具签名")
    private String selectedSignature;

    @ApiModelProperty(value = "全局提示")
    private List<String> globalTips;

    @ApiModelProperty(value = "响应唯一序列号")
    private String seq;

    @ApiModelProperty(value = "收单金额")
    private Long amount;

    @ApiModelProperty(value = "收款方信息")
    private Payee payee;

    @ApiModelProperty(value = "业务信息")
    private BizInfo bizInfo;

    @ApiModelProperty(value = "金额模型")
    private CashierAmount cashierAmount;

    @Data
    @ApiModel(value = "支付工具详情")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class PayTool {
        @ApiModelProperty(value = "支付工具id")
        private Long id;

        @ApiModelProperty(value = "支付工具代码")
        private String code;

        @ApiModelProperty(value = "支付工具名称")
        private String name;

        @ApiModelProperty(value = "支付工具类型 (0表示微信)")
        private Integer type;

        @ApiModelProperty(value = "是否可选")
        private Boolean selectable;

        @ApiModelProperty(value = "是否选中")
        private Boolean selected;

        @ApiModelProperty(value = "展示金额")
        private Long showAmount;

        @ApiModelProperty(value = "提示列表")
        private List<String> tips;

        @ApiModelProperty(value = "金额构成")
        private AmountComposition amountComposition;
    }

    @Data
    @ApiModel(value = "金额构成信息")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class AmountComposition {
        @ApiModelProperty(required = true, value = "金额构成项列表")
        private List<CompositionItem> compositionItems;
    }

    @Data
    @ApiModel(value = "金额构成项详情")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class CompositionItem {
        @ApiModelProperty(required = true, value = "构成项类目")
        private String category;

        @ApiModelProperty(required = true, value = "构成项金额")
        private Long amount;
    }

    @Data
    @ApiModel(value = "收款方信息")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Payee {
        @ApiModelProperty(value = "商户id")
        private String merchantId;

        @ApiModelProperty(value = "商户名称")
        private String merchantName;

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

        @ApiModelProperty(value = "门店名称")
        private String storeName;

        @ApiModelProperty(value = "终端号")
        private String terminalSn;
    }

    @Data
    @ApiModel(value = "业务信息")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class BizInfo {
        @ApiModelProperty(value = "业务方")
        private String bizParty;

        @ApiModelProperty(value = "交易应用")
        private String tradeApp;
    }

    @Data
    @ApiModel(value = "金额明细模型")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class CashierAmount {
        @ApiModelProperty(value = "原始支付金额")
        private Long oriPaymentAmount;

        @ApiModelProperty(value = "实际支付金额")
        private Long discPaymentAmount;

        @ApiModelProperty(value = "优惠金额")
        private Long discAmount;
    }

}
