package com.repair.model.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author ceshi
 * @since 2023-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="RepairReceiving对象", description="")
public class RepairReceiving implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "维修记录ID")
    @NotNull(message = "报修记录不能为空")
    private Integer recordId;

    @ApiModelProperty(value = "派单ID（关联派单表）")
    @NotNull(message = "派单ID不能为空")
    private Integer dispatchId;

    @ApiModelProperty(value = "接单人ID")
    @NotNull(message = "接单人不能为空")
    private Integer userId;

    @ApiModelProperty(value = "接单时间")
    @NotNull(message = "接单时间不能为空")
    private Date receivingTime;

    /**
     * 维修完成时间 用来计算是否维修超时
     * 计算公式：
     * （接单时间 + 维修考核时间） < 维修完成时间
     */
    @ApiModelProperty(value = "维修完成时间")
    private Date finishTime;

    @ApiModelProperty(value = "维修考核时间（单位：分钟）")
    @NotNull(message = "维修考核时间不能为空")
    private Integer maintenanceAssessTime;

    @ApiModelProperty(value = "是否已失效（未失效：0；已失效：1）")
    @NotNull(message = "接单状态不能为空")
    private Integer isLoseEfficacy;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "创建人员")
    @TableField(fill = FieldFill.INSERT)
    private String createUser;

    @ApiModelProperty(value = "更新人员")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    @ApiModelProperty(value = "逻辑删除 未删除：0；删除：1")
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer deleted;


}
