package com.jeeplus.finance.invoice.domain.OMS;

import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * 代收车船税信息子实体类
 * 仅在开具代收车船税特定要素的数电发票（specificFactor为07时）需要传入
 * 且只能有一组，发票明细只能有一行（或一对折扣明细行）
 */
public class VehicleVesselInfo {

    /**
     * 保险单号
     * 必填，最大40字符
     */
    @NotBlank(message = "保险单号policyNo不能为空")
    @Size(max = 40, message = "保险单号长度不能超过40字符")
    private String policyNo;

    /**
     * 车牌号
     * 必填，最大40字符
     */
    @NotBlank(message = "车牌号carNo不能为空")
    @Size(max = 40, message = "车牌号长度不能超过40字符")
    private String carNo;

    /**
     * 税款所属期
     * 必填，格式为：YYYY-MM YYYY-MM（如2023-11 2023-12），用空格分隔
     */
    @NotBlank(message = "税款所属期taxPeriod不能为空")
    @Pattern(regexp = "^\\d{4}-\\d{2} \\d{4}-\\d{2}$",
            message = "税款所属期格式错误，必须为YYYY-MM YYYY-MM（如2023-11 2023-12）")
    private String taxPeriod;

    /**
     * 代收车船税金额
     * 必填，最多16位整数，保留2位小数
     */
    @NotBlank(message = "代收车船税金额amount不能为空")
    @Digits(integer = 16, fraction = 2, message = "代收车船税金额格式错误，最多16位整数，保留2位小数")
    private BigDecimal amount;

    /**
     * 滞纳金金额
     * 必填，最多16位整数，保留2位小数
     */
    @NotBlank(message = "滞纳金金额lateFeeAmount不能为空")
    @Digits(integer = 16, fraction = 2, message = "滞纳金金额格式错误，最多16位整数，保留2位小数")
    private BigDecimal lateFeeAmount;

    /**
     * 金额合计
     * 必填，最多16位整数，保留2位小数
     */
    @NotBlank(message = "金额合计totalamount不能为空")
    @Digits(integer = 16, fraction = 2, message = "金额合计格式错误，最多16位整数，保留2位小数")
    private BigDecimal totalamount;

    /**
     * 车辆识别代码/车架号码
     * 必填，17字符
     */
    @NotBlank(message = "车辆识别代码frameNo不能为空")
    @Size(min = 17, max = 17, message = "车辆识别代码必须为17字符")
    private String frameNo;

    /**
     * 发动机号码
     * 选填，最大40字符
     */
    @Size(max = 40, message = "发动机号码长度不能超过40字符")
    private String engineCode;

    /**
     * 底盘号
     * 选填，最大40字符
     */
    @Size(max = 40, message = "底盘号长度不能超过40字符")
    private String chassisCode;

    public String getPolicyNo() {
        return policyNo;
    }

    public void setPolicyNo(String policyNo) {
        this.policyNo = policyNo;
    }

    public String getCarNo() {
        return carNo;
    }

    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }

    public String getTaxPeriod() {
        return taxPeriod;
    }

    public void setTaxPeriod(String taxPeriod) {
        this.taxPeriod = taxPeriod;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getLateFeeAmount() {
        return lateFeeAmount;
    }

    public void setLateFeeAmount(BigDecimal lateFeeAmount) {
        this.lateFeeAmount = lateFeeAmount;
    }

    public BigDecimal getTotalamount() {
        return totalamount;
    }

    public void setTotalamount(BigDecimal totalamount) {
        this.totalamount = totalamount;
    }

    public String getFrameNo() {
        return frameNo;
    }

    public void setFrameNo(String frameNo) {
        this.frameNo = frameNo;
    }

    public String getEngineCode() {
        return engineCode;
    }

    public void setEngineCode(String engineCode) {
        this.engineCode = engineCode;
    }

    public String getChassisCode() {
        return chassisCode;
    }

    public void setChassisCode(String chassisCode) {
        this.chassisCode = chassisCode;
    }
}
