package com.fuyuanshen.equipment.domain.bo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fuyuanshen.common.core.validate.AddGroup;
import com.fuyuanshen.common.core.validate.EditGroup;
import com.fuyuanshen.equipment.domain.DeviceRepairRecords;
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;

/**
 * 设备维修记录业务对象 device_repair_records
 *
 * @author Lion Li
 * @date 2025-08-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = DeviceRepairRecords.class, reverseConvertGenerate = false)
public class DeviceRepairRecordsBo extends BaseEntity {

    /**
     * 维修记录ID
     */
    @NotNull(message = "维修记录ID不能为空", groups = { EditGroup.class })
    private Long recordId;

    /**
     * 设备ID
     */
    @NotBlank(message = "设备ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private String deviceId;

    /**
     * 维修时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "维修时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date repairTime;

    /**
     * 维修部位
     */
    @NotBlank(message = "维修部位不能为空", groups = { AddGroup.class, EditGroup.class })
    private String repairPart;

    /**
     * 维修原因
     */
    @NotBlank(message = "维修原因不能为空", groups = { AddGroup.class, EditGroup.class })
    private String repairReason;

    /**
     * 维修人员
     */
    @NotBlank(message = "维修人员不能为空", groups = { AddGroup.class, EditGroup.class })
    private String repairPerson;

    @Schema(title = "维修前图片")
    @JsonIgnore
    private MultipartFile beforeFile;

    @Schema(title = "维修后图片")
    @JsonIgnore
    private MultipartFile afterFile;

    private List<Long> imageIds;
}
