package com.zt.plat.module.erp.api.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
@Schema(description = "管理后台 - 发票相关操作 响应 VO")
public class ErpInvoiceticketSubmitRespDTO {
    @Schema(description = "发票过账日期；格式为YYYYMMDD（如20251106）")
    private String postDate;

    @Schema(description = "业务单据号；长度20位字符")
    private String settlementsCode;

    @Schema(description = "状态码；详见《发票状态》表；长度1位字符")
    private String state;

    @Schema(description = "消息文本；生单失败、驳回、过账失败等状态时返回共享端和SAP消息")
    private String reason;

    @Schema(description = "会计凭证编号；已生成会计凭证的情况下返回；长度10位字符")
    private String refDoc;

    @Schema(description = "冲销凭证号；状态为已冲销时返回；长度10位字符")
    private String revDoc;

    @Schema(description = "冲销凭证会计年度；仅RE发票（采购发票）且状态为已冲销时返回；4位数字")
    private String revYear;

    @Schema(description = "冲销凭证过账日期；状态为已冲销时返回；格式为YYYYMMDD（如20251106）")
    private String revDate;

    @Schema(description = "采购发票过账差异明细；仅RE发票（采购发票）且状态为3时返回")
    private List<CallBackSettlementDetail> callBackSettlementDetails;

    /**
     * 采购发票过账差异明细子项
     */
    @Schema(description = "采购发票过账差异明细子项")
    @Data
    public static class CallBackSettlementDetail {

        @Schema(description = "工厂编号")
        private String factoryCode;

        @Schema(description = "物料编号")
        private String materialCode;

        @Schema(description = "物料凭证号")
        private String matDoc;

        @Schema(description = "物料描述")
        private String materialDesc;

        @Schema(description = "差异金额")
        private BigDecimal differenceAmount;
    }
}
