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

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

import java.util.List;

@Data
@Schema(description = "管理后台 - 电子发票冲销请求DTO")
public class ErpElectronicInvoiceReversalReqDTO {
    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
    private String id;

    @Schema(description = "要冲销的发票号；长度10位字符", requiredMode = Schema.RequiredMode.REQUIRED)
    private String billdoc;

    @Schema(description = "冲销过账日期；格式为YYYYMMDD（如20251106）", requiredMode = Schema.RequiredMode.REQUIRED)
    private String postingdate;

    @Schema(description = "冲销原因描述；长度200位字符", requiredMode = Schema.RequiredMode.REQUIRED)
    private String reason;

    @Schema(description = "不开具电子发票；X-不开票；长度1位字符")
    private String no_invoicing;

    @Schema(description = "红冲原因枚举值；no_invoicing为空时必填；枚举值：开票有误、销货退回、服务终止、销售折让；长度20位字符", requiredMode = Schema.RequiredMode.REQUIRED)
    private String reversal_reason;

    @Schema(description = "冲销相关附件列表", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<InvoiceReversalFileData> filedata;

    @Data
    @Schema(description = "冲销附件信息")
    public static class InvoiceReversalFileData {

        @Schema(description = "文件名；必须带文件后缀名；长度200位字符", requiredMode = Schema.RequiredMode.REQUIRED)
        private String filename;

        @Schema(description = "文件内容；BASE64编码", requiredMode = Schema.RequiredMode.REQUIRED)
        private String filect;
    }
}
