package com.zt.plat.module.erp.controller.admin.erp.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;

@Schema(description = "管理后台 - ERP合同映射新增/修改 Request VO")
@Data
public class ErpContractSaveReqVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9114")
    private Long id;

    @Schema(description = "操作标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "3035")
    @NotEmpty(message = "操作标识不能为空")
    private String operationId;

    @Schema(description = "合同主信息主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "10259")
    @NotNull(message = "合同主信息主键不能为空")
    private Long contractMainId;

    @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "合同编号不能为空")
    private String contractPaperNumber;

    @Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @NotEmpty(message = "合同名称不能为空")
    private String contractName;

    @Schema(description = "合同类型编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "合同类型编号不能为空")
    private String contractTypeNumber;

    @Schema(description = "合同类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    @NotEmpty(message = "合同类型名称不能为空")
    private String contractTypeName;

    @Schema(description = "合同类别", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "合同类别不能为空")
    private String contractCategory;

    @Schema(description = "是否虚拟合同", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "是否虚拟合同不能为空")
    private String isVirtualContract;

    @Schema(description = "客户/供应商编号;SAP客商公司代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "客户/供应商编号;SAP客商公司代码不能为空")
    private String supplierNumber;

    @Schema(description = "客户/供应商名称;SAP客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @NotEmpty(message = "客户/供应商名称;SAP客商公司名称不能为空")
    private String supplierName;

    @Schema(description = "代理方;SAP客商公司代码")
    private String agent;

    @Schema(description = "合同实施主体编号;SAP公司代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "合同实施主体编号;SAP公司代码不能为空")
    private String contractImplementNumber;

    @Schema(description = "合同签订主体编号;SAP公司代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "合同签订主体编号;SAP公司代码不能为空")
    private String contractSignNumber;

    @Schema(description = "合同签订日期;格式：YYYY-MM-DD", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "合同签订日期;格式：YYYY-MM-DD不能为空")
    private LocalDate signDate;

    @Schema(description = "合同起始日期;格式：YYYY-MM-DD，长单合同：长单合同起始日期 非长单：合同合同签订日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "合同起始日期;格式：YYYY-MM-DD，长单合同：长单合同起始日期 非长单：合同合同签订日期不能为空")
    private LocalDate startDate;

    @Schema(description = "合同终止日期;格式：YYYY-MM-DD，长单合同：长单合同起始日期 非长单：合同合同签订日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "合同终止日期;格式：YYYY-MM-DD，长单合同：长单合同起始日期 非长单：合同合同签订日期不能为空")
    private LocalDate stopDate;

    @Schema(description = "币种编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "币种编号不能为空")
    private String currency;

    @Schema(description = "合同总金额（原币-含税）;非长单合同：合同金额 长单合同：默认1000000000000000.00", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "合同总金额（原币-含税）;非长单合同：合同金额 长单合同：默认1000000000000000.00不能为空")
    private BigDecimal sourceAmount;

    @Schema(description = "合同总金额（本位币-含税）;非长单合同：合同金额*合同的临时汇率 长单合同：默认1000000000000000.00", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "合同总金额（本位币-含税）;非长单合同：合同金额*合同的临时汇率 长单合同：默认1000000000000000.00不能为空")
    private BigDecimal basicAmount;

    @Schema(description = "变更后合同总金额（原币-含税）;如果未做合同变更，金额等于合同总金额（原币-含税）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "变更后合同总金额（原币-含税）;如果未做合同变更，金额等于合同总金额（原币-含税）不能为空")
    private BigDecimal changeSourceAmount;

    @Schema(description = "变更后合同总金额（本位币-含税）;如果未做合同变更，金额等于合同总金额（本位币-含税）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "变更后合同总金额（本位币-含税）;如果未做合同变更，金额等于合同总金额（本位币-含税）不能为空")
    private BigDecimal changeBasicAmount;

    @Schema(description = "合同状态编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "合同状态编号不能为空")
    private String statusNumber;

    @Schema(description = "合同状态名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
    @NotEmpty(message = "合同状态名称不能为空")
    private String statusName;

    @Schema(description = "是否有预付款;长单合同:否，非长单:取合同的预付款", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "是否有预付款;长单合同:否，非长单:取合同的预付款不能为空")
    private String isPrepayment;

    @Schema(description = "预付款比例;有预付款则需要填写")
    private BigDecimal prepaymentRatio;

    @Schema(description = "预付款金额;有预付款则需要填写(通过计算得出)")
    private BigDecimal prepaymentAmount;

    @Schema(description = "履约保证金-变更前（原币）")
    private BigDecimal sourceBeforeBond;

    @Schema(description = "履约保证金-变更前（本位币）")
    private BigDecimal basicBeforeBond;

    @Schema(description = "履约保证金-变更后（原币）")
    private BigDecimal sourceAfterBond;

    @Schema(description = "履约保证金-变更后（本位币）")
    private BigDecimal basicAfterBond;

    @Schema(description = "是否含质保金", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "是否含质保金不能为空")
    private String isQualityassuranceAmount;

    @Schema(description = "质保金比例;有质保金则需要填写")
    private BigDecimal qualityassuranceRatio;

    @Schema(description = "质保金金额;有质保金则需要填写")
    private BigDecimal qualityassuranceAmount;

    @Schema(description = "是否内部企业", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "是否内部企业不能为空")
    private String isInternal;

    @Schema(description = "收支性质", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "收支性质不能为空")
    private String nature;

    @Schema(description = "备注信息;提交ERP")
    private String remark;

    @Schema(description = "累计结算金额（原币-含税）;暂定不传")
    private BigDecimal sourceAccumulateSettlementAmount;

    @Schema(description = "累计结算金额（本位币-含税）;暂定不传")
    private BigDecimal basicAccumulateSettlementAmount;

    @Schema(description = "累计已收付款金额（原币-含税）;暂定不传")
    private BigDecimal sourceUseAmount;

    @Schema(description = "累计已收付款金额（本位币-含税）;暂定不传")
    private BigDecimal basicUseAmount;

    @Schema(description = "累计已开收票金额（原币-含税）;暂定不传")
    private BigDecimal sourceInvoiceAmount;

    @Schema(description = "累计已开收票金额（本位币-含税）;暂定不传")
    private BigDecimal basicInvoiceAmount;

    @Schema(description = "累计预付款金额（原币-含税）;暂定不传")
    private BigDecimal sourceAccumulatePrepayment;

    @Schema(description = "累计预付款金额（本位币-含税）;暂定不传")
    private BigDecimal basicAccumulatePrepayment;

    @Schema(description = "履约保证金累计付款金额（原币）;暂定不传")
    private BigDecimal sourceAccumulateBond;

    @Schema(description = "履约保证金累计付款金额（本位币）;暂定不传")
    private BigDecimal basicAccumulateBond;

    @Schema(description = "履约保证金累计收款金额（原币）;暂定不传")
    private BigDecimal sourceAccumulateAmount;

    @Schema(description = "履约保证金累计收款金额（本位币）;暂定不传")
    private BigDecimal basicAccumulateAmount;

    @Schema(description = "是否框架合同;如果为是，合同总金额（本币）、合同总金额（原币）、变更后合同总金额（原币-含税）、变更后合同总金额（本位币-含税）赋默认值为：1000000000000000.00", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "是否框架合同;如果为是，合同总金额（本币）、合同总金额（原币）、变更后合同总金额（原币-含税）、变更后合同总金额（本位币-含税）赋默认值为：1000000000000000.00不能为空")
    private String isFramework;

    @Schema(description = "境内/境外", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "境内/境外不能为空")
    private String isDomestic;

    @Schema(description = "建筑服务发生地;销售合同，且类型为SAP02COSR必填")
    private String architectureService‌Place;

    @Schema(description = "达到收款条件金额;销售合同，且类型为SAP02COSR必填")
    private BigDecimal payeeConditionAmount;

    @Schema(description = "公司编号")
    private Long companyId;

    @Schema(description = "公司名称")
    private String companyName;

    @Schema(description = "部门编号")
    private Long deptId;

    @Schema(description = "部门名称")
    private String deptName;

    @Schema(description = "岗位编号")
    private Long postId;

    @Schema(description = "创建者")
    private String creatorName;

    @Schema(description = "更新者")
    private String updaterName;
}