package cn.iocoder.yudao.module.system.controller.admin.biz.vo.elderlybloodsugarrecord;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

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

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;

@Schema(description = "管理后台 - 长者血糖记录新增/修改 Request VO")
@Data
public class ElderlyBloodSugarRecordSaveReqVO {

    @Schema(description = "id（修改时必传）", example = "1")
    private Long id;

    @Schema(description = "长者id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "长者id不能为空")
    private Long elderId;

    @Schema(description = "记录日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "记录日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY, timezone = TIME_ZONE_DEFAULT)
    private LocalDate recordDate;

    @Schema(description = "血糖值", requiredMode = Schema.RequiredMode.REQUIRED, example = "5.60")
    @NotNull(message = "血糖值不能为空")
    private BigDecimal bloodSugar;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "机构id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "机构id不能为空")
    private Long tenantId;
}

