package com.multictrl.modules.business.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.multictrl.common.validator.group.AddGroup;
import com.multictrl.common.validator.group.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

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


/**
 * 设备维护信息
 *
 * @author Sdy
 * @since 1.0.0 2026-06-12
 */
@Data
@Schema(name = "设备维护信息")
public class MaintenanceDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Null(message = "标识必须为空", groups = {AddGroup.class})
    @NotNull(message = "标识不能为空", groups = {UpdateGroup.class})
    @Schema(description = "标识")
    private Long id;

    @NotBlank(message = "机库SN不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "机库SN")
    private String dockSn;

    @Schema(description = "维护内容")
    private String content;

    @NotBlank(message = "操作人不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "操作人")
    private String operator;

    @NotNull(message = "操作时间不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Schema(description = "操作时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date operationDate;

    @Schema(description = "图片集合")
    private List<String> imageUrls;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @Schema(description = "机库名称")
    private String dockName;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @Schema(description = "机库型号")
    private String dockModel;
}
