
package org.sky.scientific.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
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-17
 */
@Data
@TableName("kd_xm_goods")
@Schema(description = "XmGoods对象")
@EqualsAndHashCode(callSuper = true)
public class XmGoodsEntity extends TenantEntity {

	@Serial
	private static final long serialVersionUID = 1L;

	@Schema(description = "所属年月，如：202505")
	private String yearAndMonth;

	@Schema(description = "领用日期，如：2025-02-15")
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
	private Date useDate;

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

	@Schema(description = "类型")
	private String type;

	@Schema(description = "编号")
	private String code;

	@Schema(description = "名称")
	private String name;

	@Schema(description = "规格型号")
	private String model;

	@Schema(description = "单位")
	private String unit;

	@Schema(description = "单价（元）")
	private BigDecimal unitPrice;

	@Schema(description = "领用数量")
	private Integer useQuantity;

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