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

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data
@Schema(description = "管理后台 - 发票相关操作 Request VO")
public class ErpInvoiceticketSubmitReqDTO {
    @Schema(description = "id,用作bskey", requiredMode = Schema.RequiredMode.REQUIRED)
    private String id;

    @Schema(description = "发票类型;RE-采购发票，RV-销售发票", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "发票类型不能为空")
    @Size(min = 2, max = 2, message = "发票类型必须为2位字符")
    @Pattern(regexp = "^(RE|RV)$", message = "发票类型仅支持RE(采购发票)、RV(销售发票)")
    private String vouchertype;

    @Schema(description = "发票编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "发票编号不能为空")
    @Size(min = 1, max = 10, message = "发票编号长度不能超过10位")
    private String voucherno;

    @Schema(description = "会计年度;发票类型为RE(采购发票)时必填，格式为4位数字（如2025）")
    @Pattern(regexp = "^\\d{4}$", message = "会计年度必须为4位数字（如2025）")
    private String voucheryear;
}
