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.NotBlank;
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="RepairDispatchRecord对象", description="")
public class RepairDispatchRecord 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（多人用逗号隔开）")
    @NotBlank(message = "被派单人不能为空")
    private Integer usersId;

    @ApiModelProperty(value = "是否已失效 0未失效，1已失效")
    @NotBlank(message = "失效状态不能为空")
    private Integer isLoseEfficacy;


    @ApiModelProperty(value = "被派单/被转单/被协作时间")
    @NotBlank(message = "订单时间不能为空")
    private Date assignedTime;

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

    @ApiModelProperty(value = "接单考核时间")
    @NotNull(message = "接单考核时间不能为空")
    private Integer acceptanceAssessTime;

    @ApiModelProperty(value = "协作或转单ID")
    private Integer sourceId;

    @ApiModelProperty(value = "派单类型 0派单 1协作 2转单")
    @NotNull(message = "订单类型不能为空")
    private Integer orderType;

    @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;


}
