
package org.sky.scientific.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
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.math.BigDecimal;
import java.util.Date;

/**
 * 项目-设计费用、装备调试费用与试验费用基本信息台账 实体类
 *
 * @author Kd
 * @since 2025-07-28
 */
@Data
@TableName("kd_xm_design_cost")
@Schema(description = "XmDesignCost对象")
@EqualsAndHashCode(callSuper = true)
public class XmDesignCostEntity extends TenantEntity {

	@Serial
	private static final long serialVersionUID = 1L;

	@Schema(description = "所属年月，如：202505")
	@NotBlank(message = "参数yearAndMonth不能为空")
	private String yearAndMonth;

	@Schema(description = "项目ID")
	@NotNull(message = "请选择研发项目")
	private Long xmId;

	@Schema(description ="项目名称")
	@TableField(exist = false)
	private String xmmc;

	@Schema(description ="项目编号")
	@TableField(exist = false)
	private String xmbh;

	@Schema(description = "费用类型")
	@NotBlank(message = "请选择费用类型")
	private String costType;

	@Schema(description = "日期")
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
	private Date recordDate;

	@Schema(description = "合同名称")
	private String contractName;

	@Schema(description = "金额")
	private BigDecimal amount;

}
