package com.huimv.employment.service.settlement.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Schema(description = "订单开票归档信息")
public class OrderInvoiceResponse {

    @JsonProperty("order_id")
    private Long orderId;

    @JsonProperty("order_no")
    private String orderNo;

    @JsonProperty("settlement_id")
    private Long settlementId;

    @JsonProperty("current_step_code")
    private String currentStepCode;

    @JsonProperty("invoice_status")
    private String invoiceStatus;

    @JsonProperty("invoice_type")
    @Schema(description = "vat_special / vat_normal")
    private String invoiceType;

    @JsonProperty("invoice_type_text")
    private String invoiceTypeText;

    @JsonProperty("tax_rate")
    private BigDecimal taxRate;

    @JsonProperty("billable_amount")
    @Schema(description = "可开票金额")
    private BigDecimal billableAmount;

    @JsonProperty("invoiced_amount")
    @Schema(description = "已开票金额")
    private BigDecimal invoicedAmount;

    @JsonProperty("pending_amount")
    @Schema(description = "待开票金额")
    private BigDecimal pendingAmount;

    @JsonProperty("invoice_amount")
    @Schema(description = "开票金额（不含税）")
    private BigDecimal invoiceAmount;

    @JsonProperty("tax_amount")
    private BigDecimal taxAmount;

    @JsonProperty("total_with_tax")
    @Schema(description = "价税合计")
    private BigDecimal totalWithTax;

    @JsonProperty("company_name")
    private String companyName;

    @JsonProperty("credit_code")
    private String creditCode;

    @JsonProperty("bank_account_info")
    private String bankAccountInfo;

    @JsonProperty("invoice_no")
    private String invoiceNo;

    @JsonProperty("tax_voucher_no")
    private String taxVoucherNo;

    @JsonProperty("files")
    private List<DownloadFile> files = new ArrayList<>();

    @JsonProperty("compliance_tip")
    private String complianceTip;

    @JsonProperty("archived_at")
    private LocalDateTime archivedAt;

    private String message;

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Long getSettlementId() {
        return settlementId;
    }

    public void setSettlementId(Long settlementId) {
        this.settlementId = settlementId;
    }

    public String getCurrentStepCode() {
        return currentStepCode;
    }

    public void setCurrentStepCode(String currentStepCode) {
        this.currentStepCode = currentStepCode;
    }

    public String getInvoiceStatus() {
        return invoiceStatus;
    }

    public void setInvoiceStatus(String invoiceStatus) {
        this.invoiceStatus = invoiceStatus;
    }

    public String getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(String invoiceType) {
        this.invoiceType = invoiceType;
    }

    public String getInvoiceTypeText() {
        return invoiceTypeText;
    }

    public void setInvoiceTypeText(String invoiceTypeText) {
        this.invoiceTypeText = invoiceTypeText;
    }

    public BigDecimal getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(BigDecimal taxRate) {
        this.taxRate = taxRate;
    }

    public BigDecimal getBillableAmount() {
        return billableAmount;
    }

    public void setBillableAmount(BigDecimal billableAmount) {
        this.billableAmount = billableAmount;
    }

    public BigDecimal getInvoicedAmount() {
        return invoicedAmount;
    }

    public void setInvoicedAmount(BigDecimal invoicedAmount) {
        this.invoicedAmount = invoicedAmount;
    }

    public BigDecimal getPendingAmount() {
        return pendingAmount;
    }

    public void setPendingAmount(BigDecimal pendingAmount) {
        this.pendingAmount = pendingAmount;
    }

    public BigDecimal getInvoiceAmount() {
        return invoiceAmount;
    }

    public void setInvoiceAmount(BigDecimal invoiceAmount) {
        this.invoiceAmount = invoiceAmount;
    }

    public BigDecimal getTaxAmount() {
        return taxAmount;
    }

    public void setTaxAmount(BigDecimal taxAmount) {
        this.taxAmount = taxAmount;
    }

    public BigDecimal getTotalWithTax() {
        return totalWithTax;
    }

    public void setTotalWithTax(BigDecimal totalWithTax) {
        this.totalWithTax = totalWithTax;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCreditCode() {
        return creditCode;
    }

    public void setCreditCode(String creditCode) {
        this.creditCode = creditCode;
    }

    public String getBankAccountInfo() {
        return bankAccountInfo;
    }

    public void setBankAccountInfo(String bankAccountInfo) {
        this.bankAccountInfo = bankAccountInfo;
    }

    public String getInvoiceNo() {
        return invoiceNo;
    }

    public void setInvoiceNo(String invoiceNo) {
        this.invoiceNo = invoiceNo;
    }

    public String getTaxVoucherNo() {
        return taxVoucherNo;
    }

    public void setTaxVoucherNo(String taxVoucherNo) {
        this.taxVoucherNo = taxVoucherNo;
    }

    public List<DownloadFile> getFiles() {
        return files;
    }

    public void setFiles(List<DownloadFile> files) {
        this.files = files != null ? files : new ArrayList<>();
    }

    public String getComplianceTip() {
        return complianceTip;
    }

    public void setComplianceTip(String complianceTip) {
        this.complianceTip = complianceTip;
    }

    public LocalDateTime getArchivedAt() {
        return archivedAt;
    }

    public void setArchivedAt(LocalDateTime archivedAt) {
        this.archivedAt = archivedAt;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Schema(description = "可下载文件")
    public static class DownloadFile {
        private String code;
        private String name;
        private String url;

        public DownloadFile() {
        }

        public DownloadFile(String code, String name, String url) {
            this.code = code;
            this.name = name;
            this.url = url;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }
}
