package com.chushang.inspection.project.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.chushang.common.core.validator.Create;
import com.chushang.common.core.validator.Update;
import com.chushang.common.mybatis.annotation.Condition;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

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

/**
 * @auther: zhao
 * @date: 2024/6/17 11:58
 */
@Data
public class ContractDTO {
    /**
     * 新增合同时
     */
    private Long projectId;
    /**
     * 合同Id
     */
    @NotNull(message = "合同Id不能为空", groups = Update.class)
    @Condition(name = "contract_id", type = Condition.ConditionType.eq)
    private Long contractId;
    /**
     * 项目合同
     */
    private String contractUrl;

    /**
     * 合同有效期开始时间
     */
    @NotNull(message = "项目合同开始时间不能为空", groups = Create.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime contractStartTime;

    /**
     * 合同有效期结束日期
     */
    @TableField(value = "contract_end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "项目合同结束时间不能为空", groups = Create.class)
    private LocalDateTime contractEndTime;
    /**
     * 合同金额
     */
//    @NotNull(message = "合同金额不能为空", groups = Create.class)
    private BigDecimal contractAmount;
    /**
     * 查询枚举 AuditStatusEnums , 最终以字典表中project_audit_status字典编码为准
     */
    private Integer auditStatus;
    /**
     * 备注
     */
    private String remark;
    private String mimeType;
    private String fid;
    private String realPath;
    private String name;

}
