package com.jeequan.jeepay.pay.ctrl.channel.alipay.model.response;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/*
* 支付宝SPI  账单流水返回对象
*
* @author zx
*
* @date 2023/3/7 10:35
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class AlipaySpiBilldetailQueryResponse extends SpiBaseResponse {

    /** 账单总数量**/
    @JSONField(name = "total_size")
    private String totalSize;

    /** 商家实收总金额（单位：元），精确到小数点后两位 **/
    @JSONField(name = "order_list")
    private List<Order> orderList;

    @Data
    public static class Order {
        /** PAY|REFUND : 已支付 |已退款类型**/
        @JSONField(name = "order_type")
        private String orderType;

        /** 商户外部订单号**/
        @JSONField(name = "merchant_order_no")
        private String merchantOrderNo;

        /** ISV服务商内部订单号**/
        @JSONField(name = "isv_order_no")
        private String isvOrderNo;

        /** 支付通道订单号**/
        @JSONField(name = "channel_order_no")
        private String channelOrderNo;

        /** 商户外部退款单号**/
        @JSONField(name = "merchant_refund_no")
        private String merchantRefundNo;

        /** ISV服务商内部退款订单号**/
        @JSONField(name = "isv_refund_no")
        private String isvRefundNo;

        /** 支付通道退款单号**/
        @JSONField(name = "channel_refund_no")
        private String channelRefundNo;

        /** 支付类型，001：支付宝，002：微信，007：银联二维码 100：自动识别类型等识别类型等**/
        @JSONField(name = "channel_type")
        private String channelType;

        /** 支付订单金额，单位元，精确到小数点后2位 (REFUND |PAY状态时必填）**/
        @JSONField(name = "total_amount")
        private String totalAmount;

        /** 实收金额，单位元，精确到小数点后2位 (PAY状态必填）**/
        @JSONField(name = "receipt_amount")
        private String receiptAmount;

        /** 买家付款金额，单位元，精确到小数点后2位（PAY状态必填）**/
        @JSONField(name = "buyer_pay_amount")
        private String buyerPayAmount;

        /** 商家退款金额，单位元，精确到小数点后2位（REFUND 状态必填）**/
        @JSONField(name = "refund_amount")
        private String refundAmount;

        /** Pay时，代表支付完成时间；refund时，代表退款时间。格式：yyyy-MM-dd HH:mm:ss，需填写UTC时间**/
        @JSONField(name = "order_time")
        private String orderTime;

        /** 收银终端设备序列号**/
        @JSONField(name = "terminal_id")
        private String terminalId;

        /** 交易概述**/
        @JSONField(name = "subject")
        private String subject;
    }

}
