package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.contract;

import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

/**
 * 合同审批 创建 Request VO
 *
 * @author 符溶馨
 */
@Schema(description = "管理后台 - 合同审批创建 Request VO")
@Data
public class BpmOAContractCreateReqVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long id;

    @Schema(description = "合同类型 | 字典值 bpm_oa_contract_type", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "合同类型不能为空")
    private Integer contractType;

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

    @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String contractNo;

    @Schema(description = "签约日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "签约日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate signingDate;

    @Schema(description = "客户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long customerId;

    @Schema(description = "客户名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String customerName;

    @Schema(description = "客户签约人（联系人ID）", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long contactsId;

    @Schema(description = "客户签约人(联系人)名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String contactsName;

    @Schema(description = "签约公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "签约公司不能为空")
    private Long companyId;

    @Schema(description = "签约人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long signatoryId;

    @Schema(description = "合同金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private BigDecimal contractMoney;

    @Schema(description = "已收/已付金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private BigDecimal returnMoney;

    @Schema(description = "已开票金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private BigDecimal invoiceMoney;

    @Schema(description = "产品总金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private BigDecimal totalPrice;

    @Schema(description = "整单优惠金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private BigDecimal discountRate;

    @Schema(description = "商机ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long businessId;

    @Schema(description = "合同开始时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate startDate;

    @Schema(description = "合同结束时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate endDate;

    @Schema(description = "合同状态 | 1已签约 2过期", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Integer status;

    @Schema(description = "合同产品关系列表")
    private List<CrmContractProductVO> contractProducts;

    @Schema(description = "流程实例编号")
    private String processInstanceId;

    @Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer result;

    @Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<UploadUserFile> fileItems;
}
