
package org.sky.scientific.pojo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode;
import org.sky.core.tenant.mp.TenantEntity;
import org.sky.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.util.Date;

/**
 * 项目-变更记录 实体类
 *
 * @author Kd
 * @since 2025-06-29
 */
@Data
@TableName("kd_xm_bgrz")
@Schema(description = "XmBgrz对象")
@EqualsAndHashCode(callSuper = true)
public class XmBgrzEntity extends TenantEntity {

	@Serial
	private static final long serialVersionUID = 1L;

	@Schema(description = "科研项目id，kd_xm的主键")
	private Long xmId;

	@Schema(description = "变更的字段名称")
	@NotBlank(message = "请选择变更类型")
	private String zdmc;

	@Schema(description = "变更前的值")
	@NotBlank(message = "请填写变更前的值")
	private String bgqdz;

	@Schema(description = "变更后的值")
	@NotBlank(message = "请填写变更后的值")
	private String bghdz;

	@NotNull(message = "请选择变更生效时间")
	@Schema(description = "变更生效时间,格式：yyyy-MM-dd")
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
	private Date bgsxsj;

	@Schema(description = "变更原因")
	private String bgyy;

	@Schema(description = "附件")
	private String attachment;

}
