package com.heyu.api.baidu.response.financial;


import com.fasterxml.jackson.annotation.JsonProperty;
import com.heyu.api.baidu.response.BBaseResp;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * https://console.bce.baidu.com/support/?_=1740575657628&timestamp=1740577362983#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E8%B4%A2%E5%8A%A1%E7%A5%A8%E6%8D%AEOCR&api=rest%2F2.0%2Focr%2Fv1%2Finvoice&method=post
 *
 * 通用机打发票识别
 */
@NoArgsConstructor
@Data
public class BInvoiceResp  extends BBaseResp {


    @JsonProperty("log_id")
    private Long logId;
    @JsonProperty("direction")
    private Integer direction;
    @JsonProperty("words_result_num")
    private Integer wordsResultNum;
    @JsonProperty("words_result")
    private WordsResultDTO wordsResult;

    @NoArgsConstructor
    @Data
    public static class WordsResultDTO {
        @JsonProperty("City")
        private String city;
        @JsonProperty("InvoiceNum")
        private String invoiceNum;
        @JsonProperty("SellerName")
        private String sellerName;
        @JsonProperty("IndustrySort")
        private String industrySort;
        @JsonProperty("Province")
        private String province;
        @JsonProperty("CommodityAmount")
        private List<CommodityAmountDTO> commodityAmount;
        @JsonProperty("InvoiceDate")
        private String invoiceDate;
        @JsonProperty("PurchaserName")
        private String purchaserName;
        @JsonProperty("CommodityNum")
        private List<?> commodityNum;
        @JsonProperty("InvoiceCode")
        private String invoiceCode;
        @JsonProperty("CommodityUnit")
        private List<?> commodityUnit;
        @JsonProperty("SheetNum")
        private String sheetNum;
        @JsonProperty("PurchaserRegisterNum")
        private String purchaserRegisterNum;
        @JsonProperty("Time")
        private String time;
        @JsonProperty("CommodityPrice")
        private List<?> commodityPrice;
        @JsonProperty("AmountInFiguers")
        private String amountInFiguers;
        @JsonProperty("AmountInWords")
        private String amountInWords;
        @JsonProperty("CheckCode")
        private String checkCode;
        @JsonProperty("TotalTax")
        private String totalTax;
        @JsonProperty("InvoiceType")
        private String invoiceType;
        @JsonProperty("SellerRegisterNum")
        private String sellerRegisterNum;
        @JsonProperty("CommodityName")
        private List<CommodityNameDTO> commodityName;

        @NoArgsConstructor
        @Data
        public static class CommodityAmountDTO {
            @JsonProperty("word")
            private String word;
            @JsonProperty("row")
            private String row;
        }

        @NoArgsConstructor
        @Data
        public static class CommodityNameDTO {
            @JsonProperty("word")
            private String word;
            @JsonProperty("row")
            private String row;
        }
    }
}
