
package org.sky.scientific.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.sky.core.tenant.mp.TenantEntity;

import java.io.Serial;

/**
 * 科研仪器设备工时登记表 实体类
 *
 * @author Kd
 * @since 2025-06-29
 */
@Data
@TableName("kd_xm_asset_hours")
@Schema(description = "科研仪器设备工时登记表")
@EqualsAndHashCode(callSuper = true)
public class XmAssetHoursEntity extends TenantEntity {

	@Serial
	private static final long serialVersionUID = 1L;

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

	@Schema(description = "资产id")
	@NotBlank(message = "请选择资产")
	private Long assetId;

	@Schema(description="考勤时间,yyyyMMdd")
	@NotNull(message = "请选择出工日期")
	private String workDate;

	@Schema(description="出勤时长（小时）")
	@NotNull(message = "请填写工时（小时）")
	@Min(value = 0, message = "请填写正确的出勤时长（小时）")
	@Max(value = 24, message = "请填写正确的出勤时长（小时）")
	private Double workHours;
}
